Procházet zdrojové kódy

BETA: Maps to shared:
* Changing event timers map to shared, thanks tukune for poiting this out.
* Changing active makers map to shared by Phantom2005, thanks qwert13 for testing.
'''Note:''' This ''should'' fix NPE spam in MC Show and problems while using AltGameCreation = True.

Zoey76 před 13 roky
rodič
revize
c08aeccab0

+ 5 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/RecipeController.java

@@ -65,8 +65,8 @@ public class RecipeController
 {
 	protected static final Logger _log = Logger.getLogger(RecipeController.class.getName());
 	
-	private Map<Integer, L2RecipeList> _lists;
-	private static final Map<Integer, RecipeItemMaker> _activeMakers = new FastMap<Integer, RecipeItemMaker>();
+	private static final Map<Integer, L2RecipeList> _lists = new FastMap<Integer, L2RecipeList>();
+	private static final Map<Integer, RecipeItemMaker> _activeMakers = new FastMap<Integer, RecipeItemMaker>().shared();
 	private static final String RECIPES_FILE = "recipes.xml";
 	
 	public static RecipeController getInstance()
@@ -76,8 +76,6 @@ public class RecipeController
 	
 	private RecipeController()
 	{
-		_lists = new FastMap<Integer, L2RecipeList>();
-		
 		try
 		{
 			loadFromXML();
@@ -138,12 +136,12 @@ public class RecipeController
 			return;
 		}
 		
-		player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANT_ALTER_RECIPEBOOK_WHILE_CRAFTING));
+		player.sendPacket(SystemMessageId.CANT_ALTER_RECIPEBOOK_WHILE_CRAFTING);
 	}
 	
 	public synchronized void requestMakeItemAbort(L2PcInstance player)
 	{
-		_activeMakers.remove(player.getObjectId()); // TODO:  anything else here?
+		_activeMakers.remove(player.getObjectId()); // TODO: anything else here?
 	}
 	
 	public synchronized void requestManufactureItem(L2PcInstance manufacturer, int recipeListId, L2PcInstance player)
@@ -996,7 +994,7 @@ public class RecipeController
 				}
 				
 				// Added multiplication of Creation speed with XP/SP gain
-				// slower crafting -> more XP,  faster crafting -> less XP
+				// slower crafting -> more XP, faster crafting -> less XP
 				// you can use ALT_GAME_CREATION_XP_RATE/SP to
 				// modify XP/SP gained (default = 1)
 				

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -66,7 +66,7 @@ public class Quest extends ManagedScript
 	/** HashMap containing events from String value of the event */
 	private static Map<String, Quest> _allEventsS = new FastMap<String, Quest>();
 	/** HashMap containing lists of timers from the name of the timer */
-	private final Map<String, FastList<QuestTimer>> _allEventTimers = new FastMap<String, FastList<QuestTimer>>();
+	private final Map<String, FastList<QuestTimer>> _allEventTimers = new FastMap<String, FastList<QuestTimer>>().shared();
 	
 	private final ReentrantReadWriteLock _rwLock = new ReentrantReadWriteLock();