2
0

LoginServerThread.java 19 KB

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