Basic cleanup for the Shutdown class.

This commit is contained in:
MobiusDevelopment
2021-11-30 02:50:06 +00:00
parent a1d39adb1c
commit 0410494e1c
25 changed files with 290 additions and 269 deletions

View File

@@ -199,7 +199,7 @@ public class Shutdown extends Thread
if (_counterInstance != null)
{
_counterInstance._abort();
_counterInstance.abort();
}
if (Config.PRECAUTIONARY_RESTART_ENABLED)
@@ -231,7 +231,7 @@ public class Shutdown extends Thread
if (_counterInstance != null)
{
_counterInstance._abort();
_counterInstance.abort();
}
if (Config.PRECAUTIONARY_RESTART_ENABLED)
@@ -243,7 +243,7 @@ public class Shutdown extends Thread
/**
* set shutdown mode to ABORT
*/
private void _abort()
private void abort()
{
_shutdownMode = ABORT;
}
@@ -290,8 +290,7 @@ public class Shutdown extends Thread
_secondsShut--;
final int delay = 1000; // milliseconds
Thread.sleep(delay);
Thread.sleep(1000);
if (_shutdownMode == ABORT)
{
@@ -381,11 +380,11 @@ public class Shutdown extends Thread
}
/**
* this sends a last byebye, disconnects all players and saves data
* This sends a last byebye, disconnects all players and saves data.
*/
private synchronized void saveData()
{
final AnnouncementsTable _an = AnnouncementsTable.getInstance();
final AnnouncementsTable announcements = AnnouncementsTable.getInstance();
switch (_shutdownMode)
{
case SIGTERM:
@@ -406,7 +405,7 @@ public class Shutdown extends Thread
}
try
{
_an.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
announcements.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
}
catch (Throwable t)
{