Basic cleanup for the Shutdown class.
This commit is contained in:
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SEC_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SEC_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -302,14 +302,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -331,7 +331,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -354,7 +354,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -407,8 +409,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -527,19 +528,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -197,7 +197,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -229,7 +229,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -241,7 +241,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* set shutdown mode to ABORT
|
* set shutdown mode to ABORT
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -288,8 +288,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
|
|
||||||
if (_shutdownMode == ABORT)
|
if (_shutdownMode == ABORT)
|
||||||
{
|
{
|
||||||
@@ -379,11 +378,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()
|
private synchronized void saveData()
|
||||||
{
|
{
|
||||||
final AnnouncementsTable _an = AnnouncementsTable.getInstance();
|
final AnnouncementsTable announcements = AnnouncementsTable.getInstance();
|
||||||
switch (_shutdownMode)
|
switch (_shutdownMode)
|
||||||
{
|
{
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
@@ -404,7 +403,7 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_an.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
|
announcements.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
|
||||||
}
|
}
|
||||||
catch (Throwable t)
|
catch (Throwable t)
|
||||||
{
|
{
|
||||||
|
@@ -199,7 +199,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -231,7 +231,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -243,7 +243,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* set shutdown mode to ABORT
|
* set shutdown mode to ABORT
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -290,8 +290,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
|
|
||||||
if (_shutdownMode == ABORT)
|
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()
|
private synchronized void saveData()
|
||||||
{
|
{
|
||||||
final AnnouncementsTable _an = AnnouncementsTable.getInstance();
|
final AnnouncementsTable announcements = AnnouncementsTable.getInstance();
|
||||||
switch (_shutdownMode)
|
switch (_shutdownMode)
|
||||||
{
|
{
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
@@ -406,7 +405,7 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_an.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
|
announcements.announceToAll("Server is " + MODE_TEXT[_shutdownMode] + " NOW!");
|
||||||
}
|
}
|
||||||
catch (Throwable t)
|
catch (Throwable t)
|
||||||
{
|
{
|
||||||
|
@@ -84,7 +84,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -307,14 +307,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -336,7 +336,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -359,7 +359,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -401,7 +401,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -412,8 +414,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -557,19 +558,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -84,7 +84,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -307,14 +307,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -336,7 +336,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -359,7 +359,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -401,7 +401,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -412,8 +414,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -557,19 +558,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ public class Shutdown extends Thread
|
|||||||
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
* This function starts a shutdown count down from Telnet (Copied from Function startShutdown())
|
||||||
* @param seconds seconds until shutdown
|
* @param seconds seconds until shutdown
|
||||||
*/
|
*/
|
||||||
private void SendServerQuit(int seconds)
|
private void sendServerQuit(int seconds)
|
||||||
{
|
{
|
||||||
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
final SystemMessage sysm = new SystemMessage(SystemMessageId.THE_SERVER_WILL_BE_COMING_DOWN_IN_S1_SECOND_S_PLEASE_FIND_A_SAFE_PLACE_TO_LOG_OUT);
|
||||||
sysm.addInt(seconds);
|
sysm.addInt(seconds);
|
||||||
@@ -303,14 +303,14 @@ public class Shutdown extends Thread
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
SendServerQuit(seconds);
|
sendServerQuit(seconds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
@@ -332,7 +332,7 @@ public class Shutdown extends Thread
|
|||||||
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
LOGGER.warning("GM: " + (player != null ? player.getName() + "(" + player.getObjectId() + ") " : "") + "issued shutdown ABORT. " + MODE_TEXT[_shutdownMode] + " has been stopped!");
|
||||||
if (_counterInstance != null)
|
if (_counterInstance != null)
|
||||||
{
|
{
|
||||||
_counterInstance._abort();
|
_counterInstance.abort();
|
||||||
|
|
||||||
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
if (Config.PRECAUTIONARY_RESTART_ENABLED)
|
||||||
{
|
{
|
||||||
@@ -355,7 +355,7 @@ public class Shutdown extends Thread
|
|||||||
/**
|
/**
|
||||||
* Set shutdown mode to ABORT.
|
* Set shutdown mode to ABORT.
|
||||||
*/
|
*/
|
||||||
private void _abort()
|
private void abort()
|
||||||
{
|
{
|
||||||
_shutdownMode = ABORT;
|
_shutdownMode = ABORT;
|
||||||
}
|
}
|
||||||
@@ -397,7 +397,9 @@ public class Shutdown extends Thread
|
|||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
SendServerQuit(_secondsShut);
|
{
|
||||||
|
sendServerQuit(_secondsShut);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent players from logging in.
|
// Prevent players from logging in.
|
||||||
@@ -408,8 +410,7 @@ public class Shutdown extends Thread
|
|||||||
|
|
||||||
_secondsShut--;
|
_secondsShut--;
|
||||||
|
|
||||||
final int delay = 1000; // milliseconds
|
Thread.sleep(1000);
|
||||||
Thread.sleep(delay);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -532,19 +533,19 @@ public class Shutdown extends Thread
|
|||||||
restartCounter();
|
restartCounter();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void restartCounter()
|
public void restartCounter()
|
||||||
{
|
{
|
||||||
_startTime = Chronos.currentTimeMillis();
|
_startTime = Chronos.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTimeAndRestartCounter()
|
public long getEstimatedTimeAndRestartCounter()
|
||||||
{
|
{
|
||||||
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
final long toReturn = Chronos.currentTimeMillis() - _startTime;
|
||||||
restartCounter();
|
restartCounter();
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long getEstimatedTime()
|
public long getEstimatedTime()
|
||||||
{
|
{
|
||||||
return Chronos.currentTimeMillis() - _startTime;
|
return Chronos.currentTimeMillis() - _startTime;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user