예제 #1
0
 public void HandlePlayerDisconnect(Player player)
 {
     MultiplayerManager.Instance.PlayerList.Remove(player.Username);
     this.ConnectedPlayers.Remove(player.NetPeer.Id);
     Command.HandleClientDisconnect(player);
     TransactionHandler.ClearTransactions(player.NetPeer.Id);
 }
예제 #2
0
        public override void Handle(ClientDisconnectCommand command)
        {
            LogManager.GetCurrentClassLogger().Info($"Player {command.Username} has disconnected!");
            ChatLogPanel.PrintGameMessage($"Player {command.Username} has disconnected!");

            MultiplayerManager.Instance.PlayerList.Remove(command.Username);

            TransactionHandler.ClearTransactions(command.ClientId);
        }
예제 #3
0
        protected override void Handle(ClientDisconnectCommand command)
        {
            Log.Info($"Player {command.Username} has disconnected!");
            ChatLogPanel.PrintGameMessage($"Player {command.Username} has disconnected!");

            MultiplayerManager.Instance.PlayerList.Remove(command.Username);

            TransactionHandler.ClearTransactions(command.ClientId);
            ToolSimulator.RemoveSender(command.ClientId);
        }
예제 #4
0
파일: Client.cs 프로젝트: nzgamer41/Tango
        /// <summary>
        ///     Attempt to disconnect from the server
        /// </summary>
        public void Disconnect()
        {
            // Update status and stop client
            Status = ClientStatus.Disconnected;
            _netClient.Stop();
            MultiplayerManager.Instance.PlayerList.Clear();
            TransactionHandler.ClearTransactions();

            _logger.Info("Disconnected from server");
        }
예제 #5
0
        /// <summary>
        ///     Stops the server
        /// </summary>
        public void StopServer()
        {
            // Update status and stop the server
            Status = ServerStatus.Stopped;
            _netServer.Stop();

            MultiplayerManager.Instance.PlayerList.Clear();
            TransactionHandler.ClearTransactions();

            _logger.Info("Server stopped.");
        }
예제 #6
0
        /// <summary>
        ///     Attempt to disconnect from the server
        /// </summary>
        public void Disconnect()
        {
            bool needsUnload = (Status == ClientStatus.Connected);

            // Update status and stop client
            Status = ClientStatus.Disconnected;
            _netClient.Stop();
            MultiplayerManager.Instance.PlayerList.Clear();
            TransactionHandler.ClearTransactions();
            ToolSimulator.Clear();

            if (needsUnload)
            {
                // Go back to the main menu after disconnecting
                Singleton <LoadingManager> .instance.UnloadLevel();
            }

            _logger.Info("Disconnected from server");
        }