Disconnect() public method

public Disconnect ( ) : void
return void
示例#1
0
文件: Server.cs 项目: vans163/LKEmu
        private void RemoveConnection(Connection connection, bool raiseEvent)
        {
            if (connection == null)
                return;
            connection.Disconnect();

            if (connection.Client != null
                && connection.Client.player != null)
            {
                connection.Client.player.InstancedObjects.Clear();
                connection.Client.player.m_Buffs.Clear();
            }

            // Remove the connection from the dictionary and raise the OnDisconnection event.
            lock (ConnectionLock)
            {
                if (Connections.Contains(connection))
                    Connections.Remove(connection);
            }

            if (raiseEvent)
                NotifyRemoveConnection(connection);
        }