Beispiel #1
0
        protected override void OnMsgClientSetSpectatorMode(BasePlayer player, GameMsg_ClSetSpectatorMode message)
        {
            if (Config["SvSpamprotection"] && player.LastSetSpectatorMode + Server.TickSpeed > Server.Tick)
            {
                return;
            }

            player.LastSetSpectatorMode = Server.Tick;
            if (!player.SetSpectatorID(message.SpectatorMode, message.SpectatorId))
            {
                SendGameplayMessage(player.ClientId, GameplayMessage.SpectatorInvalidId);
            }
        }
Beispiel #2
0
        protected virtual void OnMsgSetSpectatorMode(BasePlayer player,
                                                     GameMsg_ClSetSpectatorMode msg)
        {
            if (player.Team != Team.SPECTATORS ||
                player.SpectatorId == msg.SpectatorId ||
                player.ClientId == msg.SpectatorId ||
                Config["SvSpamprotection"] &&
                player.LastSetSpectatorMode + Server.TickSpeed * 3 > Server.Tick)
            {
                return;
            }

            player.LastSetSpectatorMode = Server.Tick;
            if (msg.SpectatorId != -1 &&
                (msg.SpectatorId < -1 || msg.SpectatorId >= Players.Length ||
                 Players[msg.SpectatorId] == null ||
                 Players[msg.SpectatorId].Team == Team.SPECTATORS))
            {
                SendChatTarget(player.ClientId, "Invalid spectator id");
                return;
            }

            player.SpectatorId = msg.SpectatorId;
        }
Beispiel #3
0
 protected abstract void OnMsgClientSetSpectatorMode(BasePlayer player, GameMsg_ClSetSpectatorMode message);