Exemple #1
0
 static void OnServerShutdown(object sender, ShutdownEventArgs e)
 {
     if (minecraftNetRequest != null)
     {
         minecraftNetRequest.Abort();
     }
     if (womDirectRequest != null)
     {
         womDirectRequest.Abort();
     }
 }
Exemple #2
0
 void OnServerShutdownEnded(object sender, ShutdownEventArgs e)
 {
     try
     {
         BeginInvoke((Action)delegate
         {
             shutdownComplete = true;
             switch (e.ShutdownParams.Reason)
             {
                 case SpACraft.Server.ShutdownReason.FailedToInitialize:
                 case SpACraft.Server.ShutdownReason.FailedToStart:
                 case SpACraft.Server.ShutdownReason.Crashed:
                     if (Server.HasArg(ArgKey.ExitOnCrash))
                     {
                         Application.Exit();
                     }
                     break;
                 default:
                     Application.Exit();
                     break;
             }
         });
     }
     catch (ObjectDisposedException)
     {
     }
     catch (InvalidOperationException) { }
 }