Example #1
0
        /// <summary>
        /// Ends a certain connection to the game server and cleans up used resources.
        /// </summary>
        /// <param name="Connection">The connectionManager object of the connection to end.</param>
        public static void endConnection(userManager Connection)
        {
            if (Connections.ContainsKey(Connection.connectionID))
            {
                //Sessions.sessionManager._Sessions.Remove(Connection.Session.userInfo.userID);
                Logging.logInfo("Ended connection " + Connection.connectionID + "[" + Connection.IP + "]");
                Connection.Close(SocketShutdown.Both);
                Connections.Remove(Connection.connectionID);

                Logging.mainForm.updateOnlineUsers(Connections.Count);
            }
        }