Exemplo n.º 1
0
 /// <summary>
 /// Initializes the Session object.
 /// </summary>
 /// <param name="sessionID">The ID this session was assigned to by the Woodpecker.Sessions.sessionManager.</param>
 /// <param name="gameClient">The System.Net.Sockets.Socket object of the game client that has been accepted by the game connection listener.</param>
 public Session(uint sessionID, Socket gameClient)
 {
     this.ID = sessionID;
     this.gameConnection = new gameConnection(this, gameClient);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Destroys the session and clears up all used resources.
        /// </summary>
        public void Destroy()
        {
            if (this.isHoldingUser)
            {
                ObjectTree.Game.Users.removeUserSession(this.User.ID);
                this.leaveRoom(false);
                this.User = null;

                this.itemStripHandler.saveHandItems();
                this.itemStripHandler.Clear();
                this.itemStripHandler = null;
            }
            this.gameConnection.Abort();
            this.gameConnection = null;
        }