public void RemoveBot(Player player)
 {
     if (IsConnected && IsSinglePlayerMode)
     {
         ConnectedServer.RemovePlayer(player.ID);
         OnBotRemoved.Invoke(player.ID);
         playersID.Enqueue(player.ID);
     }
 }
Пример #2
0
        private void HandleRemoveAllBots()
        {
            var countPlayers = lobbyReader.ReadInt32();

            for (var i = 0; i < countPlayers; i++)
            {
                var playerID = lobbyReader.ReadInt32();
                ConnectedServer.RemovePlayer(playerID);
                OnPlayerDisconnectedLobby.Invoke(playerID);
            }
        }
Пример #3
0
        private void HandlePlayerDisconnected()
        {
            var playerID = lobbyReader.ReadInt32();
            var isLeave  = lobbyReader.ReadBoolean();
            var isBot    = lobbyReader.ReadBoolean();

            Chat.MutedPlayers.Remove(ConnectedServer.Players[playerID].IPAddress);

            if (ConnectedServer.State == ServerState.InGame)
            {
                ConnectedServer.Players[playerID].IsBot = isBot;
                OnPlayerDisconnectedGame.Invoke(playerID, isLeave, isBot);
                OnPlayerKicked.Invoke();
            }
            else
            {
                ConnectedServer.RemovePlayer(playerID);
                OnPlayerDisconnectedLobby.Invoke(playerID);
            }
        }