mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Server Status Changes
- refactored the code to stop the server status cycling and to be more accurate.
This commit is contained in:
parent
c79ec023d8
commit
9e52ccbaa1
15 changed files with 321 additions and 236 deletions
|
|
@ -251,84 +251,162 @@ namespace ServerManagerTool.Lib
|
|||
{
|
||||
case WatcherServerStatus.Unknown:
|
||||
if (oldStatus != ServerStatus.Updating)
|
||||
UpdateServerStatus(ServerStatus.Unknown, AvailabilityStatus.Unknown, false);
|
||||
{
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Unknown,
|
||||
AvailabilityStatus.Unknown,
|
||||
false);
|
||||
}
|
||||
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.NotInstalled:
|
||||
if (oldStatus != ServerStatus.Updating)
|
||||
UpdateServerStatus(ServerStatus.Uninstalled, AvailabilityStatus.Unavailable, false);
|
||||
{
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Uninstalled,
|
||||
AvailabilityStatus.Unavailable,
|
||||
false);
|
||||
}
|
||||
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.Stopped:
|
||||
if (oldStatus != ServerStatus.Updating)
|
||||
UpdateServerStatus(ServerStatus.Stopped, AvailabilityStatus.Unavailable, oldStatus == ServerStatus.Initializing || oldStatus == ServerStatus.Running || oldStatus == ServerStatus.Stopping);
|
||||
{
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Stopped,
|
||||
AvailabilityStatus.Unavailable,
|
||||
oldStatus == ServerStatus.Initializing || oldStatus == ServerStatus.Running || oldStatus == ServerStatus.Stopping);
|
||||
}
|
||||
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.Initializing:
|
||||
if (oldStatus != ServerStatus.Stopping)
|
||||
UpdateServerStatus(ServerStatus.Initializing, AvailabilityStatus.Unavailable, oldStatus != ServerStatus.Initializing && oldStatus != ServerStatus.Unknown);
|
||||
{
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Initializing,
|
||||
AvailabilityStatus.Unavailable,
|
||||
oldStatus != ServerStatus.Initializing && oldStatus != ServerStatus.Unknown);
|
||||
}
|
||||
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.RunningLocalCheck:
|
||||
case WatcherServerStatus.LocalSuccess:
|
||||
if (oldStatus != ServerStatus.Stopping)
|
||||
{
|
||||
UpdateServerStatus(ServerStatus.Running, oldAvailability != AvailabilityStatus.Available ? AvailabilityStatus.LocalOnly : AvailabilityStatus.Available, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Running,
|
||||
AvailabilityStatus.LocalOnly,
|
||||
oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.RunningExternalCheck:
|
||||
case WatcherServerStatus.ExternalSkipped:
|
||||
if (oldStatus != ServerStatus.Stopping)
|
||||
{
|
||||
UpdateServerStatus(ServerStatus.Running, AvailabilityStatus.PublicOnly, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Running,
|
||||
oldAvailability >= AvailabilityStatus.PublicOnly ? AvailabilityStatus.PublicOnly : AvailabilityStatus.LocalOnly,
|
||||
oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.ExternalSuccess:
|
||||
if (oldStatus != ServerStatus.Stopping)
|
||||
{
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Running,
|
||||
AvailabilityStatus.PublicOnly,
|
||||
oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WatcherServerStatus.Published:
|
||||
if (oldStatus != ServerStatus.Stopping)
|
||||
{
|
||||
UpdateServerStatus(ServerStatus.Running, AvailabilityStatus.Available, oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
UpdateServerStatus(
|
||||
ServerStatus.Running,
|
||||
AvailabilityStatus.Available,
|
||||
oldStatus != ServerStatus.Running && oldStatus != ServerStatus.Unknown);
|
||||
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
if (this.ProfileSnapshot.MOTDIntervalEnabled && this.motdIntervalTimer != null && !this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Start();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
if (this.motdIntervalTimer != null && this.motdIntervalTimer.Enabled)
|
||||
{
|
||||
this.motdIntervalTimer.Stop();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue