static void Main(string[] args) { GrpServer Svr = new GrpServer(); ZNet.ResultInfo outResult = new ZNet.ResultInfo(); if (Svr.m_Core.Start(new ZNet.StartOption(), outResult)) { Console.WriteLine("Start Server ok. ver[{0}.{1:0000}]\n", Svr.m_Core.GetCoreVersion() / 10000, Svr.m_Core.GetCoreVersion() % 10000); Console.WriteLine("/Cmd: q(Quit) h(Help) stat(status info)\n"); } else { Console.WriteLine("Error Start... : {0} \n", outResult.msg); System.Threading.Thread.Sleep(1000 * 4); Svr.m_Core.Dispose(); return; } var ret = ReadLineAsync(); bool run_program = true; while (run_program) { if (ret.IsCompleted) { switch (ret.Result) { case "/h": Console.WriteLine("/Cmd: q(Quit) h(Help) stat(status info)"); break; case "/stat": ZNet.ServerState status; Svr.m_Core.GetCurrentState(out status); Console.WriteLine(string.Format("[NetInfo] Joined Client = {0}\n", status.m_JoinedClient)); break; case "/q": Console.WriteLine("quit Server..."); run_program = false; break; } if (run_program) { ret = ReadLineAsync(); } } System.Threading.Thread.Sleep(10); } Console.WriteLine("Start Closing... "); Svr.m_Core.Dispose(); Console.WriteLine("Close complete."); System.Threading.Thread.Sleep(1000 * 2); }
static void Main(string[] args) { GrpServer Svr = new GrpServer(); ZNet.ResultInfo outResult = new ZNet.ResultInfo(); if (Svr.m_Core.Start(new ZNet.StartOption(), outResult)) { Console.WriteLine("Start Server ok. ver[{0}.{1:0000}]\n", Svr.m_Core.GetCoreVersion() / 10000, Svr.m_Core.GetCoreVersion() % 10000); Console.WriteLine("/Cmd: q(Quit) h(Help) stat(status info)\n"); } else { Console.WriteLine("Error Start... : {0} \n", outResult.msg); System.Threading.Thread.Sleep(1000 * 4); Svr.m_Core.Dispose(); return; } var ret = ReadLineAsync(); bool run_program = true; while (run_program) { if (ret.IsCompleted) { switch (ret.Result) { case "/h": Console.WriteLine("/Cmd: q(Quit) h(Help) stat(status info)"); break; case "/stat": ZNet.ServerState status; Svr.m_Core.GetCurrentState(out status); Console.WriteLine(string.Format("[NetInfo] Joined Client = {0}\n", status.m_JoinedClient)); break; case "/q": Console.WriteLine("quit Server..."); run_program = false; break; } if (run_program) ret = ReadLineAsync(); } System.Threading.Thread.Sleep(10); } Console.WriteLine("Start Closing... "); Svr.m_Core.Dispose(); Console.WriteLine("Close complete."); System.Threading.Thread.Sleep(1000 * 2); }