Exemplo n.º 1
0
 private void frmGameLobby_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!gameStarting)
     {
         client.Dispose();
         if (lobbyMode == LobbyMode.Hosting)
         {
             server.Dispose();
         }
     }
 }
Exemplo n.º 2
0
        public void Dispose()
        {
            // destroy the server
            if (netServer != null)
            {
                netServer.Dispose();
                netServer = null;
            }

            // destroy all instance-specific information
            if (world != null)
            {
                world.Dispose();
                world = null;
            }
        }