static void OnServerShutdown( object sender, ShutdownEventArgs e ) { if( minecraftNetRequest != null ) { minecraftNetRequest.Abort(); } if( womDirectRequest != null ) { womDirectRequest.Abort(); } }
static void OnShutdownEnded( object sender, ShutdownEventArgs e ) { if( exitOnShutdown ) { Environment.Exit( Environment.ExitCode ); } }
void OnServerShutdownEnded(object sender, ShutdownEventArgs e) { try { BeginInvoke((Action)delegate { shutdownComplete = true; switch (e.ShutdownParams.Reason) { case ShutdownReason.FailedToInitialize: case ShutdownReason.FailedToStart: case ShutdownReason.Crashed: if (Server.HasArg(ArgKey.ExitOnCrash)) { Application.Exit(); } break; default: Application.Exit(); break; } }); } catch (ObjectDisposedException) { } catch (InvalidOperationException) { } }
void OnServerShutdownEnded(object sender, ShutdownEventArgs e) { try { BeginInvoke((Action)delegate { console.Text = ""; Text = "fCraft " + Updater.CurrentRelease.VersionString + " - Shutdown complete."; shutdownComplete = true; switch (e.ShutdownParams.Reason) { case ShutdownReason.FailedToInitialize: case ShutdownReason.FailedToStart: case ShutdownReason.Crashed: if (Server.HasArg(ArgKey.ExitOnCrash)) { Application.Exit(); } break; default: Application.Exit(); break; } }); } catch (ObjectDisposedException) {} catch (InvalidOperationException) {} }