Browse Source

I liked this most in other forks :)

JIV 15 years ago
parent
commit
16a949b1ea

+ 79 - 75
L2_GameServer/java/com/l2jserver/gameserver/GameServer.java

@@ -194,81 +194,68 @@ public class GameServer
 		new File("log/game").mkdirs();
 		new File("log/game").mkdirs();
 		
 		
 		// load script engines
 		// load script engines
+		printSection("Engines");
 		L2ScriptEngineManager.getInstance();
 		L2ScriptEngineManager.getInstance();
 		
 		
+		printSection("World");
 		// start game time control early
 		// start game time control early
 		GameTimeController.getInstance();
 		GameTimeController.getInstance();
+		InstanceManager.getInstance();
+		L2World.getInstance();
+		MapRegionTable.getInstance();
+		Announcements.getInstance();
 		
 		
-		// keep the references of Singletons to prevent garbage collection
-		CharNameTable.getInstance();
+		printSection("Skills");
 		EnchantGroupsTable.getInstance();
 		EnchantGroupsTable.getInstance();
 		SkillTable.getInstance();
 		SkillTable.getInstance();
+		SkillTreeTable.getInstance();
+		PetSkillsTable.getInstance();
+		NobleSkillTable.getInstance();
+		GMSkillTable.getInstance();
+		HeroSkillTable.getInstance();
+		ResidentialSkillTable.getInstance();
+		SkillSpellbookTable.getInstance();
 		
 		
+		printSection("Items");
 		ItemTable.getInstance();
 		ItemTable.getInstance();
-		if (!ItemTable.getInstance().isInitialized())
-		{
-			_log.severe("Could not find the extraced files. Please Check Your Data.");
-			throw new Exception("Could not initialize the item table");
-		}
-		
-		// Load clan hall data before zone data and doors table
-		ClanHallManager.getInstance();
-		
 		ExtractableItemsData.getInstance();
 		ExtractableItemsData.getInstance();
 		ExtractableSkillsData.getInstance();
 		ExtractableSkillsData.getInstance();
 		SummonItemsData.getInstance();
 		SummonItemsData.getInstance();
-		ZoneManager.getInstance();
-		MerchantPriceConfigTable.getInstance().loadInstances();
 		EnchantHPBonusData.getInstance();
 		EnchantHPBonusData.getInstance();
+		MerchantPriceConfigTable.getInstance().loadInstances();
 		TradeController.getInstance();
 		TradeController.getInstance();
 		L2Multisell.getInstance();
 		L2Multisell.getInstance();
-		InstanceManager.getInstance();
-		
-		if (Config.ALLOW_NPC_WALKERS)
-		{
-			NpcWalkerRoutesTable.getInstance().load();
-		}
-		
-		NpcBufferTable.getInstance();
-		
 		RecipeController.getInstance();
 		RecipeController.getInstance();
-		
-		SkillTreeTable.getInstance();
-		PetSkillsTable.getInstance();
 		ArmorSetsTable.getInstance();
 		ArmorSetsTable.getInstance();
 		FishTable.getInstance();
 		FishTable.getInstance();
 		SkillSpellbookTable.getInstance();
 		SkillSpellbookTable.getInstance();
-		CharTemplateTable.getInstance();
-		NobleSkillTable.getInstance();
-		GMSkillTable.getInstance();
-		HeroSkillTable.getInstance();
-		ResidentialSkillTable.getInstance();
 		
 		
-		// Call to load caches
-		HtmCache.getInstance();
-		CrestCache.getInstance();
+		printSection("Characters");
+		CharTemplateTable.getInstance();
+		CharNameTable.getInstance();
+		LevelUpData.getInstance();
+		AccessLevels.getInstance();
+		AdminCommandAccessRights.getInstance();
+		GmListTable.getInstance();
+		PetDataTable.getInstance().loadPetsData();
 		
 		
+		printSection("Clans");
 		ClanTable.getInstance();
 		ClanTable.getInstance();
+		ClanHallManager.getInstance();
+		AuctionManager.getInstance();
+
 		
 		
+		printSection("NPCs");
 		NpcTable.getInstance();
 		NpcTable.getInstance();
-		
-		HennaTable.getInstance();
-		HennaTreeTable.getInstance();
-		HelperBuffTable.getInstance();
-		
-		GeoData.getInstance();
-		if (Config.GEODATA == 2)
-			PathFinding.getInstance();
-		
+		DoorTable.getInstance();
+		StaticObjects.getInstance();
 		CastleManager.getInstance().loadInstances();
 		CastleManager.getInstance().loadInstances();
-		SiegeManager.getInstance().getSieges();
 		FortManager.getInstance().loadInstances();
 		FortManager.getInstance().loadInstances();
