Example #1
0
        /// <summary>
        /// Clean up the game from the NetworkContext.
        /// </summary>
        public void Dispose()
        {
            if (_serverHandler != null)
            {
                _context.RemoveMessageHandler(_serverHandler);
                _serverHandler = null;
            }

            if (_clientHandler != null)
            {
                _context.RemoveMessageHandler(_clientHandler);
                _clientHandler = null;
            }
        }
Example #2
0
 /// <summary>
 /// Cleans up the ChatManager from the NetworkContext it was constructed with.
 /// </summary>
 public void Dispose()
 {
     if (_handler != null)
     {
         _context.RemoveMessageHandler(_handler);
         _handler = null;
     }
 }
Example #3
0
        /// <summary>
        /// Dispose the lobby.
        /// </summary>
        public virtual void Dispose()
        {
            if (_lobbyLaunchedHandler != null)
            {
                _context.RemoveMessageHandler(_lobbyLaunchedHandler);
                _lobbyLaunchedHandler = null;
            }

            if (_playerManager != null)
            {
                _context.RemoveMessageHandler(_playerManager);
                if (_context.IsServer)
                {
                    _context.RemoveConnectionMonitor(_playerManager);
                }
                _playerManager = null;
            }
        }