Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var mResetEvent = new ManualResetEvent(false);

            manager = new DefaultCommandManager <CommandName, CommandArgs, byte[]>(typeof(Program).Namespace + ".Commands");

            using (server = new Network.Server())
            {
                server.Start(IPAddress.Any, 4400);
                Console.CancelKeyPress   += (s, e) => mResetEvent.Reset();
                server.OnClientConnected += ServerOnClientConnected;
                Console.WriteLine("Server has started, waiting for clients");
                string command;
                do
                {
                    command = "";
                    command = Console.ReadLine();
                } while (command.ToLower() != "!start");

                Console.WriteLine("Game started.");
                GameManager.StartGame();
                mResetEvent.WaitOne();
                GameManager.StopGame();
            }
        }
Exemplo n.º 2
0
 void StartServer()
 {
     server = new Network.Server();
     server.Start();
 }