protected override void OnMsgClientSay(BasePlayer player, GameMsg_ClSay message) { if (string.IsNullOrEmpty(message.Message)) { return; } if (Config["SvSpamprotection"] && player.LastChatTick + Server.TickSpeed > Server.Tick) { return; } message.Message = message.Message.Limit(128); if (Config["SvTournamentMode"] == 2 && player.Team == Team.Spectators && GameController.GameRunning && Server.IsAuthed(player.ClientId)) { if (message.ChatMode != ChatMode.Whisper) { message.ChatMode = ChatMode.Team; } else if (Players[message.TargetId] != null && Players[message.TargetId].Team != Team.Spectators) { message.ChatMode = ChatMode.None; } } player.LastChatTick = Server.Tick; GameController.OnPlayerChat(player, message, out var isSend); if (isSend) { SendChat(player.ClientId, message.ChatMode, message.TargetId, message.Message); } }
protected virtual void OnMsgSay(BasePlayer player, GameMsg_ClSay msg) { if (string.IsNullOrEmpty(msg.Message) || Config["SvSpamprotection"] && player.LastChatMessage + Server.TickSpeed > Server.Tick) { return; } msg.Message = msg.Message.Limit(128); player.LastChatMessage = Server.Tick; SendChat(player.ClientId, msg.IsTeam, msg.Message); }
public override void OnPlayerChat(BasePlayer player, GameMsg_ClSay message, out bool isSend) { isSend = true; }
protected abstract void OnMsgClientSay(BasePlayer player, GameMsg_ClSay message);
public abstract void OnPlayerChat(BasePlayer player, GameMsg_ClSay message, out bool isSend);