Exemplo n.º 1
0
 /// <summary>
 /// Proccess stop logic
 /// </summary>
 public virtual void OnStop()
 {
     try
     {
         TraceLog.WriteLine("{0} Server is stopping, please wait.", DateTime.Now.ToString("HH:mm:ss"));
         ScriptEngines.StopMainProgram();
         GameZone.WaitStop().Wait();
         TraceLog.WriteLine("{0} Server has stoped successfully!", DateTime.Now.ToString("HH:mm:ss"));
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("OnStop error:{0}", ex);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Process start logic init
 /// </summary>
 /// <returns></returns>
 public virtual bool OnStart()
 {
     try
     {
         GameZone.Start(_setting);
         return(true);
     }
     catch (Exception ex)
     {
         TraceLog.WriteLine("{0} Server failed to start error:{1}", DateTime.Now.ToString("HH:mm:ss"), ex.Message);
         TraceLog.WriteError("OnInit error:{0}", ex);
         TraceLog.WriteLine("# Server exit command \"Ctrl+C\" or \"Ctrl+Break\".");
     }
     return(false);
 }