From 00ce590ed098b00ccfe8e4bb6aff507c4a029222 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 29 Aug 2019 19:02:14 +0000 Subject: [PATCH] Use same instance methods for start classes as other branches. --- .../org/l2jmobius/gameserver/GameServer.java | 13 ++++++++++- .../l2jmobius/loginserver/LoginServer.java | 22 +++++++++---------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java index 9280cb35e1..490cefdad9 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java @@ -146,10 +146,11 @@ public class GameServer private static LoginServerThread _loginThread; private static GamePacketHandler _gamePacketHandler; private static TelnetStatusThread _statusServer; + private static GameServer INSTANCE; public static final Calendar dateTimeServerStarted = Calendar.getInstance(); - public static void main(String[] args) throws Exception + public GameServer() throws Exception { final long serverLoadStart = System.currentTimeMillis(); @@ -608,4 +609,14 @@ public class GameServer { return _selectorThread; } + + public static void main(String[] args) throws Exception + { + INSTANCE = new GameServer(); + } + + public static GameServer getInstance() + { + return INSTANCE; + } } \ No newline at end of file diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java index 19282da098..2b7108e8f3 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java @@ -52,17 +52,7 @@ public class LoginServer private TelnetStatusThread _statusServer; private static int _loginStatus = ServerStatus.STATUS_NORMAL; - public static void main(String[] args) - { - INSTANCE = new LoginServer(); - } - - public static LoginServer getInstance() - { - return INSTANCE; - } - - public LoginServer() + private LoginServer() throws Exception { // GUI if (!GraphicsEnvironment.isHeadless()) @@ -211,4 +201,14 @@ public class LoginServer { _loginStatus = status; } + + public static void main(String[] args) throws Exception + { + INSTANCE = new LoginServer(); + } + + public static LoginServer getInstance() + { + return INSTANCE; + } }