Use same instance methods for start classes as other branches.

This commit is contained in:
MobiusDevelopment
2019-08-29 19:02:14 +00:00
parent a114a354c7
commit 00ce590ed0
2 changed files with 23 additions and 12 deletions

View File

@@ -146,10 +146,11 @@ public class GameServer
private static LoginServerThread _loginThread; private static LoginServerThread _loginThread;
private static GamePacketHandler _gamePacketHandler; private static GamePacketHandler _gamePacketHandler;
private static TelnetStatusThread _statusServer; private static TelnetStatusThread _statusServer;
private static GameServer INSTANCE;
public static final Calendar dateTimeServerStarted = Calendar.getInstance(); public static final Calendar dateTimeServerStarted = Calendar.getInstance();
public static void main(String[] args) throws Exception public GameServer() throws Exception
{ {
final long serverLoadStart = System.currentTimeMillis(); final long serverLoadStart = System.currentTimeMillis();
@@ -608,4 +609,14 @@ public class GameServer
{ {
return _selectorThread; return _selectorThread;
} }
public static void main(String[] args) throws Exception
{
INSTANCE = new GameServer();
}
public static GameServer getInstance()
{
return INSTANCE;
}
} }

View File

@@ -52,17 +52,7 @@ public class LoginServer
private TelnetStatusThread _statusServer; private TelnetStatusThread _statusServer;
private static int _loginStatus = ServerStatus.STATUS_NORMAL; private static int _loginStatus = ServerStatus.STATUS_NORMAL;
public static void main(String[] args) private LoginServer() throws Exception
{
INSTANCE = new LoginServer();
}
public static LoginServer getInstance()
{
return INSTANCE;
}
public LoginServer()
{ {
// GUI // GUI
if (!GraphicsEnvironment.isHeadless()) if (!GraphicsEnvironment.isHeadless())
@@ -211,4 +201,14 @@ public class LoginServer
{ {
_loginStatus = status; _loginStatus = status;
} }
public static void main(String[] args) throws Exception
{
INSTANCE = new LoginServer();
}
public static LoginServer getInstance()
{
return INSTANCE;
}
} }