RecipeController class is an instance manager.
This commit is contained in:
@@ -99,6 +99,7 @@ import org.l2jmobius.gameserver.instancemanager.PrecautionaryRestartManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossPointsManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.EventManager;
|
||||
@@ -294,7 +295,7 @@ public class GameServer
|
||||
|
||||
Util.printSection("Misc");
|
||||
RecipeData.getInstance();
|
||||
RecipeController.getInstance();
|
||||
RecipeManager.getInstance();
|
||||
EventDroplist.getInstance();
|
||||
MonsterRace.getInstance();
|
||||
Lottery.getInstance();
|
||||
|
@@ -29,11 +29,11 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import org.l2jmobius.commons.util.IXmlReader;
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.model.RecipeList;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RecipeInstance;
|
||||
|
||||
public class RecipeData extends RecipeController implements IXmlReader
|
||||
public class RecipeData extends RecipeManager implements IXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(RecipeData.class.getName());
|
||||
|
||||
|
@@ -18,8 +18,8 @@ package org.l2jmobius.gameserver.handler.skillhandlers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.handler.ISkillHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.Skill.SkillType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -54,7 +54,7 @@ public class Craft implements ISkillHandler
|
||||
player.sendPacket(SystemMessageId.AN_ITEM_MAY_NOT_BE_CREATED_WHILE_ENGAGED_IN_TRADING);
|
||||
return;
|
||||
}
|
||||
RecipeController.getInstance().requestBookOpen(player, (skill.getSkillType() == SkillType.DWARVEN_CRAFT));
|
||||
RecipeManager.getInstance().requestBookOpen(player, (skill.getSkillType() == SkillType.DWARVEN_CRAFT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver;
|
||||
package org.l2jmobius.gameserver.instancemanager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -49,18 +49,12 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import org.l2jmobius.gameserver.taskmanager.GameTimeTaskManager;
|
||||
import org.l2jmobius.gameserver.util.Util;
|
||||
|
||||
public class RecipeController
|
||||
public class RecipeManager
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(RecipeController.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(RecipeManager.class.getName());
|
||||
|
||||
private static RecipeController INSTANCE;
|
||||
protected static final Map<PlayerInstance, RecipeItemMaker> _activeMakers = Collections.synchronizedMap(new WeakHashMap<PlayerInstance, RecipeItemMaker>());
|
||||
|
||||
public static RecipeController getInstance()
|
||||
{
|
||||
return INSTANCE == null ? INSTANCE = new RecipeController() : INSTANCE;
|
||||
}
|
||||
|
||||
public synchronized void requestBookOpen(PlayerInstance player, boolean isDwarvenCraft)
|
||||
{
|
||||
RecipeItemMaker maker = null;
|
||||
@@ -82,7 +76,7 @@ public class RecipeController
|
||||
|
||||
public synchronized void requestMakeItemAbort(PlayerInstance player)
|
||||
{
|
||||
_activeMakers.remove(player); // TODO: anything else here?
|
||||
_activeMakers.remove(player);
|
||||
}
|
||||
|
||||
public synchronized void requestManufactureItem(PlayerInstance manufacturer, int recipeListId, PlayerInstance player)
|
||||
@@ -697,4 +691,14 @@ public class RecipeController
|
||||
}
|
||||
return recipeList;
|
||||
}
|
||||
|
||||
public static RecipeManager getInstance()
|
||||
{
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final RecipeManager INSTANCE = new RecipeManager();
|
||||
}
|
||||
}
|
@@ -40,7 +40,6 @@ import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.ai.PlayerAI;
|
||||
@@ -82,6 +81,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.ItemsOnGroundManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RebirthManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.CTF;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.DM;
|
||||
@@ -13435,7 +13435,7 @@ public class PlayerInstance extends Playable
|
||||
// Stop crafting, if in progress
|
||||
try
|
||||
{
|
||||
RecipeController.getInstance().requestMakeItemAbort(this);
|
||||
RecipeManager.getInstance().requestMakeItemAbort(this);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
@@ -47,6 +47,6 @@ public class RequestRecipeBookOpen implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
RecipeController.getInstance().requestBookOpen(player, _isDwarvenCraft);
|
||||
RecipeManager.getInstance().requestBookOpen(player, _isDwarvenCraft);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
|
||||
@@ -58,6 +58,6 @@ public class RequestRecipeItemMakeSelf implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
RecipeController.getInstance().requestMakeItem(player, _id);
|
||||
RecipeManager.getInstance().requestMakeItem(player, _id);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
package org.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import org.l2jmobius.commons.network.PacketReader;
|
||||
import org.l2jmobius.gameserver.RecipeController;
|
||||
import org.l2jmobius.gameserver.instancemanager.RecipeManager;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.GameClient;
|
||||
@@ -79,7 +79,7 @@ public class RequestRecipeShopMakeItem implements IClientIncomingPacket
|
||||
|
||||
if (Util.checkIfInRange(150, player, manufacturer, true))
|
||||
{
|
||||
RecipeController.getInstance().requestManufactureItem(manufacturer, _recipeId, player);
|
||||
RecipeManager.getInstance().requestManufactureItem(manufacturer, _recipeId, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user