diff --git a/src/engine/InterestManagement/InterestManager.java b/src/engine/InterestManagement/InterestManager.java index 8496d73f..803a4e33 100644 --- a/src/engine/InterestManagement/InterestManager.java +++ b/src/engine/InterestManagement/InterestManager.java @@ -8,6 +8,7 @@ package engine.InterestManagement; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.gameManager.SessionManager; import engine.job.JobScheduler; @@ -17,7 +18,6 @@ import engine.mbEnums.DispatchChannel; import engine.mbEnums.GameObjectType; import engine.net.AbstractNetMsg; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.LoadCharacterMsg; import engine.net.client.msg.LoadStructureMsg; @@ -88,7 +88,7 @@ public enum InterestManager implements Runnable { if (send) { Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } } } @@ -270,7 +270,7 @@ public enum InterestManager implements Runnable { } Dispatch dispatch = Dispatch.borrow(player, uom); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } loadedStaticObjects.removeAll(toRemove); @@ -292,7 +292,7 @@ public enum InterestManager implements Runnable { lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii()); Dispatch dispatch = Dispatch.borrow(player, lcm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } else if (awo.getObjectType().equals(GameObjectType.NPC)) { NPC npc = (NPC) awo; @@ -304,13 +304,13 @@ public enum InterestManager implements Runnable { if (lsm.getStructureList().size() > 0) { Dispatch dispatch = Dispatch.borrow(player, lsm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } for (LoadCharacterMsg lc : lcmList) { Dispatch dispatch = Dispatch.borrow(player, lc); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } loadedStaticObjects.addAll(toLoad); @@ -414,7 +414,7 @@ public enum InterestManager implements Runnable { if (!uom.getObjectList().isEmpty()) { Dispatch dispatch = Dispatch.borrow(player, uom); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } } @@ -492,7 +492,7 @@ public enum InterestManager implements Runnable { if (lcm != null) { Dispatch dispatch = Dispatch.borrow(player, lcm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } diff --git a/src/engine/InterestManagement/RealmMap.java b/src/engine/InterestManagement/RealmMap.java index 36fee92b..02fb5b6e 100644 --- a/src/engine/InterestManagement/RealmMap.java +++ b/src/engine/InterestManagement/RealmMap.java @@ -8,10 +8,10 @@ package engine.InterestManagement; +import engine.gameManager.DispatchManager; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.TerritoryChangeMessage; import engine.objects.City; import engine.objects.PlayerCharacter; @@ -91,17 +91,17 @@ public enum RealmMap { if (city != null) { TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm); Dispatch dispatch = Dispatch.borrow(player, tcm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } else { TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); Dispatch dispatch = Dispatch.borrow(player, tcm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } else { TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); Dispatch dispatch = Dispatch.borrow(player, tcm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } diff --git a/src/engine/InterestManagement/WorldGrid.java b/src/engine/InterestManagement/WorldGrid.java index 718d2431..ae70fe66 100644 --- a/src/engine/InterestManagement/WorldGrid.java +++ b/src/engine/InterestManagement/WorldGrid.java @@ -8,11 +8,11 @@ package engine.InterestManagement; -import engine.mbEnums.GridObjectType; +import engine.gameManager.DispatchManager; import engine.math.FastMath; import engine.math.Vector3f; import engine.math.Vector3fImmutable; -import engine.net.DispatchMessage; +import engine.mbEnums.GridObjectType; import engine.net.client.ClientConnection; import engine.net.client.msg.LoadCharacterMsg; import engine.net.client.msg.LoadStructureMsg; @@ -201,7 +201,7 @@ public class WorldGrid { UnloadObjectsMsg uom = new UnloadObjectsMsg(); uom.addObject(awo); - DispatchMessage.sendToAllInRange(awo, uom); + DispatchManager.sendToAllInRange(awo, uom); } public static void loadObject(AbstractWorldObject awo) { @@ -213,15 +213,15 @@ public class WorldGrid { case Building: lsm = new LoadStructureMsg(); lsm.addObject((Building) awo); - DispatchMessage.sendToAllInRange(awo, lsm); + DispatchManager.sendToAllInRange(awo, lsm); break; case NPC: lcm = new LoadCharacterMsg((NPC) awo, false); - DispatchMessage.sendToAllInRange(awo, lcm); + DispatchManager.sendToAllInRange(awo, lcm); break; case Mob: lcm = new LoadCharacterMsg((Mob) awo, false); - DispatchMessage.sendToAllInRange(awo, lcm); + DispatchManager.sendToAllInRange(awo, lcm); break; default: // *** Refactor: Log error? @@ -239,19 +239,19 @@ public class WorldGrid { case Building: lsm = new LoadStructureMsg(); lsm.addObject((Building) awo); - DispatchMessage.sendToAllInRange(awo, lsm); + DispatchManager.sendToAllInRange(awo, lsm); break; case NPC: lcm = new LoadCharacterMsg((NPC) awo, false); - DispatchMessage.sendToAllInRange(awo, lcm); + DispatchManager.sendToAllInRange(awo, lcm); break; case Mob: lcm = new LoadCharacterMsg((Mob) awo, false); - DispatchMessage.sendToAllInRange(awo, lcm); + DispatchManager.sendToAllInRange(awo, lcm); break; case PlayerCharacter: lcm = new LoadCharacterMsg((PlayerCharacter) awo, false); - DispatchMessage.sendToAllInRange(awo, lcm); + DispatchManager.sendToAllInRange(awo, lcm); break; default: // *** Refactor: Log error? @@ -263,7 +263,7 @@ public class WorldGrid { ClientConnection origin) { UnloadObjectsMsg uom = new UnloadObjectsMsg(); uom.addObject(awo); - DispatchMessage.sendToAllInRange(awo, uom); + DispatchManager.sendToAllInRange(awo, uom); } public static void addObject(AbstractWorldObject awo, PlayerCharacter pc) { diff --git a/src/engine/devcmd/cmds/SetHealthCmd.java b/src/engine/devcmd/cmds/SetHealthCmd.java index 1cfe6303..462c26e8 100644 --- a/src/engine/devcmd/cmds/SetHealthCmd.java +++ b/src/engine/devcmd/cmds/SetHealthCmd.java @@ -11,7 +11,7 @@ package engine.devcmd.cmds; import engine.mbEnums.DispatchChannel; import engine.devcmd.AbstractDevCmd; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.msg.TargetedActionMsg; import engine.objects.AbstractGameObject; import engine.objects.PlayerCharacter; @@ -41,7 +41,7 @@ public class SetHealthCmd extends AbstractDevCmd { // Update all surrounding clients. TargetedActionMsg cmm = new TargetedActionMsg(pc); - DispatchMessage.dispatchMsgToInterestArea(pc, cmm, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, cmm, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } catch (NumberFormatException e) { this.throwbackError(pc, "Supplied data: " + words[0] diff --git a/src/engine/devcmd/cmds/SetManaCmd.java b/src/engine/devcmd/cmds/SetManaCmd.java index b8086733..0a339b98 100644 --- a/src/engine/devcmd/cmds/SetManaCmd.java +++ b/src/engine/devcmd/cmds/SetManaCmd.java @@ -2,7 +2,7 @@ package engine.devcmd.cmds; import engine.devcmd.AbstractDevCmd; import engine.mbEnums; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.msg.TargetedActionMsg; import engine.objects.AbstractGameObject; import engine.objects.PlayerCharacter; @@ -32,7 +32,7 @@ public class SetManaCmd extends AbstractDevCmd { //Update all surrounding clients. - NOT for Mana? TargetedActionMsg cmm = new TargetedActionMsg(pc); - DispatchMessage.dispatchMsgToInterestArea(pc, cmm, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, cmm, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } catch (NumberFormatException e) { this.throwbackError(pc, "Supplied data: " + words[0] diff --git a/src/engine/devcmd/cmds/SetPromotionClassCmd.java b/src/engine/devcmd/cmds/SetPromotionClassCmd.java index 5ce13f2d..6001f7c7 100644 --- a/src/engine/devcmd/cmds/SetPromotionClassCmd.java +++ b/src/engine/devcmd/cmds/SetPromotionClassCmd.java @@ -4,7 +4,7 @@ import engine.mbEnums.DispatchChannel; import engine.InterestManagement.InterestManager; import engine.devcmd.AbstractDevCmd; import engine.gameManager.ChatManager; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.msg.ApplyRuneMsg; import engine.objects.AbstractGameObject; import engine.objects.PlayerCharacter; @@ -54,7 +54,7 @@ public class SetPromotionClassCmd extends AbstractDevCmd { PromotionClass promo = pc.getPromotionClass(); if (promo != null) { ApplyRuneMsg arm = new ApplyRuneMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), promo.getObjectUUID(), promo.getObjectType().ordinal(), promo.getObjectUUID(), true); - DispatchMessage.dispatchMsgToInterestArea(pc, arm, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, arm, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } } diff --git a/src/engine/devcmd/cmds/SetStaminaCmd.java b/src/engine/devcmd/cmds/SetStaminaCmd.java index d17cdcb7..e365363e 100644 --- a/src/engine/devcmd/cmds/SetStaminaCmd.java +++ b/src/engine/devcmd/cmds/SetStaminaCmd.java @@ -11,7 +11,7 @@ package engine.devcmd.cmds; import engine.mbEnums.DispatchChannel; import engine.devcmd.AbstractDevCmd; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.msg.TargetedActionMsg; import engine.objects.AbstractGameObject; import engine.objects.PlayerCharacter; @@ -42,7 +42,7 @@ public class SetStaminaCmd extends AbstractDevCmd { // Update all surrounding clients. TargetedActionMsg cmm = new TargetedActionMsg(pc); - DispatchMessage.dispatchMsgToInterestArea(pc, cmm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, cmm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } catch (NumberFormatException e) { this.throwbackError(pc, "Supplied data: " + words[0] diff --git a/src/engine/devcmd/cmds/SetSubRaceCmd.java b/src/engine/devcmd/cmds/SetSubRaceCmd.java index 41adcf2c..d241b95a 100644 --- a/src/engine/devcmd/cmds/SetSubRaceCmd.java +++ b/src/engine/devcmd/cmds/SetSubRaceCmd.java @@ -12,7 +12,7 @@ package engine.devcmd.cmds; import engine.mbEnums.GameObjectType; import engine.devcmd.AbstractDevCmd; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.msg.ApplyBuildingEffectMsg; import engine.net.client.msg.UpdateCharOrMobMessage; import engine.objects.*; @@ -39,13 +39,13 @@ public class SetSubRaceCmd extends AbstractDevCmd { if (raceID == 0) raceID = player.getRaceID(); UpdateCharOrMobMessage ucm = new UpdateCharOrMobMessage(player, 1, raceID); - DispatchMessage.sendToAllInRange(player, ucm); + DispatchManager.sendToAllInRange(player, ucm); return; } if (words[0].equals("all")) { for (int i = 15999; i < 16337; i++) { ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(4, 0, target.getObjectType().ordinal(), target.getObjectUUID(), i); - DispatchMessage.sendToAllInRange((AbstractWorldObject) target, applyBuildingEffectMsg); + DispatchManager.sendToAllInRange((AbstractWorldObject) target, applyBuildingEffectMsg); try { Thread.sleep(500); } catch (InterruptedException e) { @@ -56,7 +56,7 @@ public class SetSubRaceCmd extends AbstractDevCmd { } else { ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(4, 0, target.getObjectType().ordinal(), target.getObjectUUID(), Integer.parseInt(words[0])); - DispatchMessage.sendToAllInRange((AbstractWorldObject) target, applyBuildingEffectMsg); + DispatchManager.sendToAllInRange((AbstractWorldObject) target, applyBuildingEffectMsg); } return; diff --git a/src/engine/gameManager/ChatManager.java b/src/engine/gameManager/ChatManager.java index 366d2f10..03158e92 100644 --- a/src/engine/gameManager/ChatManager.java +++ b/src/engine/gameManager/ChatManager.java @@ -17,7 +17,6 @@ import engine.mbEnums.GameObjectType; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.MessageDispatcher; import engine.net.client.ClientConnection; import engine.net.client.handlers.ClientAdminCommandMsgHandler; @@ -87,7 +86,7 @@ public enum ChatManager { for (AbstractWorldObject abstractWorldObject : distroList) { PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -161,7 +160,7 @@ public enum ChatManager { // Make the Message ChatSayMsg chatSayMsg = new ChatSayMsg(player, text); - DispatchMessage.dispatchMsgToInterestArea(pcSender, chatSayMsg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SAY_RANGE, true, true); + DispatchManager.dispatchMsgToInterestArea(pcSender, chatSayMsg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SAY_RANGE, true, true); } @@ -171,7 +170,7 @@ public enum ChatManager { msg.setMessageType(4); msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); Dispatch dispatch = Dispatch.borrow(targetPlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } /* @@ -195,7 +194,7 @@ public enum ChatManager { // Make the Message ChatShoutMsg msg = new ChatShoutMsg(sender, text); - DispatchMessage.dispatchMsgToInterestArea(pcSender, msg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SHOUT_RANGE, true, true); + DispatchManager.dispatchMsgToInterestArea(pcSender, msg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SHOUT_RANGE, true, true); } @@ -217,7 +216,7 @@ public enum ChatManager { // Make the Message ChatGlobalMsg msg = new ChatGlobalMsg(sender, text); - DispatchMessage.dispatchMsgToAll(sender, msg, true); + DispatchManager.dispatchMsgToAll(sender, msg, true); } @@ -284,13 +283,13 @@ public enum ChatManager { // Send dispatch to each player Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } // Also send /tell to sender if (pcSender != null) { Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } else @@ -349,7 +348,7 @@ public enum ChatManager { for (AbstractWorldObject abstractWorldObject : distroList) { PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGuildMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -404,7 +403,7 @@ public enum ChatManager { for (AbstractWorldObject abstractWorldObject : distroList) { PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; Dispatch dispatch = Dispatch.borrow(playerCharacter, chatICMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -463,7 +462,7 @@ public enum ChatManager { for (AbstractWorldObject abstractWorldObject : distroList) { PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGroupMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -497,7 +496,7 @@ public enum ChatManager { for (AbstractWorldObject abstractWorldObject : distroList) { PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -733,7 +732,7 @@ public enum ChatManager { public static void chatPVP(String text) { // Create message ChatPvPMsg msg = new ChatPvPMsg(null, text); - DispatchMessage.dispatchMsgToAll(msg); + DispatchManager.dispatchMsgToAll(msg); } public static ChatSystemMsg CombatInfo(AbstractWorldObject source, AbstractWorldObject target) { @@ -844,7 +843,7 @@ public enum ChatManager { for (AbstractWorldObject abstractWorldObject : distroList) { PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -993,7 +992,7 @@ public enum ChatManager { chatSystemMsg.setChannel(channel); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index cc5e5e4a..a9b6e230 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -13,7 +13,6 @@ import engine.job.JobScheduler; import engine.jobs.AttackJob; import engine.jobs.DeferredPowerJob; import engine.mbEnums; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.UpdateStateMsg; @@ -272,9 +271,9 @@ public enum CombatManager { TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim); if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter) - DispatchMessage.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); else - DispatchMessage.sendToAllInRange(attacker, msg); + DispatchManager.sendToAllInRange(attacker, msg); //set auto attack job setAutoAttackJob(attacker, slot, delay); @@ -309,9 +308,9 @@ public enum CombatManager { TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value); if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter) - DispatchMessage.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); else - DispatchMessage.sendToAllInRange(attacker, msg); + DispatchManager.sendToAllInRange(attacker, msg); //set auto attack job setAutoAttackJob(attacker, slot, delay); @@ -382,7 +381,7 @@ public enum CombatManager { //apply Damage back attacker.modifyHealth(-total, absTarget, true); TargetedActionMsg cmm = new TargetedActionMsg(attacker, attacker, total, 0); - DispatchMessage.sendToAllInRange(target, cmm); + DispatchManager.sendToAllInRange(target, cmm); } } @@ -420,7 +419,7 @@ public enum CombatManager { } } TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim); - DispatchMessage.sendToAllInRange(target, cmm); + DispatchManager.sendToAllInRange(target, cmm); } } @@ -457,7 +456,7 @@ public enum CombatManager { UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); } public static void toggleSit(boolean toggle, ClientConnection origin) { @@ -470,7 +469,7 @@ public enum CombatManager { playerCharacter.setSit(toggle); UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } diff --git a/src/engine/net/DispatchMessage.java b/src/engine/gameManager/DispatchManager.java similarity index 96% rename from src/engine/net/DispatchMessage.java rename to src/engine/gameManager/DispatchManager.java index 647c2d33..fc10a4cd 100644 --- a/src/engine/net/DispatchMessage.java +++ b/src/engine/gameManager/DispatchManager.java @@ -7,13 +7,15 @@ // www.magicbane.com -package engine.net; +package engine.gameManager; -import engine.mbEnums.DispatchChannel; -import engine.mbEnums.GameObjectType; import engine.InterestManagement.WorldGrid; -import engine.gameManager.SessionManager; import engine.math.Vector3fImmutable; +import engine.mbEnums.DispatchChannel; +import engine.mbEnums.GameObjectType; +import engine.net.AbstractNetMsg; +import engine.net.Dispatch; +import engine.net.MessageDispatcher; import engine.net.client.ClientConnection; import engine.objects.AbstractWorldObject; import engine.objects.Item; @@ -31,7 +33,9 @@ import static engine.net.MessageDispatcher.maxRecipients; * async message delivery system. */ -public class DispatchMessage { +public enum DispatchManager { + + DISPATCH_MANAGER; public static void startMessagePump() { @@ -83,7 +87,7 @@ public class DispatchMessage { sourcePlayer = (PlayerCharacter) sourceObject; if (sourcePlayer.getClientConnection() != null && sendToSelf) { Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } @@ -151,7 +155,7 @@ public class DispatchMessage { if (sourcePlayer.getClientConnection() != null && sendToSelf) { Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } @@ -280,7 +284,7 @@ public class DispatchMessage { } - protected static void serializeDispatch(Dispatch messageDispatch) { + public static void serializeDispatch(Dispatch messageDispatch) { ClientConnection connection; if (messageDispatch.player == null) { diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 071369ff..55d15193 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -12,7 +12,6 @@ import engine.loot.ModTableEntry; import engine.loot.ModTypeTableEntry; import engine.loot.WorkOrder; import engine.mbEnums; -import engine.net.DispatchMessage; import engine.net.client.msg.ItemProductionMsg; import engine.objects.City; import engine.objects.Item; @@ -81,7 +80,7 @@ public enum ForgeManager implements Runnable { for (Item workOrderItem : workOrder.cooking) { workOrderItem.flags.add(mbEnums.ItemFlags.Identified); ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); } // Set this workOrder to completed and update on disk @@ -322,9 +321,9 @@ public enum ForgeManager implements Runnable { workOrder.vendor.charItemManager.addItemToInventory(completedItem); ItemProductionMsg outMsg1 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, completedItem, mbEnums.ProductionActionType.DEPOSIT, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(workOrder.vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false); ItemProductionMsg outMsg2 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, completedItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(workOrder.vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); toRemove.add(virutalItem); } @@ -334,7 +333,7 @@ public enum ForgeManager implements Runnable { // Remove virtual items from the forge window ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, virtualItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); // Remove virtual item from all collections @@ -357,7 +356,7 @@ public enum ForgeManager implements Runnable { // Update NPC window ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, forged_item, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); workOrder.total_produced = workOrder.total_produced + 1; } diff --git a/src/engine/gameManager/GroupManager.java b/src/engine/gameManager/GroupManager.java index 5c9bd570..b59e2606 100644 --- a/src/engine/gameManager/GroupManager.java +++ b/src/engine/gameManager/GroupManager.java @@ -8,10 +8,9 @@ package engine.gameManager; -import engine.mbEnums; import engine.exception.MsgSendException; +import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.UpdateGoldMsg; import engine.net.client.msg.group.GroupUpdateMsg; @@ -80,7 +79,7 @@ public enum GroupManager { groupUpdateMsg.setMessageType(3); groupUpdateMsg.setPlayer(groupMember); Dispatch dispatch = Dispatch.borrow(source, groupUpdateMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -160,7 +159,7 @@ public enum GroupManager { gum.setPlayerUUID(groupMember.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(groupMember, gum); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -189,7 +188,7 @@ public enum GroupManager { gum.setMessageType(1); gum.setPlayer(groupMember); Dispatch dispatch = Dispatch.borrow(groupMember, gum); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -217,7 +216,7 @@ public enum GroupManager { gum.setPlayer(playerToRefresh); Dispatch dispatch = Dispatch.borrow(source, gum); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } public static void RefreshOthersGroupList(PlayerCharacter source) { @@ -372,12 +371,12 @@ public enum GroupManager { ugm.configure(); Dispatch dispatch = Dispatch.borrow(splitPlayer, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } UpdateGoldMsg updateTargetGold = new UpdateGoldMsg(tar); updateTargetGold.configure(); - DispatchMessage.dispatchMsgToInterestArea(tar, updateTargetGold, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(tar, updateTargetGold, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); // //TODO send group split message String text = "Group Split: " + amount; diff --git a/src/engine/gameManager/GuildManager.java b/src/engine/gameManager/GuildManager.java index e06539b6..0dab8313 100644 --- a/src/engine/gameManager/GuildManager.java +++ b/src/engine/gameManager/GuildManager.java @@ -12,7 +12,6 @@ import engine.mbEnums; import engine.mbEnums.BuildingGroup; import engine.mbEnums.GuildHistoryType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.guild.AcceptInviteToGuildMsg; import engine.net.client.msg.guild.GuildInfoMsg; @@ -89,14 +88,14 @@ public enum GuildManager { if (fromTeleportScreen) { dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } if (DbManager.GuildQueries.ADD_TO_GUILDHISTORY(guild.getObjectUUID(), playerCharacter, DateTime.now(), historyType)) { GuildHistory guildHistory = new GuildHistory(guild.getObjectUUID(), guild.getName(), DateTime.now(), historyType); playerCharacter.getGuildHistory().add(guildHistory); } - DispatchMessage.sendToAllInRange(playerCharacter, new GuildInfoMsg(playerCharacter, guild, 2)); + DispatchManager.sendToAllInRange(playerCharacter, new GuildInfoMsg(playerCharacter, guild, 2)); // Send guild join message @@ -190,7 +189,7 @@ public enum GuildManager { for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) if (player.getGuild().equals(guild)) - DispatchMessage.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2)); + DispatchManager.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2)); } public static Boolean meetsLoreRequirements(Guild guild, PlayerCharacter player) { diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 8c19becb..81032e24 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -10,7 +10,6 @@ package engine.gameManager; import engine.loot.*; import engine.mbEnums; -import engine.net.DispatchMessage; import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.chat.ChatSystemMsg; import engine.objects.*; @@ -96,7 +95,7 @@ public enum LootManager { ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + item.template.item_base_name + ". Are you tough enough to take it?"); chatMsg.setMessageType(10); chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(chatMsg); + DispatchManager.dispatchMsgToAll(chatMsg); } } diff --git a/src/engine/gameManager/MovementManager.java b/src/engine/gameManager/MovementManager.java index 14dee33d..2549a927 100644 --- a/src/engine/gameManager/MovementManager.java +++ b/src/engine/gameManager/MovementManager.java @@ -18,7 +18,6 @@ import engine.mbEnums.DispatchChannel; import engine.mbEnums.GameObjectType; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.MoveToPointMsg; import engine.net.client.msg.TeleportToPointMsg; @@ -50,9 +49,9 @@ public enum MovementManager { UpdateStateMsg rssm = new UpdateStateMsg(); rssm.setPlayer(ac); if (ac.getObjectType() == GameObjectType.PlayerCharacter) - DispatchMessage.dispatchMsgToInterestArea(ac, rssm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(ac, rssm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); else - DispatchMessage.sendToAllInRange(ac, rssm); + DispatchManager.sendToAllInRange(ac, rssm); } /* @@ -241,7 +240,7 @@ public enum MovementManager { // If it's not a player moving just send the message if ((toMove.getObjectType() == GameObjectType.PlayerCharacter) == false) { - DispatchMessage.sendToAllInRange(toMove, msg); + DispatchManager.sendToAllInRange(toMove, msg); return; } @@ -253,9 +252,9 @@ public enum MovementManager { player.setTimeStamp("lastMoveGate", System.currentTimeMillis()); if (collide) - DispatchMessage.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); else - DispatchMessage.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); // Handle formation movement if needed @@ -443,7 +442,7 @@ public enum MovementManager { groupMsg.setStartCoord(member.getLoc()); groupMsg.setEndCoord(destination); groupMsg.clearTarget(); - DispatchMessage.sendToAllInRange(member, groupMsg); + DispatchManager.sendToAllInRange(member, groupMsg); // update group member member.setFaceDir(destination.subtract2D(member.getLoc()).normalize()); @@ -463,7 +462,7 @@ public enum MovementManager { InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) teleporter); TeleportToPointMsg msg = new TeleportToPointMsg(teleporter, teleporter.loc.getX(), teleporter.loc.getY(), teleporter.loc.getZ(), 0, -1, -1); - DispatchMessage.dispatchMsgToInterestArea(oldLoc, teleporter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(oldLoc, teleporter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index d0eb031b..fa462105 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -15,7 +15,6 @@ import engine.math.Vector3f; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.PetMsg; @@ -69,7 +68,7 @@ public enum NPCManager { PetMsg petMsg = new PetMsg(5, null); Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index 87b25d7a..ae4f2685 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -25,7 +25,6 @@ import engine.math.Vector3fImmutable; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -191,7 +190,7 @@ public enum PowersManager { RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); // Send Fail to cast message PlayerCharacter pc = SessionManager @@ -244,7 +243,7 @@ public enum PowersManager { RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); return false; } @@ -488,7 +487,7 @@ public enum PowersManager { 0f, 0f, 0, null, 9999, 0); mhm.setOmitFromChat(1); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, mhm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, mhm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } else if (pb.useMana()) if (playerCharacter.getMana() < cost) @@ -519,7 +518,7 @@ public enum PowersManager { // else send recycle message to unlock power RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } //what the fuck? @@ -529,7 +528,7 @@ public enum PowersManager { // else // msg.setUnknown04(1); // Regular Race, use mana? int tr = msg.getNumTrains(); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, sendCastToSelf, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, sendCastToSelf, false); //Make new msg.. PerformActionMsg copyMsg = new PerformActionMsg(msg); @@ -540,7 +539,7 @@ public enum PowersManager { playerCharacter.update(); playerCharacter.setSit(false); UpdateStateMsg updateStateMsg = new UpdateStateMsg(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } @@ -683,8 +682,8 @@ public enum PowersManager { msg.setNumTrains(9999); - DispatchMessage.sendToAllInRange(caster, msg); - DispatchMessage.sendToAllInRange(caster, msg); + DispatchManager.sendToAllInRange(caster, msg); + DispatchManager.sendToAllInRange(caster, msg); msg.setNumTrains(tr); @@ -751,7 +750,7 @@ public enum PowersManager { performActionMsg.setUnknown04(2); dispatch = Dispatch.borrow(playerCharacter, performActionMsg); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, performActionMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, performActionMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); return; } @@ -992,7 +991,7 @@ public enum PowersManager { PerformActionMsg castMsg = new PerformActionMsg(msg); castMsg.setNumTrains(9999); castMsg.setUnknown04(2); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); msgCasted = true; } } @@ -1002,7 +1001,7 @@ public enum PowersManager { PerformActionMsg castMsg = new PerformActionMsg(msg); castMsg.setNumTrains(9999); castMsg.setUnknown04(2); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, castMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); msgCasted = true; } @@ -1063,7 +1062,7 @@ public enum PowersManager { msg.setNumTrains(9999); msg.setUnknown04(2); - DispatchMessage.sendToAllInRange(caster, msg); + DispatchManager.sendToAllInRange(caster, msg); // get target loc Vector3fImmutable targetLoc = msg.getTargetLoc(); @@ -1170,7 +1169,7 @@ public enum PowersManager { // TODO echo power use to everyone else msg.setNumTrains(9999); msg.setUnknown04(2); - DispatchMessage.sendToAllInRange(caster, msg); + DispatchManager.sendToAllInRange(caster, msg); } @@ -1248,7 +1247,7 @@ public enum PowersManager { RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } @@ -1374,7 +1373,7 @@ public enum PowersManager { PerformActionMsg msg = new PerformActionMsg(pb.getToken(), trains, ac.getObjectType().ordinal(), ac.getObjectUUID(), tarType, tarID, 0, 0, 0, 1, 0); - DispatchMessage.sendToAllInRange(target, msg); + DispatchManager.sendToAllInRange(target, msg); ConcurrentHashMap timers = ac.getTimers(); @@ -1492,7 +1491,7 @@ public enum PowersManager { .getObjectType().ordinal(), ac.getObjectUUID(), target.getObjectType().ordinal(), target.getObjectUUID(), 0, 0, 0, 2, 0); - DispatchMessage.sendToAllInRange(ac, msg); + DispatchManager.sendToAllInRange(ac, msg); } } @@ -1943,7 +1942,7 @@ public enum PowersManager { RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token); Dispatch dispatch = Dispatch.borrow(pc, recyclePowerMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } @@ -2103,12 +2102,12 @@ public enum PowersManager { case 3: case 4: msg.setUnknown04(2); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); break; default: msg.setUnknown04(1); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } } @@ -2126,7 +2125,7 @@ public enum PowersManager { ApplyEffectMsg aem = new ApplyEffectMsg(pc, pc, 0, eb.getToken(), 9, pb.getToken(), pb.getName()); aem.setUnknown03(type); - DispatchMessage.dispatchMsgToInterestArea(pc, aem, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, aem, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } catch (Exception e) { @@ -2147,7 +2146,7 @@ public enum PowersManager { aem.setUnknown03(type); aem.setUnknown05(1); - DispatchMessage.dispatchMsgToInterestArea(pc, aem, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, aem, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } catch (Exception e) { @@ -2162,7 +2161,7 @@ public enum PowersManager { switch (type) { case 3: case 4: - DispatchMessage.sendToAllInRange(mob, msg); + DispatchManager.sendToAllInRange(mob, msg); } } @@ -2401,7 +2400,7 @@ public enum PowersManager { if (pam != null) { pam.setNumTrains(9999); pam.setUnknown04(2); - DispatchMessage.sendToAllInRange(ac, pam); + DispatchManager.sendToAllInRange(ac, pam); } } } @@ -2465,7 +2464,7 @@ public enum PowersManager { PerformActionMsg pam = new PerformActionMsg(pb.getToken(), 9999, ac .getObjectType().ordinal(), ac.getObjectUUID(), target.getObjectType().ordinal(), target.getObjectUUID(), 0, 0, 0, 2, 0); - DispatchMessage.sendToAllInRange(ac, pam); + DispatchManager.sendToAllInRange(ac, pam); } } diff --git a/src/engine/jobs/ActivateBaneJob.java b/src/engine/jobs/ActivateBaneJob.java index 521c6db4..68d9979a 100644 --- a/src/engine/jobs/ActivateBaneJob.java +++ b/src/engine/jobs/ActivateBaneJob.java @@ -10,10 +10,10 @@ package engine.jobs; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.job.AbstractScheduleJob; import engine.mbEnums; import engine.mbEnums.ChatChannelType; -import engine.net.DispatchMessage; import engine.net.client.msg.chat.ChatSystemMsg; import engine.objects.City; import org.pmw.tinylog.Logger; @@ -66,7 +66,7 @@ public class ActivateBaneJob extends AbstractScheduleJob { msg.setMessageType(4); // Error message msg.setChannel(ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(msg); + DispatchManager.dispatchMsgToAll(msg); } @Override diff --git a/src/engine/jobs/DoorCloseJob.java b/src/engine/jobs/DoorCloseJob.java index 2bbd304f..05f3125b 100644 --- a/src/engine/jobs/DoorCloseJob.java +++ b/src/engine/jobs/DoorCloseJob.java @@ -9,9 +9,9 @@ package engine.jobs; -import engine.mbEnums.DoorState; +import engine.gameManager.DispatchManager; import engine.job.AbstractScheduleJob; -import engine.net.DispatchMessage; +import engine.mbEnums.DoorState; import engine.net.client.msg.DoorTryOpenMsg; import engine.objects.Blueprint; import engine.objects.Building; @@ -40,7 +40,7 @@ public class DoorCloseJob extends AbstractScheduleJob { this.building.setDoorState(doorNumber, DoorState.CLOSED); DoorTryOpenMsg msg = new DoorTryOpenMsg(door, this.building.getObjectUUID(), 0, (byte) 0); - DispatchMessage.sendToAllInRange(building, msg); + DispatchManager.sendToAllInRange(building, msg); } diff --git a/src/engine/jobs/TrackJob.java b/src/engine/jobs/TrackJob.java index 80fd6b2e..eb302709 100644 --- a/src/engine/jobs/TrackJob.java +++ b/src/engine/jobs/TrackJob.java @@ -9,11 +9,11 @@ package engine.jobs; -import engine.mbEnums; +import engine.gameManager.DispatchManager; import engine.gameManager.PowersManager; import engine.math.Vector3fImmutable; +import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.TrackArrowMsg; import engine.objects.AbstractWorldObject; import engine.objects.PlayerCharacter; @@ -84,7 +84,7 @@ public class TrackJob extends AbstractEffectJob { TrackArrowMsg tam = new TrackArrowMsg(rotation); Dispatch dispatch = Dispatch.borrow(pc, tam); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 4200b909..12e0940d 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -17,7 +17,6 @@ import engine.mbEnums.DispatchChannel; import engine.mobileAI.Threads.MobAIThread; import engine.mobileAI.Threads.ReSpawner; import engine.mobileAI.utilities.MovementUtilities; -import engine.net.DispatchMessage; import engine.net.client.msg.PerformActionMsg; import engine.net.client.msg.PowerProjectileMsg; import engine.objects.*; @@ -161,7 +160,7 @@ public class MobAI { if (mob.isSiege()) { PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target); ppm.setRange(50); - DispatchMessage.dispatchMsgToInterestArea(mob, ppm, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(mob, ppm, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); } } catch (Exception e) { diff --git a/src/engine/net/MessageDispatcher.java b/src/engine/net/MessageDispatcher.java index 90b8fb96..4cc40394 100644 --- a/src/engine/net/MessageDispatcher.java +++ b/src/engine/net/MessageDispatcher.java @@ -9,6 +9,7 @@ package engine.net; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import org.pmw.tinylog.Logger; @@ -21,12 +22,11 @@ import java.util.regex.Pattern; // All outgoing Protocol messages to the player are managed through the MessageDispatcher.class. // All incoming Protocol messages from the player are managed by the Protocol.class. // -// A DispatchMessage is configured (Protocol messsage) and wrapped in a Dispatch (distribution list). -// A Dispatch can be submitted to the MessageDispatcher for delivery from any thread. +// A Dispatch is configured wrapping a Protocol message and a distribution list is built. // -// Dispatches are interleaved between channels. This is to ensure -// a combat or movement message is not delayed by spam clicking a -// larger message. Choose your channel wisely. +// The system interleaves dispatches between two channels. This is to ensure that +// a critical combat or movement message will not be delayed by spam clicking a larger +// message with no temporal immediacy. Pick the correct channel will this in mind. public class MessageDispatcher implements Runnable { @@ -73,7 +73,7 @@ public class MessageDispatcher implements Runnable { this.messageDispatch = _messageQueue[dispatchChannel.getChannelID()].poll(); if (this.messageDispatch != null) { - DispatchMessage.serializeDispatch(this.messageDispatch); + DispatchManager.serializeDispatch(this.messageDispatch); shouldBlock = false; } } diff --git a/src/engine/net/client/handlers/AcceptInviteToGuildHandler.java b/src/engine/net/client/handlers/AcceptInviteToGuildHandler.java index b1152980..4e470f03 100644 --- a/src/engine/net/client/handlers/AcceptInviteToGuildHandler.java +++ b/src/engine/net/client/handlers/AcceptInviteToGuildHandler.java @@ -10,15 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.mbEnums.GuildHistoryType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -86,9 +82,9 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler { player.resetGuildStatuses(); Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); - DispatchMessage.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2)); + DispatchManager.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2)); player.incVer(); diff --git a/src/engine/net/client/handlers/AcceptSubInviteHandler.java b/src/engine/net/client/handlers/AcceptSubInviteHandler.java index 90e1c5b0..6d3d884d 100644 --- a/src/engine/net/client/handlers/AcceptSubInviteHandler.java +++ b/src/engine/net/client/handlers/AcceptSubInviteHandler.java @@ -12,12 +12,12 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.mbEnums.GuildState; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -98,7 +98,7 @@ public class AcceptSubInviteHandler extends AbstractClientMsgHandler { msg.setUnknown02(1); msg.setResponse("Your guild is now a " + sourceGuild.getGuildState().name() + '.'); dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); ChatManager.chatSystemInfo(sourcePlayer, "Your guild is now a " + sourceGuild.getGuildState().name() + '.'); return true; diff --git a/src/engine/net/client/handlers/AcceptTradeRequestMsgHandler.java b/src/engine/net/client/handlers/AcceptTradeRequestMsgHandler.java index 274e897b..656aa5d2 100644 --- a/src/engine/net/client/handlers/AcceptTradeRequestMsgHandler.java +++ b/src/engine/net/client/handlers/AcceptTradeRequestMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.AcceptTradeRequestMsg; import engine.net.client.msg.ClientNetMsg; @@ -92,10 +92,10 @@ public class AcceptTradeRequestMsgHandler extends AbstractClientMsgHandler { UpdateVaultMsg uvmTarget = new UpdateVaultMsg(targetAccount); dispatch = Dispatch.borrow(source, uvmSource); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); dispatch = Dispatch.borrow(target, uvmTarget); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); source.charItemManager.setVaultOpen(false); toTradeWith.setVaultOpen(false); @@ -118,10 +118,10 @@ public class AcceptTradeRequestMsgHandler extends AbstractClientMsgHandler { toTradeWith.tradeID = msg.getUnknown01(); dispatch = Dispatch.borrow(source, otwm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); dispatch = Dispatch.borrow(target, otwm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); return true; } diff --git a/src/engine/net/client/handlers/ActivateNPCMsgHandler.java b/src/engine/net/client/handlers/ActivateNPCMsgHandler.java index 7cc842cf..31aa5ccc 100644 --- a/src/engine/net/client/handlers/ActivateNPCMsgHandler.java +++ b/src/engine/net/client/handlers/ActivateNPCMsgHandler.java @@ -5,7 +5,6 @@ import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.ItemType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ActivateNPCMessage; import engine.net.client.msg.ClientNetMsg; @@ -66,7 +65,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler { anm.setSize(ItemLists.size()); anm.setItemList(ItemLists); Dispatch dispatch = Dispatch.borrow(player, anm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } if (msg.getUnknown01() == 0) { @@ -125,7 +124,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler { mca1.setAssetName1(building.getName()); mca1.setUnknown54(1); Dispatch dispatch = Dispatch.borrow(player, mca1); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/net/client/handlers/AddGoldToTradeWindowMsgHandler.java b/src/engine/net/client/handlers/AddGoldToTradeWindowMsgHandler.java index bbb01b21..1b7247e2 100644 --- a/src/engine/net/client/handlers/AddGoldToTradeWindowMsgHandler.java +++ b/src/engine/net/client/handlers/AddGoldToTradeWindowMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.AddGoldToTradeWindowMsg; import engine.net.client.msg.ClientNetMsg; @@ -95,13 +95,13 @@ public class AddGoldToTradeWindowMsgHandler extends AbstractClientMsgHandler { source.charItemManager.modifyCommitToTrade(); dispatch = Dispatch.borrow(source, utwm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(source, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(other, utwmOther); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/AddItemToTradeWindowMsgHandler.java b/src/engine/net/client/handlers/AddItemToTradeWindowMsgHandler.java index e2cc7d6c..67ea08b1 100644 --- a/src/engine/net/client/handlers/AddItemToTradeWindowMsgHandler.java +++ b/src/engine/net/client/handlers/AddItemToTradeWindowMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.AddItemToTradeWindowMsg; import engine.net.client.msg.ClientNetMsg; @@ -81,7 +81,7 @@ public class AddItemToTradeWindowMsgHandler extends AbstractClientMsgHandler { if (!tradingWith.hasRoomTrade(item.template.item_wt)) { dispatch = Dispatch.borrow(source, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); return false; } @@ -93,12 +93,12 @@ public class AddItemToTradeWindowMsgHandler extends AbstractClientMsgHandler { source.charItemManager.addItemToTrade(item); dispatch = Dispatch.borrow(other, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); source.charItemManager.modifyCommitToTrade(); dispatch = Dispatch.borrow(other, utwm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); return true; } diff --git a/src/engine/net/client/handlers/AllianceChangeMsgHandler.java b/src/engine/net/client/handlers/AllianceChangeMsgHandler.java index 1b12f1af..8ebc0eef 100644 --- a/src/engine/net/client/handlers/AllianceChangeMsgHandler.java +++ b/src/engine/net/client/handlers/AllianceChangeMsgHandler.java @@ -1,11 +1,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.AllianceType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.AllianceChangeMsg; import engine.net.client.msg.ClientNetMsg; @@ -40,20 +40,20 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler { if (!Guild.sameGuild(origin.getPlayerCharacter().getGuild(), fromGuild)) { msg.setMsgType(AllianceChangeMsg.ERROR_NOT_SAME_GUILD); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return; } if (!GuildStatusController.isInnerCouncil(origin.getPlayerCharacter().getGuildStatus()) && !GuildStatusController.isGuildLeader(origin.getPlayerCharacter().getGuildStatus())) { msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return; } dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -72,7 +72,7 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler { return; dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -91,7 +91,7 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler { return; dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -142,7 +142,7 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler { } msg.setMsgType(AllianceChangeMsg.INFO_SUCCESS); Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; diff --git a/src/engine/net/client/handlers/AllyEnemyListMsgHandler.java b/src/engine/net/client/handlers/AllyEnemyListMsgHandler.java index 1b4685ae..96438f27 100644 --- a/src/engine/net/client/handlers/AllyEnemyListMsgHandler.java +++ b/src/engine/net/client/handlers/AllyEnemyListMsgHandler.java @@ -1,10 +1,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.AllyEnemyListMsg; import engine.net.client.msg.ClientNetMsg; @@ -35,7 +35,7 @@ public class AllyEnemyListMsgHandler extends AbstractClientMsgHandler { if (toGuild == null) return; dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); // UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(); // diff --git a/src/engine/net/client/handlers/AppointGroupLeaderHandler.java b/src/engine/net/client/handlers/AppointGroupLeaderHandler.java index 22fdc3d3..53a3ceb8 100644 --- a/src/engine/net/client/handlers/AppointGroupLeaderHandler.java +++ b/src/engine/net/client/handlers/AppointGroupLeaderHandler.java @@ -11,11 +11,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.group.AppointGroupLeaderMsg; @@ -52,7 +52,7 @@ public class AppointGroupLeaderHandler extends AbstractClientMsgHandler { AppointGroupLeaderMsg reply = new AppointGroupLeaderMsg(); reply.setResponse(1); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), reply); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } diff --git a/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java b/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java index 0ca789b2..83729365 100644 --- a/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java +++ b/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java @@ -6,7 +6,6 @@ import engine.job.JobScheduler; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.HotzoneChangeMsg; @@ -129,7 +128,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler { if (player.getPet() != null) { PetMsg pm = new PetMsg(5, player.getPet()); Dispatch dispatch = Dispatch.borrow(player, pm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } //Send current hotzone @@ -137,7 +136,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler { if (ZoneManager.hotZone != null) { HotzoneChangeMsg hcm = new HotzoneChangeMsg(mbEnums.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(player, hcm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } if (player.getGuild() != null && !player.getGuild().isEmptyGuild()) { diff --git a/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java b/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java index 963863c2..cfcd644a 100644 --- a/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java @@ -1,10 +1,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ArcMineChangeProductionMsg; import engine.net.client.msg.ClientNetMsg; @@ -60,7 +60,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler mine.changeProductionType(resource); Dispatch dispatch = Dispatch.borrow(playerCharacter, changeProductionMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java b/src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java index 3df45025..65ad65a9 100644 --- a/src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java +++ b/src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java @@ -2,10 +2,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ArcMineWindowAvailableTimeMsg; import engine.net.client.msg.ClientNetMsg; @@ -55,7 +55,7 @@ public class ArcMineWindowAvailableTimeHandler extends AbstractClientMsgHandler ArcMineWindowAvailableTimeMsg outMsg = new ArcMineWindowAvailableTimeMsg(treeOfLife, 10); outMsg.configure(); dispatch = Dispatch.borrow(playerCharacter, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/ArcOwnedMinesListHandler.java b/src/engine/net/client/handlers/ArcOwnedMinesListHandler.java index 589cf9bb..e79fcfec 100644 --- a/src/engine/net/client/handlers/ArcOwnedMinesListHandler.java +++ b/src/engine/net/client/handlers/ArcOwnedMinesListHandler.java @@ -1,9 +1,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ArcOwnedMinesListMsg; import engine.net.client.msg.ClientNetMsg; @@ -37,7 +37,7 @@ public class ArcOwnedMinesListHandler extends AbstractClientMsgHandler { msg.setMineList(Mine.getMinesForGuild(playerCharacter.getGuild().getObjectUUID())); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/ArcViewAssetTransactionsMsgHandler.java b/src/engine/net/client/handlers/ArcViewAssetTransactionsMsgHandler.java index e1e7b431..764df4cc 100644 --- a/src/engine/net/client/handlers/ArcViewAssetTransactionsMsgHandler.java +++ b/src/engine/net/client/handlers/ArcViewAssetTransactionsMsgHandler.java @@ -2,10 +2,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ArcViewAssetTransactionsMsg; import engine.net.client.msg.ClientNetMsg; @@ -55,7 +55,7 @@ public class ArcViewAssetTransactionsMsgHandler extends AbstractClientMsgHandler newMsg.configure(); dispatch = Dispatch.borrow(player, newMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/AssetSupportMsgHandler.java b/src/engine/net/client/handlers/AssetSupportMsgHandler.java index 145e0fd6..20d79ce7 100644 --- a/src/engine/net/client/handlers/AssetSupportMsgHandler.java +++ b/src/engine/net/client/handlers/AssetSupportMsgHandler.java @@ -2,13 +2,13 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.NPCManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.SupportMsgType; import engine.mbEnums.TaxType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -96,7 +96,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler { outMsg = new ManageNPCMsg(vendor); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } private static void unprotectAsset(Building targetBuilding, NPC vendor, ClientConnection origin) { @@ -179,7 +179,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler { outMsg.configure(); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case REMOVETAX: @@ -202,7 +202,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler { mca.setAssetName1(targetBuilding.getName()); mca.setUnknown54(1); dispatch = Dispatch.borrow(player, mca); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; case ACCEPTTAX: //AcceptTax @@ -226,12 +226,12 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler { mca.setUnknown54(1); dispatch = Dispatch.borrow(player, mca); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } dispatch = Dispatch.borrow(player, baseMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; diff --git a/src/engine/net/client/handlers/BanishUnbanishHandler.java b/src/engine/net/client/handlers/BanishUnbanishHandler.java index e9160929..a0d0d2da 100644 --- a/src/engine/net/client/handlers/BanishUnbanishHandler.java +++ b/src/engine/net/client/handlers/BanishUnbanishHandler.java @@ -12,11 +12,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.GuildHistoryType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -115,7 +115,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler { targetName + " has been banished from " + guild.getName() + '.'); GuildListMsg guildListMsg = new GuildListMsg(guild); dispatch = Dispatch.borrow(source, guildListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else { ErrorPopupMsg.sendErrorPopup(source, 103); // You may not banish this char } diff --git a/src/engine/net/client/handlers/BreakFealtyHandler.java b/src/engine/net/client/handlers/BreakFealtyHandler.java index 81411b08..cc78e6b3 100644 --- a/src/engine/net/client/handlers/BreakFealtyHandler.java +++ b/src/engine/net/client/handlers/BreakFealtyHandler.java @@ -10,14 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -97,7 +93,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler { SendGuildEntryMsg msg = new SendGuildEntryMsg(player); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //Update Map. @@ -164,7 +160,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler { SendGuildEntryMsg msg = new SendGuildEntryMsg(player); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //Update Map. diff --git a/src/engine/net/client/handlers/ChangeAltitudeHandler.java b/src/engine/net/client/handlers/ChangeAltitudeHandler.java index 11f2fe2a..f026373a 100644 --- a/src/engine/net/client/handlers/ChangeAltitudeHandler.java +++ b/src/engine/net/client/handlers/ChangeAltitudeHandler.java @@ -10,8 +10,8 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ChangeAltitudeMsg; import engine.net.client.msg.ClientNetMsg; @@ -171,7 +171,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler { // Add flight timer job to check stam and ground you when you run out //MovementManager.addFlightTimer(pc, msg, MBServerStatics.FLY_FREQUENCY_MS); //Send change altitude to all in range - DispatchMessage.dispatchMsgToInterestArea(pc, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); return true; diff --git a/src/engine/net/client/handlers/ChangeGuildLeaderHandler.java b/src/engine/net/client/handlers/ChangeGuildLeaderHandler.java index 0726e8a7..72895909 100644 --- a/src/engine/net/client/handlers/ChangeGuildLeaderHandler.java +++ b/src/engine/net/client/handlers/ChangeGuildLeaderHandler.java @@ -12,10 +12,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ChangeGuildLeaderMsg; import engine.net.client.msg.ClientNetMsg; @@ -115,17 +115,17 @@ public class ChangeGuildLeaderHandler extends AbstractClientMsgHandler { GuildInfoMsg guildInfoMsg = new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2); Dispatch dispatch = Dispatch.borrow(sourcePlayer, guildInfoMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); GuildListMsg guildListMsg = new GuildListMsg(sourcePlayer.getGuild()); dispatch = Dispatch.borrow(sourcePlayer, guildListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); if (targetPlayer != null) { if (updateTarget) - DispatchMessage.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2)); + DispatchManager.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2)); } return true; diff --git a/src/engine/net/client/handlers/ChangeRankHandler.java b/src/engine/net/client/handlers/ChangeRankHandler.java index 29cda5e1..c4134804 100644 --- a/src/engine/net/client/handlers/ChangeRankHandler.java +++ b/src/engine/net/client/handlers/ChangeRankHandler.java @@ -12,10 +12,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.guild.ChangeRankMsg; @@ -146,16 +146,16 @@ public class ChangeRankHandler extends AbstractClientMsgHandler { if (targetPlayer != null) { targetPlayer.incVer(); if (updateTarget) - DispatchMessage.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2)); + DispatchManager.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2)); } if (updateSource) { Dispatch dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2)); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(sourcePlayer, new GuildListMsg(sourcePlayer.getGuild())); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/net/client/handlers/CityChoiceMsgHandler.java b/src/engine/net/client/handlers/CityChoiceMsgHandler.java index db4dde4e..6790caf6 100644 --- a/src/engine/net/client/handlers/CityChoiceMsgHandler.java +++ b/src/engine/net/client/handlers/CityChoiceMsgHandler.java @@ -1,11 +1,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.GuildManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.CityChoiceMsg; import engine.net.client.msg.ClientNetMsg; @@ -42,7 +42,7 @@ public class CityChoiceMsgHandler extends AbstractClientMsgHandler { TeleportRepledgeListMsg trlm = new TeleportRepledgeListMsg(player, false); trlm.configure(); dispatch = Dispatch.borrow(player, trlm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case 3: City city = City.getCity(msg.getCityID()); diff --git a/src/engine/net/client/handlers/CityDataHandler.java b/src/engine/net/client/handlers/CityDataHandler.java index 4848e6e4..9d4419d7 100644 --- a/src/engine/net/client/handlers/CityDataHandler.java +++ b/src/engine/net/client/handlers/CityDataHandler.java @@ -1,12 +1,12 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.gameManager.ZoneManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.CityDataMsg; import engine.net.client.msg.ClientNetMsg; @@ -62,14 +62,14 @@ public class CityDataHandler extends AbstractClientMsgHandler { cityDataMsg.updateCities(updateCities); dispatch = Dispatch.borrow(playerCharacter, cityDataMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); // If the hotZone has changed then update the client's map accordingly. if (playerCharacter.getTimeStamp("hotzoneupdate") <= ZoneManager.hotZoneLastUpdate.toEpochMilli() && ZoneManager.hotZone != null) { HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(mbEnums.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID()); dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100); } @@ -77,7 +77,7 @@ public class CityDataHandler extends AbstractClientMsgHandler { WorldRealmMsg worldRealmMsg = new WorldRealmMsg(); dispatch = Dispatch.borrow(playerCharacter, worldRealmMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java b/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java index 0662a5e1..6073e0a3 100644 --- a/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java +++ b/src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java @@ -12,10 +12,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.BuildingGroup; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -115,10 +115,10 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { GuildTreeStatusMsg gtsm = new GuildTreeStatusMsg(building, sourcePlayer); gtsm.configure(); dispatch = Dispatch.borrow(sourcePlayer, gtsm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); CityZoneMsg czm = new CityZoneMsg(2, playerZone.getLoc().x, playerZone.getLoc().y, playerZone.getLoc().z, playerCity.getCityName(), playerZone, mbEnums.CityBoundsType.ZONE.halfExtents, mbEnums.CityBoundsType.ZONE.halfExtents); - DispatchMessage.dispatchMsgToAll(czm); + DispatchManager.dispatchMsgToAll(czm); break; case BIND_TREE: @@ -152,7 +152,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { sourcePlayer.setBindBuildingID(building.getObjectUUID()); dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case OPEN_CITY: case CLOSE_CITY: @@ -171,7 +171,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { } dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; default: break; diff --git a/src/engine/net/client/handlers/CloseTradeWindowMsgHandler.java b/src/engine/net/client/handlers/CloseTradeWindowMsgHandler.java index 5d22651a..9027f52e 100644 --- a/src/engine/net/client/handlers/CloseTradeWindowMsgHandler.java +++ b/src/engine/net/client/handlers/CloseTradeWindowMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.CloseTradeWindowMsg; @@ -51,7 +51,7 @@ public class CloseTradeWindowMsgHandler extends AbstractClientMsgHandler { CloseTradeWindowMsg closeMsg = new CloseTradeWindowMsg(source, tradeID); dispatch = Dispatch.borrow(source, closeMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); ClientConnection cc2 = sourceItemMan.getTradingWith(); diff --git a/src/engine/net/client/handlers/DeleteItemMsgHandler.java b/src/engine/net/client/handlers/DeleteItemMsgHandler.java index b9cf6e2e..c2c0fabc 100644 --- a/src/engine/net/client/handlers/DeleteItemMsgHandler.java +++ b/src/engine/net/client/handlers/DeleteItemMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.DeleteItemMsg; @@ -60,7 +60,7 @@ public class DeleteItemMsgHandler extends AbstractClientMsgHandler { if (item.isCanDestroy()) if (itemManager.delete(item) == true) { Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } return true; diff --git a/src/engine/net/client/handlers/DisbandGuildHandler.java b/src/engine/net/client/handlers/DisbandGuildHandler.java index 97620928..890c6e7e 100644 --- a/src/engine/net/client/handlers/DisbandGuildHandler.java +++ b/src/engine/net/client/handlers/DisbandGuildHandler.java @@ -15,11 +15,11 @@ import engine.db.archive.GuildRecord; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.GuildHistoryType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -112,7 +112,7 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler { LeaveGuildMsg leaveGuildMsg = new LeaveGuildMsg(); leaveGuildMsg.setMessage("You guild has been disbanded!"); dispatch = Dispatch.borrow(player, leaveGuildMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/DismissGuildHandler.java b/src/engine/net/client/handlers/DismissGuildHandler.java index fe3f72c1..889cf161 100644 --- a/src/engine/net/client/handlers/DismissGuildHandler.java +++ b/src/engine/net/client/handlers/DismissGuildHandler.java @@ -10,14 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -122,7 +118,7 @@ public class DismissGuildHandler extends AbstractClientMsgHandler { SendGuildEntryMsg msg = new SendGuildEntryMsg(player); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); final Session s = SessionManager.getSession(player); diff --git a/src/engine/net/client/handlers/DoorTryOpenMsgHandler.java b/src/engine/net/client/handlers/DoorTryOpenMsgHandler.java index 2dc62437..8792cad9 100644 --- a/src/engine/net/client/handlers/DoorTryOpenMsgHandler.java +++ b/src/engine/net/client/handlers/DoorTryOpenMsgHandler.java @@ -3,10 +3,10 @@ package engine.net.client.handlers; import engine.InterestManagement.WorldGrid; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.DoorState; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.DoorTryOpenMsg; @@ -62,7 +62,7 @@ public class DoorTryOpenMsgHandler extends AbstractClientMsgHandler { if ((targetBuilding.isDoorLocked(doorNumber) == true) && msg.getToggle() == 0x01) { msg.setUnk1(2); Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; //don't open a locked door } @@ -79,7 +79,7 @@ public class DoorTryOpenMsgHandler extends AbstractClientMsgHandler { for (AbstractWorldObject awo : container) { PlayerCharacter playerCharacter = (PlayerCharacter) awo; Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } return true; diff --git a/src/engine/net/client/handlers/FriendAcceptHandler.java b/src/engine/net/client/handlers/FriendAcceptHandler.java index a922857c..9bdac146 100644 --- a/src/engine/net/client/handlers/FriendAcceptHandler.java +++ b/src/engine/net/client/handlers/FriendAcceptHandler.java @@ -11,10 +11,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.AcceptFriendMsg; import engine.net.client.msg.AddFriendMessage; @@ -45,11 +45,11 @@ public class FriendAcceptHandler extends AbstractClientMsgHandler { AddFriendMessage outMsg = new AddFriendMessage(player); Dispatch dispatch = Dispatch.borrow(sourceFriend, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); outMsg = new AddFriendMessage(sourceFriend); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ChatManager.chatSystemInfo(sourceFriend, player.getFirstName() + " has agreed to be your friend."); diff --git a/src/engine/net/client/handlers/FriendDeclineHandler.java b/src/engine/net/client/handlers/FriendDeclineHandler.java index 1b72b132..82ebb7d2 100644 --- a/src/engine/net/client/handlers/FriendDeclineHandler.java +++ b/src/engine/net/client/handlers/FriendDeclineHandler.java @@ -10,10 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.DeclineFriendMsg; @@ -36,7 +36,7 @@ public class FriendDeclineHandler extends AbstractClientMsgHandler { } Dispatch dispatch = Dispatch.borrow(sourceFriend, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } diff --git a/src/engine/net/client/handlers/FriendRequestHandler.java b/src/engine/net/client/handlers/FriendRequestHandler.java index 6e600dd0..a671fbd6 100644 --- a/src/engine/net/client/handlers/FriendRequestHandler.java +++ b/src/engine/net/client/handlers/FriendRequestHandler.java @@ -11,10 +11,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -40,7 +40,7 @@ public class FriendRequestHandler extends AbstractClientMsgHandler { Dispatch dispatch = Dispatch.borrow(targetFriend, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ChatManager.chatSystemInfo(player, "Your friend request has been sent."); } diff --git a/src/engine/net/client/handlers/FurnitureHandler.java b/src/engine/net/client/handlers/FurnitureHandler.java index 821377e2..4c3f73ce 100644 --- a/src/engine/net/client/handlers/FurnitureHandler.java +++ b/src/engine/net/client/handlers/FurnitureHandler.java @@ -10,9 +10,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.FurnitureMsg; @@ -41,7 +41,7 @@ public class FurnitureHandler extends AbstractClientMsgHandler { if (msg.getType() == 3) msg.setType(2); Dispatch dispatch = Dispatch.borrow(pc, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/GroupInviteHandler.java b/src/engine/net/client/handlers/GroupInviteHandler.java index a54f6be6..4e79b6c7 100644 --- a/src/engine/net/client/handlers/GroupInviteHandler.java +++ b/src/engine/net/client/handlers/GroupInviteHandler.java @@ -11,12 +11,12 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ConfigManager; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.group.GroupInviteMsg; @@ -47,7 +47,7 @@ public class GroupInviteHandler extends AbstractClientMsgHandler { msg.setPlayer(pc); msg.setMessageType(1); Dispatch dispatch = Dispatch.borrow(pc, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); group.addUpdateGroupJob(); @@ -128,7 +128,7 @@ public class GroupInviteHandler extends AbstractClientMsgHandler { msg.setName(source.getFirstName()); Dispatch dispatch = Dispatch.borrow(target, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/GroupInviteResponseHandler.java b/src/engine/net/client/handlers/GroupInviteResponseHandler.java index 0f5edd78..321f0686 100644 --- a/src/engine/net/client/handlers/GroupInviteResponseHandler.java +++ b/src/engine/net/client/handlers/GroupInviteResponseHandler.java @@ -11,10 +11,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.group.GroupInviteResponseMsg; @@ -86,7 +86,7 @@ public class GroupInviteResponseHandler extends AbstractClientMsgHandler { groupUpdateMsg.setPlayer(groupMember); Dispatch dispatch = Dispatch.borrow(player, groupUpdateMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/net/client/handlers/GuildControlHandler.java b/src/engine/net/client/handlers/GuildControlHandler.java index d9f19313..e5d88fd0 100644 --- a/src/engine/net/client/handlers/GuildControlHandler.java +++ b/src/engine/net/client/handlers/GuildControlHandler.java @@ -10,10 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -47,11 +47,11 @@ public class GuildControlHandler extends AbstractClientMsgHandler { msg.setGM((byte) (GuildStatusController.isGuildLeader(player.getGuildStatus()) ? 1 : 0)); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); if (GuildStatusController.isInnerCouncil(player.getGuildStatus()) || GuildStatusController.isGuildLeader(player.getGuildStatus())) { dispatch = Dispatch.borrow(player, new GuildListMsg(player.getGuild())); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else ErrorPopupMsg.sendErrorMsg(player, "Only guild leader and inner council have such authority!"); @@ -64,7 +64,7 @@ public class GuildControlHandler extends AbstractClientMsgHandler { if (pc != null) { dispatch = Dispatch.borrow(player, new GuildListMsg(pc)); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } diff --git a/src/engine/net/client/handlers/GuildCreationFinalizeHandler.java b/src/engine/net/client/handlers/GuildCreationFinalizeHandler.java index 2d1a6f2e..cdc035f5 100644 --- a/src/engine/net/client/handlers/GuildCreationFinalizeHandler.java +++ b/src/engine/net/client/handlers/GuildCreationFinalizeHandler.java @@ -10,17 +10,13 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.mbEnums.GuildHistoryType; import engine.mbEnums.ItemType; import engine.mbEnums.OwnerType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -122,7 +118,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler { } dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); GuildManager.joinGuild(player, newGuild, GuildHistoryType.CREATE); @@ -135,7 +131,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler { player.charItemManager.updateInventory(); player.incVer(); - DispatchMessage.sendToAllInRange(player, new GuildInfoMsg(player, newGuild, 2)); + DispatchManager.sendToAllInRange(player, new GuildInfoMsg(player, newGuild, 2)); ChatManager.chatSystemInfo(player, msg.getName() + " has arrived on Grief server!"); diff --git a/src/engine/net/client/handlers/GuildCreationOptionsHandler.java b/src/engine/net/client/handlers/GuildCreationOptionsHandler.java index 5a8cddc3..b8ef6e39 100644 --- a/src/engine/net/client/handlers/GuildCreationOptionsHandler.java +++ b/src/engine/net/client/handlers/GuildCreationOptionsHandler.java @@ -10,9 +10,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.guild.GuildCreationOptionsMsg; @@ -40,7 +40,7 @@ public class GuildCreationOptionsHandler extends AbstractClientMsgHandler { return true; dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/GuildInfoHandler.java b/src/engine/net/client/handlers/GuildInfoHandler.java index a253d7fd..6ff45f2f 100644 --- a/src/engine/net/client/handlers/GuildInfoHandler.java +++ b/src/engine/net/client/handlers/GuildInfoHandler.java @@ -10,11 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.guild.GuildInfoMsg; @@ -40,18 +40,18 @@ public class GuildInfoHandler extends AbstractClientMsgHandler { if (msg.getMsgType() == 1) { dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 4)); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else if (msg.getMsgType() == 5) { if (msg.getObjectType() == GameObjectType.PlayerCharacter.ordinal()) { PlayerCharacter pc = PlayerCharacter.getPlayerCharacter(msg.getObjectID()); dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(pc, pc.getGuild(), 5)); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else { //TODO Change this to a null object when we make a null object. dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 1)); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } diff --git a/src/engine/net/client/handlers/GuildTreeStatusMsgHandler.java b/src/engine/net/client/handlers/GuildTreeStatusMsgHandler.java index b20671bc..6033e7ac 100644 --- a/src/engine/net/client/handlers/GuildTreeStatusMsgHandler.java +++ b/src/engine/net/client/handlers/GuildTreeStatusMsgHandler.java @@ -10,10 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.GuildTreeStatusMsg; @@ -52,7 +52,7 @@ public class GuildTreeStatusMsgHandler extends AbstractClientMsgHandler { guildTreeStatusMsg.configure(); dispatch = Dispatch.borrow(player, guildTreeStatusMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/HirelingServiceMsgHandler.java b/src/engine/net/client/handlers/HirelingServiceMsgHandler.java index 167924c3..d5754395 100644 --- a/src/engine/net/client/handlers/HirelingServiceMsgHandler.java +++ b/src/engine/net/client/handlers/HirelingServiceMsgHandler.java @@ -12,10 +12,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.HirelingServiceMsg; @@ -65,10 +65,10 @@ public class HirelingServiceMsgHandler extends AbstractClientMsgHandler { ManageNPCMsg outMsg = new ManageNPCMsg(npc); Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; } diff --git a/src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java b/src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java index fce42eba..ee8225df 100644 --- a/src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java +++ b/src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.InvalidTradeRequestMsg; @@ -39,7 +39,7 @@ public class InvalidTradeRequestMsgHandler extends AbstractClientMsgHandler { Dispatch dispatch; dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/InviteToGuildHandler.java b/src/engine/net/client/handlers/InviteToGuildHandler.java index 410b742a..159439da 100644 --- a/src/engine/net/client/handlers/InviteToGuildHandler.java +++ b/src/engine/net/client/handlers/InviteToGuildHandler.java @@ -11,14 +11,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.ConfigManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -149,7 +145,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler { msg.setTargetName(""); dispatch = Dispatch.borrow(targetPlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/InviteToSubHandler.java b/src/engine/net/client/handlers/InviteToSubHandler.java index c2f79c2d..e0340462 100644 --- a/src/engine/net/client/handlers/InviteToSubHandler.java +++ b/src/engine/net/client/handlers/InviteToSubHandler.java @@ -10,14 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.ConfigManager; -import engine.gameManager.DbManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -127,7 +123,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler { msg.setUnknown02(1); dispatch = Dispatch.borrow(target, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else { sendChat(source, "Failed to send sub invite to target."); diff --git a/src/engine/net/client/handlers/ItemFromVaultMsgHandler.java b/src/engine/net/client/handlers/ItemFromVaultMsgHandler.java index 678e046d..4fa57ee3 100644 --- a/src/engine/net/client/handlers/ItemFromVaultMsgHandler.java +++ b/src/engine/net/client/handlers/ItemFromVaultMsgHandler.java @@ -10,9 +10,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ItemFromVaultMsg; @@ -36,7 +36,7 @@ public class ItemFromVaultMsgHandler extends AbstractClientMsgHandler { ItemToVaultMsg back = new ItemToVaultMsg(msg); dispatch = Dispatch.borrow(player, back); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); ChatManager.chatInfoError(player, "Can't transfer to inventory: " + reason); } diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 0e7f2fbe..8f47f442 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -10,15 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.ForgeManager; -import engine.gameManager.ItemManager; +import engine.gameManager.*; import engine.loot.WorkOrder; import engine.mbEnums; import engine.mbEnums.ItemType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -104,7 +100,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { recycleItem(msg.items, vendor, origin); msg.actionType = mbEnums.ProductionActionType.TAKE; dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case COMPLETE: completeItem(msg.itemUUID, vendor); @@ -118,7 +114,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { case TAKE: takeItem(msg.items, vendor, origin); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; } return true; @@ -142,7 +138,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { // (Add / Completed / Remove) ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, virtualItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true); - DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); // Remove virtualItem from collections @@ -177,9 +173,9 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { // Add persisted items to the vendor inventory window ItemProductionMsg outMsg1 = new ItemProductionMsg(vendor.building, vendor, completedItem, mbEnums.ProductionActionType.DEPOSIT, true); - DispatchMessage.dispatchMsgToInterestArea(vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(vendor, outMsg1, mbEnums.DispatchChannel.SECONDARY, 700, false, false); ItemProductionMsg outMsg2 = new ItemProductionMsg(vendor.building, vendor, completedItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true); - DispatchMessage.dispatchMsgToInterestArea(vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); + DispatchManager.dispatchMsgToInterestArea(vendor, outMsg2, mbEnums.DispatchChannel.SECONDARY, 700, false, false); } catch (Exception e) { Logger.error(e); @@ -214,11 +210,11 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT, true); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.SETPRICE, true); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -275,11 +271,11 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT, true); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); origin.getPlayerCharacter().charItemManager.updateInventory(); } catch (Exception e) { @@ -356,7 +352,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.TAKE, true); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } // Refund a portion of the gold @@ -446,7 +442,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { outMsg = new ManageNPCMsg(vendor); outMsg.setMessageType(1); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } catch (Exception e) { Logger.error(e); } finally { diff --git a/src/engine/net/client/handlers/ItemToVaultMsgHandler.java b/src/engine/net/client/handlers/ItemToVaultMsgHandler.java index 04a4e1f4..cd09a2da 100644 --- a/src/engine/net/client/handlers/ItemToVaultMsgHandler.java +++ b/src/engine/net/client/handlers/ItemToVaultMsgHandler.java @@ -10,9 +10,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ItemFromVaultMsg; @@ -36,7 +36,7 @@ public class ItemToVaultMsgHandler extends AbstractClientMsgHandler { ItemFromVaultMsg back = new ItemFromVaultMsg(msg); dispatch = Dispatch.borrow(player, back); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); ChatManager.chatInfoError(player, "Can't transfer to vault: " + reason); } diff --git a/src/engine/net/client/handlers/KeepAliveServerClientHandler.java b/src/engine/net/client/handlers/KeepAliveServerClientHandler.java index da6eb347..b82f7cec 100644 --- a/src/engine/net/client/handlers/KeepAliveServerClientHandler.java +++ b/src/engine/net/client/handlers/KeepAliveServerClientHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.KeepAliveServerClientMsg; @@ -39,7 +39,7 @@ public class KeepAliveServerClientHandler extends AbstractClientMsgHandler { // Send ping to client Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); return true; } diff --git a/src/engine/net/client/handlers/LeaveGuildHandler.java b/src/engine/net/client/handlers/LeaveGuildHandler.java index 029a76db..c1688651 100644 --- a/src/engine/net/client/handlers/LeaveGuildHandler.java +++ b/src/engine/net/client/handlers/LeaveGuildHandler.java @@ -10,14 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.ConfigManager; -import engine.gameManager.GroupManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GuildHistoryType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.guild.LeaveGuildMsg; @@ -49,7 +45,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler { if (GuildStatusController.isGuildLeader(playerCharacter.getGuildStatus())) { msg.setMessage("You must switch leadership of your guild before leaving!"); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } @@ -75,7 +71,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler { // Send message back to client msg.setMessage("You have left the guild."); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/LockUnlockDoorMsgHandler.java b/src/engine/net/client/handlers/LockUnlockDoorMsgHandler.java index 3f47245e..0e620b8b 100644 --- a/src/engine/net/client/handlers/LockUnlockDoorMsgHandler.java +++ b/src/engine/net/client/handlers/LockUnlockDoorMsgHandler.java @@ -2,10 +2,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.LockUnlockDoorMsg; @@ -82,7 +82,7 @@ public class LockUnlockDoorMsgHandler extends AbstractClientMsgHandler { } Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/LootMsgHandler.java b/src/engine/net/client/handlers/LootMsgHandler.java index db9a1da0..688792fd 100644 --- a/src/engine/net/client/handlers/LootMsgHandler.java +++ b/src/engine/net/client/handlers/LootMsgHandler.java @@ -10,11 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -125,11 +125,11 @@ public class LootMsgHandler extends AbstractClientMsgHandler { for (Item equip : mobTarget.charItemManager.equipped.values()) { TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(mobTarget, equip.equipSlot); - DispatchMessage.dispatchMsgToInterestArea(mobTarget, back, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(mobTarget, back, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); LootMsg lootMsg = new LootMsg(0, 0, tar.getObjectType().ordinal(), tar.getObjectUUID(), equip); Dispatch dispatch = Dispatch.borrow(player, lootMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; } } @@ -172,17 +172,17 @@ public class LootMsgHandler extends AbstractClientMsgHandler { updateTargetGold = new UpdateGoldMsg(corpse); updateTargetGold.configure(); - DispatchMessage.dispatchMsgToInterestArea(corpse, updateTargetGold, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(corpse, updateTargetGold, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); UpdateGoldMsg ugm = new UpdateGoldMsg(player); ugm.configure(); Dispatch dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); // respond back loot message. Try sending to everyone. } else - DispatchMessage.dispatchMsgToInterestArea(corpse, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, true); + DispatchManager.dispatchMsgToInterestArea(corpse, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, true); //TODO send group loot message if player is grouped and visible @@ -215,12 +215,12 @@ public class LootMsgHandler extends AbstractClientMsgHandler { updateTargetGold = new UpdateGoldMsg(corpse); updateTargetGold.configure(); - DispatchMessage.dispatchMsgToInterestArea(tar, updateTargetGold, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(tar, updateTargetGold, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); UpdateGoldMsg ugm = new UpdateGoldMsg(player); ugm.configure(); Dispatch dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); // respond back loot message. Try sending to everyone. @@ -231,10 +231,10 @@ public class LootMsgHandler extends AbstractClientMsgHandler { msg.setSourceID2(0); Dispatch dispatch = Dispatch.borrow(player, msg); //DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); - DispatchMessage.dispatchMsgToInterestArea(tar, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, true); + DispatchManager.dispatchMsgToInterestArea(tar, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, true); LootMsg newItemMsg = new LootMsg(mbEnums.GameObjectType.PlayerCharacter.ordinal(), player.getObjectUUID(), 0, 0, itemRet); dispatch = Dispatch.borrow(player, newItemMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); //player.getCharItemManager().updateInventory(); } diff --git a/src/engine/net/client/handlers/LootWindowRequestMsgHandler.java b/src/engine/net/client/handlers/LootWindowRequestMsgHandler.java index e0384157..dba534b6 100644 --- a/src/engine/net/client/handlers/LootWindowRequestMsgHandler.java +++ b/src/engine/net/client/handlers/LootWindowRequestMsgHandler.java @@ -10,10 +10,10 @@ package engine.net.client.handlers; import engine.InterestManagement.WorldGrid; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -131,9 +131,9 @@ public class LootWindowRequestMsgHandler extends AbstractClientMsgHandler { if (lwrm == null) return true; - DispatchMessage.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); Dispatch dispatch = Dispatch.borrow(player, lwrm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); return true; } diff --git a/src/engine/net/client/handlers/MOTDCommitHandler.java b/src/engine/net/client/handlers/MOTDCommitHandler.java index 3af350a6..0d9f27a1 100644 --- a/src/engine/net/client/handlers/MOTDCommitHandler.java +++ b/src/engine/net/client/handlers/MOTDCommitHandler.java @@ -11,10 +11,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.guild.MOTDCommitMsg; @@ -74,7 +74,7 @@ public class MOTDCommitHandler extends AbstractClientMsgHandler { } } dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } return true; diff --git a/src/engine/net/client/handlers/MOTDEditHandler.java b/src/engine/net/client/handlers/MOTDEditHandler.java index 32640468..20f0244f 100644 --- a/src/engine/net/client/handlers/MOTDEditHandler.java +++ b/src/engine/net/client/handlers/MOTDEditHandler.java @@ -10,10 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -57,7 +57,7 @@ public class MOTDEditHandler extends AbstractClientMsgHandler { LeaveGuildMsg leaveGuildMsg = new LeaveGuildMsg(); leaveGuildMsg.setMessage("You do not belong to a guild!"); dispatch = Dispatch.borrow(playerCharacter, leaveGuildMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } @@ -75,7 +75,7 @@ public class MOTDEditHandler extends AbstractClientMsgHandler { msg.setMessage(nation.getMOTD()); } dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } return true; diff --git a/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java b/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java index 90b88b26..d7b8f564 100644 --- a/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java +++ b/src/engine/net/client/handlers/ManageCityAssetMsgHandler.java @@ -2,6 +2,7 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.gameManager.ZoneManager; import engine.math.Bounds; @@ -9,7 +10,6 @@ import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -99,7 +99,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building); mca.actionType = 15; Dispatch dispatch = Dispatch.borrow(player, mca); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } return true; } @@ -112,7 +112,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { outMsg.setTargetID(building.getObjectUUID()); outMsg.setAssetName(building.getName()); Dispatch dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -196,7 +196,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { msg.actionType = 4; Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } outMsg.actionType = 4; @@ -206,14 +206,14 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { } Dispatch dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } if (msg.actionType == 13) { outMsg.actionType = 13; Dispatch dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -235,7 +235,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { outMsg.setUnknown54(1); Dispatch dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; @@ -248,7 +248,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building); mca.actionType = 15; Dispatch dispatch = Dispatch.borrow(player, mca); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -285,7 +285,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { outMsg.actionType = 18; Dispatch dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } return true; diff --git a/src/engine/net/client/handlers/MerchantMsgHandler.java b/src/engine/net/client/handlers/MerchantMsgHandler.java index e80227bb..92ee287a 100644 --- a/src/engine/net/client/handlers/MerchantMsgHandler.java +++ b/src/engine/net/client/handlers/MerchantMsgHandler.java @@ -9,7 +9,6 @@ import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.GuildHistoryType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -230,7 +229,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler { trlm.configure(); dispatch = Dispatch.borrow(pc, trlm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } private static void teleportRepledge(MerchantMsg msg, ClientConnection origin, PlayerCharacter player, boolean isTeleport, NPC npc) { @@ -294,7 +293,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler { if ((!isTeleport && joinedGuild) || (isTeleport)) { dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } //teleport player to city @@ -401,7 +400,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler { case 5: dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); requestSwearAsSubGuild(msg, origin, player, npc); break; case 10: @@ -425,7 +424,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler { case 15: LeaderboardMessage lbm = new LeaderboardMessage(); dispatch = Dispatch.borrow(player, lbm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case 16: ViewResourcesMsg vrm = new ViewResourcesMsg(player); @@ -434,7 +433,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler { vrm.setWarehouseBuilding(warehouse); vrm.configure(); dispatch = Dispatch.borrow(player, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case 17: Warehouse.warehouseWithdraw(msg, player, npc); diff --git a/src/engine/net/client/handlers/MinionTrainingMsgHandler.java b/src/engine/net/client/handlers/MinionTrainingMsgHandler.java index b832db92..98cc58d0 100644 --- a/src/engine/net/client/handlers/MinionTrainingMsgHandler.java +++ b/src/engine/net/client/handlers/MinionTrainingMsgHandler.java @@ -2,14 +2,10 @@ package engine.net.client.handlers; import engine.InterestManagement.WorldGrid; import engine.exception.MsgSendException; -import engine.gameManager.BuildingManager; -import engine.gameManager.DbManager; -import engine.gameManager.NPCManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -80,7 +76,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { toRemove.guardCaptain = null; PetMsg petMsg = new PetMsg(5, null); Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } } @@ -95,11 +91,11 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { mca1.setUnknown54(1); Dispatch dispatch = Dispatch.borrow(playerCharacter, mca1); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ManageNPCMsg mnm = new ManageNPCMsg(npc); dispatch = Dispatch.borrow(playerCharacter, mnm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); //Add Minion } else { @@ -153,7 +149,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { ManageNPCMsg mnm = new ManageNPCMsg(npc); mnm.setMessageType(1); Dispatch dispatch = Dispatch.borrow(playerCharacter, mnm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } finally { npc.minionLock.writeLock().unlock(); @@ -206,7 +202,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { toRemove.guardCaptain = null; PetMsg petMsg = new PetMsg(5, null); Dispatch dispatch = Dispatch.borrow(trebOwner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } } @@ -221,11 +217,11 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { mca1.setUnknown54(1); Dispatch dispatch = Dispatch.borrow(playerCharacter, mca1); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ManageNPCMsg mnm = new ManageNPCMsg(npc); dispatch = Dispatch.borrow(playerCharacter, mnm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); //Add Minion } else { @@ -287,7 +283,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler { ManageNPCMsg mnm = new ManageNPCMsg(npc); mnm.setMessageType(1); Dispatch dispatch = Dispatch.borrow(playerCharacter, mnm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } catch (Exception e) { Logger.error(e); diff --git a/src/engine/net/client/handlers/ObjectActionMsgHandler.java b/src/engine/net/client/handlers/ObjectActionMsgHandler.java index 1760e4fa..2f7d79c4 100644 --- a/src/engine/net/client/handlers/ObjectActionMsgHandler.java +++ b/src/engine/net/client/handlers/ObjectActionMsgHandler.java @@ -6,7 +6,6 @@ import engine.math.Bounds; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -104,7 +103,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { pam.addPlacementInfo(item.template.deed_structure_id); dispatch = Dispatch.borrow(player, pam); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //itemMan.consume(item); //temporary fix for dupe.. TODO Make Item Unusable after This message is sent. break; @@ -248,7 +247,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { VisualUpdateMessage vum = new VisualUpdateMessage(player, 16323); vum.configure(); - DispatchMessage.sendToAllInRange(player, vum); + DispatchManager.sendToAllInRange(player, vum); } if (waterbucketBypass == false) { @@ -262,7 +261,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { itemMan.consume(item); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); player.cancelOnSpell(); break; case RUNE: @@ -271,7 +270,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { break; default: //shouldn't be here, consume item dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); // itemMan.consume(item); } } else { diff --git a/src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java b/src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java index 1c4ef4ed..3242eb95 100644 --- a/src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java +++ b/src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java @@ -3,12 +3,12 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -60,7 +60,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { outMsg.setOrigin(origin); outMsg.setMessageType(2); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case ADDHERALDRY: @@ -93,7 +93,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { outMsg.setOrigin(origin); outMsg.setMessageType(2); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case REMOVEHERALDRY: @@ -105,20 +105,20 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { outMsg.setOrigin(origin); outMsg.setMessageType(2); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case DEALTHS: // Death List openFriendsCondemnListMsg.updateMsg(8, new ArrayList<>(player.pvpDeaths)); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case KILLS: // Kill List openFriendsCondemnListMsg.updateMsg(10, new ArrayList<>(player.pvpKills)); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case VIEWCONDEMN: @@ -131,7 +131,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(12, sourceBuilding.getCondemned(), sourceBuilding.reverseKOS); openFriendsCondemnListMsg.configure(); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //msg.updateMsg(12, DbManager.GuildQueries.) break; @@ -156,7 +156,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { sourceBuilding.getCondemned().remove(msg.getRemoveFriendID()); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case TOGGLEACTIVE: @@ -177,7 +177,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { condemn.setActive(msg.isReverseKOS()); openFriendsCondemnListMsg.setReverseKOS(condemn.active); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; case REVERSEKOS: @@ -276,7 +276,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(12, sourceBuilding.getCondemned(), sourceBuilding.reverseKOS); openFriendsCondemnListMsg.configure(); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; //ADD FRIEND BUILDING @@ -337,7 +337,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { openFriendsCondemnListMsg.configure(); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; //REMOVE from friends list. case REMOVEFRIEND: @@ -363,7 +363,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(26, sourceBuilding.getFriends()); openFriendsCondemnListMsg.configure(); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; //view Friends @@ -384,7 +384,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler { dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); break; default: diff --git a/src/engine/net/client/handlers/OrderNPCMsgHandler.java b/src/engine/net/client/handlers/OrderNPCMsgHandler.java index 3c9ce110..c649e52a 100644 --- a/src/engine/net/client/handlers/OrderNPCMsgHandler.java +++ b/src/engine/net/client/handlers/OrderNPCMsgHandler.java @@ -3,6 +3,7 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.math.FastMath; import engine.math.Vector3fImmutable; @@ -11,7 +12,6 @@ import engine.mbEnums.DispatchChannel; import engine.mbEnums.GameObjectType; import engine.mbEnums.ProfitType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -429,7 +429,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { manageCityAssetsMsg.setTargetID(building.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(player, manageCityAssetsMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; @@ -452,7 +452,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { outMsg.setUnknown54(1); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case CLIENT_REDEED_REQUEST: @@ -472,7 +472,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { modifySellProfit(orderNPCMsg, origin); dispatch = Dispatch.borrow(player, orderNPCMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 10: case 11: @@ -483,7 +483,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { modifyBuyProfit(orderNPCMsg, origin); dispatch = Dispatch.borrow(player, orderNPCMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -494,7 +494,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { ManageNPCMsg manageNPCMsg = new ManageNPCMsg(npc); Dispatch dispatch = Dispatch.borrow(player, manageNPCMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } else if (orderNPCMsg.getObjectType() == GameObjectType.Mob.ordinal()) { @@ -535,7 +535,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { manageCityAssetsMsg.setTargetType(building.getObjectType().ordinal()); manageCityAssetsMsg.setTargetID(building.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(player, manageCityAssetsMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case 3: @@ -556,7 +556,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { outMsg.setUnknown54(1); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); break; case 6: @@ -583,7 +583,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler { ManageNPCMsg manageNPCMsg = new ManageNPCMsg(mob); Dispatch dispatch = Dispatch.borrow(player, manageNPCMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } return true; diff --git a/src/engine/net/client/handlers/PetCmdMsgHandler.java b/src/engine/net/client/handlers/PetCmdMsgHandler.java index 4413c9fd..4a0ac067 100644 --- a/src/engine/net/client/handlers/PetCmdMsgHandler.java +++ b/src/engine/net/client/handlers/PetCmdMsgHandler.java @@ -10,7 +10,7 @@ package engine.net.client.handlers; import engine.InterestManagement.WorldGrid; import engine.exception.MsgSendException; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.PetCmdMsg; @@ -75,7 +75,7 @@ public class PetCmdMsgHandler extends AbstractClientMsgHandler { UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(pet); - DispatchMessage.sendToAllInRange(pet, rwss); + DispatchManager.sendToAllInRange(pet, rwss); } return true; diff --git a/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java b/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java index 74d423cb..0b9b926e 100644 --- a/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java +++ b/src/engine/net/client/handlers/PetitionReceivedMsgHandler.java @@ -2,9 +2,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.PetitionReceivedMsg; @@ -53,7 +53,7 @@ public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler { petitionReceivedMsg.unknown04 = 0; Dispatch dispatch = Dispatch.borrow(playerCharacter, petitionReceivedMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java index 655941e2..abfab260 100644 --- a/src/engine/net/client/handlers/PlaceAssetMsgHandler.java +++ b/src/engine/net/client/handlers/PlaceAssetMsgHandler.java @@ -12,7 +12,6 @@ import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.*; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.CityZoneMsg; import engine.net.client.msg.ClientNetMsg; @@ -62,7 +61,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { PlaceAssetMsg pam = new PlaceAssetMsg(); pam.setActionType(4); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), pam); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } // Default method: Validates and places all buildings that do not @@ -786,7 +785,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { //load the new city on the clients CityZoneMsg czm = new CityZoneMsg(1, treeObject.getLoc().x, treeObject.getLoc().y, treeObject.getLoc().z, cityObject.getCityName(), zoneObject, mbEnums.CityBoundsType.ZONE.halfExtents, mbEnums.CityBoundsType.ZONE.halfExtents); - DispatchMessage.dispatchMsgToAll(czm); + DispatchManager.dispatchMsgToAll(czm); // Set maintenance date diff --git a/src/engine/net/client/handlers/RandomMsgHandler.java b/src/engine/net/client/handlers/RandomMsgHandler.java index a7f04123..7408ab95 100644 --- a/src/engine/net/client/handlers/RandomMsgHandler.java +++ b/src/engine/net/client/handlers/RandomMsgHandler.java @@ -9,8 +9,8 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.RandomMsg; @@ -59,7 +59,7 @@ public class RandomMsgHandler extends AbstractClientMsgHandler { msg.setSourceID(source.getObjectUUID()); //send to all in range - DispatchMessage.dispatchMsgToInterestArea(source, msg, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, true); + DispatchManager.dispatchMsgToInterestArea(source, msg, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, true); return true; } diff --git a/src/engine/net/client/handlers/RefineMsgHandler.java b/src/engine/net/client/handlers/RefineMsgHandler.java index 8c690ae7..48867cee 100644 --- a/src/engine/net/client/handlers/RefineMsgHandler.java +++ b/src/engine/net/client/handlers/RefineMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.RefineMsg; @@ -69,7 +69,7 @@ public class RefineMsgHandler extends AbstractClientMsgHandler { //echo refine message back Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); // if (type == 0 && token == 1488335491){ // dispatch = Dispatch.borrow(pc, msg); @@ -80,7 +80,7 @@ public class RefineMsgHandler extends AbstractClientMsgHandler { RefinerScreenMsg refinerScreenMsg = new RefinerScreenMsg(skillPower, npc.getSellPercent(playerCharacter)); //TODO set npc cost dispatch = Dispatch.borrow(playerCharacter, refinerScreenMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); playerCharacter.recalculate(); } return true; diff --git a/src/engine/net/client/handlers/RefinerScreenMsgHandler.java b/src/engine/net/client/handlers/RefinerScreenMsgHandler.java index 94b1f1c2..4156b4cf 100644 --- a/src/engine/net/client/handlers/RefinerScreenMsgHandler.java +++ b/src/engine/net/client/handlers/RefinerScreenMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.RefinerScreenMsg; @@ -43,7 +43,7 @@ public class RefinerScreenMsgHandler extends AbstractClientMsgHandler { msg.setUnknown02(0); //cost to refine? Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/RemoveFriendHandler.java b/src/engine/net/client/handlers/RemoveFriendHandler.java index d623e731..be283106 100644 --- a/src/engine/net/client/handlers/RemoveFriendHandler.java +++ b/src/engine/net/client/handlers/RemoveFriendHandler.java @@ -10,9 +10,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.RemoveFriendMessage; @@ -33,12 +33,12 @@ public class RemoveFriendHandler extends AbstractClientMsgHandler { PlayerFriends.RemoveFromFriends(msg.friendID, player.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); msg = new RemoveFriendMessage(msg.friendID); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } @Override diff --git a/src/engine/net/client/handlers/RemoveFromGroupHandler.java b/src/engine/net/client/handlers/RemoveFromGroupHandler.java index 39d0ca1e..1c722ce2 100644 --- a/src/engine/net/client/handlers/RemoveFromGroupHandler.java +++ b/src/engine/net/client/handlers/RemoveFromGroupHandler.java @@ -11,11 +11,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.group.GroupUpdateMsg; @@ -71,7 +71,7 @@ public class RemoveFromGroupHandler extends AbstractClientMsgHandler { RemoveFromGroupMsg reply = new RemoveFromGroupMsg(); reply.setResponse(1); Dispatch dispatch = Dispatch.borrow(source, reply); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -94,7 +94,7 @@ public class RemoveFromGroupHandler extends AbstractClientMsgHandler { gim.setMessageType(3); gim.setPlayer(groupMember); Dispatch dispatch = Dispatch.borrow(target, gim); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } diff --git a/src/engine/net/client/handlers/RepairBuildingMsgHandler.java b/src/engine/net/client/handlers/RepairBuildingMsgHandler.java index cb148455..851877c4 100644 --- a/src/engine/net/client/handlers/RepairBuildingMsgHandler.java +++ b/src/engine/net/client/handlers/RepairBuildingMsgHandler.java @@ -2,12 +2,12 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.gameManager.ZoneManager; import engine.mbEnums; import engine.mbEnums.BuildingGroup; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.RepairBuildingMsg; @@ -70,14 +70,14 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { UpdateObjectMsg uom = new UpdateObjectMsg(targetBuilding, 3); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), uom); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); RepairBuildingMsg rbm = new RepairBuildingMsg(targetBuilding.getObjectUUID(), maxHP, missingHealth, repairCost, targetBuilding.getStrongboxValue()); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), rbm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @Override diff --git a/src/engine/net/client/handlers/RepairMsgHandler.java b/src/engine/net/client/handlers/RepairMsgHandler.java index e44122a8..65966fd6 100644 --- a/src/engine/net/client/handlers/RepairMsgHandler.java +++ b/src/engine/net/client/handlers/RepairMsgHandler.java @@ -10,11 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -56,7 +56,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler { repairMsg.setRepairWindowAck(npc); dispatch = Dispatch.borrow(player, repairMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } else if (repairMsg.getMsgType() == 0) { //Request RepairObject @@ -98,7 +98,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler { toRepair.setCombat_health_current(max); repairMsg.setupRepairAck(max - dur); dispatch = Dispatch.borrow(player, repairMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -133,7 +133,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler { ugm.configure(); dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); //update durability to database @@ -148,7 +148,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler { repairMsg.setupRepairAck(max - dur); dispatch = Dispatch.borrow(player, repairMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } return true; diff --git a/src/engine/net/client/handlers/RequestEnterWorldHandler.java b/src/engine/net/client/handlers/RequestEnterWorldHandler.java index 3da6d3fa..c61ffaf4 100644 --- a/src/engine/net/client/handlers/RequestEnterWorldHandler.java +++ b/src/engine/net/client/handlers/RequestEnterWorldHandler.java @@ -11,7 +11,7 @@ import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.Account; @@ -70,7 +70,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { if (player.getLevel() == 1 && player.getBindBuildingID() == -1) { SelectCityMsg scm = new SelectCityMsg(player, true); dispatch = Dispatch.borrow(player, scm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -81,7 +81,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { try { WorldDataMsg wdm = new WorldDataMsg(); dispatch = Dispatch.borrow(player, wdm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } catch (Exception e) { // TODO Auto-generated catch block Logger.error("WORLDDATAMESSAGE" + e.getMessage()); @@ -92,7 +92,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { try { WorldRealmMsg wrm = new WorldRealmMsg(); dispatch = Dispatch.borrow(player, wrm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } catch (Exception e) { // TODO Auto-generated catch block Logger.error("REALMMESSAGE" + e.getMessage()); @@ -101,7 +101,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { // Object Data CityDataMsg wom = new CityDataMsg(session, true); dispatch = Dispatch.borrow(player, wom); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); player.getTimestamps().put("EnterWorld", System.currentTimeMillis()); @@ -153,7 +153,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { SendOwnPlayerMsg sopm = new SendOwnPlayerMsg(SessionManager.getSession(origin)); dispatch = Dispatch.borrow(player, sopm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); return true; } diff --git a/src/engine/net/client/handlers/RequestGuildListHandler.java b/src/engine/net/client/handlers/RequestGuildListHandler.java index 64d89481..1238f8a5 100644 --- a/src/engine/net/client/handlers/RequestGuildListHandler.java +++ b/src/engine/net/client/handlers/RequestGuildListHandler.java @@ -14,7 +14,7 @@ import engine.exception.MsgSendException; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -46,7 +46,7 @@ public class RequestGuildListHandler extends AbstractClientMsgHandler { dispatch = Dispatch.borrow(pc, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/RespawnMsgHandler.java b/src/engine/net/client/handlers/RespawnMsgHandler.java index 441abd52..01ad147a 100644 --- a/src/engine/net/client/handlers/RespawnMsgHandler.java +++ b/src/engine/net/client/handlers/RespawnMsgHandler.java @@ -14,7 +14,7 @@ import engine.job.JobScheduler; import engine.jobs.RefreshGroupJob; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.MoveToPointMsg; @@ -72,7 +72,7 @@ public class RespawnMsgHandler extends AbstractClientMsgHandler { // TODO calculate any experience loss before this point msg.setPlayerExp(playerCharacter.getExp() + playerCharacter.getOverFlowEXP()); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); MoveToPointMsg moveMsg = new MoveToPointMsg(); moveMsg.setPlayer(playerCharacter); @@ -82,7 +82,7 @@ public class RespawnMsgHandler extends AbstractClientMsgHandler { moveMsg.setInBuildingFloor(-1); dispatch = Dispatch.borrow(playerCharacter, moveMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); MovementManager.sendRWSSMsg(playerCharacter); diff --git a/src/engine/net/client/handlers/SetCombatModeMsgHandler.java b/src/engine/net/client/handlers/SetCombatModeMsgHandler.java index ffab0eaf..0cd9f93b 100644 --- a/src/engine/net/client/handlers/SetCombatModeMsgHandler.java +++ b/src/engine/net/client/handlers/SetCombatModeMsgHandler.java @@ -10,7 +10,7 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.mbEnums; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.SetCombatModeMsg; @@ -49,7 +49,7 @@ public class SetCombatModeMsgHandler extends AbstractClientMsgHandler { UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); return true; } diff --git a/src/engine/net/client/handlers/ShowMsgHandler.java b/src/engine/net/client/handlers/ShowMsgHandler.java index 9c4090bf..36176661 100644 --- a/src/engine/net/client/handlers/ShowMsgHandler.java +++ b/src/engine/net/client/handlers/ShowMsgHandler.java @@ -12,7 +12,7 @@ import engine.exception.MsgSendException; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ShowMsg; @@ -64,7 +64,7 @@ public class ShowMsgHandler extends AbstractClientMsgHandler { msg.setRange01(tar.getRange()); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/SocialMsgHandler.java b/src/engine/net/client/handlers/SocialMsgHandler.java index 923db391..7f3333f7 100644 --- a/src/engine/net/client/handlers/SocialMsgHandler.java +++ b/src/engine/net/client/handlers/SocialMsgHandler.java @@ -10,7 +10,7 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.SocialMsg; @@ -35,7 +35,7 @@ public class SocialMsgHandler extends AbstractClientMsgHandler { if (player == null) return true; - DispatchMessage.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, true); + DispatchManager.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, true); return true; } diff --git a/src/engine/net/client/handlers/SwearInGuildHandler.java b/src/engine/net/client/handlers/SwearInGuildHandler.java index e33a014d..e82d1d65 100644 --- a/src/engine/net/client/handlers/SwearInGuildHandler.java +++ b/src/engine/net/client/handlers/SwearInGuildHandler.java @@ -10,15 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.mbEnums.GuildState; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -112,7 +108,7 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler { SendGuildEntryMsg msg = new SendGuildEntryMsg(player); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); City.lastCityUpdate = System.currentTimeMillis(); diff --git a/src/engine/net/client/handlers/SwearInHandler.java b/src/engine/net/client/handlers/SwearInHandler.java index ea443e4f..f9995b4f 100644 --- a/src/engine/net/client/handlers/SwearInHandler.java +++ b/src/engine/net/client/handlers/SwearInHandler.java @@ -11,10 +11,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -69,8 +69,8 @@ public class SwearInHandler extends AbstractClientMsgHandler { ChatManager.chatGuildInfo(source, target.getFirstName() + " has been sworn in as a full member!"); dispatch = Dispatch.borrow(source, new GuildListMsg(source.getGuild())); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); - DispatchMessage.sendToAllInRange(target, new GuildInfoMsg(target, target.getGuild(), 2)); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.sendToAllInRange(target, new GuildInfoMsg(target, target.getGuild(), 2)); return true; } diff --git a/src/engine/net/client/handlers/TaxCityMsgHandler.java b/src/engine/net/client/handlers/TaxCityMsgHandler.java index a33bc5c7..dc155ab8 100644 --- a/src/engine/net/client/handlers/TaxCityMsgHandler.java +++ b/src/engine/net/client/handlers/TaxCityMsgHandler.java @@ -3,9 +3,9 @@ package engine.net.client.handlers; import engine.InterestManagement.RealmMap; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -115,9 +115,9 @@ public class TaxCityMsgHandler extends AbstractClientMsgHandler { vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.building.getObjectUUID())); vrm.configure(); Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(player, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; diff --git a/src/engine/net/client/handlers/ToggleCombatMsgHandler.java b/src/engine/net/client/handlers/ToggleCombatMsgHandler.java index 1006d764..fe0766fb 100644 --- a/src/engine/net/client/handlers/ToggleCombatMsgHandler.java +++ b/src/engine/net/client/handlers/ToggleCombatMsgHandler.java @@ -9,8 +9,8 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ToggleCombatMsg; @@ -49,7 +49,7 @@ public class ToggleCombatMsgHandler extends AbstractClientMsgHandler { UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); return true; } diff --git a/src/engine/net/client/handlers/ToggleLfgRecruitingMsgHandler.java b/src/engine/net/client/handlers/ToggleLfgRecruitingMsgHandler.java index 75fa9ff3..33735b0c 100644 --- a/src/engine/net/client/handlers/ToggleLfgRecruitingMsgHandler.java +++ b/src/engine/net/client/handlers/ToggleLfgRecruitingMsgHandler.java @@ -9,8 +9,8 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ToggleLfgRecruitingMsg; @@ -51,7 +51,7 @@ public class ToggleLfgRecruitingMsgHandler extends AbstractClientMsgHandler { UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); return true; } diff --git a/src/engine/net/client/handlers/ToggleSitStandMsgHandler.java b/src/engine/net/client/handlers/ToggleSitStandMsgHandler.java index 2e952823..9ffcfcfc 100644 --- a/src/engine/net/client/handlers/ToggleSitStandMsgHandler.java +++ b/src/engine/net/client/handlers/ToggleSitStandMsgHandler.java @@ -9,8 +9,8 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ToggleSitStandMsg; @@ -58,7 +58,7 @@ public class ToggleSitStandMsgHandler extends AbstractClientMsgHandler { } rwss.setPlayer(playerCharacter); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); return true; } diff --git a/src/engine/net/client/handlers/TrackWindowMsgHandler.java b/src/engine/net/client/handlers/TrackWindowMsgHandler.java index 8070ab0b..0643be71 100644 --- a/src/engine/net/client/handlers/TrackWindowMsgHandler.java +++ b/src/engine/net/client/handlers/TrackWindowMsgHandler.java @@ -11,11 +11,11 @@ package engine.net.client.handlers; import engine.InterestManagement.WorldGrid; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.gameManager.PowersManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.TrackWindowMsg; @@ -176,7 +176,7 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler { trackWindowMsg.setCharacters(trackChars); Dispatch dispatch = Dispatch.borrow(playerCharacter, trackWindowMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/TradeRequestMsgHandler.java b/src/engine/net/client/handlers/TradeRequestMsgHandler.java index ae03dbd2..cdccb92d 100644 --- a/src/engine/net/client/handlers/TradeRequestMsgHandler.java +++ b/src/engine/net/client/handlers/TradeRequestMsgHandler.java @@ -10,9 +10,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.TradeRequestMsg; @@ -51,7 +51,7 @@ public class TradeRequestMsgHandler extends AbstractClientMsgHandler { return false; dispatch = Dispatch.borrow(target, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/TrainMsgHandler.java b/src/engine/net/client/handlers/TrainMsgHandler.java index 3ccd0b7d..f5eb5bcc 100644 --- a/src/engine/net/client/handlers/TrainMsgHandler.java +++ b/src/engine/net/client/handlers/TrainMsgHandler.java @@ -9,13 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.PowersManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -196,7 +192,7 @@ public class TrainMsgHandler extends AbstractClientMsgHandler { playerCharacter.charItemManager.buyFromNPC(building, (int) profitCost, (int) (profitCost - cost)); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //update trainer window @@ -204,7 +200,7 @@ public class TrainMsgHandler extends AbstractClientMsgHandler { TrainerInfoMsg tim = new TrainerInfoMsg(msg.npcType, msg.npcID, npc.getSellPercent(playerCharacter)); tim.setTrainPercent(npc.getSellPercent(playerCharacter)); dispatch = Dispatch.borrow(playerCharacter, tim); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } @@ -263,7 +259,7 @@ public class TrainMsgHandler extends AbstractClientMsgHandler { //train succeeded dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //update trainer window @@ -271,7 +267,7 @@ public class TrainMsgHandler extends AbstractClientMsgHandler { TrainerInfoMsg tim = new TrainerInfoMsg(msg.npcType, msg.npcID, npc.getSellPercent(playerCharacter)); tim.setTrainPercent(npc.getSellPercent(playerCharacter)); dispatch = Dispatch.borrow(playerCharacter, tim); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } } diff --git a/src/engine/net/client/handlers/TrainerInfoMsgHandler.java b/src/engine/net/client/handlers/TrainerInfoMsgHandler.java index 8b539b2f..ca2dc160 100644 --- a/src/engine/net/client/handlers/TrainerInfoMsgHandler.java +++ b/src/engine/net/client/handlers/TrainerInfoMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.TrainerInfoMsg; @@ -51,7 +51,7 @@ public class TrainerInfoMsgHandler extends AbstractClientMsgHandler { } Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/TransferGoldToFromBuildingMsgHandler.java b/src/engine/net/client/handlers/TransferGoldToFromBuildingMsgHandler.java index 26f20eae..628615b8 100644 --- a/src/engine/net/client/handlers/TransferGoldToFromBuildingMsgHandler.java +++ b/src/engine/net/client/handlers/TransferGoldToFromBuildingMsgHandler.java @@ -2,11 +2,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.PlaceAssetMsg; @@ -58,7 +58,7 @@ public class TransferGoldToFromBuildingMsgHandler extends AbstractClientMsgHandl return true; if (building.setReserve(msg.getUnknown01(), player)) { dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } return true; @@ -94,7 +94,7 @@ public class TransferGoldToFromBuildingMsgHandler extends AbstractClientMsgHandl UpdateGoldMsg ugm = new UpdateGoldMsg(player); ugm.configure(); dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); // Refresh the player's inventory if it's currently open @@ -103,7 +103,7 @@ public class TransferGoldToFromBuildingMsgHandler extends AbstractClientMsgHandl msg.setAmount(building.getStrongboxValue()); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } catch (Exception e) { PlaceAssetMsg.sendPlaceAssetError(player.getClientConnection(), 1, "A Serious error has occurred. Please post details for to ensure transaction integrity"); diff --git a/src/engine/net/client/handlers/TransferItemFromBankMsgHandler.java b/src/engine/net/client/handlers/TransferItemFromBankMsgHandler.java index f0c1f03b..8abbf5f8 100644 --- a/src/engine/net/client/handlers/TransferItemFromBankMsgHandler.java +++ b/src/engine/net/client/handlers/TransferItemFromBankMsgHandler.java @@ -9,11 +9,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.NPCManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.TransferItemFromBankMsg; @@ -79,7 +79,7 @@ public class TransferItemFromBankMsgHandler extends AbstractClientMsgHandler { goldMes.configure(); dispatch = Dispatch.borrow(player, goldMes); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -93,7 +93,7 @@ public class TransferItemFromBankMsgHandler extends AbstractClientMsgHandler { return true; dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/TransferItemFromEquipToInventoryHandler.java b/src/engine/net/client/handlers/TransferItemFromEquipToInventoryHandler.java index 0629b60d..c684f9ab 100644 --- a/src/engine/net/client/handlers/TransferItemFromEquipToInventoryHandler.java +++ b/src/engine/net/client/handlers/TransferItemFromEquipToInventoryHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ApplyEffectMsg; import engine.net.client.msg.ClientNetMsg; @@ -86,13 +86,13 @@ public class TransferItemFromEquipToInventoryHandler extends AbstractClientMsgHa pum.setEffectSourceID(ItemID); pum.setDuration(-1); - DispatchMessage.dispatchMsgToInterestArea(player, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(player, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } // Update player formulas player.applyBonuses(); - DispatchMessage.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); return true; } diff --git a/src/engine/net/client/handlers/TransferItemFromInventoryToEquipHandler.java b/src/engine/net/client/handlers/TransferItemFromInventoryToEquipHandler.java index 46845e52..502e3663 100644 --- a/src/engine/net/client/handlers/TransferItemFromInventoryToEquipHandler.java +++ b/src/engine/net/client/handlers/TransferItemFromInventoryToEquipHandler.java @@ -10,10 +10,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ApplyEffectMsg; import engine.net.client.msg.ClientNetMsg; @@ -74,7 +74,7 @@ public class TransferItemFromInventoryToEquipHandler extends AbstractClientMsgHa // Update player formulas playerCharacter.applyBonuses(); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, transferMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, transferMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); for (String name : item.getEffects().keySet()) { Effect eff = item.getEffects().get(name); @@ -95,7 +95,7 @@ public class TransferItemFromInventoryToEquipHandler extends AbstractClientMsgHa pum.setEffectSourceID(item.getObjectUUID()); pum.setDuration(-1); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, pum, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); } return true; @@ -110,7 +110,7 @@ public class TransferItemFromInventoryToEquipHandler extends AbstractClientMsgHa TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(player, msg.slot); Dispatch dispatch = Dispatch.borrow(player, back); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ChatManager.chatInfoError(player, "Can't equip item: " + reason); } diff --git a/src/engine/net/client/handlers/TransferItemToBankMsgHandler.java b/src/engine/net/client/handlers/TransferItemToBankMsgHandler.java index 86aeee94..845590e7 100644 --- a/src/engine/net/client/handlers/TransferItemToBankMsgHandler.java +++ b/src/engine/net/client/handlers/TransferItemToBankMsgHandler.java @@ -9,11 +9,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.NPCManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -73,7 +73,7 @@ public class TransferItemToBankMsgHandler extends AbstractClientMsgHandler { goldMes.configure(); dispatch = Dispatch.borrow(player, goldMes); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } else { @@ -84,7 +84,7 @@ public class TransferItemToBankMsgHandler extends AbstractClientMsgHandler { return true; dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } return true; diff --git a/src/engine/net/client/handlers/UpdateFriendStatusHandler.java b/src/engine/net/client/handlers/UpdateFriendStatusHandler.java index 4830508b..42048230 100644 --- a/src/engine/net/client/handlers/UpdateFriendStatusHandler.java +++ b/src/engine/net/client/handlers/UpdateFriendStatusHandler.java @@ -10,11 +10,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.mbEnums.FriendStatus; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.UpdateFriendStatusMessage; @@ -57,7 +57,7 @@ public class UpdateFriendStatusHandler extends AbstractClientMsgHandler { if (playerFriend == null) return; Dispatch dispatch = Dispatch.borrow(playerFriend, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } diff --git a/src/engine/net/client/handlers/UpdateStateMsgHandler.java b/src/engine/net/client/handlers/UpdateStateMsgHandler.java index e9a36ddf..9ae6dfb5 100644 --- a/src/engine/net/client/handlers/UpdateStateMsgHandler.java +++ b/src/engine/net/client/handlers/UpdateStateMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.UpdateStateMsg; @@ -41,7 +41,7 @@ public class UpdateStateMsgHandler extends AbstractClientMsgHandler { else player.setWalkMode(true); - DispatchMessage.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(player, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); return true; } diff --git a/src/engine/net/client/handlers/UpgradeAssetMsgHandler.java b/src/engine/net/client/handlers/UpgradeAssetMsgHandler.java index 7e87ef8e..d8ca1f48 100644 --- a/src/engine/net/client/handlers/UpgradeAssetMsgHandler.java +++ b/src/engine/net/client/handlers/UpgradeAssetMsgHandler.java @@ -3,11 +3,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.Building; @@ -142,7 +142,7 @@ public class UpgradeAssetMsgHandler extends AbstractClientMsgHandler { outMsg.setUnknown54(1); dispatch = Dispatch.borrow(player, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } catch (Exception e) { PlaceAssetMsg.sendPlaceAssetError(player.getClientConnection(), 1, "A Serious error has occurred. Please post details for to ensure transaction integrity"); diff --git a/src/engine/net/client/handlers/UseCharterMsgHandler.java b/src/engine/net/client/handlers/UseCharterMsgHandler.java index 91bad149..469b02f9 100644 --- a/src/engine/net/client/handlers/UseCharterMsgHandler.java +++ b/src/engine/net/client/handlers/UseCharterMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.UseCharterMsg; @@ -29,7 +29,7 @@ public class UseCharterMsgHandler extends AbstractClientMsgHandler { msg.setUnknown02(1); msg.configure(); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/VendorBuyWindowMsgHandler.java b/src/engine/net/client/handlers/VendorBuyWindowMsgHandler.java index ef9db5a1..08dd84f5 100644 --- a/src/engine/net/client/handlers/VendorBuyWindowMsgHandler.java +++ b/src/engine/net/client/handlers/VendorBuyWindowMsgHandler.java @@ -9,10 +9,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -51,7 +51,7 @@ public class VendorBuyWindowMsgHandler extends AbstractClientMsgHandler { } dispatch = Dispatch.borrow(sourcePlayer, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/VendorDialogMsgHandler.java b/src/engine/net/client/handlers/VendorDialogMsgHandler.java index 5338a74c..947b0d16 100644 --- a/src/engine/net/client/handlers/VendorDialogMsgHandler.java +++ b/src/engine/net/client/handlers/VendorDialogMsgHandler.java @@ -9,15 +9,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; -import engine.gameManager.BuildingManager; -import engine.gameManager.DbManager; -import engine.gameManager.GuildManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.objects.*; @@ -42,35 +38,35 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { case 0: // Close Dialog msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 180: // Promote to class promote(playerCharacter, npc); msg.updateMessage(4, 0); // <-0 closes dialog dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 1000: // TrainSkill skills and powers msg.updateMessage(4, 2); // <-2 sends trainer screen dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 1001: // Open Bank getBank(playerCharacter, npc, origin); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 1002: // Open Vault getVault(playerCharacter, npc, origin); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 1003: //Refine msg.updateMessage(4, 3); // <-3 sends refine screen dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; // Mainland Teleports @@ -80,7 +76,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 10, 75, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100012: // teleport me to SDR city = City.getCity(24); @@ -88,7 +84,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 10, 75, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100013: // teleport me to Erkeng Hold city = City.getCity(26); @@ -96,7 +92,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 10, 75, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100014: // teleport me to Khan city = City.getCity(36); @@ -104,7 +100,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 75, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100015: // teleport me to Maelstrom @@ -112,28 +108,28 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, loc, 10, 75, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100016: // teleport me to Oblivion loc = new Vector3fImmutable(108921f, 167f, -51590f); handleTeleport(playerCharacter, loc, 10, 75, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100017: // teleport me to Vander's Doom loc = new Vector3fImmutable(42033f, 46f, -54471f); handleTeleport(playerCharacter, loc, 10, 75, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100018: // teleport me to The Sinking Isle loc = new Vector3fImmutable(67177f, 36f, -31940f); handleTeleport(playerCharacter, loc, 10, 75, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; // MainLand Repledges @@ -143,7 +139,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleRepledge(playerCharacter, city, 10, 55, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100031: // repledge me to Sea Dog's Rest city = City.getCity(24); @@ -151,7 +147,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleRepledge(playerCharacter, city, 10, 75, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100032: // repledge me to Erkeng Hold city = City.getCity(26); @@ -159,7 +155,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleRepledge(playerCharacter, city, 10, 55, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100033: // repledge me to Khan\'Of Srekel city = City.getCity(36); @@ -167,7 +163,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleRepledge(playerCharacter, city, 1, 75, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100035: // repledge me to Starkholm city = City.getCity(27); @@ -175,7 +171,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleRepledge(playerCharacter, city, 1, 20, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; // Noob Isle Teleports @@ -185,7 +181,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 20, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100041: // teleport me to All-Father's Rest city = City.getCity(28); @@ -193,7 +189,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 20, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100042: // teleport me to Hengest city = City.getCity(33); @@ -201,7 +197,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 20, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100043: // teleport me to Hrimdal city = City.getCity(30); @@ -209,14 +205,14 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 20, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100044: // teleport me to Hothor's Doom city = City.getCity(29); if (city != null) handleTeleport(playerCharacter, city.getLoc(), 1, 20, true); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100045: // teleport me to Scraefahl city = City.getCity(32); @@ -224,7 +220,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 20, false); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; case 100046: // teleport me to Valkirch city = City.getCity(31); @@ -232,7 +228,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { handleTeleport(playerCharacter, city.getLoc(), 1, 20, true); msg.updateMessage(4, 0); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; @@ -244,7 +240,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { private static boolean finishMessage(VendorDialogMsg msg, ClientConnection origin) throws MsgSendException { msg.updateMessage(4, 0); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } @@ -415,7 +411,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { // send the rune application to the clients ApplyRuneMsg arm = new ApplyRuneMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), promo.getObjectUUID(), promo.getObjectType().ordinal(), promo .getObjectUUID(), true); - DispatchMessage.dispatchMsgToInterestArea(pc, arm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, arm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } @@ -462,11 +458,11 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { OpenVaultMsg openVaultMsg = new OpenVaultMsg(playerCharacter, target); Dispatch dispatch = Dispatch.borrow(playerCharacter, openVaultMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ShowVaultInventoryMsg showVaultInventoryMsg = new ShowVaultInventoryMsg(playerCharacter, ac, target); // 37?? dispatch = Dispatch.borrow(playerCharacter, showVaultInventoryMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); // All recordings have "open - show - open." // Seems to work fine with just "show - open" as well. @@ -513,15 +509,15 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { CostOpenBankMsg costOpenBankMsg = new CostOpenBankMsg(playerCharacter, 0L, 0L); Dispatch dispatch = Dispatch.borrow(playerCharacter, costOpenBankMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ReqBankInventoryMsg reqBankInventoryMsg = new ReqBankInventoryMsg(playerCharacter, 0L); dispatch = Dispatch.borrow(playerCharacter, reqBankInventoryMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); ShowBankInventoryMsg showBankInventoryMsg = new ShowBankInventoryMsg(playerCharacter, 0L); dispatch = Dispatch.borrow(playerCharacter, showBankInventoryMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } @@ -594,7 +590,7 @@ public class VendorDialogMsgHandler extends AbstractClientMsgHandler { } Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/VendorSellMsgHandler.java b/src/engine/net/client/handlers/VendorSellMsgHandler.java index 4965b208..b837398d 100644 --- a/src/engine/net/client/handlers/VendorSellMsgHandler.java +++ b/src/engine/net/client/handlers/VendorSellMsgHandler.java @@ -9,11 +9,11 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -172,7 +172,7 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler { ugm.configure(); dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); //send the sell message back to update player vendorSellMsg.setItemType(sell.getObjectType().ordinal()); @@ -180,7 +180,7 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler { vendorSellMsg.setUnknown01(cost); //not sure if this is correct dispatch = Dispatch.borrow(player, vendorSellMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } finally { origin.sellLock.unlock(); @@ -192,7 +192,7 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler { // Send ping to client dispatch = Dispatch.borrow(pc, vendorSellMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); return true; } diff --git a/src/engine/net/client/handlers/VendorSellWindowMsgHandler.java b/src/engine/net/client/handlers/VendorSellWindowMsgHandler.java index ab9c2f23..f0c0c5c8 100644 --- a/src/engine/net/client/handlers/VendorSellWindowMsgHandler.java +++ b/src/engine/net/client/handlers/VendorSellWindowMsgHandler.java @@ -9,10 +9,10 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ErrorPopupMsg; @@ -72,7 +72,7 @@ public class VendorSellWindowMsgHandler extends AbstractClientMsgHandler { msg.setUnknownArray(contract.getBuyUnknownToken()); dispatch = Dispatch.borrow(playerCharacter, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/handlers/ViewResourcesMsgHandler.java b/src/engine/net/client/handlers/ViewResourcesMsgHandler.java index 35879ffa..05939ad0 100644 --- a/src/engine/net/client/handlers/ViewResourcesMsgHandler.java +++ b/src/engine/net/client/handlers/ViewResourcesMsgHandler.java @@ -9,9 +9,9 @@ package engine.net.client.handlers; import engine.exception.MsgSendException; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ViewResourcesMsg; @@ -59,7 +59,7 @@ public class ViewResourcesMsgHandler extends AbstractClientMsgHandler { vrm.configure(); Dispatch dispatch = Dispatch.borrow(playerCharacter, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/net/client/msg/ApplyRuneMsg.java b/src/engine/net/client/msg/ApplyRuneMsg.java index aea94c6b..0c6b812d 100644 --- a/src/engine/net/client/msg/ApplyRuneMsg.java +++ b/src/engine/net/client/msg/ApplyRuneMsg.java @@ -10,6 +10,7 @@ package engine.net.client.msg; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.*; import engine.net.client.ClientConnection; @@ -307,13 +308,13 @@ public class ApplyRuneMsg extends ClientNetMsg { if (cost > 0) { ModifyStatMsg msm = new ModifyStatMsg((0 - cost), 0, 3); dispatch = Dispatch.borrow(playerCharacter, msm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } //send apply rune message to client ApplyRuneMsg arm = new ApplyRuneMsg(playerCharacter.getObjectType().ordinal(), playerCharacter.getObjectUUID(), runeID, cr.getObjectType().ordinal(), cr.getObjectUUID(), false); dispatch = Dispatch.borrow(playerCharacter, arm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //alert them of success diff --git a/src/engine/net/client/msg/ErrorPopupMsg.java b/src/engine/net/client/msg/ErrorPopupMsg.java index 6c995f1b..fed748ad 100644 --- a/src/engine/net/client/msg/ErrorPopupMsg.java +++ b/src/engine/net/client/msg/ErrorPopupMsg.java @@ -9,6 +9,7 @@ package engine.net.client.msg; +import engine.gameManager.DispatchManager; import engine.mbEnums; import engine.net.*; import engine.objects.PlayerCharacter; @@ -274,7 +275,7 @@ public class ErrorPopupMsg extends ClientNetMsg { popupMessage = new ErrorPopupMsg(300, errorMessage); errorDispatch = Dispatch.borrow(player, popupMessage); - DispatchMessage.dispatchMsgDispatch(errorDispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(errorDispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -289,7 +290,7 @@ public class ErrorPopupMsg extends ClientNetMsg { errorPopup = new ErrorPopupMsg(popupID); errorDispatch = Dispatch.borrow(player, errorPopup); - DispatchMessage.dispatchMsgDispatch(errorDispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(errorDispatch, mbEnums.DispatchChannel.SECONDARY); } /** diff --git a/src/engine/net/client/msg/PlaceAssetMsg.java b/src/engine/net/client/msg/PlaceAssetMsg.java index 15d0f14c..f51aab4f 100644 --- a/src/engine/net/client/msg/PlaceAssetMsg.java +++ b/src/engine/net/client/msg/PlaceAssetMsg.java @@ -9,6 +9,7 @@ package engine.net.client.msg; +import engine.gameManager.DispatchManager; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.net.*; @@ -348,7 +349,7 @@ public class PlaceAssetMsg extends ClientNetMsg { outMsg.msg = stringData; Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } public static void sendPlaceAssetConfirmWall(ClientConnection origin, Zone zone) { @@ -363,7 +364,7 @@ public class PlaceAssetMsg extends ClientNetMsg { Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } /** diff --git a/src/engine/net/client/msg/WhoResponseMsg.java b/src/engine/net/client/msg/WhoResponseMsg.java index a52d827c..01960fd3 100644 --- a/src/engine/net/client/msg/WhoResponseMsg.java +++ b/src/engine/net/client/msg/WhoResponseMsg.java @@ -9,6 +9,7 @@ package engine.net.client.msg; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums; import engine.net.*; @@ -174,7 +175,7 @@ public class WhoResponseMsg extends ClientNetMsg { } Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index 2947c45b..a6749f9b 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -27,7 +27,6 @@ import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ApplyRuneMsg; import engine.net.client.msg.UpdateStateMsg; @@ -579,7 +578,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { //update client with removed rune. ApplyRuneMsg arm = new ApplyRuneMsg(playerCharacter.getObjectType().ordinal(), playerCharacter.getObjectUUID(), runeID); Dispatch dispatch = Dispatch.borrow(playerCharacter, arm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } public static void removeAllBlessings(PlayerCharacter playerCharacter) { @@ -1677,14 +1676,14 @@ public abstract class AbstractCharacter extends AbstractWorldObject { this.setCombat(false); UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(this); - DispatchMessage.sendToAllInRange(this, rwss); + DispatchManager.sendToAllInRange(this, rwss); } } else { if (!this.isCombat()) { this.setCombat(true); UpdateStateMsg rwss = new UpdateStateMsg(); rwss.setPlayer(this); - DispatchMessage.sendToAllInRange(this, rwss); + DispatchManager.sendToAllInRange(this, rwss); } } } diff --git a/src/engine/objects/AbstractIntelligenceAgent.java b/src/engine/objects/AbstractIntelligenceAgent.java index f9800b35..fc863056 100644 --- a/src/engine/objects/AbstractIntelligenceAgent.java +++ b/src/engine/objects/AbstractIntelligenceAgent.java @@ -10,6 +10,7 @@ package engine.objects; import engine.InterestManagement.WorldGrid; +import engine.gameManager.DispatchManager; import engine.gameManager.ZoneManager; import engine.math.Vector3fImmutable; import engine.mbEnums; @@ -18,7 +19,6 @@ import engine.mbEnums.ModType; import engine.mbEnums.SourceType; import engine.mobileAI.Threads.MobAIThread; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.PetMsg; import engine.server.MBServerStatics; @@ -179,7 +179,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter { PetMsg petMsg = new PetMsg(5, null); Dispatch dispatch = Dispatch.borrow(owner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); if (pet != null && pet.getObjectUUID() == this.getObjectUUID()) owner.setPet(null); diff --git a/src/engine/objects/AbstractWorldObject.java b/src/engine/objects/AbstractWorldObject.java index b93bfe2a..12d867f9 100644 --- a/src/engine/objects/AbstractWorldObject.java +++ b/src/engine/objects/AbstractWorldObject.java @@ -11,6 +11,7 @@ package engine.objects; import engine.InterestManagement.Terrain; import engine.InterestManagement.WorldGrid; +import engine.gameManager.DispatchManager; import engine.job.AbstractScheduleJob; import engine.job.JobContainer; import engine.job.JobScheduler; @@ -24,7 +25,6 @@ import engine.mbEnums.EffectSourceType; import engine.mbEnums.GameObjectType; import engine.mbEnums.GridObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.UpdateEffectsMsg; import engine.powers.EffectsBase; @@ -431,7 +431,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject { public void sendAllEffects(ClientConnection cc) { UpdateEffectsMsg msg = new UpdateEffectsMsg(this); Dispatch dispatch = Dispatch.borrow((PlayerCharacter) this, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } public void applyAllBonuses() { diff --git a/src/engine/objects/Account.java b/src/engine/objects/Account.java index 417bd3c4..9ed2065e 100644 --- a/src/engine/objects/Account.java +++ b/src/engine/objects/Account.java @@ -9,15 +9,11 @@ package engine.objects; -import engine.gameManager.ConfigManager; -import engine.gameManager.DbManager; -import engine.gameManager.NPCManager; -import engine.gameManager.SessionManager; +import engine.gameManager.*; import engine.mbEnums; import engine.mbEnums.DispatchChannel; import engine.mbEnums.ItemContainerType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.handlers.ItemFromVaultMsgHandler; import engine.net.client.handlers.ItemToVaultMsgHandler; @@ -228,7 +224,7 @@ public class Account extends AbstractGameObject { if (player.charItemManager.moveItemToVault(item)) { this.vault.add(item); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } else ItemToVaultMsgHandler.forceTransferFromVaultToInventory(msg, origin, "Failed to transfer item."); } @@ -274,7 +270,7 @@ public class Account extends AbstractGameObject { this.vault.remove(item); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } else ItemFromVaultMsgHandler.forceTransferFromInventoryToVault(msg, origin, "Failed to transfer item."); @@ -319,17 +315,17 @@ public class Account extends AbstractGameObject { UpdateGoldMsg ugm = new UpdateGoldMsg(player); ugm.configure(); dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); UpdateVaultMsg uvm = new UpdateVaultMsg(account); dispatch = Dispatch.borrow(player, uvm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(player, open); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(player, show); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } @@ -373,20 +369,20 @@ public class Account extends AbstractGameObject { UpdateGoldMsg ugm = new UpdateGoldMsg(player); ugm.configure(); dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); UpdateVaultMsg uvm = new UpdateVaultMsg(account); dispatch = Dispatch.borrow(player, uvm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); OpenVaultMsg open = new OpenVaultMsg(player, npc); dispatch = Dispatch.borrow(player, open); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); // // ShowVaultInventoryMsg show = new ShowVaultInventoryMsg(player, account, npc); // 37?? dispatch = Dispatch.borrow(player, show); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } } diff --git a/src/engine/objects/Bane.java b/src/engine/objects/Bane.java index 0cebc002..6132373f 100644 --- a/src/engine/objects/Bane.java +++ b/src/engine/objects/Bane.java @@ -12,10 +12,7 @@ package engine.objects; import engine.InterestManagement.WorldGrid; import engine.db.archive.BaneRecord; import engine.db.archive.DataWarehouse; -import engine.gameManager.BuildingManager; -import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; -import engine.gameManager.ZoneManager; +import engine.gameManager.*; import engine.job.JobScheduler; import engine.jobs.ActivateBaneJob; import engine.jobs.BaneDefaultTimeJob; @@ -24,7 +21,6 @@ import engine.mbEnums; import engine.mbEnums.ProtectionState; import engine.mbEnums.SiegePhase; import engine.mbEnums.SiegeResult; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.PlaceAssetMsg; import engine.net.client.msg.chat.ChatSystemMsg; @@ -258,7 +254,7 @@ public final class Bane { chatMsg.setMessageType(4); chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(chatMsg); + DispatchManager.dispatchMsgToAll(chatMsg); // Push this event to the DataWarehouse @@ -554,7 +550,7 @@ public final class Bane { msg.setMessageType(4); msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(msg); + DispatchManager.dispatchMsgToAll(msg); } @@ -573,7 +569,7 @@ public final class Bane { msg.setMessageType(4); msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(msg); + DispatchManager.dispatchMsgToAll(msg); } break; case DESTROY: @@ -590,7 +586,7 @@ public final class Bane { msg.setMessageType(4); msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(msg); + DispatchManager.dispatchMsgToAll(msg); } break; } diff --git a/src/engine/objects/Building.java b/src/engine/objects/Building.java index c70ae851..d218eb64 100644 --- a/src/engine/objects/Building.java +++ b/src/engine/objects/Building.java @@ -17,6 +17,7 @@ import engine.db.archive.DataWarehouse; import engine.db.archive.MineRecord; import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.ZoneManager; import engine.job.JobContainer; import engine.job.JobScheduler; @@ -28,7 +29,6 @@ import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; -import engine.net.DispatchMessage; import engine.net.client.msg.ApplyBuildingEffectMsg; import engine.net.client.msg.UpdateObjectMsg; import engine.server.MBServerStatics; @@ -783,7 +783,7 @@ public class Building extends AbstractWorldObject { public void removeAllVisualEffects() { this.effectFlags = 0; ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(3276859, 1, this.getObjectType().ordinal(), this.getObjectUUID(), 0); - DispatchMessage.sendToAllInRange(this, applyBuildingEffectMsg); + DispatchManager.sendToAllInRange(this, applyBuildingEffectMsg); } public void removeEffectBit(int bit) { @@ -865,21 +865,21 @@ public class Building extends AbstractWorldObject { WorldGrid.updateObject(this); else { UpdateObjectMsg uom = new UpdateObjectMsg(this, 3); - DispatchMessage.sendToAllInRange(this, uom); + DispatchManager.sendToAllInRange(this, uom); } } public final void updateName() { UpdateObjectMsg uom = new UpdateObjectMsg(this, 2); - DispatchMessage.sendToAllInRange(this, uom); + DispatchManager.sendToAllInRange(this, uom); } public final void refreshGuild() { UpdateObjectMsg uom = new UpdateObjectMsg(this, 5); - DispatchMessage.sendToAllInRange(this, uom); + DispatchManager.sendToAllInRange(this, uom); } @@ -1157,7 +1157,7 @@ public class Building extends AbstractWorldObject { public void updateEffects() { ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(0x00720063, 1, this.getObjectType().ordinal(), this.getObjectUUID(), this.effectFlags); - DispatchMessage.sendToAllInRange(this, applyBuildingEffectMsg); + DispatchManager.sendToAllInRange(this, applyBuildingEffectMsg); } diff --git a/src/engine/objects/CharacterItemManager.java b/src/engine/objects/CharacterItemManager.java index 93b5b2db..3c8c5280 100644 --- a/src/engine/objects/CharacterItemManager.java +++ b/src/engine/objects/CharacterItemManager.java @@ -9,16 +9,12 @@ package engine.objects; -import engine.gameManager.BuildingManager; -import engine.gameManager.ConfigManager; -import engine.gameManager.DbManager; -import engine.gameManager.ItemManager; +import engine.gameManager.*; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.mbEnums.ItemType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.server.MBServerStatics; @@ -364,7 +360,7 @@ public class CharacterItemManager { ugm.configure(); Dispatch dispatch = Dispatch.borrow(player, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return success; } @@ -395,7 +391,7 @@ public class CharacterItemManager { mca.setTargetType(mbEnums.GameObjectType.Building.ordinal()); mca.setTargetID(playerA.lastBuildingAccessed); Dispatch dispatch = Dispatch.borrow(playerA, mca); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); playerA.lastBuildingAccessed = 0; } @@ -421,10 +417,10 @@ public class CharacterItemManager { man2.getTradeCommitted()); dispatch = Dispatch.borrow((PlayerCharacter) this.getOwner(), modify); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); dispatch = Dispatch.borrow((PlayerCharacter) man2.getOwner(), modify); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; @@ -447,7 +443,7 @@ public class CharacterItemManager { CloseTradeWindowMsg closeMsg = new CloseTradeWindowMsg(source, tradeID); dispatch = Dispatch.borrow(source, closeMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); if (!sourceTrade) { sourceItemMan.endTrade(); @@ -1748,7 +1744,7 @@ public class CharacterItemManager { UpdateInventoryMsg updateInventoryMsg = new UpdateInventoryMsg(inventory, this.getBank(), this.getGoldInventory(), add); Dispatch dispatch = Dispatch.borrow(pc, updateInventoryMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -1773,7 +1769,7 @@ public class CharacterItemManager { if (initialized) { TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(player, slot); - DispatchMessage.dispatchMsgToInterestArea(player, back, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(player, back, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } } @@ -1965,7 +1961,7 @@ public class CharacterItemManager { ItemHealthUpdateMsg itemHealthUpdateMsg = new ItemHealthUpdateMsg(slot.ordinal(), (float) dur); Dispatch dispatch = Dispatch.borrow(pc, itemHealthUpdateMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/objects/CharacterRune.java b/src/engine/objects/CharacterRune.java index c5a3f3ff..f07434b0 100644 --- a/src/engine/objects/CharacterRune.java +++ b/src/engine/objects/CharacterRune.java @@ -10,9 +10,9 @@ package engine.objects; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.mbEnums.DispatchChannel; import engine.net.ByteBufferWriter; -import engine.net.DispatchMessage; import engine.net.client.msg.ApplyRuneMsg; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; @@ -143,7 +143,7 @@ public class CharacterRune extends AbstractGameObject { //worked, send ApplyRuneMsg if (worked) { ApplyRuneMsg arm = new ApplyRuneMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), runeID, rune.getObjectType().ordinal(), rune.getObjectUUID(), true); - DispatchMessage.dispatchMsgToInterestArea(pc, arm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(pc, arm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); CharacterSkill.calculateSkills(pc); pc.applyBonuses(); return true; diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index fa9fee9d..2d9b3d3e 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -22,7 +22,6 @@ import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.TaxResourcesMsg; import engine.net.client.msg.ViewResourcesMsg; @@ -1387,9 +1386,9 @@ public class City extends AbstractWorldObject { vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.building.getObjectUUID())); vrm.configure(); Dispatch dispatch = Dispatch.borrow(player, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/objects/Corpse.java b/src/engine/objects/Corpse.java index 65ac6fc1..8b583122 100644 --- a/src/engine/objects/Corpse.java +++ b/src/engine/objects/Corpse.java @@ -13,6 +13,7 @@ import engine.InterestManagement.WorldGrid; import engine.exception.SerializationException; import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.job.JobContainer; import engine.job.JobScheduler; import engine.jobs.RemoveCorpseJob; @@ -20,7 +21,6 @@ import engine.mbEnums.GameObjectType; import engine.mbEnums.GridObjectType; import engine.mbEnums.ItemType; import engine.net.ByteBufferWriter; -import engine.net.DispatchMessage; import engine.net.client.msg.UnloadObjectsMsg; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; @@ -132,7 +132,7 @@ public class Corpse extends AbstractWorldObject { //Remove from world UnloadObjectsMsg uom = new UnloadObjectsMsg(); uom.addObject(corpse); - DispatchMessage.sendToAllInRange(corpse, uom); + DispatchManager.sendToAllInRange(corpse, uom); WorldGrid.RemoveWorldObject(corpse); //clear from cache diff --git a/src/engine/objects/Group.java b/src/engine/objects/Group.java index b9594517..678d941b 100644 --- a/src/engine/objects/Group.java +++ b/src/engine/objects/Group.java @@ -9,12 +9,12 @@ package engine.objects; +import engine.gameManager.DispatchManager; import engine.gameManager.GroupManager; import engine.job.JobScheduler; import engine.jobs.UpdateGroupJob; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.group.GroupUpdateMsg; import engine.server.MBServerStatics; @@ -133,7 +133,7 @@ public class Group extends AbstractWorldObject { for (PlayerCharacter pc : this.members) { Dispatch dispatch = Dispatch.borrow(pc, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } diff --git a/src/engine/objects/Guild.java b/src/engine/objects/Guild.java index 8bac6c14..0791b85f 100644 --- a/src/engine/objects/Guild.java +++ b/src/engine/objects/Guild.java @@ -17,7 +17,6 @@ import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.AllianceChangeMsg; import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.UpdateClientAlliancesMsg; @@ -347,7 +346,7 @@ public class Guild extends AbstractWorldObject { if (Guild.sameGuild(player.getGuild(), toUpdate)) { Dispatch dispatch = Dispatch.borrow(player, ucam); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -357,7 +356,7 @@ public class Guild extends AbstractWorldObject { public static void UpdateClientAlliancesForPlayer(PlayerCharacter toUpdate) { UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(toUpdate.getGuild()); Dispatch dispatch = Dispatch.borrow(toUpdate, ucam); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @@ -637,7 +636,7 @@ public class Guild extends AbstractWorldObject { pc.setGuild(Guild.getErrantGuild()); pc.incVer(); - DispatchMessage.sendToAllInRange(pc, new GuildInfoMsg(pc, Guild.getErrantGuild(), 2)); + DispatchManager.sendToAllInRange(pc, new GuildInfoMsg(pc, Guild.getErrantGuild(), 2)); } @@ -993,7 +992,7 @@ public class Guild extends AbstractWorldObject { if (!Guild.sameGuild(player.getGuild(), this)) { msg.setMsgType(AllianceChangeMsg.ERROR_NOT_SAME_GUILD); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1001,7 +1000,7 @@ public class Guild extends AbstractWorldObject { if (!GuildStatusController.isInnerCouncil(player.getGuildStatus()) && !GuildStatusController.isGuildLeader(player.getGuildStatus())) { msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1009,7 +1008,7 @@ public class Guild extends AbstractWorldObject { if (!GuildStatusController.isFullMember(player.getGuildStatus())) { msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } } @@ -1027,7 +1026,7 @@ public class Guild extends AbstractWorldObject { if (recommendList.size() == 10) { msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1035,7 +1034,7 @@ public class Guild extends AbstractWorldObject { ErrorPopupMsg.sendErrorMsg(player, "This guild is already recommonded!"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1058,7 +1057,7 @@ public class Guild extends AbstractWorldObject { if (recommendList.size() == 10) { msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1066,7 +1065,7 @@ public class Guild extends AbstractWorldObject { ErrorPopupMsg.sendErrorMsg(player, "This guild is already recommonded!"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1088,7 +1087,7 @@ public class Guild extends AbstractWorldObject { if (allyList.size() == 10) { msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1096,7 +1095,7 @@ public class Guild extends AbstractWorldObject { ErrorPopupMsg.sendErrorMsg(player, "This guild is already an Ally!"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1105,7 +1104,7 @@ public class Guild extends AbstractWorldObject { Logger.error(this.getObjectUUID() + " Could not find alliance Guild"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1115,7 +1114,7 @@ public class Guild extends AbstractWorldObject { Logger.error(this.getObjectUUID() + " failed to update alliance Database"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1132,7 +1131,7 @@ public class Guild extends AbstractWorldObject { if (enemyList.size() == 10) { msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1140,7 +1139,7 @@ public class Guild extends AbstractWorldObject { ErrorPopupMsg.sendErrorMsg(player, "This guild is already an Enemy!"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1149,7 +1148,7 @@ public class Guild extends AbstractWorldObject { Logger.error(this.getObjectUUID() + " Could not find alliance Guild"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1159,7 +1158,7 @@ public class Guild extends AbstractWorldObject { Logger.error(this.getObjectUUID() + " failed to update alliance Database"); msg.setMsgType((byte) 15); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1177,7 +1176,7 @@ public class Guild extends AbstractWorldObject { // once here everything passed, send successMsg; msg.setMsgType(AllianceChangeMsg.INFO_SUCCESS); dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return true; } diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 3ded3ff7..1bc36a83 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -12,13 +12,13 @@ package engine.objects; import engine.exception.SerializationException; import engine.gameManager.ConfigManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.PowersManager; import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferReader; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.DeleteItemMsg; import engine.powers.EffectsBase; @@ -1069,7 +1069,7 @@ public class Item extends AbstractWorldObject { DeleteItemMsg deleteItemMsg = new DeleteItemMsg(this.getObjectType().ordinal(), this.getObjectUUID()); charItemMan.cleanupDupe(this); Dispatch dispatch = Dispatch.borrow(pc, deleteItemMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } @@ -1092,7 +1092,7 @@ public class Item extends AbstractWorldObject { DeleteItemMsg deleteItemMsg = new DeleteItemMsg(this.getObjectType().ordinal(), this.getObjectUUID()); charItemMan.cleanupDupe(this); Dispatch dispatch = Dispatch.borrow(pc, deleteItemMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); return false; } return true; diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 3c68ddc9..b288e295 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -21,7 +21,6 @@ import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.PetMsg; import engine.net.client.msg.PlaceAssetMsg; import engine.server.MBServerStatics; @@ -896,7 +895,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { dispatch = Dispatch.borrow((PlayerCharacter) this.guardCaptain, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } @@ -924,7 +923,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { petOwner.setPet(null); PetMsg petMsg = new PetMsg(5, null); dispatch = Dispatch.borrow(petOwner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } else { diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 74e3b2ca..603cd387 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -22,7 +22,6 @@ import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.PetMsg; import engine.net.client.msg.PlaceAssetMsg; import engine.server.MBServerStatics; @@ -669,7 +668,7 @@ public class NPC extends AbstractCharacter { PetMsg petMsg = new PetMsg(5, null); Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index b93e2d13..663fdd98 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -31,7 +31,6 @@ import engine.mbEnums; import engine.mbEnums.*; import engine.net.ByteBufferWriter; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.net.client.msg.login.CommitNewCharacterMsg; @@ -1478,7 +1477,7 @@ public class PlayerCharacter extends AbstractCharacter { if (disable) return; UpdateCharOrMobMessage ucm = new UpdateCharOrMobMessage(pc, 2, pc.getRank()); - DispatchMessage.sendToAllInRange(pc, ucm); + DispatchManager.sendToAllInRange(pc, ucm); } public static void GroundPlayer(PlayerCharacter groundee) { @@ -1490,7 +1489,7 @@ public class PlayerCharacter extends AbstractCharacter { ChangeAltitudeMsg msg = ChangeAltitudeMsg.GroundPlayerMsg(groundee); // force a landing - DispatchMessage.dispatchMsgToInterestArea(groundee, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); + DispatchManager.dispatchMsgToInterestArea(groundee, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); } @@ -1899,7 +1898,7 @@ public class PlayerCharacter extends AbstractCharacter { TargetedActionMsg targetedActionMsg = new TargetedActionMsg(this, true); Dispatch dispatch = Dispatch.borrow(this, targetedActionMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); String message = this.getFirstName(); @@ -1959,7 +1958,7 @@ public class PlayerCharacter extends AbstractCharacter { this.respawn(false, false, true); } else { TargetedActionMsg killmsg = new TargetedActionMsg(this, true); - DispatchMessage.dispatchMsgToInterestArea(this, killmsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(this, killmsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); } } catch (Exception e) { Logger.error(e); @@ -2665,7 +2664,7 @@ public class PlayerCharacter extends AbstractCharacter { rm.setToken(skill.getToken()); Dispatch dispatch = Dispatch.borrow(this, rm); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } else { Logger.error("Failed to force refine of skill " + skill.getObjectUUID() + " by character " + this.getObjectUUID()); @@ -2912,7 +2911,7 @@ public class PlayerCharacter extends AbstractCharacter { GrantExperienceMsg gem = new GrantExperienceMsg(this, remainingXP); Dispatch dispatch = Dispatch.borrow(this, gem); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); this.addDatabaseJob("EXP", MBServerStatics.FIVE_MINUTES); return; @@ -2927,7 +2926,7 @@ public class PlayerCharacter extends AbstractCharacter { GrantExperienceMsg grantExperienceMsg = new GrantExperienceMsg(this, remainingXP); Dispatch dispatch = Dispatch.borrow(this, grantExperienceMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); this.addDatabaseJob("EXP", MBServerStatics.FIVE_MINUTES); return; @@ -2938,7 +2937,7 @@ public class PlayerCharacter extends AbstractCharacter { GrantExperienceMsg grantExperienceMsg = new GrantExperienceMsg(this, remainingXP); remainingXP = 0; Dispatch dispatch = Dispatch.borrow(this, grantExperienceMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); this.addDatabaseJob("EXP", MBServerStatics.FIVE_MINUTES); return; @@ -2971,10 +2970,10 @@ public class PlayerCharacter extends AbstractCharacter { GrantExperienceMsg grantExperienceMsg = new GrantExperienceMsg(this, 1); Dispatch dispatch = Dispatch.borrow(this, grantExperienceMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); SetObjectValueMsg upm = new SetObjectValueMsg(this, 9); - DispatchMessage.dispatchMsgToInterestArea(this, upm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(this, upm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); checkGuildStatus(); this.addDatabaseJob("EXP", MBServerStatics.FIVE_MINUTES); // double overflow exp used up, remaining overflow will just add to level + 1. @@ -2986,9 +2985,9 @@ public class PlayerCharacter extends AbstractCharacter { this.overFlowEXP = 0; GrantExperienceMsg grantExperienceMsg = new GrantExperienceMsg(this, 1); Dispatch dispatch = Dispatch.borrow(this, grantExperienceMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); SetObjectValueMsg upm = new SetObjectValueMsg(this, 9); - DispatchMessage.dispatchMsgToInterestArea(this, upm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(this, upm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); checkGuildStatus(); this.addDatabaseJob("EXP", MBServerStatics.FIVE_MINUTES); } @@ -3006,13 +3005,13 @@ public class PlayerCharacter extends AbstractCharacter { GrantExperienceMsg grantExperienceMsg = new GrantExperienceMsg(this, neededXP); Dispatch dispatch = Dispatch.borrow(this, grantExperienceMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); remainingXP -= neededXP; //Send newLevel. SetObjectValueMsg upm = new SetObjectValueMsg(this, 9); - DispatchMessage.dispatchMsgToInterestArea(this, upm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(this, upm, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); checkGuildStatus(); } else { @@ -3020,7 +3019,7 @@ public class PlayerCharacter extends AbstractCharacter { GrantExperienceMsg grantExperienceMsg = new GrantExperienceMsg(this, remainingXP); remainingXP = 0; Dispatch dispatch = Dispatch.borrow(this, grantExperienceMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); this.addDatabaseJob("EXP", MBServerStatics.FIVE_MINUTES); } @@ -4200,7 +4199,7 @@ public class PlayerCharacter extends AbstractCharacter { toCommand.setCombatTarget(null); PetMsg petMsg = new PetMsg(6, toCommand); Dispatch dispatch = Dispatch.borrow(this, petMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); if (toCommand.isAlive()) WorldGrid.updateObject(toCommand); @@ -4772,7 +4771,7 @@ public class PlayerCharacter extends AbstractCharacter { ModifyHealthMsg modifyHealthMsg = new ModifyHealthMsg(null, this, 0, 1, 1, -1984683793, "", 0, 652920987); //mhm.setOmitFromChat(0); Dispatch dispatch = Dispatch.borrow(this, modifyHealthMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); } @@ -4850,7 +4849,7 @@ public class PlayerCharacter extends AbstractCharacter { moveToMsg.setSourceID(this.getObjectUUID()); Dispatch dispatch = Dispatch.borrow(this, moveToMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); try { MovementManager.movement(moveToMsg, this); diff --git a/src/engine/objects/PlayerFriends.java b/src/engine/objects/PlayerFriends.java index 1acc20cf..7868a028 100644 --- a/src/engine/objects/PlayerFriends.java +++ b/src/engine/objects/PlayerFriends.java @@ -10,10 +10,10 @@ package engine.objects; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.mbEnums.DispatchChannel; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.UpdateFriendStatusMessage; import java.sql.ResultSet; @@ -109,7 +109,7 @@ public class PlayerFriends { UpdateFriendStatusMessage outMsg = new UpdateFriendStatusMessage(player); outMsg.online = online; Dispatch dispatch = Dispatch.borrow(friend, outMsg); - DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); } } diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index 7bf3061c..f039d35e 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -11,10 +11,10 @@ package engine.objects; import engine.gameManager.ChatManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.loot.WorkOrder; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.*; import engine.server.MBServerStatics; @@ -111,7 +111,7 @@ public class Warehouse { vrm.setWarehouseBuilding(warehouseBuilding); vrm.configure(); dispatch = Dispatch.borrow(playerCharacter, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } public static void warehouseWithdraw(MerchantMsg msg, PlayerCharacter playerCharacter, NPC npc) { @@ -157,7 +157,7 @@ public class Warehouse { vrm.setWarehouseBuilding(warehouseBuilding); vrm.configure(); dispatch = Dispatch.borrow(playerCharacter, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } public static void warehouseLock(MerchantMsg msg, PlayerCharacter playerCharacter, NPC npc) { @@ -198,7 +198,7 @@ public class Warehouse { vrm.setWarehouseBuilding(warehouseBuilding); vrm.configure(); dispatch = Dispatch.borrow(playerCharacter, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else warehouse.locked.add(resourceType); @@ -215,7 +215,7 @@ public class Warehouse { vrm.setWarehouseBuilding(warehouseBuilding); vrm.configure(); dispatch = Dispatch.borrow(playerCharacter, vrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else warehouse.locked.remove(resourceType); @@ -279,7 +279,7 @@ public class Warehouse { UpdateGoldMsg ugm = new UpdateGoldMsg(playerCharacter); ugm.configure(); Dispatch dispatch = Dispatch.borrow(playerCharacter, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); itemMan.updateInventory(); @@ -464,7 +464,7 @@ public class Warehouse { UpdateGoldMsg ugm = new UpdateGoldMsg(playerCharacter); ugm.configure(); Dispatch dispatch = Dispatch.borrow(playerCharacter, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); itemMan.updateInventory(); } else { @@ -537,7 +537,7 @@ public class Warehouse { UpdateGoldMsg ugm = new UpdateGoldMsg(playerCharacter); ugm.configure(); Dispatch dispatch = Dispatch.borrow(playerCharacter, ugm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); itemMan.updateInventory(); } else { diff --git a/src/engine/powers/EffectsBase.java b/src/engine/powers/EffectsBase.java index 24043173..cf1f1e26 100644 --- a/src/engine/powers/EffectsBase.java +++ b/src/engine/powers/EffectsBase.java @@ -10,6 +10,7 @@ package engine.powers; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.PowersManager; import engine.job.JobContainer; import engine.jobs.AbstractEffectJob; @@ -21,7 +22,6 @@ import engine.mbEnums.EffectSourceType; import engine.mbEnums.GameObjectType; import engine.mbEnums.PowerFailCondition; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.ApplyEffectMsg; import engine.objects.AbstractCharacter; @@ -441,7 +441,7 @@ public class EffectsBase { // pum.setDuration((pb.isChant()) ? (int)pb.getChantDuration() : ab.getDurationInSeconds(trains)); pum.setPowerUsedID(pb.getToken()); pum.setPowerUsedName(pb.getName()); - DispatchMessage.sendToAllInRange(awo, pum); + DispatchManager.sendToAllInRange(awo, pum); } if (awo.getObjectType().equals(GameObjectType.Item)) { @@ -497,7 +497,7 @@ public class EffectsBase { pum.setDuration(-1); pum.setPowerUsedID(pb.getToken()); pum.setPowerUsedName(pb.getName()); - DispatchMessage.sendToAllInRange(awo, pum); + DispatchManager.sendToAllInRange(awo, pum); } } @@ -528,7 +528,7 @@ public class EffectsBase { if (source.getObjectType() == GameObjectType.PlayerCharacter) { Dispatch dispatch = Dispatch.borrow((PlayerCharacter) source, pum); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } } @@ -582,7 +582,7 @@ public class EffectsBase { pum.setPowerUsedName(pb.getName()); Dispatch dispatch = Dispatch.borrow(conn.getPlayerCharacter(), pum); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } @@ -634,7 +634,7 @@ public class EffectsBase { pum.setPowerUsedName(this.name); Dispatch dispatch = Dispatch.borrow(conn.getPlayerCharacter(), pum); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } } diff --git a/src/engine/powers/effectmodifiers/HealthEffectModifier.java b/src/engine/powers/effectmodifiers/HealthEffectModifier.java index 525b7d13..09e53c6b 100644 --- a/src/engine/powers/effectmodifiers/HealthEffectModifier.java +++ b/src/engine/powers/effectmodifiers/HealthEffectModifier.java @@ -9,6 +9,7 @@ package engine.powers.effectmodifiers; +import engine.gameManager.DispatchManager; import engine.jobs.AbstractEffectJob; import engine.jobs.DamageOverTimeJob; import engine.mbEnums; @@ -16,7 +17,6 @@ import engine.mbEnums.GameObjectType; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; import engine.net.AbstractNetMsg; -import engine.net.DispatchMessage; import engine.net.client.msg.ModifyHealthKillMsg; import engine.net.client.msg.ModifyHealthMsg; import engine.objects.*; @@ -196,7 +196,7 @@ public class HealthEffectModifier extends AbstractEffectModifier { if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) { ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID); mhm.setUnknown03(5); //set target is immune - DispatchMessage.sendToAllInRange(ac, mhm); + DispatchManager.sendToAllInRange(ac, mhm); return; } } @@ -224,7 +224,7 @@ public class HealthEffectModifier extends AbstractEffectModifier { //send the damage - DispatchMessage.sendToAllInRange(ac, mhm); + DispatchManager.sendToAllInRange(ac, mhm); // //send corpse if this kills a mob // //TODO fix the someone misses blurb. @@ -264,7 +264,7 @@ public class HealthEffectModifier extends AbstractEffectModifier { //send the damage - DispatchMessage.sendToAllInRange(b, mhm); + DispatchManager.sendToAllInRange(b, mhm); } } diff --git a/src/engine/powers/effectmodifiers/ManaEffectModifier.java b/src/engine/powers/effectmodifiers/ManaEffectModifier.java index 184e8b7d..cfa30efe 100644 --- a/src/engine/powers/effectmodifiers/ManaEffectModifier.java +++ b/src/engine/powers/effectmodifiers/ManaEffectModifier.java @@ -9,12 +9,12 @@ package engine.powers.effectmodifiers; +import engine.gameManager.DispatchManager; import engine.jobs.AbstractEffectJob; import engine.jobs.DamageOverTimeJob; import engine.mbEnums; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; -import engine.net.DispatchMessage; import engine.net.client.msg.ModifyHealthMsg; import engine.objects.*; import engine.powers.ActionsBase; @@ -145,7 +145,7 @@ public class ManaEffectModifier extends AbstractEffectModifier { if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) { ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID); mhm.setUnknown03(5); //set target is immune - DispatchMessage.sendToAllInRange(ac, mhm); + DispatchManager.sendToAllInRange(ac, mhm); return; } } @@ -156,7 +156,7 @@ public class ManaEffectModifier extends AbstractEffectModifier { effectID); if (effect instanceof DamageOverTimeJob) mhm.setOmitFromChat(1); - DispatchMessage.sendToAllInRange(ac, mhm); + DispatchManager.sendToAllInRange(ac, mhm); } } diff --git a/src/engine/powers/effectmodifiers/StaminaEffectModifier.java b/src/engine/powers/effectmodifiers/StaminaEffectModifier.java index 9e325c95..9567cfd0 100644 --- a/src/engine/powers/effectmodifiers/StaminaEffectModifier.java +++ b/src/engine/powers/effectmodifiers/StaminaEffectModifier.java @@ -9,12 +9,12 @@ package engine.powers.effectmodifiers; +import engine.gameManager.DispatchManager; +import engine.jobs.AbstractEffectJob; +import engine.jobs.DamageOverTimeJob; import engine.mbEnums; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; -import engine.jobs.AbstractEffectJob; -import engine.jobs.DamageOverTimeJob; -import engine.net.DispatchMessage; import engine.net.client.msg.ModifyHealthMsg; import engine.objects.*; import engine.powers.ActionsBase; @@ -143,7 +143,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier { if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) { ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID); mhm.setUnknown03(5); //set target is immune - DispatchMessage.sendToAllInRange(ac, mhm); + DispatchManager.sendToAllInRange(ac, mhm); return; } @@ -155,7 +155,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier { effectID); if (effect instanceof DamageOverTimeJob) mhm.setOmitFromChat(1); - DispatchMessage.sendToAllInRange(ac, mhm); + DispatchManager.sendToAllInRange(ac, mhm); } } diff --git a/src/engine/powers/poweractions/ApplyEffectPowerAction.java b/src/engine/powers/poweractions/ApplyEffectPowerAction.java index 7f03842c..c4f61bb2 100644 --- a/src/engine/powers/poweractions/ApplyEffectPowerAction.java +++ b/src/engine/powers/poweractions/ApplyEffectPowerAction.java @@ -11,6 +11,7 @@ package engine.powers.poweractions; import engine.InterestManagement.WorldGrid; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.jobs.ChantJob; import engine.jobs.DeferredPowerJob; import engine.jobs.FinishEffectTimeJob; @@ -18,7 +19,6 @@ import engine.math.Vector3fImmutable; import engine.mbEnums.GameObjectType; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; -import engine.net.DispatchMessage; import engine.net.client.msg.chat.ChatSystemMsg; import engine.objects.*; import engine.powers.ActionsBase; @@ -117,7 +117,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction { if (awo != null && awo.getObjectType() == GameObjectType.Mob) { ChatSystemMsg msg = ChatManager.CombatInfo(source, awo); - DispatchMessage.sendToAllInRange(source, msg); + DispatchManager.sendToAllInRange(source, msg); } } if (awo != null && awo.getObjectType() == GameObjectType.Mob) { @@ -249,7 +249,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction { if (awo != null && awo.getObjectType() == GameObjectType.Mob) { ((Mob) awo).setCombatTarget(source); ChatSystemMsg msg = ChatManager.CombatInfo(source, awo); - DispatchMessage.sendToAllInRange(source, msg); + DispatchManager.sendToAllInRange(source, msg); } } this.effect.startEffect(source, awo, trains, eff); diff --git a/src/engine/powers/poweractions/CreateMobPowerAction.java b/src/engine/powers/poweractions/CreateMobPowerAction.java index 25d4c979..88964b2c 100644 --- a/src/engine/powers/poweractions/CreateMobPowerAction.java +++ b/src/engine/powers/poweractions/CreateMobPowerAction.java @@ -11,12 +11,12 @@ package engine.powers.poweractions; import engine.InterestManagement.WorldGrid; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.NPCManager; import engine.gameManager.ZoneManager; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.PetMsg; import engine.objects.*; @@ -142,7 +142,7 @@ public class CreateMobPowerAction extends AbstractPowerAction { pet.setHealth(pet.healthMax); PetMsg pm = new PetMsg(5, pet); Dispatch dispatch = Dispatch.borrow(owner, pm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @Override diff --git a/src/engine/powers/poweractions/PeekPowerAction.java b/src/engine/powers/poweractions/PeekPowerAction.java index b94c6e73..eef1cf20 100644 --- a/src/engine/powers/poweractions/PeekPowerAction.java +++ b/src/engine/powers/poweractions/PeekPowerAction.java @@ -10,10 +10,10 @@ package engine.powers.poweractions; import engine.gameManager.ChatManager; +import engine.gameManager.DispatchManager; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.msg.LootWindowResponseMsg; import engine.objects.*; import engine.powers.ActionsBase; @@ -120,7 +120,7 @@ public class PeekPowerAction extends AbstractPowerAction { return; Dispatch dispatch = Dispatch.borrow(pc, lwrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } @Override diff --git a/src/engine/powers/poweractions/RecallPowerAction.java b/src/engine/powers/poweractions/RecallPowerAction.java index 75d90d5a..340b6261 100644 --- a/src/engine/powers/poweractions/RecallPowerAction.java +++ b/src/engine/powers/poweractions/RecallPowerAction.java @@ -10,12 +10,12 @@ package engine.powers.poweractions; import engine.InterestManagement.WorldGrid; +import engine.gameManager.DispatchManager; import engine.gameManager.MovementManager; import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.GameObjectType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.PromptRecallMsg; import engine.objects.AbstractCharacter; @@ -56,7 +56,7 @@ public class RecallPowerAction extends AbstractPowerAction { pc.setTimeStamp("LastRecallType", 1); //recall to bind PromptRecallMsg promptRecallMsgmsg = new PromptRecallMsg(); Dispatch dispatch = Dispatch.borrow(pc, promptRecallMsgmsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } else { MovementManager.translocate(awoac, awoac.getBindLoc()); diff --git a/src/engine/powers/poweractions/RunegateTeleportPowerAction.java b/src/engine/powers/poweractions/RunegateTeleportPowerAction.java index 67ca652a..860f9fe1 100644 --- a/src/engine/powers/poweractions/RunegateTeleportPowerAction.java +++ b/src/engine/powers/poweractions/RunegateTeleportPowerAction.java @@ -12,7 +12,7 @@ package engine.powers.poweractions; import engine.mbEnums; import engine.math.Vector3fImmutable; import engine.net.Dispatch; -import engine.net.DispatchMessage; +import engine.gameManager.DispatchManager; import engine.net.client.msg.PromptRecallMsg; import engine.objects.*; import engine.powers.ActionsBase; @@ -63,7 +63,7 @@ public class RunegateTeleportPowerAction extends AbstractPowerAction { if (rg != null) { PromptRecallMsg promptRecallMsgmsg = new PromptRecallMsg(); Dispatch dispatch = Dispatch.borrow(pc, promptRecallMsgmsg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } } else { diff --git a/src/engine/powers/poweractions/StealPowerAction.java b/src/engine/powers/poweractions/StealPowerAction.java index 0e9e0019..9260e4c2 100644 --- a/src/engine/powers/poweractions/StealPowerAction.java +++ b/src/engine/powers/poweractions/StealPowerAction.java @@ -9,13 +9,13 @@ package engine.powers.poweractions; -import engine.mbEnums; -import engine.mbEnums.ItemType; import engine.gameManager.ChatManager; import engine.gameManager.CombatManager; +import engine.gameManager.DispatchManager; import engine.math.Vector3fImmutable; +import engine.mbEnums; +import engine.mbEnums.ItemType; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.LootMsg; import engine.objects.*; @@ -172,7 +172,7 @@ public class StealPowerAction extends AbstractPowerAction { //send loot message to person stealing. LootMsg lm = new LootMsg(source.getObjectType().ordinal(), source.getObjectUUID(), owner.getObjectType().ordinal(), owner.getObjectUUID(), tar); Dispatch dispatch = Dispatch.borrow(sourcePlayer, lm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); //update thief's inventory if (sourcePlayer.charItemManager != null) diff --git a/src/engine/powers/poweractions/SummonPowerAction.java b/src/engine/powers/poweractions/SummonPowerAction.java index 810d519a..283bca54 100644 --- a/src/engine/powers/poweractions/SummonPowerAction.java +++ b/src/engine/powers/poweractions/SummonPowerAction.java @@ -9,12 +9,12 @@ package engine.powers.poweractions; -import engine.mbEnums; +import engine.gameManager.DispatchManager; import engine.gameManager.SessionManager; import engine.gameManager.ZoneManager; import engine.math.Vector3fImmutable; +import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.client.ClientConnection; import engine.net.client.msg.RecvSummonsMsg; import engine.objects.AbstractCharacter; @@ -61,7 +61,7 @@ public class SummonPowerAction extends AbstractPowerAction { location, false); Dispatch dispatch = Dispatch.borrow(target, rsrm); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); } diff --git a/src/engine/powers/poweractions/TransferStatPowerAction.java b/src/engine/powers/poweractions/TransferStatPowerAction.java index eb43391a..4abe41bf 100644 --- a/src/engine/powers/poweractions/TransferStatPowerAction.java +++ b/src/engine/powers/poweractions/TransferStatPowerAction.java @@ -9,12 +9,12 @@ package engine.powers.poweractions; +import engine.gameManager.DispatchManager; +import engine.math.Vector3fImmutable; import engine.mbEnums; import engine.mbEnums.ModType; import engine.mbEnums.SourceType; -import engine.math.Vector3fImmutable; import engine.net.AbstractNetMsg; -import engine.net.DispatchMessage; import engine.net.client.msg.ModifyHealthKillMsg; import engine.net.client.msg.ModifyHealthMsg; import engine.objects.*; @@ -239,7 +239,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { if (from.getBonuses().getBool(ModType.ImmuneTo, SourceType.Drain)) { ModifyHealthMsg mhm = new ModifyHealthMsg(source, to, 0f, 0f, 0f, powerID, powerName, trains, effectID); mhm.setUnknown03(5); //set target is immune - DispatchMessage.sendToAllInRange(from, mhm); + DispatchManager.sendToAllInRange(from, mhm); return; } @@ -271,8 +271,8 @@ public class TransferStatPowerAction extends AbstractPowerAction { mhmFrom = new ModifyHealthMsg(source, from, 0f, 0f, -fromAmount, powerID, powerName, trains, effectID); } - DispatchMessage.sendToAllInRange(to, mhmTo); - DispatchMessage.sendToAllInRange(from, mhmFrom); + DispatchManager.sendToAllInRange(to, mhmTo); + DispatchManager.sendToAllInRange(from, mhmFrom); } } diff --git a/src/engine/server/login/LoginServer.java b/src/engine/server/login/LoginServer.java index 341221b7..d3c55966 100644 --- a/src/engine/server/login/LoginServer.java +++ b/src/engine/server/login/LoginServer.java @@ -15,7 +15,6 @@ import engine.jobs.CSessionCleanupJob; import engine.jobs.DisconnectJob; import engine.mbEnums; import engine.net.Dispatch; -import engine.net.DispatchMessage; import engine.net.Network; import engine.net.Protocol; import engine.net.client.ClientConnection; @@ -192,7 +191,7 @@ public class LoginServer { origin.sendMsg(msg); } else { Dispatch dispatch = Dispatch.borrow(player, msg); - DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); + DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); } diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 08efd842..f9d7324a 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -25,7 +25,6 @@ import engine.mbEnums.MinionType; import engine.mbEnums.SupportMsgType; import engine.mobileAI.Threads.MobAIThread; import engine.mobileAI.Threads.ReSpawner; -import engine.net.DispatchMessage; import engine.net.Network; import engine.net.Protocol; import engine.net.client.ClientConnection; @@ -261,7 +260,7 @@ public class WorldServer { initDatabaselayer(); Logger.info("Starting network Dispatcher"); - DispatchMessage.startMessagePump(); + DispatchManager.startMessagePump(); Logger.info("Setting cross server session behavior"); SessionManager.setCrossServerBehavior(1); // Sets cross server behavior @@ -552,7 +551,7 @@ public class WorldServer { updateStateMsg.setPlayer(playerCharacter); updateStateMsg.setActivity(5); - DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); + DispatchManager.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); if (playerCharacter.region != null) if (PlayerCharacter.CanBindToBuilding(playerCharacter, playerCharacter.region.parentBuildingID)) @@ -733,7 +732,7 @@ public class WorldServer { ChatSystemMsg msg = new ChatSystemMsg(null, flashString); msg.setChannel(mbEnums.ChatChannelType.FLASH.getChannelID()); msg.setMessageType(mbEnums.ChatMessageType.INFO.ordinal()); - DispatchMessage.dispatchMsgToAll(msg); + DispatchManager.dispatchMsgToAll(msg); // Delete file diff --git a/src/engine/workthreads/HourlyJobThread.java b/src/engine/workthreads/HourlyJobThread.java index 057ca27d..ecbf93e4 100644 --- a/src/engine/workthreads/HourlyJobThread.java +++ b/src/engine/workthreads/HourlyJobThread.java @@ -14,7 +14,6 @@ import engine.db.archive.DataWarehouse; import engine.db.archive.MineRecord; import engine.gameManager.*; import engine.mbEnums; -import engine.net.DispatchMessage; import engine.net.MessageDispatcher; import engine.net.client.msg.chat.ChatSystemMsg; import engine.objects.*; @@ -169,7 +168,7 @@ public class HourlyJobThread implements Runnable { ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().parent.zoneName + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active."); chatMsg.setMessageType(10); chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(chatMsg); + DispatchManager.dispatchMsgToAll(chatMsg); // Warehouse this claim event diff --git a/src/engine/workthreads/TransferCityThread.java b/src/engine/workthreads/TransferCityThread.java index bb59d3a1..33006d6f 100644 --- a/src/engine/workthreads/TransferCityThread.java +++ b/src/engine/workthreads/TransferCityThread.java @@ -15,11 +15,11 @@ package engine.workthreads; * */ -import engine.mbEnums; import engine.gameManager.BuildingManager; import engine.gameManager.DbManager; +import engine.gameManager.DispatchManager; import engine.gameManager.GuildManager; -import engine.net.DispatchMessage; +import engine.mbEnums; import engine.net.client.msg.CityZoneMsg; import engine.objects.AbstractCharacter; import engine.objects.City; @@ -87,7 +87,7 @@ public class TransferCityThread implements Runnable { // Send updated cityZone to players CityZoneMsg czm = new CityZoneMsg(2, city.getTOL().getLoc().x, city.getTOL().getLoc().y, city.getTOL().getLoc().z, city.getTOL().getName(), city.getTOL().getParentZone(), 0f, 0f); - DispatchMessage.dispatchMsgToAll(czm); + DispatchManager.dispatchMsgToAll(czm); // Reset city timer for map update