GameServer.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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. if (Config.LOG_GAME_DAMAGE)
  186. new File("log/game").mkdirs();
  187. // load script engines
  188. L2ScriptEngineManager.getInstance();
  189. // start game time control early
  190. GameTimeController.getInstance();
  191. // keep the references of Singletons to prevent garbage collection
  192. CharNameTable.getInstance();
  193. _skillTable = SkillTable.getInstance();
  194. if (!_skillTable.isInitialized())
  195. {
  196. _log.severe("Could not find the extraced files. Please Check Your Data.");
  197. throw new Exception("Could not initialize the skill table");
  198. }
  199. _itemTable = ItemTable.getInstance();
  200. if (!_itemTable.isInitialized())
  201. {
  202. _log.severe("Could not find the extraced files. Please Check Your Data.");
  203. throw new Exception("Could not initialize the item table");
  204. }
  205. // Load clan hall data before zone data and doors table
  206. _cHManager = ClanHallManager.getInstance();
  207. ExtractableItemsData.getInstance();
  208. ExtractableSkillsData.getInstance();
  209. SummonItemsData.getInstance();
  210. ZoneManager.getInstance();
  211. MerchantPriceConfigTable.getInstance().loadInstances();
  212. EnchantHPBonusData.getInstance();
  213. TradeController.getInstance();
  214. InstanceManager.getInstance();
  215. if (Config.ALLOW_NPC_WALKERS)
  216. {
  217. NpcWalkerRoutesTable.getInstance().load();
  218. }
  219. NpcBufferTable.getInstance();
  220. RecipeController.getInstance();
  221. SkillTreeTable.getInstance();
  222. PetSkillsTable.getInstance();
  223. ArmorSetsTable.getInstance();
  224. FishTable.getInstance();
  225. SkillSpellbookTable.getInstance();
  226. CharTemplateTable.getInstance();
  227. NobleSkillTable.getInstance();
  228. HeroSkillTable.getInstance();
  229. ResidentialSkillTable.getInstance();
  230. // Call to load caches
  231. HtmCache.getInstance();
  232. CrestCache.getInstance();
  233. ClanTable.getInstance();
  234. _npcTable = NpcTable.getInstance();
  235. if (!_npcTable.isInitialized())
  236. {
  237. _log.severe("Could not find the extraced files. Please Check Your Data.");
  238. throw new Exception("Could not initialize the npc table");
  239. }
  240. _hennaTable = HennaTable.getInstance();
  241. if (!_hennaTable.isInitialized())
  242. {
  243. throw new Exception("Could not initialize the Henna Table");
  244. }
  245. HennaTreeTable.getInstance();
  246. if (!_hennaTable.isInitialized())
  247. {
  248. throw new Exception("Could not initialize the Henna Tree Table");
  249. }
  250. _helperBuffTable = HelperBuffTable.getInstance();
  251. if (!_helperBuffTable.isInitialized())
  252. {
  253. throw new Exception("Could not initialize the Helper Buff Table");
  254. }
  255. GeoData.getInstance();
  256. if (Config.GEODATA == 2)
  257. PathFinding.getInstance();
  258. CastleManager.getInstance().loadInstances();
  259. SiegeManager.getInstance();
  260. FortManager.getInstance().loadInstances();
  261. FortSiegeManager.getInstance();
  262. TeleportLocationTable.getInstance();
  263. LevelUpData.getInstance();
  264. L2World.getInstance();
  265. SpawnTable.getInstance();
  266. RaidBossSpawnManager.getInstance();
  267. DayNightSpawnManager.getInstance().notifyChangeMode();
  268. GrandBossManager.getInstance().initZones();
  269. RaidBossPointsManager.init();
  270. FourSepulchersManager.getInstance().init();
  271. DimensionalRiftManager.getInstance();
  272. Announcements.getInstance();
  273. AutoAnnounceTaskManager.getInstance();
  274. MapRegionTable.getInstance();
  275. EventDroplist.getInstance();
  276. _doorTable = DoorTable.getInstance();
  277. StaticObjects.getInstance();
  278. /** Load Manor data */
  279. L2Manor.getInstance();
  280. /** Load Manager */
  281. AuctionManager.getInstance();
  282. BoatManager.getInstance();
  283. CastleManorManager.getInstance();
  284. MercTicketManager.getInstance();
  285. // PartyCommandManager.getInstance();
  286. PetitionManager.getInstance();
  287. QuestManager.getInstance();
  288. TransformationManager.getInstance();
  289. AirShipManager.getInstance();
  290. try
  291. {
  292. _log.info("Loading Server Scripts");
  293. File scripts = new File(Config.DATAPACK_ROOT + "/data/scripts.cfg");
  294. L2ScriptEngineManager.getInstance().executeScriptList(scripts);
  295. }
  296. catch (IOException ioe)
  297. {
  298. _log.severe("Failed loading scripts.cfg, no script going to be loaded");
  299. }
  300. try
  301. {
  302. CompiledScriptCache compiledScriptCache = L2ScriptEngineManager.getInstance().getCompiledScriptCache();
  303. if (compiledScriptCache == null)
  304. {
  305. _log.info("Compiled Scripts Cache is disabled.");
  306. }
  307. else
  308. {
  309. compiledScriptCache.purge();
  310. if (compiledScriptCache.isModified())
  311. {
  312. compiledScriptCache.save();
  313. _log.info("Compiled Scripts Cache was saved.");
  314. }
  315. else
  316. {
  317. _log.info("Compiled Scripts Cache is up-to-date.");
  318. }
  319. }
  320. }
  321. catch (IOException e)
  322. {
  323. _log.log(Level.SEVERE, "Failed to store Compiled Scripts Cache.", e);
  324. }
  325. QuestManager.getInstance().report();
  326. TransformationManager.getInstance().report();
  327. AugmentationData.getInstance();
  328. if (Config.SAVE_DROPPED_ITEM)
  329. ItemsOnGroundManager.getInstance();
  330. if (Config.AUTODESTROY_ITEM_AFTER > 0 || Config.HERB_AUTO_DESTROY_TIME > 0)
  331. ItemsAutoDestroy.getInstance();
  332. MonsterRace.getInstance();
  333. _sevenSignsEngine = SevenSigns.getInstance();
  334. SevenSignsFestival.getInstance();
  335. _autoSpawnHandler = AutoSpawnHandler.getInstance();
  336. _autoChatHandler = AutoChatHandler.getInstance();
  337. // Spawn the Orators/Preachers if in the Seal Validation period.
  338. _sevenSignsEngine.spawnSevenSignsNPC();
  339. Olympiad.getInstance();
  340. Hero.getInstance();
  341. FaenorScriptEngine.getInstance();
  342. // Init of a cursed weapon manager
  343. CursedWeaponsManager.getInstance();
  344. _log.config("AutoChatHandler: Loaded " + _autoChatHandler.size() + " handlers in total.");
  345. _log.config("AutoSpawnHandler: Loaded " + _autoSpawnHandler.size() + " handlers in total.");
  346. AdminCommandHandler.getInstance();
  347. ChatHandler.getInstance();
  348. ItemHandler.getInstance();
  349. SkillHandler.getInstance();
  350. UserCommandHandler.getInstance();
  351. VoicedCommandHandler.getInstance();
  352. AccessLevels.getInstance();
  353. AdminCommandAccessRights.getInstance();
  354. if (Config.L2JMOD_ALLOW_WEDDING)
  355. CoupleManager.getInstance();
  356. TaskManager.getInstance();
  357. GmListTable.getInstance();
  358. // read pet stats from db
  359. L2PetDataTable.getInstance().loadPetsData();
  360. MerchantPriceConfigTable.getInstance().updateReferences();
  361. CastleManager.getInstance().activateInstances();
  362. FortManager.getInstance().activateInstances();
  363. Universe.getInstance();
  364. if (Config.ACCEPT_GEOEDITOR_CONN)
  365. GeoEditorListener.getInstance();
  366. _shutdownHandler = Shutdown.getInstance();
  367. Runtime.getRuntime().addShutdownHook(_shutdownHandler);
  368. try
  369. {
  370. _doorTable.getDoor(24190001).openMe();
  371. _doorTable.getDoor(24190002).openMe();
  372. _doorTable.getDoor(24190003).openMe();
  373. _doorTable.getDoor(24190004).openMe();
  374. _doorTable.getDoor(23180001).openMe();
  375. _doorTable.getDoor(23180002).openMe();
  376. _doorTable.getDoor(23180003).openMe();
  377. _doorTable.getDoor(23180004).openMe();
  378. _doorTable.getDoor(23180005).openMe();
  379. _doorTable.getDoor(23180006).openMe();
  380. _doorTable.checkAutoOpen();
  381. }
  382. catch (NullPointerException e)
  383. {
  384. _log.warning("There is errors in your Door.csv file. Update door.csv");
  385. if (Config.DEBUG)
  386. e.printStackTrace();
  387. }
  388. ForumsBBSManager.getInstance();
  389. _log.config("IdFactory: Free ObjectID's remaining: " + IdFactory.getInstance().size());
  390. // initialize the dynamic extension loader
  391. try
  392. {
  393. DynamicExtension.getInstance();
  394. }
  395. catch (Exception ex)
  396. {
  397. _log.log(Level.WARNING, "DynamicExtension could not be loaded and initialized", ex);
  398. }
  399. TvTManager.getInstance();
  400. KnownListUpdateTaskManager.getInstance();
  401. if (Config.DEADLOCK_DETECTOR)
  402. {
  403. _deadDetectThread = new DeadLockDetector();
  404. _deadDetectThread.setDaemon(true);
  405. _deadDetectThread.start();
  406. }
  407. else
  408. _deadDetectThread = null;
  409. System.gc();
  410. // maxMemory is the upper limit the jvm can use, totalMemory the size of
  411. // the current allocation pool, freeMemory the unused memory in the
  412. // allocation pool
  413. long freeMem = (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory() + Runtime.getRuntime().freeMemory()) / 1048576;
  414. long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
  415. _log.info("GameServer Started, free memory " + freeMem + " Mb of " + totalMem + " Mb");
  416. _loginThread = LoginServerThread.getInstance();
  417. _loginThread.start();
  418. final SelectorConfig sc = new SelectorConfig();
  419. sc.MAX_READ_PER_PASS = Config.MMO_MAX_READ_PER_PASS;
  420. sc.MAX_SEND_PER_PASS = Config.MMO_MAX_SEND_PER_PASS;
  421. sc.SLEEP_TIME = Config.MMO_SELECTOR_SLEEP_TIME;
  422. sc.HELPER_BUFFER_COUNT = Config.MMO_HELPER_BUFFER_COUNT;
  423. final L2GamePacketHandler gph = new L2GamePacketHandler();
  424. _selectorThread = new SelectorThread<L2GameClient>(sc, gph, gph, gph, null);
  425. InetAddress bindAddress = null;
  426. if (!Config.GAMESERVER_HOSTNAME.equals("*"))
  427. {
  428. try
  429. {
  430. bindAddress = InetAddress.getByName(Config.GAMESERVER_HOSTNAME);
  431. }
  432. catch (UnknownHostException e1)
  433. {
  434. _log.severe("WARNING: The GameServer bind address is invalid, using all avaliable IPs. Reason: " + e1.getMessage());
  435. if (Config.DEVELOPER)
  436. {
  437. e1.printStackTrace();
  438. }
  439. }
  440. }
  441. try
  442. {
  443. _selectorThread.openServerSocket(bindAddress, Config.PORT_GAME);
  444. }
  445. catch (IOException e)
  446. {
  447. _log.severe("FATAL: Failed to open server socket. Reason: " + e.getMessage());
  448. if (Config.DEVELOPER)
  449. {
  450. e.printStackTrace();
  451. }
  452. System.exit(1);
  453. }
  454. _selectorThread.start();
  455. _log.config("Maximum Numbers of Connected Players: " + Config.MAXIMUM_ONLINE_USERS);
  456. long serverLoadEnd = System.currentTimeMillis();
  457. _log.info("Server Loaded in " + ((serverLoadEnd - serverLoadStart) / 1000) + " seconds");
  458. }
  459. public static void main(String[] args) throws Exception
  460. {
  461. Server.serverMode = Server.MODE_GAMESERVER;
  462. // Local Constants
  463. final String LOG_FOLDER = "log"; // Name of folder for log file
  464. final String LOG_NAME = "./log.cfg"; // Name of log file
  465. /*** Main ***/
  466. // Create log folder
  467. File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
  468. logFolder.mkdir();
  469. // Create input stream for log file -- or store file data into memory
  470. InputStream is = new FileInputStream(new File(LOG_NAME));
  471. LogManager.getLogManager().readConfiguration(is);
  472. is.close();
  473. // Initialize config
  474. Config.load();
  475. L2DatabaseFactory.getInstance();
  476. gameServer = new GameServer();
  477. if (Config.IS_TELNET_ENABLED)
  478. {
  479. _statusServer = new Status(Server.serverMode);
  480. _statusServer.start();
  481. }
  482. else
  483. {
  484. _log.info("Telnet server is currently disabled.");
  485. }
  486. }
  487. }