static void Main(string[] args) { GameServer server = new GameServer(); server.Start(); while (true) { string command = Console.ReadLine(); if (command.Equals("new seed", StringComparison.CurrentCultureIgnoreCase)) { server.GenerateSeed(); Console.WriteLine(server.Seed); } else if (command.Equals("start game", StringComparison.CurrentCultureIgnoreCase)) { server.StartGame(); } } }
public void StartServer() { server = new GameServer(); //start server Thread serverThread = new Thread(server.Start); server.InitGame(players, map, gametype); serverThread.Start(); Thread.Sleep(200); // connect to it if (World.InitNetwork("127.0.0.1")) { Console.Write("Connected to Server", MessageType.special); menuManager.SwitchMenu(menuManager.lobby); } else { menuManager.SwitchMenu(menuManager.failure); } }