-		FortSiegeManager.getInstance();
-		TerritoryWarManager.getInstance();
-		
-		TeleportLocationTable.getInstance();
-		LevelUpData.getInstance();
-		L2World.getInstance();
+		if (Config.ALLOW_NPC_WALKERS)
+		{
+			NpcWalkerRoutesTable.getInstance().load();
+		}
+		NpcBufferTable.getInstance();
 		SpawnTable.getInstance();
 		SpawnTable.getInstance();
 		RaidBossSpawnManager.getInstance();
 		RaidBossSpawnManager.getInstance();
 		DayNightSpawnManager.getInstance().notifyChangeMode();
 		DayNightSpawnManager.getInstance().notifyChangeMode();
@@ -276,28 +263,48 @@ public class GameServer
 		RaidBossPointsManager.init();
 		RaidBossPointsManager.init();
 		FourSepulchersManager.getInstance().init();
 		FourSepulchersManager.getInstance().init();
 		DimensionalRiftManager.getInstance();
 		DimensionalRiftManager.getInstance();
-		Announcements.getInstance();
-		MapRegionTable.getInstance();
 		EventDroplist.getInstance();
 		EventDroplist.getInstance();
+
 		
 		
-		DoorTable.getInstance();
-		StaticObjects.getInstance();
-		UITable.getInstance();
-		
-		/** Load Manor data */
-		L2Manor.getInstance();
-		
-		/** Load Manager */
-		AuctionManager.getInstance();
-		BoatManager.getInstance();
+		printSection("Siege");
+		SiegeManager.getInstance().getSieges();
+		FortSiegeManager.getInstance();
+		TerritoryWarManager.getInstance();
 		CastleManorManager.getInstance();
 		CastleManorManager.getInstance();
 		MercTicketManager.getInstance();
 		MercTicketManager.getInstance();
-		// PartyCommandManager.getInstance();
+		L2Manor.getInstance();
+		
+		//printSection("Zones");
+		ZoneManager.getInstance();
+		
+		printSection("Olympiad");
+		Olympiad.getInstance();
+		Hero.getInstance();
+		
+		// Call to load caches
+		printSection("Cache");
+		HtmCache.getInstance();
+		CrestCache.getInstance();
+		TeleportLocationTable.getInstance();
+		UITable.getInstance();
 		PartyMatchWaitingList.getInstance();
 		PartyMatchWaitingList.getInstance();
 		PartyMatchRoomList.getInstance();
 		PartyMatchRoomList.getInstance();
 		PetitionManager.getInstance();
 		PetitionManager.getInstance();
+		HennaTable.getInstance();
+		HennaTreeTable.getInstance();
+		HelperBuffTable.getInstance();
+		AugmentationData.getInstance();
+		CursedWeaponsManager.getInstance();
+		
+		printSection("Geodata");
+		GeoData.getInstance();
+		if (Config.GEODATA == 2)
+			PathFinding.getInstance();
+		
+		printSection("Scripts");
 		QuestManager.getInstance();
 		QuestManager.getInstance();
 		TransformationManager.getInstance();
 		TransformationManager.getInstance();
+		BoatManager.getInstance();
 		AirShipManager.getInstance();
 		AirShipManager.getInstance();
 		
 		
 		try
 		try
@@ -340,8 +347,7 @@ public class GameServer
 		}
 		}
 		QuestManager.getInstance().report();
 		QuestManager.getInstance().report();
 		TransformationManager.getInstance().report();
 		TransformationManager.getInstance().report();
-		
-		AugmentationData.getInstance();
+
 		if (Config.SAVE_DROPPED_ITEM)
 		if (Config.SAVE_DROPPED_ITEM)
 			ItemsOnGroundManager.getInstance();
 			ItemsOnGroundManager.getInstance();
 		
 		
@@ -355,11 +361,8 @@ public class GameServer
 		AutoSpawnHandler.getInstance();
 		AutoSpawnHandler.getInstance();
 		AutoChatHandler.getInstance();
 		AutoChatHandler.getInstance();
 		
 		
-		Olympiad.getInstance();
-		Hero.getInstance();
 		FaenorScriptEngine.getInstance();
 		FaenorScriptEngine.getInstance();
 		// Init of a cursed weapon manager
 		// Init of a cursed weapon manager
-		CursedWeaponsManager.getInstance();
 		
 		
 		_log.info("AutoChatHandler: Loaded " + AutoChatHandler.getInstance().size() + " handlers in total.");
 		_log.info("AutoChatHandler: Loaded " + AutoChatHandler.getInstance().size() + " handlers in total.");
 		_log.info("AutoSpawnHandler: Loaded " + AutoSpawnHandler.getInstance().size() + " handlers in total.");
 		_log.info("AutoSpawnHandler: Loaded " + AutoSpawnHandler.getInstance().size() + " handlers in total.");
@@ -371,19 +374,11 @@ public class GameServer
 		UserCommandHandler.getInstance();
 		UserCommandHandler.getInstance();
 		VoicedCommandHandler.getInstance();
 		VoicedCommandHandler.getInstance();
 		
 		
-		AccessLevels.getInstance();
-		AdminCommandAccessRights.getInstance();
-		
 		if (Config.L2JMOD_ALLOW_WEDDING)
 		if (Config.L2JMOD_ALLOW_WEDDING)
 			CoupleManager.getInstance();
 			CoupleManager.getInstance();
 		
 		
 		TaskManager.getInstance();
 		TaskManager.getInstance();
 		
 		
