GameServer.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  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 net.sf.l2j.gameserver;
  16. import java.io.File;
  17. import java.io.FileInputStream;
  18. import java.io.IOException;
  19. import java.io.InputStream;
  20. import java.net.InetAddress;
  21. import java.net.UnknownHostException;
  22. import java.util.Calendar;
  23. import java.util.logging.Level;
  24. import java.util.logging.LogManager;
  25. import java.util.logging.Logger;
  26. import net.sf.l2j.Config;
  27. import net.sf.l2j.L2DatabaseFactory;
  28. import net.sf.l2j.Server;
  29. import net.sf.l2j.gameserver.cache.CrestCache;
  30. import net.sf.l2j.gameserver.cache.HtmCache;
  31. import net.sf.l2j.gameserver.communitybbs.Manager.ForumsBBSManager;
  32. import net.sf.l2j.gameserver.datatables.AccessLevels;
  33. import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
  34. import net.sf.l2j.gameserver.datatables.ArmorSetsTable;
  35. import net.sf.l2j.gameserver.datatables.AugmentationData;
  36. import net.sf.l2j.gameserver.datatables.CharNameTable;
  37. import net.sf.l2j.gameserver.datatables.CharTemplateTable;
  38. import net.sf.l2j.gameserver.datatables.ClanTable;
  39. import net.sf.l2j.gameserver.datatables.DoorTable;
  40. import net.sf.l2j.gameserver.datatables.EnchantHPBonusData;
  41. import net.sf.l2j.gameserver.datatables.EventDroplist;
  42. import net.sf.l2j.gameserver.datatables.ExtractableItemsData;
  43. import net.sf.l2j.gameserver.datatables.ExtractableSkillsData;
  44. import net.sf.l2j.gameserver.datatables.FishTable;
  45. import net.sf.l2j.gameserver.datatables.HelperBuffTable;
  46. import net.sf.l2j.gameserver.datatables.HennaTable;
  47. import net.sf.l2j.gameserver.datatables.HennaTreeTable;
  48. import net.sf.l2j.gameserver.datatables.HeroSkillTable;
  49. import net.sf.l2j.gameserver.datatables.ItemTable;
  50. import net.sf.l2j.gameserver.datatables.LevelUpData;
  51. import net.sf.l2j.gameserver.datatables.MapRegionTable;
  52. import net.sf.l2j.gameserver.datatables.MerchantPriceConfigTable;
  53. import net.sf.l2j.gameserver.datatables.NobleSkillTable;
  54. import net.sf.l2j.gameserver.datatables.NpcBufferTable;
  55. import net.sf.l2j.gameserver.datatables.NpcTable;
  56. import net.sf.l2j.gameserver.datatables.NpcWalkerRoutesTable;
  57. import net.sf.l2j.gameserver.datatables.PetSkillsTable;
  58. import net.sf.l2j.gameserver.datatables.ResidentialSkillTable;
  59. import net.sf.l2j.gameserver.datatables.SkillSpellbookTable;
  60. import net.sf.l2j.gameserver.datatables.SkillTable;
  61. import net.sf.l2j.gameserver.datatables.SkillTreeTable;
  62. import net.sf.l2j.gameserver.datatables.SpawnTable;
  63. import net.sf.l2j.gameserver.datatables.StaticObjects;
  64. import net.sf.l2j.gameserver.datatables.SummonItemsData;
  65. import net.sf.l2j.gameserver.datatables.TeleportLocationTable;
  66. import net.sf.l2j.gameserver.geoeditorcon.GeoEditorListener;
  67. import net.sf.l2j.gameserver.handler.AdminCommandHandler;
  68. import net.sf.l2j.gameserver.handler.ChatHandler;
  69. import net.sf.l2j.gameserver.handler.ItemHandler;
  70. import net.sf.l2j.gameserver.handler.SkillHandler;
  71. import net.sf.l2j.gameserver.handler.UserCommandHandler;
  72. import net.sf.l2j.gameserver.handler.VoicedCommandHandler;
  73. import net.sf.l2j.gameserver.idfactory.IdFactory;
  74. import net.sf.l2j.gameserver.instancemanager.AirShipManager;
  75. import net.sf.l2j.gameserver.instancemanager.AuctionManager;
  76. import net.sf.l2j.gameserver.instancemanager.BoatManager;
  77. import net.sf.l2j.gameserver.instancemanager.CastleManager;
  78. import net.sf.l2j.gameserver.instancemanager.CastleManorManager;
  79. import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
  80. import net.sf.l2j.gameserver.instancemanager.CoupleManager;
  81. import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
  82. import net.sf.l2j.gameserver.instancemanager.DayNightSpawnManager;
  83. import net.sf.l2j.gameserver.instancemanager.DimensionalRiftManager;
  84. import net.sf.l2j.gameserver.instancemanager.FortManager;
  85. import net.sf.l2j.gameserver.instancemanager.FortSiegeManager;
  86. import net.sf.l2j.gameserver.instancemanager.FourSepulchersManager;
  87. import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
  88. import net.sf.l2j.gameserver.instancemanager.InstanceManager;
  89. import net.sf.l2j.gameserver.instancemanager.ItemsOnGroundManager;
  90. import net.sf.l2j.gameserver.instancemanager.MercTicketManager;
  91. import net.sf.l2j.gameserver.instancemanager.PetitionManager;
  92. import net.sf.l2j.gameserver.instancemanager.QuestManager;
  93. import net.sf.l2j.gameserver.instancemanager.RaidBossPointsManager;
  94. import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
  95. import net.sf.l2j.gameserver.instancemanager.SiegeManager;
  96. import net.sf.l2j.gameserver.instancemanager.TransformationManager;
  97. import net.sf.l2j.gameserver.instancemanager.ZoneManager;
  98. import net.sf.l2j.gameserver.model.AutoChatHandler;
  99. import net.sf.l2j.gameserver.model.AutoSpawnHandler;
  100. import net.sf.l2j.gameserver.model.L2Manor;
  101. import net.sf.l2j.gameserver.model.L2PetDataTable;
  102. import net.sf.l2j.gameserver.model.L2World;
  103. import net.sf.l2j.gameserver.model.entity.Hero;
  104. import net.sf.l2j.gameserver.model.entity.TvTManager;
  105. import net.sf.l2j.gameserver.model.olympiad.Olympiad;
  106. import net.sf.l2j.gameserver.network.L2GameClient;
  107. import net.sf.l2j.gameserver.network.L2GamePacketHandler;
  108. import net.sf.l2j.gameserver.pathfinding.PathFinding;
  109. import net.sf.l2j.gameserver.script.faenor.FaenorScriptEngine;
  110. import net.sf.l2j.gameserver.scripting.CompiledScriptCache;
  111. import net.sf.l2j.gameserver.scripting.L2ScriptEngineManager;
  112. import net.sf.l2j.gameserver.taskmanager.AutoAnnounceTaskManager;
  113. import net.sf.l2j.gameserver.taskmanager.KnownListUpdateTaskManager;
  114. import net.sf.l2j.gameserver.taskmanager.TaskManager;
  115. import net.sf.l2j.gameserver.util.DynamicExtension;
  116. import net.sf.l2j.status.Status;
  117. import net.sf.l2j.util.DeadLockDetector;
  118. import org.mmocore.network.SelectorConfig;
  119. import org.mmocore.network.SelectorThread;
  120. /**
  121. * This class ...
  122. *
  123. * @version $Revision: 1.29.2.15.2.19 $ $Date: 2005/04/05 19:41:23 $
  124. */
  125. public class GameServer
  126. {
  127. private static final Logger _log = Logger.getLogger(GameServer.class.getName());
  128. private final SelectorThread<L2GameClient> _selectorThread;
  129. private final DeadLockDetector _deadDetectThread;
  130. private final SkillTable _skillTable;
  131. private final ItemTable _itemTable;
  132. private final NpcTable _npcTable;
  133. private final HennaTable _hennaTable;
  134. private final IdFactory _idFactory;
  135. public static GameServer gameServer;
  136. private static ClanHallManager _cHManager;
  137. private final Shutdown _shutdownHandler;
  138. private final DoorTable _doorTable;
  139. private final SevenSigns _sevenSignsEngine;
  140. private final AutoChatHandler _autoChatHandler;
  141. private final AutoSpawnHandler _autoSpawnHandler;
  142. private LoginServerThread _loginThread;
  143. private final HelperBuffTable _helperBuffTable;
  144. private static Status _statusServer;
  145. @SuppressWarnings("unused")
  146. private final ThreadPoolManager _threadpools;
  147. public static final Calendar dateTimeServerStarted = Calendar.getInstance();
  148. public long getUsedMemoryMB()
  149. {
  150. return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576; // ;
  151. }
  152. public SelectorThread<L2GameClient> getSelectorThread()
  153. {
  154. return _selectorThread;
  155. }
  156. public DeadLockDetector getDeadLockDetectorThread()
  157. {
  158. return _deadDetectThread;
  159. }
  160. public ClanHallManager getCHManager()
  161. {
  162. return _cHManager;
  163. }
  164. public GameServer() throws Exception
  165. {
  166. long serverLoadStart = System.currentTimeMillis();
  167. gameServer = this;
  168. _log.finest("used mem:" + getUsedMemoryMB() + "MB");
  169. if (Config.SERVER_VERSION != null)
  170. {
  171. _log.info("L2J Server Version: " + Config.SERVER_VERSION);
  172. }
  173. if (Config.DATAPACK_VERSION != null)
  174. {
  175. _log.info("L2J Datapack Version: " + Config.DATAPACK_VERSION);
  176. }
  177. _idFactory = IdFactory.getInstance();
  178. if (!_idFactory.isInitialized())
  179. {
  180. _log.severe("Could not read object IDs from DB. Please Check Your Data.");
  181. throw new Exception("Could not initialize the ID factory");
  182. }
  183. _threadpools = ThreadPoolManager.getInstance();
  184. new File(Config.DATAPACK_ROOT, "data/crests").mkdirs();
  185. new File("log/game").mkdirs();
  186. // load script engines
  187. L2ScriptEngineManager.getInstance();
  188. // start game time control early
  189. GameTimeController.getInstance();
  190. // keep the references of Singletons to prevent garbage collection
  191. CharNameTable.getInstance();
  192. _skillTable = SkillTable.getInstance();
  193. if (!_skillTable.isInitialized())
  194. {
  195. _log.severe("Could not find the extraced files. Please Check Your Data.");
  196. throw new Exception("Could not initialize the skill table");
  197. }
  198. _itemTable = ItemTable.getInstance();
  199. if (!_itemTable.isInitialized())
  200. {
  201. _log.severe("Could not find the extraced files. Please Check Your Data.");
  202. throw new Exception("Could not initialize the item table");
  203. }
  204. // Load clan hall data before zone data and doors table
  205. _cHManager = ClanHallManager.getInstance();
  206. ExtractableItemsData.getInstance();
  207. ExtractableSkillsData.getInstance();
  208. SummonItemsData.getInstance();
  209. ZoneManager.getInstance();
  210. MerchantPriceConfigTable.getInstance().loadInstances();
  211. EnchantHPBonusData.getInstance();
  212. TradeController.getInstance();
  213. InstanceManager.getInstance();
  214. if (Config.ALLOW_NPC_WALKERS)
  215. {
  216. NpcWalkerRoutesTable.getInstance().load();
  217. }
  218. NpcBufferTable.getInstance();
  219. RecipeController.getInstance();
  220. SkillTreeTable.getInstance();
  221. PetSkillsTable.getInstance();
  222. ArmorSetsTable.getInstance();
  223. FishTable.getInstance();
  224. SkillSpellbookTable.getInstance();
  225. CharTemplateTable.getInstance();
  226. NobleSkillTable.getInstance();
  227. HeroSkillTable.getInstance();
  228. ResidentialSkillTable.getInstance();
  229. // Call to load caches
  230. HtmCache.getInstance();
  231. CrestCache.getInstance();
  232. ClanTable.getInstance();
  233. _npcTable = NpcTable.getInstance();
  234. if (!_npcTable.isInitialized())
  235. {
  236. _log.severe("Could not find the extraced files. Please Check Your Data.");
  237. throw new Exception("Could not initialize the npc table");
  238. }
  239. _hennaTable = HennaTable.getInstance();
  240. if (!_hennaTable.isInitialized())
  241. {
  242. throw new Exception("Could not initialize the Henna Table");
  243. }
  244. HennaTreeTable.getInstance();
  245. if (!_hennaTable.isInitialized())
  246. {
  247. throw new Exception("Could not initialize the Henna Tree Table");
  248. }
  249. _helperBuffTable = HelperBuffTable.getInstance();
  250. if (!_helperBuffTable.isInitialized())
  251. {
  252. throw new Exception("Could not initialize the Helper Buff Table");
  253. }
  254. GeoData.getInstance();
  255. if (Config.GEODATA == 2)
  256. PathFinding.getInstance();
  257. CastleManager.getInstance().loadInstances();
  258. SiegeManager.getInstance();
  259. FortManager.getInstance().loadInstances();
  260. FortSiegeManager.getInstance();
  261. TeleportLocationTable.getInstance();
  262. LevelUpData.getInstance();
  263. L2World.getInstance();
  264. SpawnTable.getInstance();
  265. RaidBossSpawnManager.getInstance();
  266. DayNightSpawnManager.getInstance().notifyChangeMode();
  267. GrandBossManager.getInstance().initZones();
  268. RaidBossPointsManager.init();
  269. FourSepulchersManager.getInstance().init();
  270. DimensionalRiftManager.getInstance();
  271. Announcements.getInstance();
  272. AutoAnnounceTaskManager.getInstance();
  273. MapRegionTable.getInstance();
  274. EventDroplist.getInstance();
  275. _doorTable = DoorTable.getInstance();
  276. StaticObjects.getInstance();
  277. /** Load Manor data */
  278. L2Manor.getInstance();
  279. /** Load Manager */
  280. AuctionManager.getInstance();
  281. BoatManager.getInstance();
  282. CastleManorManager.getInstance();
  283. MercTicketManager.getInstance();
  284. // PartyCommandManager.getInstance();
  285. PetitionManager.getInstance();
  286. QuestManager.getInstance();
  287. TransformationManager.getInstance();
  288. AirShipManager.getInstance();
  289. try
  290. {
  291. _log.info("Loading Server Scripts");
  292. File scripts = new File(Config.DATAPACK_ROOT + "/data/scripts.cfg");
  293. L2ScriptEngineManager.getInstance().executeScriptList(scripts);
  294. }
  295. catch (IOException ioe)
  296. {
  297. _log.severe("Failed loading scripts.cfg, no script going to be loaded");
  298. }
  299. try
  300. {
  301. CompiledScriptCache compiledScriptCache = L2ScriptEngineManager.getInstance().getCompiledScriptCache();
  302. if (compiledScriptCache == null)
  303. {
  304. _log.info("Compiled Scripts Cache is disabled.");
  305. }
  306. else
  307. {
  308. compiledScriptCache.purge();
  309. if (compiledScriptCache.isModified())
  310. {
  311. compiledScriptCache.save();
  312. _log.info("Compiled Scripts Cache was saved.");
  313. }
  314. else
  315. {
  316. _log.info("Compiled Scripts Cache is up-to-date.");
  317. }
  318. }
  319. }
  320. catch (IOException e)
  321. {
  322. _log.log(Level.SEVERE, "Failed to store Compiled Scripts Cache.", e);
  323. }
  324. QuestManager.getInstance().report();
  325. TransformationManager.getInstance().report();
  326. AugmentationData.getInstance();
  327. if (Config.SAVE_DROPPED_ITEM)
  328. ItemsOnGroundManager.getInstance();
  329. if (Config.AUTODESTROY_ITEM_AFTER > 0 || Config.HERB_AUTO_DESTROY_TIME > 0)
  330. ItemsAutoDestroy.getInstance();
  331. MonsterRace.getInstance();
  332. _sevenSignsEngine = SevenSigns.getInstance();
  333. SevenSignsFestival.getInstance();
  334. _autoSpawnHandler = AutoSpawnHandler.getInstance();
  335. _autoChatHandler = AutoChatHandler.getInstance();
  336. // Spawn the Orators/Preachers if in the Seal Validation period.
  337. _sevenSignsEngine.spawnSevenSignsNPC();
  338. Olympiad.getInstance();
  339. Hero.getInstance();
  340. FaenorScriptEngine.getInstance();
  341. // Init of a cursed weapon manager
  342. CursedWeaponsManager.getInstance();
  343. _log.config("AutoChatHandler: Loaded " + _autoChatHandler.size() + " handlers in total.");
  344. _log.config("AutoSpawnHandler: Loaded " + _autoSpawnHandler.size() + " handlers in total.");
  345. AdminCommandHandler.getInstance();
  346. ChatHandler.getInstance();
  347. ItemHandler.getInstance();
  348. SkillHandler.getInstance();
  349. UserCommandHandler.getInstance();
  350. VoicedCommandHandler.getInstance();
  351. AccessLevels.getInstance();
  352. AdminCommandAccessRights.getInstance();
  353. if (Config.L2JMOD_ALLOW_WEDDING)
  354. CoupleManager.getInstance();
  355. TaskManager.getInstance();
  356. GmListTable.getInstance();
  357. // read pet stats from db
  358. L2PetDataTable.getInstance().loadPetsData();
  359. MerchantPriceConfigTable.getInstance().updateReferences();
  360. CastleManager.getInstance().activateInstances();
  361. FortManager.getInstance().activateInstances();
  362. Universe.getInstance();
  363. if (Config.ACCEPT_GEOEDITOR_CONN)
  364. GeoEditorListener.getInstance();
  365. _shutdownHandler = Shutdown.getInstance();
  366. Runtime.getRuntime().addShutdownHook(_shutdownHandler);
  367. try
  368. {
  369. _doorTable.getDoor(24190001).openMe();
  370. _doorTable.getDoor(24190002).openMe();
  371. _doorTable.getDoor(24190003).openMe();
  372. _doorTable.getDoor(24190004).openMe();
  373. _doorTable.getDoor(23180001).openMe();
  374. _doorTable.getDoor(23180002).openMe();
  375. _doorTable.getDoor(23180003).openMe();
  376. _doorTable.getDoor(23180004).openMe();
  377. _doorTable.getDoor(23180005).openMe();
  378. _doorTable.getDoor(23180006).openMe();
  379. _doorTable.checkAutoOpen();
  380. }
  381. catch (NullPointerException e)
  382. {
  383. _log.warning("There is errors in your Door.csv file. Update door.csv");
  384. if (Config.DEBUG)
  385. e.printStackTrace();
  386. }
  387. ForumsBBSManager.getInstance();
  388. _log.config("IdFactory: Free ObjectID's remaining: " + IdFactory.getInstance().size());
  389. // initialize the dynamic extension loader
  390. try
  391. {
  392. DynamicExtension.getInstance();
  393. }
  394. catch (Exception ex)
  395. {
  396. _log.log(Level.WARNING, "DynamicExtension could not be loaded and initialized", ex);
  397. }
  398. TvTManager.getInstance();
  399. KnownListUpdateTaskManager.getInstance();
  400. if (Config.DEADLOCK_DETECTOR)
  401. {
  402. _deadDetectThread = new DeadLockDetector();
  403. _deadDetectThread.setDaemon(true);
  404. _deadDetectThread.start();
  405. }
  406. else
  407. _deadDetectThread = null;
  408. System.gc();
  409. // maxMemory is the upper limit the jvm can use, totalMemory the size of
  410. // the current allocation pool, freeMemory the unused memory in the
  411. // allocation pool
  412. long freeMem = (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory() + Runtime.getRuntime().freeMemory()) / 1048576;
  413. long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
  414. _log.info("GameServer Started, free memory " + freeMem + " Mb of " + totalMem + " Mb");
  415. _loginThread = LoginServerThread.getInstance();
  416. _loginThread.start();
  417. final SelectorConfig sc = new SelectorConfig();
  418. sc.MAX_READ_PER_PASS = Config.MMO_MAX_READ_PER_PASS;
  419. sc.MAX_SEND_PER_PASS = Config.MMO_MAX_SEND_PER_PASS;
  420. sc.SLEEP_TIME = Config.MMO_SELECTOR_SLEEP_TIME;
  421. sc.HELPER_BUFFER_COUNT = Config.MMO_HELPER_BUFFER_COUNT;
  422. final L2GamePacketHandler gph = new L2GamePacketHandler();
  423. _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, null);
  424. InetAddress bindAddress = null;
  425. if (!Config.GAMESERVER_HOSTNAME.equals("*"))
  426. {
  427. try
  428. {
  429. bindAddress = InetAddress.getByName(Config.GAMESERVER_HOSTNAME);
  430. }
  431. catch (UnknownHostException e1)
  432. {
  433. _log.severe("WARNING: The GameServer bind address is invalid, using all avaliable IPs. Reason: " + e1.getMessage());
  434. if (Config.DEVELOPER)
  435. {
  436. e1.printStackTrace();
  437. }
  438. }
  439. }
  440. try
  441. {
  442. _selectorThread.openServerSocket(bindAddress, Config.PORT_GAME);
  443. }
  444. catch (IOException e)
  445. {
  446. _log.severe("FATAL: Failed to open server socket. Reason: " + e.getMessage());
  447. if (Config.DEVELOPER)
  448. {
  449. e.printStackTrace();
  450. }
  451. System.exit(1);
  452. }
  453. _selectorThread.start();
  454. _log.config("Maximum Numbers of Connected Players: " + Config.MAXIMUM_ONLINE_USERS);
  455. long serverLoadEnd = System.currentTimeMillis();
  456. _log.info("Server Loaded in " + ((serverLoadEnd - serverLoadStart) / 1000) + " seconds");
  457. }
  458. public static void main(String[] args) throws Exception
  459. {
  460. Server.serverMode = Server.MODE_GAMESERVER;
  461. // Local Constants
  462. final String LOG_FOLDER = "log"; // Name of folder for log file
  463. final String LOG_NAME = "./log.cfg"; // Name of log file
  464. /*** Main ***/
  465. // Create log folder
  466. File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
  467. logFolder.mkdir();
  468. // Create input stream for log file -- or store file data into memory
  469. InputStream is = new FileInputStream(new File(LOG_NAME));
  470. LogManager.getLogManager().readConfiguration(is);
  471. is.close();
  472. // Initialize config
  473. Config.load();
  474. L2DatabaseFactory.getInstance();
  475. gameServer = new GameServer();
  476. if (Config.IS_TELNET_ENABLED)
  477. {
  478. _statusServer = new Status(Server.serverMode);
  479. _statusServer.start();
  480. }
  481. else
  482. {
  483. _log.info("Telnet server is currently disabled.");
  484. }
  485. }
  486. }