private void ServerUpdate() { while (!serverShutdown) { strikerServer.Update(); if (startGame) { startGame = false; strikerServer.StartGame(); } Thread.Sleep(10); } if (strikerServer != null) { try { strikerServer.Shutdown(); } catch (System.Exception) { } } strikerServer = null; serverShutdown = false; }
public void StartServer() { strikerServer = new StrikerServer("level0", Resources.Load("Levels/level0").ToString(), Resources.Load("names").ToString()); serverThread = new Thread(ServerUpdate); serverThread.Start(); }