-		GmListTable.getInstance();
-		
-		// read pet stats from db
-		PetDataTable.getInstance().loadPetsData();
-		
 		MerchantPriceConfigTable.getInstance().updateReferences();
 		MerchantPriceConfigTable.getInstance().updateReferences();
 		CastleManager.getInstance().activateInstances();
 		CastleManager.getInstance().activateInstances();
 		FortManager.getInstance().activateInstances();
 		FortManager.getInstance().activateInstances();
@@ -492,6 +487,7 @@ public class GameServer
 		
 		
 		// Initialize config
 		// Initialize config
 		Config.load();
 		Config.load();
+		printSection("Database");
 		L2DatabaseFactory.getInstance();
 		L2DatabaseFactory.getInstance();
 		gameServer = new GameServer();
 		gameServer = new GameServer();
 		
 		
@@ -505,4 +501,12 @@ public class GameServer
 			_log.info("Telnet server is currently disabled.");
 			_log.info("Telnet server is currently disabled.");
 		}
 		}
 	}
 	}
+	
+	public static void printSection(String s)
+	{
+		s = "=[ " + s + " ]";
+		while (s.length() < 78)
+			s = "-" + s;
+		_log.info(s);
+	}
 }
 }

+ 1 - 12
L2_GameServer/java/com/l2jserver/gameserver/datatables/ItemTable.java

@@ -70,8 +70,6 @@ public class ItemTable
 	private Map<Integer, L2Armor> _armors;
 	private Map<Integer, L2Armor> _armors;
 	private Map<Integer, L2Weapon> _weapons;
 	private Map<Integer, L2Weapon> _weapons;
 	
 	
-	private boolean _initialized = true;
-	
 	static
 	static
 	{
 	{
 		_materials.put("paper", L2Item.MATERIAL_PAPER);
 		_materials.put("paper", L2Item.MATERIAL_PAPER);
@@ -657,16 +655,7 @@ public class ItemTable
 		
 		
 		return item;
 		return item;
 	}
 	}
-	
-	/**
-	 * Returns if ItemTable initialized
-	 * @return boolean
-	 */
-	public boolean isInitialized()
-	{
-		return _initialized;
-	}
-	
+
 	/*
 	/*
 	private void fillEtcItemsTable()
 	private void fillEtcItemsTable()
 	{
 	{

+ 5 - 12
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/TransformationManager.java

@@ -14,15 +14,13 @@
  */
  */
 package com.l2jserver.gameserver.instancemanager;
 package com.l2jserver.gameserver.instancemanager;
 
 
-import java.util.Collection;
-import java.util.Map;
+import gnu.trove.TIntObjectHashMap;
+
 import java.util.logging.Logger;
 import java.util.logging.Logger;
 
 
 import com.l2jserver.gameserver.model.L2Transformation;
 import com.l2jserver.gameserver.model.L2Transformation;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 
 
-import javolution.util.FastMap;
-
 /**
 /**
  *
  *
  * @author  KenM
  * @author  KenM
@@ -36,16 +34,16 @@ public class TransformationManager
 		return SingletonHolder._instance;
 		return SingletonHolder._instance;
 	}
 	}
 	
 	
-	private Map<Integer, L2Transformation> _transformations;
+	private TIntObjectHashMap<L2Transformation> _transformations;
 	
 	
 	private TransformationManager()
 	private TransformationManager()
 	{
 	{
-		_transformations = new FastMap<Integer, L2Transformation>();
+		_transformations = new TIntObjectHashMap<L2Transformation>();
 	}
 	}
 	
 	
 	public void report()
 	public void report()
 	{
 	{
-		_log.info("Loaded: " + this.getAllTransformations().size() + " transformations.");
+		_log.info("Loaded: " + _transformations.size() + " transformations.");
 	}
 	}
 	
 	
 	public boolean transformPlayer(int id, L2PcInstance player)
 	public boolean transformPlayer(int id, L2PcInstance player)
@@ -73,11 +71,6 @@ public class TransformationManager
 		return _transformations.put(transformation.getId(), transformation);
 		return _transformations.put(transformation.getId(), transformation);
 	}
 	}
 	
 	
-	public Collection<L2Transformation> getAllTransformations()
-	{
-		return _transformations.values();
-	}
-	
 	@SuppressWarnings("synthetic-access")
 	@SuppressWarnings("synthetic-access")
 	private static class SingletonHolder
 	private static class SingletonHolder
 	{
 	{

+ 1 - 7
L2_GameServer/java/com/l2jserver/loginserver/GameServerTable.java

@@ -244,13 +244,7 @@ public class GameServerTable
 		}
 		}
 		finally
 		finally
 		{
 		{
-			try
-			{
-				L2DatabaseFactory.close(con);
-			}
-			catch (Exception e)
-			{
-			}
+			L2DatabaseFactory.close(con);
 		}
 		}
 	}
 	}