2
0

LoginServerThread.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /*
  2. * This program is free software: you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation, either version 3 of the License, or (at your option) any later
  5. * version.
  6. *
  7. * This program is distributed in the hope that it will be useful, but WITHOUT
  8. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  10. * details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with
  13. * this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. package com.l2jserver.gameserver;
  16. import java.io.BufferedOutputStream;
  17. import java.io.IOException;
  18. import java.io.InputStream;
  19. import java.io.OutputStream;
  20. import java.math.BigInteger;
  21. import java.net.Socket;
  22. import java.net.UnknownHostException;
  23. import java.security.GeneralSecurityException;
  24. import java.security.KeyFactory;
  25. import java.security.interfaces.RSAPublicKey;
  26. import java.security.spec.RSAKeyGenParameterSpec;
  27. import java.security.spec.RSAPublicKeySpec;
  28. import java.util.Collection;
  29. import java.util.List;
  30. import java.util.Map;
  31. import java.util.logging.Level;
  32. import java.util.logging.LogRecord;
  33. import java.util.logging.Logger;
  34. import javolution.util.FastList;
  35. import javolution.util.FastMap;
  36. import com.l2jserver.Config;
  37. import com.l2jserver.gameserver.model.L2World;
  38. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  39. import com.l2jserver.gameserver.network.L2GameClient;
  40. import com.l2jserver.gameserver.network.SystemMessageId;
  41. import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
  42. import com.l2jserver.gameserver.network.gameserverpackets.AuthRequest;
  43. import com.l2jserver.gameserver.network.gameserverpackets.BlowFishKey;
  44. import com.l2jserver.gameserver.network.gameserverpackets.ChangeAccessLevel;
  45. import com.l2jserver.gameserver.network.gameserverpackets.PlayerAuthRequest;
  46. import com.l2jserver.gameserver.network.gameserverpackets.PlayerInGame;
  47. import com.l2jserver.gameserver.network.gameserverpackets.PlayerLogout;
  48. import com.l2jserver.gameserver.network.gameserverpackets.PlayerTracert;
  49. import com.l2jserver.gameserver.network.gameserverpackets.ServerStatus;
  50. import com.l2jserver.gameserver.network.loginserverpackets.AuthResponse;
  51. import com.l2jserver.gameserver.network.loginserverpackets.InitLS;
  52. import com.l2jserver.gameserver.network.loginserverpackets.KickPlayer;
  53. import com.l2jserver.gameserver.network.loginserverpackets.LoginServerFail;
  54. import com.l2jserver.gameserver.network.loginserverpackets.PlayerAuthResponse;
  55. import com.l2jserver.gameserver.network.serverpackets.CharSelectionInfo;
  56. import com.l2jserver.gameserver.network.serverpackets.LoginFail;
  57. import com.l2jserver.loginserver.crypt.NewCrypt;
  58. import com.l2jserver.util.Rnd;
  59. import com.l2jserver.util.Util;
  60. import com.l2jserver.util.network.BaseSendablePacket;
  61. public class LoginServerThread extends Thread
  62. {
  63. protected static final Logger _log = Logger.getLogger(LoginServerThread.class.getName());
  64. protected static final Logger _logAccounting = Logger.getLogger("accounting");
  65. /** {@see com.l2jserver.loginserver.LoginServer#PROTOCOL_REV } */
  66. private static final int REVISION = 0x0103;
  67. private RSAPublicKey _publicKey;
  68. private String _hostname;
  69. private int _port;
  70. private int _gamePort;
  71. private Socket _loginSocket;
  72. private InputStream _in;
  73. private OutputStream _out;
  74. /**
  75. * The BlowFish engine used to encrypt packets<br>
  76. * It is first initialized with a unified key:<br>
  77. * "_;v.]05-31!|+-%xT!^[$\00"<br>
  78. * <br>
  79. * and then after handshake, with a new key sent by<br>
  80. * loginserver during the handshake. This new key is stored<br>
  81. * in {@link #_blowfishKey}
  82. */
  83. private NewCrypt _blowfish;
  84. private byte[] _blowfishKey;
  85. private byte[] _hexID;
  86. private boolean _acceptAlternate;
  87. private int _requestID;
  88. private int _serverID;
  89. private boolean _reserveHost;
  90. private int _maxPlayer;
  91. private List<WaitingClient> _waitingClients;
  92. private Map<String, L2GameClient> _accountsInGameServer;
  93. private int _status;
  94. private String _serverName;
  95. private String _gameExternalHost;
  96. private String _gameInternalHost;
  97. private LoginServerThread()
  98. {
  99. super("LoginServerThread");
  100. _port = Config.GAME_SERVER_LOGIN_PORT;
  101. _gamePort = Config.PORT_GAME;
  102. _hostname = Config.GAME_SERVER_LOGIN_HOST;
  103. _hexID = Config.HEX_ID;
  104. if (_hexID == null)
  105. {
  106. _requestID = Config.REQUEST_ID;
  107. _hexID = generateHex(16);
  108. }
  109. else
  110. {
  111. _requestID = Config.SERVER_ID;
  112. }
  113. _acceptAlternate = Config.ACCEPT_ALTERNATE_ID;
  114. _reserveHost = Config.RESERVE_HOST_ON_LOGIN;
  115. _gameExternalHost = Config.EXTERNAL_HOSTNAME;
  116. _gameInternalHost = Config.INTERNAL_HOSTNAME;
  117. _waitingClients = new FastList<WaitingClient>();
  118. _accountsInGameServer = new FastMap<String, L2GameClient>().setShared(true);
  119. _maxPlayer = Config.MAXIMUM_ONLINE_USERS;
  120. }
  121. public static LoginServerThread getInstance()
  122. {
  123. return SingletonHolder._instance;
  124. }
  125. @Override
  126. public void run()
  127. {
  128. while (true)
  129. {
  130. int lengthHi = 0;
  131. int lengthLo = 0;
  132. int length = 0;
  133. boolean checksumOk = false;
  134. try
  135. {
  136. // Connection
  137. _log.info("Connecting to login on " + _hostname + ":" + _port);
  138. _loginSocket = new Socket(_hostname, _port);
  139. _in = _loginSocket.getInputStream();
  140. _out = new BufferedOutputStream(_loginSocket.getOutputStream());
  141. //init Blowfish
  142. _blowfishKey = generateHex(40);
  143. _blowfish = new NewCrypt("_;v.]05-31!|+-%xT!^[$\00");
  144. while (true)
  145. {
  146. lengthLo = _in.read();
  147. lengthHi = _in.read();
  148. length = lengthHi * 256 + lengthLo;
  149. if (lengthHi < 0)
  150. {
  151. _log.finer("LoginServerThread: Login terminated the connection.");
  152. break;
  153. }
  154. byte[] incoming = new byte[length];
  155. incoming[0] = (byte) lengthLo;
  156. incoming[1] = (byte) lengthHi;
  157. int receivedBytes = 0;
  158. int newBytes = 0;
  159. while (newBytes != -1 && receivedBytes < length - 2)
  160. {
  161. newBytes = _in.read(incoming, 2, length - 2);
  162. receivedBytes = receivedBytes + newBytes;
  163. }
  164. if (receivedBytes != length - 2)
  165. {
  166. _log.warning("Incomplete Packet is sent to the server, closing connection.(LS)");
  167. break;
  168. }
  169. byte[] decrypt = new byte[length - 2];
  170. System.arraycopy(incoming, 2, decrypt, 0, decrypt.length);
  171. // decrypt if we have a key
  172. decrypt = _blowfish.decrypt(decrypt);
  173. checksumOk = NewCrypt.verifyChecksum(decrypt);
  174. if (!checksumOk)
  175. {
  176. _log.warning("Incorrect packet checksum, ignoring packet (LS)");
  177. break;
  178. }
  179. if (Config.DEBUG)
  180. _log.warning("[C]\n" + Util.printData(decrypt));
  181. int packetType = decrypt[0] & 0xff;
  182. switch (packetType)
  183. {
  184. case 00:
  185. InitLS init = new InitLS(decrypt);
  186. if (Config.DEBUG)
  187. _log.info("Init received");
  188. if (init.getRevision() != REVISION)
  189. {
  190. //TODO: revision mismatch
  191. _log.warning("/!\\ Revision mismatch between LS and GS /!\\");
  192. break;
  193. }
  194. try
  195. {
  196. KeyFactory kfac = KeyFactory.getInstance("RSA");
  197. BigInteger modulus = new BigInteger(init.getRSAKey());
  198. RSAPublicKeySpec kspec1 = new RSAPublicKeySpec(modulus, RSAKeyGenParameterSpec.F4);
  199. _publicKey = (RSAPublicKey) kfac.generatePublic(kspec1);
  200. if (Config.DEBUG)
  201. _log.info("RSA key set up");
  202. }
  203. catch (GeneralSecurityException e)
  204. {
  205. _log.warning("Troubles while init the public key send by login");
  206. break;
  207. }
  208. //send the blowfish key through the rsa encryption
  209. BlowFishKey bfk = new BlowFishKey(_blowfishKey, _publicKey);
  210. sendPacket(bfk);
  211. if (Config.DEBUG)
  212. _log.info("Sent new blowfish key");
  213. //now, only accept paket with the new encryption
  214. _blowfish = new NewCrypt(_blowfishKey);
  215. if (Config.DEBUG)
  216. _log.info("Changed blowfish key");
  217. AuthRequest ar = new AuthRequest(_requestID, _acceptAlternate, _hexID, _gameExternalHost, _gameInternalHost, _gamePort, _reserveHost, _maxPlayer);
  218. sendPacket(ar);
  219. if (Config.DEBUG)
  220. _log.info("Sent AuthRequest to login");
  221. break;
  222. case 01:
  223. LoginServerFail lsf = new LoginServerFail(decrypt);
  224. _log.info("Damn! Registeration Failed: " + lsf.getReasonString());
  225. // login will close the connection here
  226. break;
  227. case 02:
  228. AuthResponse aresp = new AuthResponse(decrypt);
  229. _serverID = aresp.getServerId();
  230. _serverName = aresp.getServerName();
  231. Config.saveHexid(_serverID, hexToString(_hexID));
  232. _log.info("Registered on login as Server " + _serverID + " : " + _serverName);
  233. ServerStatus st = new ServerStatus();
  234. if (Config.SERVER_LIST_BRACKET)
  235. {
  236. st.addAttribute(ServerStatus.SERVER_LIST_SQUARE_BRACKET, ServerStatus.ON);
  237. }
  238. else
  239. {
  240. st.addAttribute(ServerStatus.SERVER_LIST_SQUARE_BRACKET, ServerStatus.OFF);
  241. }
  242. if (Config.SERVER_LIST_CLOCK)
  243. {
  244. st.addAttribute(ServerStatus.SERVER_LIST_CLOCK, ServerStatus.ON);
  245. }
  246. else
  247. {
  248. st.addAttribute(ServerStatus.SERVER_LIST_CLOCK, ServerStatus.OFF);
  249. }
  250. if (Config.SERVER_LIST_TESTSERVER)
  251. {
  252. st.addAttribute(ServerStatus.TEST_SERVER, ServerStatus.ON);
  253. }
  254. else
  255. {
  256. st.addAttribute(ServerStatus.TEST_SERVER, ServerStatus.OFF);
  257. }
  258. if (Config.SERVER_GMONLY)
  259. {
  260. st.addAttribute(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_GM_ONLY);
  261. }
  262. else
  263. {
  264. st.addAttribute(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_AUTO);
  265. }
  266. sendPacket(st);
  267. if (L2World.getInstance().getAllPlayersCount() > 0)
  268. {
  269. FastList<String> playerList = new FastList<String>();
  270. Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
  271. //synchronized (L2World.getInstance().getAllPlayers())
  272. {
  273. for (L2PcInstance player : pls)
  274. playerList.add(player.getAccountName());
  275. }
  276. PlayerInGame pig = new PlayerInGame(playerList);
  277. sendPacket(pig);
  278. }
  279. break;
  280. case 03:
  281. PlayerAuthResponse par = new PlayerAuthResponse(decrypt);
  282. String account = par.getAccount();
  283. WaitingClient wcToRemove = null;
  284. synchronized (_waitingClients)
  285. {
  286. for (WaitingClient wc : _waitingClients)
  287. {
  288. if (wc.account.equals(account))
  289. {
  290. wcToRemove = wc;
  291. }
  292. }
  293. }
  294. if (wcToRemove != null)
  295. {
  296. if (par.isAuthed())
  297. {
  298. if (Config.DEBUG)
  299. _log.info("Login accepted player " + wcToRemove.account + " waited("
  300. + (GameTimeController.getGameTicks() - wcToRemove.timestamp) + "ms)");
  301. PlayerInGame pig = new PlayerInGame(par.getAccount());
  302. sendPacket(pig);
  303. wcToRemove.gameClient.setState(GameClientState.AUTHED);
  304. wcToRemove.gameClient.setSessionId(wcToRemove.session);
  305. CharSelectionInfo cl = new CharSelectionInfo(wcToRemove.account, wcToRemove.gameClient.getSessionId().playOkID1);
  306. wcToRemove.gameClient.getConnection().sendPacket(cl);
  307. wcToRemove.gameClient.setCharSelection(cl.getCharInfo());
  308. }
  309. else
  310. {
  311. _log.warning("session key is not correct. closing connection");
  312. wcToRemove.gameClient.getConnection().sendPacket(new LoginFail(1));
  313. wcToRemove.gameClient.closeNow();
  314. }
  315. _waitingClients.remove(wcToRemove);
  316. }
  317. break;
  318. case 04:
  319. KickPlayer kp = new KickPlayer(decrypt);
  320. doKickPlayer(kp.getAccount());
  321. break;
  322. }
  323. }
  324. }
  325. catch (UnknownHostException e)
  326. {
  327. if (Config.DEBUG)
  328. e.printStackTrace();
  329. }
  330. catch (IOException e)
  331. {
  332. _log.info("Deconnected from Login, Trying to reconnect:");
  333. _log.info(e.toString());
  334. }
  335. finally
  336. {
  337. try
  338. {
  339. _loginSocket.close();
  340. }
  341. catch (Exception e)
  342. {
  343. }
  344. }
  345. try
  346. {
  347. Thread.sleep(5000); // 5 seconds tempo.
  348. }
  349. catch (InterruptedException e)
  350. {
  351. return; // never swallow an interrupt!
  352. }
  353. }
  354. }
  355. public void addWaitingClientAndSendRequest(String acc, L2GameClient client, SessionKey key)
  356. {
  357. if (Config.DEBUG)
  358. _log.info(String.valueOf(key));
  359. WaitingClient wc = new WaitingClient(acc, client, key);
  360. synchronized (_waitingClients)
  361. {
  362. _waitingClients.add(wc);
  363. }
  364. PlayerAuthRequest par = new PlayerAuthRequest(acc, key);
  365. try
  366. {
  367. sendPacket(par);
  368. }
  369. catch (IOException e)
  370. {
  371. _log.warning("Error while sending player auth request");
  372. if (Config.DEBUG)
  373. e.printStackTrace();
  374. }
  375. }
  376. public void removeWaitingClient(L2GameClient client)
  377. {
  378. WaitingClient toRemove = null;
  379. synchronized (_waitingClients)
  380. {
  381. for (WaitingClient c : _waitingClients)
  382. {
  383. if (c.gameClient == client)
  384. {
  385. toRemove = c;
  386. }
  387. }
  388. if (toRemove != null)
  389. _waitingClients.remove(toRemove);
  390. }
  391. }
  392. public void sendLogout(String account)
  393. {
  394. PlayerLogout pl = new PlayerLogout(account);
  395. try
  396. {
  397. sendPacket(pl);
  398. }
  399. catch (IOException e)
  400. {
  401. _log.warning("Error while sending logout packet to login");
  402. if (Config.DEBUG)
  403. e.printStackTrace();
  404. }
  405. }
  406. public void addGameServerLogin(String account, L2GameClient client)
  407. {
  408. _accountsInGameServer.put(account, client);
  409. }
  410. public void sendAccessLevel(String account, int level)
  411. {
  412. ChangeAccessLevel cal = new ChangeAccessLevel(account, level);
  413. try
  414. {
  415. sendPacket(cal);
  416. }
  417. catch (IOException e)
  418. {
  419. if (Config.DEBUG)
  420. e.printStackTrace();
  421. }
  422. }
  423. public void sendClientTracert(String account, String pcIp,
  424. String hop1, String hop2, String hop3, String hop4)
  425. {
  426. PlayerTracert ptc = new PlayerTracert(account, pcIp, hop1, hop2, hop3, hop4);
  427. try
  428. {
  429. sendPacket(ptc);
  430. }
  431. catch (IOException e)
  432. {
  433. if (Config.DEBUG)
  434. e.printStackTrace();
  435. }
  436. }
  437. private String hexToString(byte[] hex)
  438. {
  439. return new BigInteger(hex).toString(16);
  440. }
  441. public void doKickPlayer(String account)
  442. {
  443. if (_accountsInGameServer.get(account) != null)
  444. {
  445. L2GameClient client = _accountsInGameServer.get(account);
  446. LogRecord record = new LogRecord(Level.WARNING, "Kicked by login");
  447. record.setParameters(new Object[]{client});
  448. _logAccounting.log(record);
  449. final L2PcInstance player = client.getActiveChar();
  450. if (player != null)
  451. {
  452. player.sendPacket(SystemMessageId.ANOTHER_LOGIN_WITH_ACCOUNT);
  453. ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  454. {
  455. public void run()
  456. {
  457. player.logout(false);
  458. }
  459. } , 400);
  460. }
  461. else
  462. client.closeNow();
  463. LoginServerThread.getInstance().sendLogout(account);
  464. }
  465. }
  466. public static byte[] generateHex(int size)
  467. {
  468. byte[] array = new byte[size];
  469. Rnd.nextBytes(array);
  470. if (Config.DEBUG)
  471. _log.fine("Generated random String: \"" + array + "\"");
  472. return array;
  473. }
  474. /**
  475. * @param sl
  476. * @throws IOException
  477. */
  478. private void sendPacket(BaseSendablePacket sl) throws IOException
  479. {
  480. byte[] data = sl.getContent();
  481. NewCrypt.appendChecksum(data);
  482. if (Config.DEBUG)
  483. _log.finest("[S]\n" + Util.printData(data));
  484. data = _blowfish.crypt(data);
  485. int len = data.length + 2;
  486. synchronized (_out) //avoids tow threads writing in the mean time
  487. {
  488. _out.write(len & 0xff);
  489. _out.write(len >> 8 & 0xff);
  490. _out.write(data);
  491. _out.flush();
  492. }
  493. }
  494. /**
  495. * @param maxPlayer The maxPlayer to set.
  496. */
  497. public void setMaxPlayer(int maxPlayer)
  498. {
  499. sendServerStatus(ServerStatus.MAX_PLAYERS, maxPlayer);
  500. _maxPlayer = maxPlayer;
  501. }
  502. /**
  503. * @return Returns the maxPlayer.
  504. */
  505. public int getMaxPlayer()
  506. {
  507. return _maxPlayer;
  508. }
  509. /**
  510. * @param server_gm_only
  511. */
  512. public void sendServerStatus(int id, int value)
  513. {
  514. ServerStatus ss = new ServerStatus();
  515. ss.addAttribute(id, value);
  516. try
  517. {
  518. sendPacket(ss);
  519. }
  520. catch (IOException e)
  521. {
  522. if (Config.DEBUG)
  523. e.printStackTrace();
  524. }
  525. }
  526. /**
  527. * @return
  528. */
  529. public String getStatusString()
  530. {
  531. return ServerStatus.STATUS_STRING[_status];
  532. }
  533. /**
  534. * @return
  535. */
  536. public boolean isClockShown()
  537. {
  538. return Config.SERVER_LIST_CLOCK;
  539. }
  540. /**
  541. * @return
  542. */
  543. public boolean isBracketShown()
  544. {
  545. return Config.SERVER_LIST_BRACKET;
  546. }
  547. /**
  548. * @return Returns the serverName.
  549. */
  550. public String getServerName()
  551. {
  552. return _serverName;
  553. }
  554. public void setServerStatus(int status)
  555. {
  556. switch (status)
  557. {
  558. case ServerStatus.STATUS_AUTO:
  559. sendServerStatus(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_AUTO);
  560. _status = status;
  561. break;
  562. case ServerStatus.STATUS_DOWN:
  563. sendServerStatus(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_DOWN);
  564. _status = status;
  565. break;
  566. case ServerStatus.STATUS_FULL:
  567. sendServerStatus(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_FULL);
  568. _status = status;
  569. break;
  570. case ServerStatus.STATUS_GM_ONLY:
  571. sendServerStatus(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_GM_ONLY);
  572. _status = status;
  573. break;
  574. case ServerStatus.STATUS_GOOD:
  575. sendServerStatus(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_GOOD);
  576. _status = status;
  577. break;
  578. case ServerStatus.STATUS_NORMAL:
  579. sendServerStatus(ServerStatus.SERVER_LIST_STATUS, ServerStatus.STATUS_NORMAL);
  580. _status = status;
  581. break;
  582. default:
  583. throw new IllegalArgumentException("Status does not exists:" + status);
  584. }
  585. }
  586. public static class SessionKey
  587. {
  588. public int playOkID1;
  589. public int playOkID2;
  590. public int loginOkID1;
  591. public int loginOkID2;
  592. public SessionKey(int loginOK1, int loginOK2, int playOK1, int playOK2)
  593. {
  594. playOkID1 = playOK1;
  595. playOkID2 = playOK2;
  596. loginOkID1 = loginOK1;
  597. loginOkID2 = loginOK2;
  598. }
  599. @Override
  600. public String toString()
  601. {
  602. return "PlayOk: " + playOkID1 + " " + playOkID2 + " LoginOk:" + loginOkID1 + " " + loginOkID2;
  603. }
  604. }
  605. private class WaitingClient
  606. {
  607. public int timestamp;
  608. public String account;
  609. public L2GameClient gameClient;
  610. public SessionKey session;
  611. public WaitingClient(String acc, L2GameClient client, SessionKey key)
  612. {
  613. account = acc;
  614. timestamp = GameTimeController.getGameTicks();
  615. gameClient = client;
  616. session = key;
  617. }
  618. }
  619. @SuppressWarnings("synthetic-access")
  620. private static class SingletonHolder
  621. {
  622. protected static final LoginServerThread _instance = new LoginServerThread();
  623. }
  624. }