Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public override void OnPlayerChat(BasePlayer player, GameMsg_ClSay message, out bool isSend)
 {
     isSend = true;
 }
Ejemplo n.º 4
0
 protected abstract void OnMsgClientSay(BasePlayer player, GameMsg_ClSay message);
Ejemplo n.º 5
0
 public abstract void OnPlayerChat(BasePlayer player, GameMsg_ClSay message, out bool isSend);