Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions plugins/rust/RustApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2212,18 +2212,26 @@ private void OnTeamLeave(RelationshipManager.PlayerTeam team, BasePlayer player)
#region Chat hooks

private object OnClientCommand(Connection connection, string text)
{
if (!text.StartsWith("chat.say") || text.StartsWith("chat.say \"/") || text.StartsWith("chat.say /")) {
{
if (!text.StartsWith("chat.say", StringComparison.OrdinalIgnoreCase)
|| text.StartsWith("chat.say \"/", StringComparison.OrdinalIgnoreCase)
|| text.StartsWith("chat.say /", StringComparison.OrdinalIgnoreCase))
{
return null;
}
}

var mute = _RustAppEngine?.PlayerMuteWorker?.GetMute(connection.userid);
if (mute != null && mute.LeftSeconds() > 0)
{
var msg = _RustApp.lang.GetMessage("System.Mute.Message.Self", _RustApp, connection.userid.ToString())
.Replace("%REASON%", mute.reason)
.Replace("%TIME%", mute.GetLeftTime());

if (mute != null && mute.LeftSeconds() > 0) {
var player = BasePlayer.FindByID(connection.userid);
var msg = _RustApp.lang.GetMessage("System.Mute.Message.Self", _RustApp, connection.userid.ToString()).Replace("%REASON%", mute.reason).Replace("%TIME%", mute.GetLeftTime());
if (connection.player is BasePlayer player)
{
SendMessage(player, msg);
}

SendMessage(player, msg);
return false;
}

Expand Down