Browse Source

DispatchManager is now an official manager singleton.

combat-2
MagicBot 6 months ago
parent
commit
96ba17f67a
  1. 16
      src/engine/InterestManagement/InterestManager.java
  2. 8
      src/engine/InterestManagement/RealmMap.java
  3. 22
      src/engine/InterestManagement/WorldGrid.java
  4. 4
      src/engine/devcmd/cmds/SetHealthCmd.java
  5. 4
      src/engine/devcmd/cmds/SetManaCmd.java
  6. 4
      src/engine/devcmd/cmds/SetPromotionClassCmd.java
  7. 4
      src/engine/devcmd/cmds/SetStaminaCmd.java
  8. 8
      src/engine/devcmd/cmds/SetSubRaceCmd.java
  9. 29
      src/engine/gameManager/ChatManager.java
  10. 17
      src/engine/gameManager/CombatManager.java
  11. 20
      src/engine/gameManager/DispatchManager.java
  12. 11
      src/engine/gameManager/ForgeManager.java
  13. 15
      src/engine/gameManager/GroupManager.java
  14. 7
      src/engine/gameManager/GuildManager.java
  15. 3
      src/engine/gameManager/LootManager.java
  16. 15
      src/engine/gameManager/MovementManager.java
  17. 3
      src/engine/gameManager/NPCManager.java
  18. 49
      src/engine/gameManager/PowersManager.java
  19. 4
      src/engine/jobs/ActivateBaneJob.java
  20. 6
      src/engine/jobs/DoorCloseJob.java
  21. 6
      src/engine/jobs/TrackJob.java
  22. 3
      src/engine/mobileAI/MobAI.java
  23. 12
      src/engine/net/MessageDispatcher.java
  24. 10
      src/engine/net/client/handlers/AcceptInviteToGuildHandler.java
  25. 4
      src/engine/net/client/handlers/AcceptSubInviteHandler.java
  26. 10
      src/engine/net/client/handlers/AcceptTradeRequestMsgHandler.java
  27. 5
      src/engine/net/client/handlers/ActivateNPCMsgHandler.java
  28. 8
      src/engine/net/client/handlers/AddGoldToTradeWindowMsgHandler.java
  29. 8
      src/engine/net/client/handlers/AddItemToTradeWindowMsgHandler.java
  30. 14
      src/engine/net/client/handlers/AllianceChangeMsgHandler.java
  31. 4
      src/engine/net/client/handlers/AllyEnemyListMsgHandler.java
  32. 4
      src/engine/net/client/handlers/AppointGroupLeaderHandler.java
  33. 5
      src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java
  34. 4
      src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java
  35. 4
      src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java
  36. 4
      src/engine/net/client/handlers/ArcOwnedMinesListHandler.java
  37. 4
      src/engine/net/client/handlers/ArcViewAssetTransactionsMsgHandler.java
  38. 12
      src/engine/net/client/handlers/AssetSupportMsgHandler.java
  39. 4
      src/engine/net/client/handlers/BanishUnbanishHandler.java
  40. 10
      src/engine/net/client/handlers/BreakFealtyHandler.java
  41. 4
      src/engine/net/client/handlers/ChangeAltitudeHandler.java
  42. 8
      src/engine/net/client/handlers/ChangeGuildLeaderHandler.java
  43. 8
      src/engine/net/client/handlers/ChangeRankHandler.java
  44. 4
      src/engine/net/client/handlers/CityChoiceMsgHandler.java
  45. 8
      src/engine/net/client/handlers/CityDataHandler.java
  46. 10
      src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java
  47. 4
      src/engine/net/client/handlers/CloseTradeWindowMsgHandler.java
  48. 4
      src/engine/net/client/handlers/DeleteItemMsgHandler.java
  49. 4
      src/engine/net/client/handlers/DisbandGuildHandler.java
  50. 8
      src/engine/net/client/handlers/DismissGuildHandler.java
  51. 6
      src/engine/net/client/handlers/DoorTryOpenMsgHandler.java
  52. 6
      src/engine/net/client/handlers/FriendAcceptHandler.java
  53. 4
      src/engine/net/client/handlers/FriendDeclineHandler.java
  54. 4
      src/engine/net/client/handlers/FriendRequestHandler.java
  55. 4
      src/engine/net/client/handlers/FurnitureHandler.java
  56. 6
      src/engine/net/client/handlers/GroupInviteHandler.java
  57. 4
      src/engine/net/client/handlers/GroupInviteResponseHandler.java
  58. 8
      src/engine/net/client/handlers/GuildControlHandler.java
  59. 10
      src/engine/net/client/handlers/GuildCreationFinalizeHandler.java
  60. 4
      src/engine/net/client/handlers/GuildCreationOptionsHandler.java
  61. 8
      src/engine/net/client/handlers/GuildInfoHandler.java
  62. 4
      src/engine/net/client/handlers/GuildTreeStatusMsgHandler.java
  63. 6
      src/engine/net/client/handlers/HirelingServiceMsgHandler.java
  64. 4
      src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java
  65. 8
      src/engine/net/client/handlers/InviteToGuildHandler.java
  66. 8
      src/engine/net/client/handlers/InviteToSubHandler.java
  67. 4
      src/engine/net/client/handlers/ItemFromVaultMsgHandler.java
  68. 28
      src/engine/net/client/handlers/ItemProductionMsgHandler.java
  69. 4
      src/engine/net/client/handlers/ItemToVaultMsgHandler.java
  70. 4
      src/engine/net/client/handlers/KeepAliveServerClientHandler.java
  71. 10
      src/engine/net/client/handlers/LeaveGuildHandler.java
  72. 4
      src/engine/net/client/handlers/LockUnlockDoorMsgHandler.java
  73. 20
      src/engine/net/client/handlers/LootMsgHandler.java
  74. 6
      src/engine/net/client/handlers/LootWindowRequestMsgHandler.java
  75. 4
      src/engine/net/client/handlers/MOTDCommitHandler.java
  76. 6
      src/engine/net/client/handlers/MOTDEditHandler.java
  77. 18
      src/engine/net/client/handlers/ManageCityAssetMsgHandler.java
  78. 11
      src/engine/net/client/handlers/MerchantMsgHandler.java
  79. 22
      src/engine/net/client/handlers/MinionTrainingMsgHandler.java
  80. 9
      src/engine/net/client/handlers/ObjectActionMsgHandler.java
  81. 26
      src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java
  82. 18
      src/engine/net/client/handlers/OrderNPCMsgHandler.java
  83. 4
      src/engine/net/client/handlers/PetCmdMsgHandler.java
  84. 4
      src/engine/net/client/handlers/PetitionReceivedMsgHandler.java
  85. 5
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  86. 4
      src/engine/net/client/handlers/RandomMsgHandler.java
  87. 6
      src/engine/net/client/handlers/RefineMsgHandler.java
  88. 4
      src/engine/net/client/handlers/RefinerScreenMsgHandler.java
  89. 6
      src/engine/net/client/handlers/RemoveFriendHandler.java
  90. 6
      src/engine/net/client/handlers/RemoveFromGroupHandler.java
  91. 6
      src/engine/net/client/handlers/RepairBuildingMsgHandler.java
  92. 10
      src/engine/net/client/handlers/RepairMsgHandler.java
  93. 12
      src/engine/net/client/handlers/RequestEnterWorldHandler.java
  94. 4
      src/engine/net/client/handlers/RequestGuildListHandler.java
  95. 6
      src/engine/net/client/handlers/RespawnMsgHandler.java
  96. 4
      src/engine/net/client/handlers/SetCombatModeMsgHandler.java
  97. 4
      src/engine/net/client/handlers/ShowMsgHandler.java
  98. 4
      src/engine/net/client/handlers/SocialMsgHandler.java
  99. 8
      src/engine/net/client/handlers/SwearInGuildHandler.java
  100. 6
      src/engine/net/client/handlers/SwearInHandler.java
  101. Some files were not shown because too many files have changed in this diff Show More

16
src/engine/InterestManagement/InterestManager.java

@ -8,6 +8,7 @@
package engine.InterestManagement; package engine.InterestManagement;
import engine.gameManager.DispatchManager;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.job.JobScheduler; import engine.job.JobScheduler;
@ -17,7 +18,6 @@ import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.LoadCharacterMsg; import engine.net.client.msg.LoadCharacterMsg;
import engine.net.client.msg.LoadStructureMsg; import engine.net.client.msg.LoadStructureMsg;
@ -88,7 +88,7 @@ public enum InterestManager implements Runnable {
if (send) { if (send) {
Dispatch dispatch = Dispatch.borrow(player, msg); 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); Dispatch dispatch = Dispatch.borrow(player, uom);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
loadedStaticObjects.removeAll(toRemove); loadedStaticObjects.removeAll(toRemove);
@ -292,7 +292,7 @@ public enum InterestManager implements Runnable {
lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(corpse, PlayerCharacter.hideNonAscii());
Dispatch dispatch = Dispatch.borrow(player, lcm); Dispatch dispatch = Dispatch.borrow(player, lcm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} else if (awo.getObjectType().equals(GameObjectType.NPC)) { } else if (awo.getObjectType().equals(GameObjectType.NPC)) {
NPC npc = (NPC) awo; NPC npc = (NPC) awo;
@ -304,13 +304,13 @@ public enum InterestManager implements Runnable {
if (lsm.getStructureList().size() > 0) { if (lsm.getStructureList().size() > 0) {
Dispatch dispatch = Dispatch.borrow(player, lsm); Dispatch dispatch = Dispatch.borrow(player, lsm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
for (LoadCharacterMsg lc : lcmList) { for (LoadCharacterMsg lc : lcmList) {
Dispatch dispatch = Dispatch.borrow(player, lc); Dispatch dispatch = Dispatch.borrow(player, lc);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
loadedStaticObjects.addAll(toLoad); loadedStaticObjects.addAll(toLoad);
@ -414,7 +414,7 @@ public enum InterestManager implements Runnable {
if (!uom.getObjectList().isEmpty()) { if (!uom.getObjectList().isEmpty()) {
Dispatch dispatch = Dispatch.borrow(player, uom); 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) { if (lcm != null) {
Dispatch dispatch = Dispatch.borrow(player, lcm); Dispatch dispatch = Dispatch.borrow(player, lcm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }

8
src/engine/InterestManagement/RealmMap.java

@ -8,10 +8,10 @@
package engine.InterestManagement; package engine.InterestManagement;
import engine.gameManager.DispatchManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.msg.TerritoryChangeMessage; import engine.net.client.msg.TerritoryChangeMessage;
import engine.objects.City; import engine.objects.City;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -91,17 +91,17 @@ public enum RealmMap {
if (city != null) { if (city != null) {
TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} else { } else {
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} else { } else {
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} }

22
src/engine/InterestManagement/WorldGrid.java

@ -8,11 +8,11 @@
package engine.InterestManagement; package engine.InterestManagement;
import engine.mbEnums.GridObjectType; import engine.gameManager.DispatchManager;
import engine.math.FastMath; import engine.math.FastMath;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.DispatchMessage; import engine.mbEnums.GridObjectType;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.LoadCharacterMsg; import engine.net.client.msg.LoadCharacterMsg;
import engine.net.client.msg.LoadStructureMsg; import engine.net.client.msg.LoadStructureMsg;
@ -201,7 +201,7 @@ public class WorldGrid {
UnloadObjectsMsg uom = new UnloadObjectsMsg(); UnloadObjectsMsg uom = new UnloadObjectsMsg();
uom.addObject(awo); uom.addObject(awo);
DispatchMessage.sendToAllInRange(awo, uom); DispatchManager.sendToAllInRange(awo, uom);
} }
public static void loadObject(AbstractWorldObject awo) { public static void loadObject(AbstractWorldObject awo) {
@ -213,15 +213,15 @@ public class WorldGrid {
case Building: case Building:
lsm = new LoadStructureMsg(); lsm = new LoadStructureMsg();
lsm.addObject((Building) awo); lsm.addObject((Building) awo);
DispatchMessage.sendToAllInRange(awo, lsm); DispatchManager.sendToAllInRange(awo, lsm);
break; break;
case NPC: case NPC:
lcm = new LoadCharacterMsg((NPC) awo, false); lcm = new LoadCharacterMsg((NPC) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
case Mob: case Mob:
lcm = new LoadCharacterMsg((Mob) awo, false); lcm = new LoadCharacterMsg((Mob) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
default: default:
// *** Refactor: Log error? // *** Refactor: Log error?
@ -239,19 +239,19 @@ public class WorldGrid {
case Building: case Building:
lsm = new LoadStructureMsg(); lsm = new LoadStructureMsg();
lsm.addObject((Building) awo); lsm.addObject((Building) awo);
DispatchMessage.sendToAllInRange(awo, lsm); DispatchManager.sendToAllInRange(awo, lsm);
break; break;
case NPC: case NPC:
lcm = new LoadCharacterMsg((NPC) awo, false); lcm = new LoadCharacterMsg((NPC) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
case Mob: case Mob:
lcm = new LoadCharacterMsg((Mob) awo, false); lcm = new LoadCharacterMsg((Mob) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
case PlayerCharacter: case PlayerCharacter:
lcm = new LoadCharacterMsg((PlayerCharacter) awo, false); lcm = new LoadCharacterMsg((PlayerCharacter) awo, false);
DispatchMessage.sendToAllInRange(awo, lcm); DispatchManager.sendToAllInRange(awo, lcm);
break; break;
default: default:
// *** Refactor: Log error? // *** Refactor: Log error?
@ -263,7 +263,7 @@ public class WorldGrid {
ClientConnection origin) { ClientConnection origin) {
UnloadObjectsMsg uom = new UnloadObjectsMsg(); UnloadObjectsMsg uom = new UnloadObjectsMsg();
uom.addObject(awo); uom.addObject(awo);
DispatchMessage.sendToAllInRange(awo, uom); DispatchManager.sendToAllInRange(awo, uom);
} }
public static void addObject(AbstractWorldObject awo, PlayerCharacter pc) { public static void addObject(AbstractWorldObject awo, PlayerCharacter pc) {

4
src/engine/devcmd/cmds/SetHealthCmd.java

@ -11,7 +11,7 @@ package engine.devcmd.cmds;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -41,7 +41,7 @@ public class SetHealthCmd extends AbstractDevCmd {
// Update all surrounding clients. // Update all surrounding clients.
TargetedActionMsg cmm = new TargetedActionMsg(pc); 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) { } catch (NumberFormatException e) {
this.throwbackError(pc, "Supplied data: " + words[0] this.throwbackError(pc, "Supplied data: " + words[0]

4
src/engine/devcmd/cmds/SetManaCmd.java

@ -2,7 +2,7 @@ package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums; import engine.mbEnums;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -32,7 +32,7 @@ public class SetManaCmd extends AbstractDevCmd {
//Update all surrounding clients. - NOT for Mana? //Update all surrounding clients. - NOT for Mana?
TargetedActionMsg cmm = new TargetedActionMsg(pc); 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) { } catch (NumberFormatException e) {
this.throwbackError(pc, "Supplied data: " + words[0] this.throwbackError(pc, "Supplied data: " + words[0]

4
src/engine/devcmd/cmds/SetPromotionClassCmd.java

@ -4,7 +4,7 @@ import engine.mbEnums.DispatchChannel;
import engine.InterestManagement.InterestManager; import engine.InterestManagement.InterestManager;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.msg.ApplyRuneMsg; import engine.net.client.msg.ApplyRuneMsg;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -54,7 +54,7 @@ public class SetPromotionClassCmd extends AbstractDevCmd {
PromotionClass promo = pc.getPromotionClass(); PromotionClass promo = pc.getPromotionClass();
if (promo != null) { if (promo != null) {
ApplyRuneMsg arm = new ApplyRuneMsg(pc.getObjectType().ordinal(), pc.getObjectUUID(), promo.getObjectUUID(), promo.getObjectType().ordinal(), promo.getObjectUUID(), true); 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);
} }
} }

4
src/engine/devcmd/cmds/SetStaminaCmd.java

@ -11,7 +11,7 @@ package engine.devcmd.cmds;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -42,7 +42,7 @@ public class SetStaminaCmd extends AbstractDevCmd {
// Update all surrounding clients. // Update all surrounding clients.
TargetedActionMsg cmm = new TargetedActionMsg(pc); 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) { } catch (NumberFormatException e) {
this.throwbackError(pc, "Supplied data: " + words[0] this.throwbackError(pc, "Supplied data: " + words[0]

8
src/engine/devcmd/cmds/SetSubRaceCmd.java

@ -12,7 +12,7 @@ package engine.devcmd.cmds;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.msg.ApplyBuildingEffectMsg; import engine.net.client.msg.ApplyBuildingEffectMsg;
import engine.net.client.msg.UpdateCharOrMobMessage; import engine.net.client.msg.UpdateCharOrMobMessage;
import engine.objects.*; import engine.objects.*;
@ -39,13 +39,13 @@ public class SetSubRaceCmd extends AbstractDevCmd {
if (raceID == 0) if (raceID == 0)
raceID = player.getRaceID(); raceID = player.getRaceID();
UpdateCharOrMobMessage ucm = new UpdateCharOrMobMessage(player, 1, raceID); UpdateCharOrMobMessage ucm = new UpdateCharOrMobMessage(player, 1, raceID);
DispatchMessage.sendToAllInRange(player, ucm); DispatchManager.sendToAllInRange(player, ucm);
return; return;
} }
if (words[0].equals("all")) { if (words[0].equals("all")) {
for (int i = 15999; i < 16337; i++) { for (int i = 15999; i < 16337; i++) {
ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(4, 0, target.getObjectType().ordinal(), target.getObjectUUID(), i); ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(4, 0, target.getObjectType().ordinal(), target.getObjectUUID(), i);
DispatchMessage.sendToAllInRange((AbstractWorldObject) target, applyBuildingEffectMsg); DispatchManager.sendToAllInRange((AbstractWorldObject) target, applyBuildingEffectMsg);
try { try {
Thread.sleep(500); Thread.sleep(500);
} catch (InterruptedException e) { } catch (InterruptedException e) {
@ -56,7 +56,7 @@ public class SetSubRaceCmd extends AbstractDevCmd {
} else { } else {
ApplyBuildingEffectMsg applyBuildingEffectMsg = new ApplyBuildingEffectMsg(4, 0, target.getObjectType().ordinal(), target.getObjectUUID(), Integer.parseInt(words[0])); 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; return;

29
src/engine/gameManager/ChatManager.java

@ -17,7 +17,6 @@ import engine.mbEnums.GameObjectType;
import engine.mbEnums.ModType; import engine.mbEnums.ModType;
import engine.mbEnums.SourceType; import engine.mbEnums.SourceType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.MessageDispatcher; import engine.net.MessageDispatcher;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.handlers.ClientAdminCommandMsgHandler; import engine.net.client.handlers.ClientAdminCommandMsgHandler;
@ -87,7 +86,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); 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 // Make the Message
ChatSayMsg chatSayMsg = new ChatSayMsg(player, text); 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.setMessageType(4);
msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
Dispatch dispatch = Dispatch.borrow(targetPlayer, msg); 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 // Make the Message
ChatShoutMsg msg = new ChatShoutMsg(sender, text); 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 // Make the Message
ChatGlobalMsg msg = new ChatGlobalMsg(sender, text); 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 // Send dispatch to each player
Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg); Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
// Also send /tell to sender // Also send /tell to sender
if (pcSender != null) { if (pcSender != null) {
Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg); Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} else } else
@ -349,7 +348,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGuildMsg); 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) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatICMsg); 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) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGroupMsg); 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) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); 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) { public static void chatPVP(String text) {
// Create message // Create message
ChatPvPMsg msg = new ChatPvPMsg(null, text); ChatPvPMsg msg = new ChatPvPMsg(null, text);
DispatchMessage.dispatchMsgToAll(msg); DispatchManager.dispatchMsgToAll(msg);
} }
public static ChatSystemMsg CombatInfo(AbstractWorldObject source, AbstractWorldObject target) { public static ChatSystemMsg CombatInfo(AbstractWorldObject source, AbstractWorldObject target) {
@ -844,7 +843,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg); 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); chatSystemMsg.setChannel(channel);
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }

17
src/engine/gameManager/CombatManager.java

@ -13,7 +13,6 @@ import engine.job.JobScheduler;
import engine.jobs.AttackJob; import engine.jobs.AttackJob;
import engine.jobs.DeferredPowerJob; import engine.jobs.DeferredPowerJob;
import engine.mbEnums; import engine.mbEnums;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
import engine.net.client.msg.UpdateStateMsg; import engine.net.client.msg.UpdateStateMsg;
@ -272,9 +271,9 @@ public enum CombatManager {
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim); TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter) 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 else
DispatchMessage.sendToAllInRange(attacker, msg); DispatchManager.sendToAllInRange(attacker, msg);
//set auto attack job //set auto attack job
setAutoAttackJob(attacker, slot, delay); setAutoAttackJob(attacker, slot, delay);
@ -309,9 +308,9 @@ public enum CombatManager {
TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value); TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value);
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter) 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 else
DispatchMessage.sendToAllInRange(attacker, msg); DispatchManager.sendToAllInRange(attacker, msg);
//set auto attack job //set auto attack job
setAutoAttackJob(attacker, slot, delay); setAutoAttackJob(attacker, slot, delay);
@ -382,7 +381,7 @@ public enum CombatManager {
//apply Damage back //apply Damage back
attacker.modifyHealth(-total, absTarget, true); attacker.modifyHealth(-total, absTarget, true);
TargetedActionMsg cmm = new TargetedActionMsg(attacker, attacker, total, 0); 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); 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(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(playerCharacter); 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) { public static void toggleSit(boolean toggle, ClientConnection origin) {
@ -470,7 +469,7 @@ public enum CombatManager {
playerCharacter.setSit(toggle); playerCharacter.setSit(toggle);
UpdateStateMsg rwss = new UpdateStateMsg(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(playerCharacter); 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);
} }

20
src/engine/net/DispatchMessage.java → src/engine/gameManager/DispatchManager.java

@ -7,13 +7,15 @@
// www.magicbane.com // www.magicbane.com
package engine.net; package engine.gameManager;
import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable; 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.net.client.ClientConnection;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.objects.Item; import engine.objects.Item;
@ -31,7 +33,9 @@ import static engine.net.MessageDispatcher.maxRecipients;
* async message delivery system. * async message delivery system.
*/ */
public class DispatchMessage { public enum DispatchManager {
DISPATCH_MANAGER;
public static void startMessagePump() { public static void startMessagePump() {
@ -83,7 +87,7 @@ public class DispatchMessage {
sourcePlayer = (PlayerCharacter) sourceObject; sourcePlayer = (PlayerCharacter) sourceObject;
if (sourcePlayer.getClientConnection() != null && sendToSelf) { if (sourcePlayer.getClientConnection() != null && sendToSelf) {
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); 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) { if (sourcePlayer.getClientConnection() != null && sendToSelf) {
Dispatch dispatch = Dispatch.borrow(sourcePlayer, msg); 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; ClientConnection connection;
if (messageDispatch.player == null) { if (messageDispatch.player == null) {

11
src/engine/gameManager/ForgeManager.java

@ -12,7 +12,6 @@ import engine.loot.ModTableEntry;
import engine.loot.ModTypeTableEntry; import engine.loot.ModTypeTableEntry;
import engine.loot.WorkOrder; import engine.loot.WorkOrder;
import engine.mbEnums; import engine.mbEnums;
import engine.net.DispatchMessage;
import engine.net.client.msg.ItemProductionMsg; import engine.net.client.msg.ItemProductionMsg;
import engine.objects.City; import engine.objects.City;
import engine.objects.Item; import engine.objects.Item;
@ -81,7 +80,7 @@ public enum ForgeManager implements Runnable {
for (Item workOrderItem : workOrder.cooking) { for (Item workOrderItem : workOrder.cooking) {
workOrderItem.flags.add(mbEnums.ItemFlags.Identified); workOrderItem.flags.add(mbEnums.ItemFlags.Identified);
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); 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 // Set this workOrder to completed and update on disk
@ -322,9 +321,9 @@ public enum ForgeManager implements Runnable {
workOrder.vendor.charItemManager.addItemToInventory(completedItem); workOrder.vendor.charItemManager.addItemToInventory(completedItem);
ItemProductionMsg outMsg1 = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, completedItem, mbEnums.ProductionActionType.DEPOSIT, true); 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); 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); toRemove.add(virutalItem);
} }
@ -334,7 +333,7 @@ public enum ForgeManager implements Runnable {
// Remove virtual items from the forge window // Remove virtual items from the forge window
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, virtualItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true); 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 // Remove virtual item from all collections
@ -357,7 +356,7 @@ public enum ForgeManager implements Runnable {
// Update NPC window // Update NPC window
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, forged_item, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); 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; workOrder.total_produced = workOrder.total_produced + 1;
} }

15
src/engine/gameManager/GroupManager.java

@ -8,10 +8,9 @@
package engine.gameManager; package engine.gameManager;
import engine.mbEnums;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.UpdateGoldMsg; import engine.net.client.msg.UpdateGoldMsg;
import engine.net.client.msg.group.GroupUpdateMsg; import engine.net.client.msg.group.GroupUpdateMsg;
@ -80,7 +79,7 @@ public enum GroupManager {
groupUpdateMsg.setMessageType(3); groupUpdateMsg.setMessageType(3);
groupUpdateMsg.setPlayer(groupMember); groupUpdateMsg.setPlayer(groupMember);
Dispatch dispatch = Dispatch.borrow(source, groupUpdateMsg); 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()); gum.setPlayerUUID(groupMember.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(groupMember, gum); 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.setMessageType(1);
gum.setPlayer(groupMember); gum.setPlayer(groupMember);
Dispatch dispatch = Dispatch.borrow(groupMember, gum); 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); gum.setPlayer(playerToRefresh);
Dispatch dispatch = Dispatch.borrow(source, gum); Dispatch dispatch = Dispatch.borrow(source, gum);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
public static void RefreshOthersGroupList(PlayerCharacter source) { public static void RefreshOthersGroupList(PlayerCharacter source) {
@ -372,12 +371,12 @@ public enum GroupManager {
ugm.configure(); ugm.configure();
Dispatch dispatch = Dispatch.borrow(splitPlayer, ugm); Dispatch dispatch = Dispatch.borrow(splitPlayer, ugm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
UpdateGoldMsg updateTargetGold = new UpdateGoldMsg(tar); UpdateGoldMsg updateTargetGold = new UpdateGoldMsg(tar);
updateTargetGold.configure(); 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 // //TODO send group split message
String text = "Group Split: " + amount; String text = "Group Split: " + amount;

7
src/engine/gameManager/GuildManager.java

@ -12,7 +12,6 @@ import engine.mbEnums;
import engine.mbEnums.BuildingGroup; import engine.mbEnums.BuildingGroup;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.guild.AcceptInviteToGuildMsg; import engine.net.client.msg.guild.AcceptInviteToGuildMsg;
import engine.net.client.msg.guild.GuildInfoMsg; import engine.net.client.msg.guild.GuildInfoMsg;
@ -89,14 +88,14 @@ public enum GuildManager {
if (fromTeleportScreen) { if (fromTeleportScreen) {
dispatch = Dispatch.borrow(playerCharacter, msg); 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)) { if (DbManager.GuildQueries.ADD_TO_GUILDHISTORY(guild.getObjectUUID(), playerCharacter, DateTime.now(), historyType)) {
GuildHistory guildHistory = new GuildHistory(guild.getObjectUUID(), guild.getName(), DateTime.now(), historyType); GuildHistory guildHistory = new GuildHistory(guild.getObjectUUID(), guild.getName(), DateTime.now(), historyType);
playerCharacter.getGuildHistory().add(guildHistory); playerCharacter.getGuildHistory().add(guildHistory);
} }
DispatchMessage.sendToAllInRange(playerCharacter, new GuildInfoMsg(playerCharacter, guild, 2)); DispatchManager.sendToAllInRange(playerCharacter, new GuildInfoMsg(playerCharacter, guild, 2));
// Send guild join message // Send guild join message
@ -190,7 +189,7 @@ public enum GuildManager {
for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters()) for (PlayerCharacter player : SessionManager.getAllActivePlayerCharacters())
if (player.getGuild().equals(guild)) 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) { public static Boolean meetsLoreRequirements(Guild guild, PlayerCharacter player) {

3
src/engine/gameManager/LootManager.java

@ -10,7 +10,6 @@ package engine.gameManager;
import engine.loot.*; import engine.loot.*;
import engine.mbEnums; import engine.mbEnums;
import engine.net.DispatchMessage;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.*; 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?"); 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.setMessageType(10);
chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID()); chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg); DispatchManager.dispatchMsgToAll(chatMsg);
} }
} }

15
src/engine/gameManager/MovementManager.java

@ -18,7 +18,6 @@ import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.mbEnums.ModType; import engine.mbEnums.ModType;
import engine.mbEnums.SourceType; import engine.mbEnums.SourceType;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.MoveToPointMsg; import engine.net.client.msg.MoveToPointMsg;
import engine.net.client.msg.TeleportToPointMsg; import engine.net.client.msg.TeleportToPointMsg;
@ -50,9 +49,9 @@ public enum MovementManager {
UpdateStateMsg rssm = new UpdateStateMsg(); UpdateStateMsg rssm = new UpdateStateMsg();
rssm.setPlayer(ac); rssm.setPlayer(ac);
if (ac.getObjectType() == GameObjectType.PlayerCharacter) 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 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 it's not a player moving just send the message
if ((toMove.getObjectType() == GameObjectType.PlayerCharacter) == false) { if ((toMove.getObjectType() == GameObjectType.PlayerCharacter) == false) {
DispatchMessage.sendToAllInRange(toMove, msg); DispatchManager.sendToAllInRange(toMove, msg);
return; return;
} }
@ -253,9 +252,9 @@ public enum MovementManager {
player.setTimeStamp("lastMoveGate", System.currentTimeMillis()); player.setTimeStamp("lastMoveGate", System.currentTimeMillis());
if (collide) 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 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 // Handle formation movement if needed
@ -443,7 +442,7 @@ public enum MovementManager {
groupMsg.setStartCoord(member.getLoc()); groupMsg.setStartCoord(member.getLoc());
groupMsg.setEndCoord(destination); groupMsg.setEndCoord(destination);
groupMsg.clearTarget(); groupMsg.clearTarget();
DispatchMessage.sendToAllInRange(member, groupMsg); DispatchManager.sendToAllInRange(member, groupMsg);
// update group member // update group member
member.setFaceDir(destination.subtract2D(member.getLoc()).normalize()); member.setFaceDir(destination.subtract2D(member.getLoc()).normalize());
@ -463,7 +462,7 @@ public enum MovementManager {
InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) teleporter); InterestManager.INTERESTMANAGER.HandleLoadForTeleport((PlayerCharacter) teleporter);
TeleportToPointMsg msg = new TeleportToPointMsg(teleporter, teleporter.loc.getX(), teleporter.loc.getY(), teleporter.loc.getZ(), 0, -1, -1); 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);
} }

3
src/engine/gameManager/NPCManager.java

@ -15,7 +15,6 @@ import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.PetMsg; import engine.net.client.msg.PetMsg;
@ -69,7 +68,7 @@ public enum NPCManager {
PetMsg petMsg = new PetMsg(5, null); PetMsg petMsg = new PetMsg(5, null);
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} }

49
src/engine/gameManager/PowersManager.java

@ -25,7 +25,6 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums.*; import engine.mbEnums.*;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -191,7 +190,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
// Send Fail to cast message // Send Fail to cast message
PlayerCharacter pc = SessionManager PlayerCharacter pc = SessionManager
@ -244,7 +243,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
return false; return false;
} }
@ -488,7 +487,7 @@ public enum PowersManager {
0f, 0f, 0, null, 0f, 0f, 0, null,
9999, 0); 9999, 0);
mhm.setOmitFromChat(1); 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()) else if (pb.useMana())
if (playerCharacter.getMana() < cost) if (playerCharacter.getMana() < cost)
@ -519,7 +518,7 @@ public enum PowersManager {
// else send recycle message to unlock power // else send recycle message to unlock power
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID()); RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, recyclePowerMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} }
//what the fuck? //what the fuck?
@ -529,7 +528,7 @@ public enum PowersManager {
// else // else
// msg.setUnknown04(1); // Regular Race, use mana? // msg.setUnknown04(1); // Regular Race, use mana?
int tr = msg.getNumTrains(); 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.. //Make new msg..
PerformActionMsg copyMsg = new PerformActionMsg(msg); PerformActionMsg copyMsg = new PerformActionMsg(msg);
@ -540,7 +539,7 @@ public enum PowersManager {
playerCharacter.update(); playerCharacter.update();
playerCharacter.setSit(false); playerCharacter.setSit(false);
UpdateStateMsg updateStateMsg = new UpdateStateMsg(playerCharacter); 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); msg.setNumTrains(9999);
DispatchMessage.sendToAllInRange(caster, msg); DispatchManager.sendToAllInRange(caster, msg);
DispatchMessage.sendToAllInRange(caster, msg); DispatchManager.sendToAllInRange(caster, msg);
msg.setNumTrains(tr); msg.setNumTrains(tr);
@ -751,7 +750,7 @@ public enum PowersManager {
performActionMsg.setUnknown04(2); performActionMsg.setUnknown04(2);
dispatch = Dispatch.borrow(playerCharacter, performActionMsg); 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; return;
} }
@ -992,7 +991,7 @@ public enum PowersManager {
PerformActionMsg castMsg = new PerformActionMsg(msg); PerformActionMsg castMsg = new PerformActionMsg(msg);
castMsg.setNumTrains(9999); castMsg.setNumTrains(9999);
castMsg.setUnknown04(2); 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; msgCasted = true;
} }
} }
@ -1002,7 +1001,7 @@ public enum PowersManager {
PerformActionMsg castMsg = new PerformActionMsg(msg); PerformActionMsg castMsg = new PerformActionMsg(msg);
castMsg.setNumTrains(9999); castMsg.setNumTrains(9999);
castMsg.setUnknown04(2); 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; msgCasted = true;
} }
@ -1063,7 +1062,7 @@ public enum PowersManager {
msg.setNumTrains(9999); msg.setNumTrains(9999);
msg.setUnknown04(2); msg.setUnknown04(2);
DispatchMessage.sendToAllInRange(caster, msg); DispatchManager.sendToAllInRange(caster, msg);
// get target loc // get target loc
Vector3fImmutable targetLoc = msg.getTargetLoc(); Vector3fImmutable targetLoc = msg.getTargetLoc();
@ -1170,7 +1169,7 @@ public enum PowersManager {
// TODO echo power use to everyone else // TODO echo power use to everyone else
msg.setNumTrains(9999); msg.setNumTrains(9999);
msg.setUnknown04(2); msg.setUnknown04(2);
DispatchMessage.sendToAllInRange(caster, msg); DispatchManager.sendToAllInRange(caster, msg);
} }
@ -1248,7 +1247,7 @@ public enum PowersManager {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token); RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token);
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg); 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(), PerformActionMsg msg = new PerformActionMsg(pb.getToken(),
trains, ac.getObjectType().ordinal(), ac.getObjectUUID(), tarType, tarID, 0, trains, ac.getObjectType().ordinal(), ac.getObjectUUID(), tarType, tarID, 0,
0, 0, 1, 0); 0, 0, 1, 0);
DispatchMessage.sendToAllInRange(target, msg); DispatchManager.sendToAllInRange(target, msg);
ConcurrentHashMap<String, JobContainer> timers = ac.getTimers(); ConcurrentHashMap<String, JobContainer> timers = ac.getTimers();
@ -1492,7 +1491,7 @@ public enum PowersManager {
.getObjectType().ordinal(), ac.getObjectUUID(), target.getObjectType().ordinal(), .getObjectType().ordinal(), ac.getObjectUUID(), target.getObjectType().ordinal(),
target.getObjectUUID(), 0, 0, 0, 2, 0); 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); RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token);
Dispatch dispatch = Dispatch.borrow(pc, recyclePowerMsg); 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 3:
case 4: case 4:
msg.setUnknown04(2); 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; break;
default: default:
msg.setUnknown04(1); msg.setUnknown04(1);
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); 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()); ApplyEffectMsg aem = new ApplyEffectMsg(pc, pc, 0, eb.getToken(), 9, pb.getToken(), pb.getName());
aem.setUnknown03(type); 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) { } catch (Exception e) {
@ -2147,7 +2146,7 @@ public enum PowersManager {
aem.setUnknown03(type); aem.setUnknown03(type);
aem.setUnknown05(1); 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) { } catch (Exception e) {
@ -2162,7 +2161,7 @@ public enum PowersManager {
switch (type) { switch (type) {
case 3: case 3:
case 4: case 4:
DispatchMessage.sendToAllInRange(mob, msg); DispatchManager.sendToAllInRange(mob, msg);
} }
} }
@ -2401,7 +2400,7 @@ public enum PowersManager {
if (pam != null) { if (pam != null) {
pam.setNumTrains(9999); pam.setNumTrains(9999);
pam.setUnknown04(2); 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 PerformActionMsg pam = new PerformActionMsg(pb.getToken(), 9999, ac
.getObjectType().ordinal(), ac.getObjectUUID(), target.getObjectType().ordinal(), .getObjectType().ordinal(), ac.getObjectUUID(), target.getObjectType().ordinal(),
target.getObjectUUID(), 0, 0, 0, 2, 0); target.getObjectUUID(), 0, 0, 0, 2, 0);
DispatchMessage.sendToAllInRange(ac, pam); DispatchManager.sendToAllInRange(ac, pam);
} }
} }

4
src/engine/jobs/ActivateBaneJob.java

@ -10,10 +10,10 @@
package engine.jobs; package engine.jobs;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.ChatChannelType; import engine.mbEnums.ChatChannelType;
import engine.net.DispatchMessage;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.City; import engine.objects.City;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -66,7 +66,7 @@ public class ActivateBaneJob extends AbstractScheduleJob {
msg.setMessageType(4); // Error message msg.setMessageType(4); // Error message
msg.setChannel(ChatChannelType.SYSTEM.getChannelID()); msg.setChannel(ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(msg); DispatchManager.dispatchMsgToAll(msg);
} }
@Override @Override

6
src/engine/jobs/DoorCloseJob.java

@ -9,9 +9,9 @@
package engine.jobs; package engine.jobs;
import engine.mbEnums.DoorState; import engine.gameManager.DispatchManager;
import engine.job.AbstractScheduleJob; import engine.job.AbstractScheduleJob;
import engine.net.DispatchMessage; import engine.mbEnums.DoorState;
import engine.net.client.msg.DoorTryOpenMsg; import engine.net.client.msg.DoorTryOpenMsg;
import engine.objects.Blueprint; import engine.objects.Blueprint;
import engine.objects.Building; import engine.objects.Building;
@ -40,7 +40,7 @@ public class DoorCloseJob extends AbstractScheduleJob {
this.building.setDoorState(doorNumber, DoorState.CLOSED); this.building.setDoorState(doorNumber, DoorState.CLOSED);
DoorTryOpenMsg msg = new DoorTryOpenMsg(door, this.building.getObjectUUID(), 0, (byte) 0); DoorTryOpenMsg msg = new DoorTryOpenMsg(door, this.building.getObjectUUID(), 0, (byte) 0);
DispatchMessage.sendToAllInRange(building, msg); DispatchManager.sendToAllInRange(building, msg);
} }

6
src/engine/jobs/TrackJob.java

@ -9,11 +9,11 @@
package engine.jobs; package engine.jobs;
import engine.mbEnums; import engine.gameManager.DispatchManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.msg.TrackArrowMsg; import engine.net.client.msg.TrackArrowMsg;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -84,7 +84,7 @@ public class TrackJob extends AbstractEffectJob {
TrackArrowMsg tam = new TrackArrowMsg(rotation); TrackArrowMsg tam = new TrackArrowMsg(rotation);
Dispatch dispatch = Dispatch.borrow(pc, tam); Dispatch dispatch = Dispatch.borrow(pc, tam);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} }

3
src/engine/mobileAI/MobAI.java

@ -17,7 +17,6 @@ import engine.mbEnums.DispatchChannel;
import engine.mobileAI.Threads.MobAIThread; import engine.mobileAI.Threads.MobAIThread;
import engine.mobileAI.Threads.ReSpawner; import engine.mobileAI.Threads.ReSpawner;
import engine.mobileAI.utilities.MovementUtilities; import engine.mobileAI.utilities.MovementUtilities;
import engine.net.DispatchMessage;
import engine.net.client.msg.PerformActionMsg; import engine.net.client.msg.PerformActionMsg;
import engine.net.client.msg.PowerProjectileMsg; import engine.net.client.msg.PowerProjectileMsg;
import engine.objects.*; import engine.objects.*;
@ -161,7 +160,7 @@ public class MobAI {
if (mob.isSiege()) { if (mob.isSiege()) {
PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target); PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target);
ppm.setRange(50); 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) { } catch (Exception e) {

12
src/engine/net/MessageDispatcher.java

@ -9,6 +9,7 @@
package engine.net; package engine.net;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import org.pmw.tinylog.Logger; 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 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. // 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 is configured wrapping a Protocol message and a distribution list is built.
// A Dispatch can be submitted to the MessageDispatcher for delivery from any thread.
// //
// Dispatches are interleaved between channels. This is to ensure // The system interleaves dispatches between two channels. This is to ensure that
// a combat or movement message is not delayed by spam clicking a // a critical combat or movement message will not be delayed by spam clicking a larger
// larger message. Choose your channel wisely. // message with no temporal immediacy. Pick the correct channel will this in mind.
public class MessageDispatcher implements Runnable { public class MessageDispatcher implements Runnable {
@ -73,7 +73,7 @@ public class MessageDispatcher implements Runnable {
this.messageDispatch = _messageQueue[dispatchChannel.getChannelID()].poll(); this.messageDispatch = _messageQueue[dispatchChannel.getChannelID()].poll();
if (this.messageDispatch != null) { if (this.messageDispatch != null) {
DispatchMessage.serializeDispatch(this.messageDispatch); DispatchManager.serializeDispatch(this.messageDispatch);
shouldBlock = false; shouldBlock = false;
} }
} }

10
src/engine/net/client/handlers/AcceptInviteToGuildHandler.java

@ -10,15 +10,11 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -86,9 +82,9 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler {
player.resetGuildStatuses(); player.resetGuildStatuses();
Dispatch dispatch = Dispatch.borrow(player, msg); 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(); player.incVer();

4
src/engine/net/client/handlers/AcceptSubInviteHandler.java

@ -12,12 +12,12 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.mbEnums.GuildState; import engine.mbEnums.GuildState;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -98,7 +98,7 @@ public class AcceptSubInviteHandler extends AbstractClientMsgHandler {
msg.setUnknown02(1); msg.setUnknown02(1);
msg.setResponse("Your guild is now a " + sourceGuild.getGuildState().name() + '.'); msg.setResponse("Your guild is now a " + sourceGuild.getGuildState().name() + '.');
dispatch = Dispatch.borrow(sourcePlayer, msg); 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() + '.'); ChatManager.chatSystemInfo(sourcePlayer, "Your guild is now a " + sourceGuild.getGuildState().name() + '.');
return true; return true;

10
src/engine/net/client/handlers/AcceptTradeRequestMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.AcceptTradeRequestMsg; import engine.net.client.msg.AcceptTradeRequestMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -92,10 +92,10 @@ public class AcceptTradeRequestMsgHandler extends AbstractClientMsgHandler {
UpdateVaultMsg uvmTarget = new UpdateVaultMsg(targetAccount); UpdateVaultMsg uvmTarget = new UpdateVaultMsg(targetAccount);
dispatch = Dispatch.borrow(source, uvmSource); dispatch = Dispatch.borrow(source, uvmSource);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
dispatch = Dispatch.borrow(target, uvmTarget); dispatch = Dispatch.borrow(target, uvmTarget);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
source.charItemManager.setVaultOpen(false); source.charItemManager.setVaultOpen(false);
toTradeWith.setVaultOpen(false); toTradeWith.setVaultOpen(false);
@ -118,10 +118,10 @@ public class AcceptTradeRequestMsgHandler extends AbstractClientMsgHandler {
toTradeWith.tradeID = msg.getUnknown01(); toTradeWith.tradeID = msg.getUnknown01();
dispatch = Dispatch.borrow(source, otwm); dispatch = Dispatch.borrow(source, otwm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
dispatch = Dispatch.borrow(target, otwm); dispatch = Dispatch.borrow(target, otwm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
return true; return true;
} }

5
src/engine/net/client/handlers/ActivateNPCMsgHandler.java

@ -5,7 +5,6 @@ import engine.gameManager.*;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.ItemType; import engine.mbEnums.ItemType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ActivateNPCMessage; import engine.net.client.msg.ActivateNPCMessage;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -66,7 +65,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
anm.setSize(ItemLists.size()); anm.setSize(ItemLists.size());
anm.setItemList(ItemLists); anm.setItemList(ItemLists);
Dispatch dispatch = Dispatch.borrow(player, anm); Dispatch dispatch = Dispatch.borrow(player, anm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
if (msg.getUnknown01() == 0) { if (msg.getUnknown01() == 0) {
@ -125,7 +124,7 @@ public class ActivateNPCMsgHandler extends AbstractClientMsgHandler {
mca1.setAssetName1(building.getName()); mca1.setAssetName1(building.getName());
mca1.setUnknown54(1); mca1.setUnknown54(1);
Dispatch dispatch = Dispatch.borrow(player, mca1); Dispatch dispatch = Dispatch.borrow(player, mca1);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }

8
src/engine/net/client/handlers/AddGoldToTradeWindowMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.AddGoldToTradeWindowMsg; import engine.net.client.msg.AddGoldToTradeWindowMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -95,13 +95,13 @@ public class AddGoldToTradeWindowMsgHandler extends AbstractClientMsgHandler {
source.charItemManager.modifyCommitToTrade(); source.charItemManager.modifyCommitToTrade();
dispatch = Dispatch.borrow(source, utwm); dispatch = Dispatch.borrow(source, utwm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
dispatch = Dispatch.borrow(source, ugm); dispatch = Dispatch.borrow(source, ugm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
dispatch = Dispatch.borrow(other, utwmOther); dispatch = Dispatch.borrow(other, utwmOther);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

8
src/engine/net/client/handlers/AddItemToTradeWindowMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.AddItemToTradeWindowMsg; import engine.net.client.msg.AddItemToTradeWindowMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -81,7 +81,7 @@ public class AddItemToTradeWindowMsgHandler extends AbstractClientMsgHandler {
if (!tradingWith.hasRoomTrade(item.template.item_wt)) { if (!tradingWith.hasRoomTrade(item.template.item_wt)) {
dispatch = Dispatch.borrow(source, msg); dispatch = Dispatch.borrow(source, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
return false; return false;
} }
@ -93,12 +93,12 @@ public class AddItemToTradeWindowMsgHandler extends AbstractClientMsgHandler {
source.charItemManager.addItemToTrade(item); source.charItemManager.addItemToTrade(item);
dispatch = Dispatch.borrow(other, msg); dispatch = Dispatch.borrow(other, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
source.charItemManager.modifyCommitToTrade(); source.charItemManager.modifyCommitToTrade();
dispatch = Dispatch.borrow(other, utwm); dispatch = Dispatch.borrow(other, utwm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
return true; return true;
} }

14
src/engine/net/client/handlers/AllianceChangeMsgHandler.java

@ -1,11 +1,11 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.AllianceType; import engine.mbEnums.AllianceType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.AllianceChangeMsg; import engine.net.client.msg.AllianceChangeMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -40,20 +40,20 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler {
if (!Guild.sameGuild(origin.getPlayerCharacter().getGuild(), fromGuild)) { if (!Guild.sameGuild(origin.getPlayerCharacter().getGuild(), fromGuild)) {
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_SAME_GUILD); msg.setMsgType(AllianceChangeMsg.ERROR_NOT_SAME_GUILD);
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return; return;
} }
if (!GuildStatusController.isInnerCouncil(origin.getPlayerCharacter().getGuildStatus()) && !GuildStatusController.isGuildLeader(origin.getPlayerCharacter().getGuildStatus())) { if (!GuildStatusController.isInnerCouncil(origin.getPlayerCharacter().getGuildStatus()) && !GuildStatusController.isGuildLeader(origin.getPlayerCharacter().getGuildStatus())) {
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED); msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED);
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return; return;
} }
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); 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; return;
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); 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; return;
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); 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); msg.setMsgType(AllianceChangeMsg.INFO_SUCCESS);
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;

4
src/engine/net/client/handlers/AllyEnemyListMsgHandler.java

@ -1,10 +1,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.AllyEnemyListMsg; import engine.net.client.msg.AllyEnemyListMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -35,7 +35,7 @@ public class AllyEnemyListMsgHandler extends AbstractClientMsgHandler {
if (toGuild == null) if (toGuild == null)
return; return;
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
// UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(); // UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg();
// //

4
src/engine/net/client/handlers/AppointGroupLeaderHandler.java

@ -11,11 +11,11 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.group.AppointGroupLeaderMsg; import engine.net.client.msg.group.AppointGroupLeaderMsg;
@ -52,7 +52,7 @@ public class AppointGroupLeaderHandler extends AbstractClientMsgHandler {
AppointGroupLeaderMsg reply = new AppointGroupLeaderMsg(); AppointGroupLeaderMsg reply = new AppointGroupLeaderMsg();
reply.setResponse(1); reply.setResponse(1);
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), reply); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), reply);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false; return false;
} }

5
src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java

@ -6,7 +6,6 @@ import engine.job.JobScheduler;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.HotzoneChangeMsg; import engine.net.client.msg.HotzoneChangeMsg;
@ -129,7 +128,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
if (player.getPet() != null) { if (player.getPet() != null) {
PetMsg pm = new PetMsg(5, player.getPet()); PetMsg pm = new PetMsg(5, player.getPet());
Dispatch dispatch = Dispatch.borrow(player, pm); Dispatch dispatch = Dispatch.borrow(player, pm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
//Send current hotzone //Send current hotzone
@ -137,7 +136,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
if (ZoneManager.hotZone != null) { if (ZoneManager.hotZone != null) {
HotzoneChangeMsg hcm = new HotzoneChangeMsg(mbEnums.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID()); HotzoneChangeMsg hcm = new HotzoneChangeMsg(mbEnums.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(player, hcm); Dispatch dispatch = Dispatch.borrow(player, hcm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
if (player.getGuild() != null && !player.getGuild().isEmptyGuild()) { if (player.getGuild() != null && !player.getGuild().isEmptyGuild()) {

4
src/engine/net/client/handlers/ArcMineChangeProductionMsgHandler.java

@ -1,10 +1,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ArcMineChangeProductionMsg; import engine.net.client.msg.ArcMineChangeProductionMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -60,7 +60,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
mine.changeProductionType(resource); mine.changeProductionType(resource);
Dispatch dispatch = Dispatch.borrow(playerCharacter, changeProductionMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, changeProductionMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

4
src/engine/net/client/handlers/ArcMineWindowAvailableTimeHandler.java

@ -2,10 +2,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ArcMineWindowAvailableTimeMsg; import engine.net.client.msg.ArcMineWindowAvailableTimeMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -55,7 +55,7 @@ public class ArcMineWindowAvailableTimeHandler extends AbstractClientMsgHandler
ArcMineWindowAvailableTimeMsg outMsg = new ArcMineWindowAvailableTimeMsg(treeOfLife, 10); ArcMineWindowAvailableTimeMsg outMsg = new ArcMineWindowAvailableTimeMsg(treeOfLife, 10);
outMsg.configure(); outMsg.configure();
dispatch = Dispatch.borrow(playerCharacter, outMsg); dispatch = Dispatch.borrow(playerCharacter, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

4
src/engine/net/client/handlers/ArcOwnedMinesListHandler.java

@ -1,9 +1,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ArcOwnedMinesListMsg; import engine.net.client.msg.ArcOwnedMinesListMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -37,7 +37,7 @@ public class ArcOwnedMinesListHandler extends AbstractClientMsgHandler {
msg.setMineList(Mine.getMinesForGuild(playerCharacter.getGuild().getObjectUUID())); msg.setMineList(Mine.getMinesForGuild(playerCharacter.getGuild().getObjectUUID()));
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

4
src/engine/net/client/handlers/ArcViewAssetTransactionsMsgHandler.java

@ -2,10 +2,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ArcViewAssetTransactionsMsg; import engine.net.client.msg.ArcViewAssetTransactionsMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -55,7 +55,7 @@ public class ArcViewAssetTransactionsMsgHandler extends AbstractClientMsgHandler
newMsg.configure(); newMsg.configure();
dispatch = Dispatch.borrow(player, newMsg); dispatch = Dispatch.borrow(player, newMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

12
src/engine/net/client/handlers/AssetSupportMsgHandler.java

@ -2,13 +2,13 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.NPCManager; import engine.gameManager.NPCManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.SupportMsgType; import engine.mbEnums.SupportMsgType;
import engine.mbEnums.TaxType; import engine.mbEnums.TaxType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -96,7 +96,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler {
outMsg = new ManageNPCMsg(vendor); outMsg = new ManageNPCMsg(vendor);
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg); 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) { private static void unprotectAsset(Building targetBuilding, NPC vendor, ClientConnection origin) {
@ -179,7 +179,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler {
outMsg.configure(); outMsg.configure();
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case REMOVETAX: case REMOVETAX:
@ -202,7 +202,7 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler {
mca.setAssetName1(targetBuilding.getName()); mca.setAssetName1(targetBuilding.getName());
mca.setUnknown54(1); mca.setUnknown54(1);
dispatch = Dispatch.borrow(player, mca); dispatch = Dispatch.borrow(player, mca);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
case ACCEPTTAX: //AcceptTax case ACCEPTTAX: //AcceptTax
@ -226,12 +226,12 @@ public class AssetSupportMsgHandler extends AbstractClientMsgHandler {
mca.setUnknown54(1); mca.setUnknown54(1);
dispatch = Dispatch.borrow(player, mca); dispatch = Dispatch.borrow(player, mca);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }
dispatch = Dispatch.borrow(player, baseMsg); dispatch = Dispatch.borrow(player, baseMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;

4
src/engine/net/client/handlers/BanishUnbanishHandler.java

@ -12,11 +12,11 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -115,7 +115,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
targetName + " has been banished from " + guild.getName() + '.'); targetName + " has been banished from " + guild.getName() + '.');
GuildListMsg guildListMsg = new GuildListMsg(guild); GuildListMsg guildListMsg = new GuildListMsg(guild);
dispatch = Dispatch.borrow(source, guildListMsg); dispatch = Dispatch.borrow(source, guildListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} else { } else {
ErrorPopupMsg.sendErrorPopup(source, 103); // You may not banish this char ErrorPopupMsg.sendErrorPopup(source, 103); // You may not banish this char
} }

10
src/engine/net/client/handlers/BreakFealtyHandler.java

@ -10,14 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -97,7 +93,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
SendGuildEntryMsg msg = new SendGuildEntryMsg(player); SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
//Update Map. //Update Map.
@ -164,7 +160,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
SendGuildEntryMsg msg = new SendGuildEntryMsg(player); SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
//Update Map. //Update Map.

4
src/engine/net/client/handlers/ChangeAltitudeHandler.java

@ -10,8 +10,8 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ChangeAltitudeMsg; import engine.net.client.msg.ChangeAltitudeMsg;
import engine.net.client.msg.ClientNetMsg; 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 // Add flight timer job to check stam and ground you when you run out
//MovementManager.addFlightTimer(pc, msg, MBServerStatics.FLY_FREQUENCY_MS); //MovementManager.addFlightTimer(pc, msg, MBServerStatics.FLY_FREQUENCY_MS);
//Send change altitude to all in range //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; return true;

8
src/engine/net/client/handlers/ChangeGuildLeaderHandler.java

@ -12,10 +12,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ChangeGuildLeaderMsg; import engine.net.client.msg.ChangeGuildLeaderMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -115,17 +115,17 @@ public class ChangeGuildLeaderHandler extends AbstractClientMsgHandler {
GuildInfoMsg guildInfoMsg = new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2); GuildInfoMsg guildInfoMsg = new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2);
Dispatch dispatch = Dispatch.borrow(sourcePlayer, guildInfoMsg); Dispatch dispatch = Dispatch.borrow(sourcePlayer, guildInfoMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
GuildListMsg guildListMsg = new GuildListMsg(sourcePlayer.getGuild()); GuildListMsg guildListMsg = new GuildListMsg(sourcePlayer.getGuild());
dispatch = Dispatch.borrow(sourcePlayer, guildListMsg); dispatch = Dispatch.borrow(sourcePlayer, guildListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
if (targetPlayer != null) { if (targetPlayer != null) {
if (updateTarget) if (updateTarget)
DispatchMessage.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2)); DispatchManager.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2));
} }
return true; return true;

8
src/engine/net/client/handlers/ChangeRankHandler.java

@ -12,10 +12,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.guild.ChangeRankMsg; import engine.net.client.msg.guild.ChangeRankMsg;
@ -146,16 +146,16 @@ public class ChangeRankHandler extends AbstractClientMsgHandler {
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.incVer(); targetPlayer.incVer();
if (updateTarget) if (updateTarget)
DispatchMessage.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2)); DispatchManager.sendToAllInRange(targetPlayer, new GuildInfoMsg(targetPlayer, targetPlayer.getGuild(), 2));
} }
if (updateSource) { if (updateSource) {
Dispatch dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 2)); 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())); dispatch = Dispatch.borrow(sourcePlayer, new GuildListMsg(sourcePlayer.getGuild()));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }

4
src/engine/net/client/handlers/CityChoiceMsgHandler.java

@ -1,11 +1,11 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.GuildManager; import engine.gameManager.GuildManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.CityChoiceMsg; import engine.net.client.msg.CityChoiceMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -42,7 +42,7 @@ public class CityChoiceMsgHandler extends AbstractClientMsgHandler {
TeleportRepledgeListMsg trlm = new TeleportRepledgeListMsg(player, false); TeleportRepledgeListMsg trlm = new TeleportRepledgeListMsg(player, false);
trlm.configure(); trlm.configure();
dispatch = Dispatch.borrow(player, trlm); dispatch = Dispatch.borrow(player, trlm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case 3: case 3:
City city = City.getCity(msg.getCityID()); City city = City.getCity(msg.getCityID());

8
src/engine/net/client/handlers/CityDataHandler.java

@ -1,12 +1,12 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.CityDataMsg; import engine.net.client.msg.CityDataMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -62,14 +62,14 @@ public class CityDataHandler extends AbstractClientMsgHandler {
cityDataMsg.updateCities(updateCities); cityDataMsg.updateCities(updateCities);
dispatch = Dispatch.borrow(playerCharacter, cityDataMsg); 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 the hotZone has changed then update the client's map accordingly.
if (playerCharacter.getTimeStamp("hotzoneupdate") <= ZoneManager.hotZoneLastUpdate.toEpochMilli() && ZoneManager.hotZone != null) { if (playerCharacter.getTimeStamp("hotzoneupdate") <= ZoneManager.hotZoneLastUpdate.toEpochMilli() && ZoneManager.hotZone != null) {
HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(mbEnums.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID()); HotzoneChangeMsg hotzoneChangeMsg = new HotzoneChangeMsg(mbEnums.GameObjectType.Zone.ordinal(), ZoneManager.hotZone.getObjectUUID());
dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg); dispatch = Dispatch.borrow(playerCharacter, hotzoneChangeMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100); playerCharacter.setTimeStamp("hotzoneupdate", System.currentTimeMillis() - 100);
} }
@ -77,7 +77,7 @@ public class CityDataHandler extends AbstractClientMsgHandler {
WorldRealmMsg worldRealmMsg = new WorldRealmMsg(); WorldRealmMsg worldRealmMsg = new WorldRealmMsg();
dispatch = Dispatch.borrow(playerCharacter, worldRealmMsg); dispatch = Dispatch.borrow(playerCharacter, worldRealmMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

10
src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java

@ -12,10 +12,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.BuildingGroup; import engine.mbEnums.BuildingGroup;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -115,10 +115,10 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
GuildTreeStatusMsg gtsm = new GuildTreeStatusMsg(building, sourcePlayer); GuildTreeStatusMsg gtsm = new GuildTreeStatusMsg(building, sourcePlayer);
gtsm.configure(); gtsm.configure();
dispatch = Dispatch.borrow(sourcePlayer, gtsm); 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); 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; break;
case BIND_TREE: case BIND_TREE:
@ -152,7 +152,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
sourcePlayer.setBindBuildingID(building.getObjectUUID()); sourcePlayer.setBindBuildingID(building.getObjectUUID());
dispatch = Dispatch.borrow(sourcePlayer, msg); dispatch = Dispatch.borrow(sourcePlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case OPEN_CITY: case OPEN_CITY:
case CLOSE_CITY: case CLOSE_CITY:
@ -171,7 +171,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
} }
dispatch = Dispatch.borrow(sourcePlayer, msg); dispatch = Dispatch.borrow(sourcePlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
default: default:
break; break;

4
src/engine/net/client/handlers/CloseTradeWindowMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.CloseTradeWindowMsg; import engine.net.client.msg.CloseTradeWindowMsg;
@ -51,7 +51,7 @@ public class CloseTradeWindowMsgHandler extends AbstractClientMsgHandler {
CloseTradeWindowMsg closeMsg = new CloseTradeWindowMsg(source, tradeID); CloseTradeWindowMsg closeMsg = new CloseTradeWindowMsg(source, tradeID);
dispatch = Dispatch.borrow(source, closeMsg); dispatch = Dispatch.borrow(source, closeMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
ClientConnection cc2 = sourceItemMan.getTradingWith(); ClientConnection cc2 = sourceItemMan.getTradingWith();

4
src/engine/net/client/handlers/DeleteItemMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.DeleteItemMsg; import engine.net.client.msg.DeleteItemMsg;
@ -60,7 +60,7 @@ public class DeleteItemMsgHandler extends AbstractClientMsgHandler {
if (item.isCanDestroy()) if (item.isCanDestroy())
if (itemManager.delete(item) == true) { if (itemManager.delete(item) == true) {
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
return true; return true;

4
src/engine/net/client/handlers/DisbandGuildHandler.java

@ -15,11 +15,11 @@ import engine.db.archive.GuildRecord;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -112,7 +112,7 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler {
LeaveGuildMsg leaveGuildMsg = new LeaveGuildMsg(); LeaveGuildMsg leaveGuildMsg = new LeaveGuildMsg();
leaveGuildMsg.setMessage("You guild has been disbanded!"); leaveGuildMsg.setMessage("You guild has been disbanded!");
dispatch = Dispatch.borrow(player, leaveGuildMsg); dispatch = Dispatch.borrow(player, leaveGuildMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

8
src/engine/net/client/handlers/DismissGuildHandler.java

@ -10,14 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -122,7 +118,7 @@ public class DismissGuildHandler extends AbstractClientMsgHandler {
SendGuildEntryMsg msg = new SendGuildEntryMsg(player); SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
final Session s = SessionManager.getSession(player); final Session s = SessionManager.getSession(player);

6
src/engine/net/client/handlers/DoorTryOpenMsgHandler.java

@ -3,10 +3,10 @@ package engine.net.client.handlers;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DoorState; import engine.mbEnums.DoorState;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.DoorTryOpenMsg; import engine.net.client.msg.DoorTryOpenMsg;
@ -62,7 +62,7 @@ public class DoorTryOpenMsgHandler extends AbstractClientMsgHandler {
if ((targetBuilding.isDoorLocked(doorNumber) == true) && msg.getToggle() == 0x01) { if ((targetBuilding.isDoorLocked(doorNumber) == true) && msg.getToggle() == 0x01) {
msg.setUnk1(2); msg.setUnk1(2);
Dispatch dispatch = Dispatch.borrow(player, msg); 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 return true; //don't open a locked door
} }
@ -79,7 +79,7 @@ public class DoorTryOpenMsgHandler extends AbstractClientMsgHandler {
for (AbstractWorldObject awo : container) { for (AbstractWorldObject awo : container) {
PlayerCharacter playerCharacter = (PlayerCharacter) awo; PlayerCharacter playerCharacter = (PlayerCharacter) awo;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
return true; return true;

6
src/engine/net/client/handlers/FriendAcceptHandler.java

@ -11,10 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.AcceptFriendMsg; import engine.net.client.msg.AcceptFriendMsg;
import engine.net.client.msg.AddFriendMessage; import engine.net.client.msg.AddFriendMessage;
@ -45,11 +45,11 @@ public class FriendAcceptHandler extends AbstractClientMsgHandler {
AddFriendMessage outMsg = new AddFriendMessage(player); AddFriendMessage outMsg = new AddFriendMessage(player);
Dispatch dispatch = Dispatch.borrow(sourceFriend, outMsg); Dispatch dispatch = Dispatch.borrow(sourceFriend, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
outMsg = new AddFriendMessage(sourceFriend); outMsg = new AddFriendMessage(sourceFriend);
dispatch = Dispatch.borrow(player, outMsg); 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."); ChatManager.chatSystemInfo(sourceFriend, player.getFirstName() + " has agreed to be your friend.");

4
src/engine/net/client/handlers/FriendDeclineHandler.java

@ -10,10 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.DeclineFriendMsg; import engine.net.client.msg.DeclineFriendMsg;
@ -36,7 +36,7 @@ public class FriendDeclineHandler extends AbstractClientMsgHandler {
} }
Dispatch dispatch = Dispatch.borrow(sourceFriend, msg); Dispatch dispatch = Dispatch.borrow(sourceFriend, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }

4
src/engine/net/client/handlers/FriendRequestHandler.java

@ -11,10 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -40,7 +40,7 @@ public class FriendRequestHandler extends AbstractClientMsgHandler {
Dispatch dispatch = Dispatch.borrow(targetFriend, msg); 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."); ChatManager.chatSystemInfo(player, "Your friend request has been sent.");
} }

4
src/engine/net/client/handlers/FurnitureHandler.java

@ -10,9 +10,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.FurnitureMsg; import engine.net.client.msg.FurnitureMsg;
@ -41,7 +41,7 @@ public class FurnitureHandler extends AbstractClientMsgHandler {
if (msg.getType() == 3) if (msg.getType() == 3)
msg.setType(2); msg.setType(2);
Dispatch dispatch = Dispatch.borrow(pc, msg); Dispatch dispatch = Dispatch.borrow(pc, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

6
src/engine/net/client/handlers/GroupInviteHandler.java

@ -11,12 +11,12 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.group.GroupInviteMsg; import engine.net.client.msg.group.GroupInviteMsg;
@ -47,7 +47,7 @@ public class GroupInviteHandler extends AbstractClientMsgHandler {
msg.setPlayer(pc); msg.setPlayer(pc);
msg.setMessageType(1); msg.setMessageType(1);
Dispatch dispatch = Dispatch.borrow(pc, msg); Dispatch dispatch = Dispatch.borrow(pc, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
group.addUpdateGroupJob(); group.addUpdateGroupJob();
@ -128,7 +128,7 @@ public class GroupInviteHandler extends AbstractClientMsgHandler {
msg.setName(source.getFirstName()); msg.setName(source.getFirstName());
Dispatch dispatch = Dispatch.borrow(target, msg); Dispatch dispatch = Dispatch.borrow(target, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

4
src/engine/net/client/handlers/GroupInviteResponseHandler.java

@ -11,10 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.group.GroupInviteResponseMsg; import engine.net.client.msg.group.GroupInviteResponseMsg;
@ -86,7 +86,7 @@ public class GroupInviteResponseHandler extends AbstractClientMsgHandler {
groupUpdateMsg.setPlayer(groupMember); groupUpdateMsg.setPlayer(groupMember);
Dispatch dispatch = Dispatch.borrow(player, groupUpdateMsg); Dispatch dispatch = Dispatch.borrow(player, groupUpdateMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }

8
src/engine/net/client/handlers/GuildControlHandler.java

@ -10,10 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -47,11 +47,11 @@ public class GuildControlHandler extends AbstractClientMsgHandler {
msg.setGM((byte) (GuildStatusController.isGuildLeader(player.getGuildStatus()) ? 1 : 0)); msg.setGM((byte) (GuildStatusController.isGuildLeader(player.getGuildStatus()) ? 1 : 0));
dispatch = Dispatch.borrow(player, msg); 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())) { if (GuildStatusController.isInnerCouncil(player.getGuildStatus()) || GuildStatusController.isGuildLeader(player.getGuildStatus())) {
dispatch = Dispatch.borrow(player, new GuildListMsg(player.getGuild())); dispatch = Dispatch.borrow(player, new GuildListMsg(player.getGuild()));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} else } else
ErrorPopupMsg.sendErrorMsg(player, "Only guild leader and inner council have such authority!"); ErrorPopupMsg.sendErrorMsg(player, "Only guild leader and inner council have such authority!");
@ -64,7 +64,7 @@ public class GuildControlHandler extends AbstractClientMsgHandler {
if (pc != null) { if (pc != null) {
dispatch = Dispatch.borrow(player, new GuildListMsg(pc)); dispatch = Dispatch.borrow(player, new GuildListMsg(pc));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }

10
src/engine/net/client/handlers/GuildCreationFinalizeHandler.java

@ -10,17 +10,13 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.mbEnums.ItemType; import engine.mbEnums.ItemType;
import engine.mbEnums.OwnerType; import engine.mbEnums.OwnerType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -122,7 +118,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
} }
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
GuildManager.joinGuild(player, newGuild, GuildHistoryType.CREATE); GuildManager.joinGuild(player, newGuild, GuildHistoryType.CREATE);
@ -135,7 +131,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
player.charItemManager.updateInventory(); player.charItemManager.updateInventory();
player.incVer(); 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!"); ChatManager.chatSystemInfo(player, msg.getName() + " has arrived on Grief server!");

4
src/engine/net/client/handlers/GuildCreationOptionsHandler.java

@ -10,9 +10,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.guild.GuildCreationOptionsMsg; import engine.net.client.msg.guild.GuildCreationOptionsMsg;
@ -40,7 +40,7 @@ public class GuildCreationOptionsHandler extends AbstractClientMsgHandler {
return true; return true;
dispatch = Dispatch.borrow(sourcePlayer, msg); dispatch = Dispatch.borrow(sourcePlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

8
src/engine/net/client/handlers/GuildInfoHandler.java

@ -10,11 +10,11 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.guild.GuildInfoMsg; import engine.net.client.msg.guild.GuildInfoMsg;
@ -40,18 +40,18 @@ public class GuildInfoHandler extends AbstractClientMsgHandler {
if (msg.getMsgType() == 1) { if (msg.getMsgType() == 1) {
dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 4)); 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) { } else if (msg.getMsgType() == 5) {
if (msg.getObjectType() == GameObjectType.PlayerCharacter.ordinal()) { if (msg.getObjectType() == GameObjectType.PlayerCharacter.ordinal()) {
PlayerCharacter pc = PlayerCharacter.getPlayerCharacter(msg.getObjectID()); PlayerCharacter pc = PlayerCharacter.getPlayerCharacter(msg.getObjectID());
dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(pc, pc.getGuild(), 5)); dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(pc, pc.getGuild(), 5));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} else { } else {
//TODO Change this to a null object when we make a null object. //TODO Change this to a null object when we make a null object.
dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 1)); dispatch = Dispatch.borrow(sourcePlayer, new GuildInfoMsg(sourcePlayer, sourcePlayer.getGuild(), 1));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }

4
src/engine/net/client/handlers/GuildTreeStatusMsgHandler.java

@ -10,10 +10,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.GuildTreeStatusMsg; import engine.net.client.msg.GuildTreeStatusMsg;
@ -52,7 +52,7 @@ public class GuildTreeStatusMsgHandler extends AbstractClientMsgHandler {
guildTreeStatusMsg.configure(); guildTreeStatusMsg.configure();
dispatch = Dispatch.borrow(player, guildTreeStatusMsg); dispatch = Dispatch.borrow(player, guildTreeStatusMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

6
src/engine/net/client/handlers/HirelingServiceMsgHandler.java

@ -12,10 +12,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.HirelingServiceMsg; import engine.net.client.msg.HirelingServiceMsg;
@ -65,10 +65,10 @@ public class HirelingServiceMsgHandler extends AbstractClientMsgHandler {
ManageNPCMsg outMsg = new ManageNPCMsg(npc); ManageNPCMsg outMsg = new ManageNPCMsg(npc);
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
} }

4
src/engine/net/client/handlers/InvalidTradeRequestMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.InvalidTradeRequestMsg; import engine.net.client.msg.InvalidTradeRequestMsg;
@ -39,7 +39,7 @@ public class InvalidTradeRequestMsgHandler extends AbstractClientMsgHandler {
Dispatch dispatch; Dispatch dispatch;
dispatch = Dispatch.borrow(playerCharacter, msg); dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

8
src/engine/net/client/handlers/InviteToGuildHandler.java

@ -11,14 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.ConfigManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -149,7 +145,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler {
msg.setTargetName(""); msg.setTargetName("");
dispatch = Dispatch.borrow(targetPlayer, msg); dispatch = Dispatch.borrow(targetPlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

8
src/engine/net/client/handlers/InviteToSubHandler.java

@ -10,14 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -127,7 +123,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
msg.setUnknown02(1); msg.setUnknown02(1);
dispatch = Dispatch.borrow(target, msg); dispatch = Dispatch.borrow(target, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} else { } else {
sendChat(source, "Failed to send sub invite to target."); sendChat(source, "Failed to send sub invite to target.");

4
src/engine/net/client/handlers/ItemFromVaultMsgHandler.java

@ -10,9 +10,9 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ItemFromVaultMsg; import engine.net.client.msg.ItemFromVaultMsg;
@ -36,7 +36,7 @@ public class ItemFromVaultMsgHandler extends AbstractClientMsgHandler {
ItemToVaultMsg back = new ItemToVaultMsg(msg); ItemToVaultMsg back = new ItemToVaultMsg(msg);
dispatch = Dispatch.borrow(player, back); 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); ChatManager.chatInfoError(player, "Can't transfer to inventory: " + reason);
} }

28
src/engine/net/client/handlers/ItemProductionMsgHandler.java

@ -10,15 +10,11 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.ForgeManager;
import engine.gameManager.ItemManager;
import engine.loot.WorkOrder; import engine.loot.WorkOrder;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.ItemType; import engine.mbEnums.ItemType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -104,7 +100,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
recycleItem(msg.items, vendor, origin); recycleItem(msg.items, vendor, origin);
msg.actionType = mbEnums.ProductionActionType.TAKE; msg.actionType = mbEnums.ProductionActionType.TAKE;
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case COMPLETE: case COMPLETE:
completeItem(msg.itemUUID, vendor); completeItem(msg.itemUUID, vendor);
@ -118,7 +114,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
case TAKE: case TAKE:
takeItem(msg.items, vendor, origin); takeItem(msg.items, vendor, origin);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
} }
return true; return true;
@ -142,7 +138,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
// (Add / Completed / Remove) // (Add / Completed / Remove)
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, virtualItem, mbEnums.ProductionActionType.CONFIRM_SETPRICE, true); 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 // Remove virtualItem from collections
@ -177,9 +173,9 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
// Add persisted items to the vendor inventory window // Add persisted items to the vendor inventory window
ItemProductionMsg outMsg1 = new ItemProductionMsg(vendor.building, vendor, completedItem, mbEnums.ProductionActionType.DEPOSIT, true); 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); 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) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
@ -214,11 +210,11 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT, true); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT, true);
dispatch = Dispatch.borrow(player, outMsg); 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); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.SETPRICE, true);
dispatch = Dispatch.borrow(player, outMsg); 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); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.DEPOSIT, true);
dispatch = Dispatch.borrow(player, outMsg); 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); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.CONFIRM_DEPOSIT, true);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
origin.getPlayerCharacter().charItemManager.updateInventory(); origin.getPlayerCharacter().charItemManager.updateInventory();
} catch (Exception e) { } catch (Exception e) {
@ -356,7 +352,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.TAKE, true); outMsg = new ItemProductionMsg(vendor.getBuilding(), vendor, targetItem, mbEnums.ProductionActionType.TAKE, true);
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
// Refund a portion of the gold // Refund a portion of the gold
@ -446,7 +442,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
outMsg = new ManageNPCMsg(vendor); outMsg = new ManageNPCMsg(vendor);
outMsg.setMessageType(1); outMsg.setMessageType(1);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} finally { } finally {

4
src/engine/net/client/handlers/ItemToVaultMsgHandler.java

@ -10,9 +10,9 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ItemFromVaultMsg; import engine.net.client.msg.ItemFromVaultMsg;
@ -36,7 +36,7 @@ public class ItemToVaultMsgHandler extends AbstractClientMsgHandler {
ItemFromVaultMsg back = new ItemFromVaultMsg(msg); ItemFromVaultMsg back = new ItemFromVaultMsg(msg);
dispatch = Dispatch.borrow(player, back); 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); ChatManager.chatInfoError(player, "Can't transfer to vault: " + reason);
} }

4
src/engine/net/client/handlers/KeepAliveServerClientHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.KeepAliveServerClientMsg; import engine.net.client.msg.KeepAliveServerClientMsg;
@ -39,7 +39,7 @@ public class KeepAliveServerClientHandler extends AbstractClientMsgHandler {
// Send ping to client // Send ping to client
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
return true; return true;
} }

10
src/engine/net/client/handlers/LeaveGuildHandler.java

@ -10,14 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.ConfigManager;
import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.guild.LeaveGuildMsg; import engine.net.client.msg.guild.LeaveGuildMsg;
@ -49,7 +45,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler {
if (GuildStatusController.isGuildLeader(playerCharacter.getGuildStatus())) { if (GuildStatusController.isGuildLeader(playerCharacter.getGuildStatus())) {
msg.setMessage("You must switch leadership of your guild before leaving!"); msg.setMessage("You must switch leadership of your guild before leaving!");
dispatch = Dispatch.borrow(playerCharacter, msg); dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }
@ -75,7 +71,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler {
// Send message back to client // Send message back to client
msg.setMessage("You have left the guild."); msg.setMessage("You have left the guild.");
dispatch = Dispatch.borrow(playerCharacter, msg); dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

4
src/engine/net/client/handlers/LockUnlockDoorMsgHandler.java

@ -2,10 +2,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.LockUnlockDoorMsg; import engine.net.client.msg.LockUnlockDoorMsg;
@ -82,7 +82,7 @@ public class LockUnlockDoorMsgHandler extends AbstractClientMsgHandler {
} }
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

20
src/engine/net/client/handlers/LootMsgHandler.java

@ -10,11 +10,11 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -125,11 +125,11 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
for (Item equip : mobTarget.charItemManager.equipped.values()) { for (Item equip : mobTarget.charItemManager.equipped.values()) {
TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(mobTarget, equip.equipSlot); 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); LootMsg lootMsg = new LootMsg(0, 0, tar.getObjectType().ordinal(), tar.getObjectUUID(), equip);
Dispatch dispatch = Dispatch.borrow(player, lootMsg); Dispatch dispatch = Dispatch.borrow(player, lootMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
} }
} }
@ -172,17 +172,17 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
updateTargetGold = new UpdateGoldMsg(corpse); updateTargetGold = new UpdateGoldMsg(corpse);
updateTargetGold.configure(); 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); UpdateGoldMsg ugm = new UpdateGoldMsg(player);
ugm.configure(); ugm.configure();
Dispatch dispatch = Dispatch.borrow(player, ugm); Dispatch dispatch = Dispatch.borrow(player, ugm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
// respond back loot message. Try sending to everyone. // respond back loot message. Try sending to everyone.
} else } 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 //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 = new UpdateGoldMsg(corpse);
updateTargetGold.configure(); 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); UpdateGoldMsg ugm = new UpdateGoldMsg(player);
ugm.configure(); ugm.configure();
Dispatch dispatch = Dispatch.borrow(player, ugm); Dispatch dispatch = Dispatch.borrow(player, ugm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
// respond back loot message. Try sending to everyone. // respond back loot message. Try sending to everyone.
@ -231,10 +231,10 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
msg.setSourceID2(0); msg.setSourceID2(0);
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
//DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); //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); LootMsg newItemMsg = new LootMsg(mbEnums.GameObjectType.PlayerCharacter.ordinal(), player.getObjectUUID(), 0, 0, itemRet);
dispatch = Dispatch.borrow(player, newItemMsg); dispatch = Dispatch.borrow(player, newItemMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
//player.getCharItemManager().updateInventory(); //player.getCharItemManager().updateInventory();
} }

6
src/engine/net/client/handlers/LootWindowRequestMsgHandler.java

@ -10,10 +10,10 @@ package engine.net.client.handlers;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -131,9 +131,9 @@ public class LootWindowRequestMsgHandler extends AbstractClientMsgHandler {
if (lwrm == null) if (lwrm == null)
return true; 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); Dispatch dispatch = Dispatch.borrow(player, lwrm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
return true; return true;
} }

4
src/engine/net/client/handlers/MOTDCommitHandler.java

@ -11,10 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.guild.MOTDCommitMsg; import engine.net.client.msg.guild.MOTDCommitMsg;
@ -74,7 +74,7 @@ public class MOTDCommitHandler extends AbstractClientMsgHandler {
} }
} }
dispatch = Dispatch.borrow(sourcePlayer, msg); dispatch = Dispatch.borrow(sourcePlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
return true; return true;

6
src/engine/net/client/handlers/MOTDEditHandler.java

@ -10,10 +10,10 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -57,7 +57,7 @@ public class MOTDEditHandler extends AbstractClientMsgHandler {
LeaveGuildMsg leaveGuildMsg = new LeaveGuildMsg(); LeaveGuildMsg leaveGuildMsg = new LeaveGuildMsg();
leaveGuildMsg.setMessage("You do not belong to a guild!"); leaveGuildMsg.setMessage("You do not belong to a guild!");
dispatch = Dispatch.borrow(playerCharacter, leaveGuildMsg); dispatch = Dispatch.borrow(playerCharacter, leaveGuildMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }
@ -75,7 +75,7 @@ public class MOTDEditHandler extends AbstractClientMsgHandler {
msg.setMessage(nation.getMOTD()); msg.setMessage(nation.getMOTD());
} }
dispatch = Dispatch.borrow(playerCharacter, msg); dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
return true; return true;

18
src/engine/net/client/handlers/ManageCityAssetMsgHandler.java

@ -2,6 +2,7 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Bounds; import engine.math.Bounds;
@ -9,7 +10,6 @@ import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -99,7 +99,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building); ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building);
mca.actionType = 15; mca.actionType = 15;
Dispatch dispatch = Dispatch.borrow(player, mca); Dispatch dispatch = Dispatch.borrow(player, mca);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
return true; return true;
} }
@ -112,7 +112,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
outMsg.setTargetID(building.getObjectUUID()); outMsg.setTargetID(building.getObjectUUID());
outMsg.setAssetName(building.getName()); outMsg.setAssetName(building.getName());
Dispatch dispatch = Dispatch.borrow(player, outMsg); Dispatch dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
@ -196,7 +196,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
msg.actionType = 4; msg.actionType = 4;
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
outMsg.actionType = 4; outMsg.actionType = 4;
@ -206,14 +206,14 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
} }
Dispatch dispatch = Dispatch.borrow(player, outMsg); Dispatch dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
if (msg.actionType == 13) { if (msg.actionType == 13) {
outMsg.actionType = 13; outMsg.actionType = 13;
Dispatch dispatch = Dispatch.borrow(player, outMsg); Dispatch dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
@ -235,7 +235,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
outMsg.setUnknown54(1); outMsg.setUnknown54(1);
Dispatch dispatch = Dispatch.borrow(player, outMsg); Dispatch dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
@ -248,7 +248,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building); ManageCityAssetsMsg mca = new ManageCityAssetsMsg(player, building);
mca.actionType = 15; mca.actionType = 15;
Dispatch dispatch = Dispatch.borrow(player, mca); Dispatch dispatch = Dispatch.borrow(player, mca);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
@ -285,7 +285,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
outMsg.actionType = 18; outMsg.actionType = 18;
Dispatch dispatch = Dispatch.borrow(player, outMsg); Dispatch dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
return true; return true;

11
src/engine/net/client/handlers/MerchantMsgHandler.java

@ -9,7 +9,6 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -230,7 +229,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
trlm.configure(); trlm.configure();
dispatch = Dispatch.borrow(pc, trlm); 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) { 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)) { if ((!isTeleport && joinedGuild) || (isTeleport)) {
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
//teleport player to city //teleport player to city
@ -401,7 +400,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
case 5: case 5:
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
requestSwearAsSubGuild(msg, origin, player, npc); requestSwearAsSubGuild(msg, origin, player, npc);
break; break;
case 10: case 10:
@ -425,7 +424,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
case 15: case 15:
LeaderboardMessage lbm = new LeaderboardMessage(); LeaderboardMessage lbm = new LeaderboardMessage();
dispatch = Dispatch.borrow(player, lbm); dispatch = Dispatch.borrow(player, lbm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case 16: case 16:
ViewResourcesMsg vrm = new ViewResourcesMsg(player); ViewResourcesMsg vrm = new ViewResourcesMsg(player);
@ -434,7 +433,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
vrm.setWarehouseBuilding(warehouse); vrm.setWarehouseBuilding(warehouse);
vrm.configure(); vrm.configure();
dispatch = Dispatch.borrow(player, vrm); dispatch = Dispatch.borrow(player, vrm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case 17: case 17:
Warehouse.warehouseWithdraw(msg, player, npc); Warehouse.warehouseWithdraw(msg, player, npc);

22
src/engine/net/client/handlers/MinionTrainingMsgHandler.java

@ -2,14 +2,10 @@ package engine.net.client.handlers;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.NPCManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -80,7 +76,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
toRemove.guardCaptain = null; toRemove.guardCaptain = null;
PetMsg petMsg = new PetMsg(5, null); PetMsg petMsg = new PetMsg(5, null);
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); 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); mca1.setUnknown54(1);
Dispatch dispatch = Dispatch.borrow(playerCharacter, mca1); Dispatch dispatch = Dispatch.borrow(playerCharacter, mca1);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
ManageNPCMsg mnm = new ManageNPCMsg(npc); ManageNPCMsg mnm = new ManageNPCMsg(npc);
dispatch = Dispatch.borrow(playerCharacter, mnm); dispatch = Dispatch.borrow(playerCharacter, mnm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
//Add Minion //Add Minion
} else { } else {
@ -153,7 +149,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
ManageNPCMsg mnm = new ManageNPCMsg(npc); ManageNPCMsg mnm = new ManageNPCMsg(npc);
mnm.setMessageType(1); mnm.setMessageType(1);
Dispatch dispatch = Dispatch.borrow(playerCharacter, mnm); Dispatch dispatch = Dispatch.borrow(playerCharacter, mnm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} finally { } finally {
npc.minionLock.writeLock().unlock(); npc.minionLock.writeLock().unlock();
@ -206,7 +202,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
toRemove.guardCaptain = null; toRemove.guardCaptain = null;
PetMsg petMsg = new PetMsg(5, null); PetMsg petMsg = new PetMsg(5, null);
Dispatch dispatch = Dispatch.borrow(trebOwner, petMsg); 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); mca1.setUnknown54(1);
Dispatch dispatch = Dispatch.borrow(playerCharacter, mca1); Dispatch dispatch = Dispatch.borrow(playerCharacter, mca1);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
ManageNPCMsg mnm = new ManageNPCMsg(npc); ManageNPCMsg mnm = new ManageNPCMsg(npc);
dispatch = Dispatch.borrow(playerCharacter, mnm); dispatch = Dispatch.borrow(playerCharacter, mnm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
//Add Minion //Add Minion
} else { } else {
@ -287,7 +283,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
ManageNPCMsg mnm = new ManageNPCMsg(npc); ManageNPCMsg mnm = new ManageNPCMsg(npc);
mnm.setMessageType(1); mnm.setMessageType(1);
Dispatch dispatch = Dispatch.borrow(playerCharacter, mnm); Dispatch dispatch = Dispatch.borrow(playerCharacter, mnm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);

9
src/engine/net/client/handlers/ObjectActionMsgHandler.java

@ -6,7 +6,6 @@ import engine.math.Bounds;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -104,7 +103,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
pam.addPlacementInfo(item.template.deed_structure_id); pam.addPlacementInfo(item.template.deed_structure_id);
dispatch = Dispatch.borrow(player, pam); 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. //itemMan.consume(item); //temporary fix for dupe.. TODO Make Item Unusable after This message is sent.
break; break;
@ -248,7 +247,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
VisualUpdateMessage vum = new VisualUpdateMessage(player, 16323); VisualUpdateMessage vum = new VisualUpdateMessage(player, 16323);
vum.configure(); vum.configure();
DispatchMessage.sendToAllInRange(player, vum); DispatchManager.sendToAllInRange(player, vum);
} }
if (waterbucketBypass == false) { if (waterbucketBypass == false) {
@ -262,7 +261,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
itemMan.consume(item); itemMan.consume(item);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
player.cancelOnSpell(); player.cancelOnSpell();
break; break;
case RUNE: case RUNE:
@ -271,7 +270,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
break; break;
default: //shouldn't be here, consume item default: //shouldn't be here, consume item
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
// itemMan.consume(item); // itemMan.consume(item);
} }
} else { } else {

26
src/engine/net/client/handlers/OpenFriendsCondemnListMsgHandler.java

@ -3,12 +3,12 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -60,7 +60,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
outMsg.setOrigin(origin); outMsg.setOrigin(origin);
outMsg.setMessageType(2); outMsg.setMessageType(2);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case ADDHERALDRY: case ADDHERALDRY:
@ -93,7 +93,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
outMsg.setOrigin(origin); outMsg.setOrigin(origin);
outMsg.setMessageType(2); outMsg.setMessageType(2);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case REMOVEHERALDRY: case REMOVEHERALDRY:
@ -105,20 +105,20 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
outMsg.setOrigin(origin); outMsg.setOrigin(origin);
outMsg.setMessageType(2); outMsg.setMessageType(2);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case DEALTHS: // Death List case DEALTHS: // Death List
openFriendsCondemnListMsg.updateMsg(8, new ArrayList<>(player.pvpDeaths)); openFriendsCondemnListMsg.updateMsg(8, new ArrayList<>(player.pvpDeaths));
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case KILLS: // Kill List case KILLS: // Kill List
openFriendsCondemnListMsg.updateMsg(10, new ArrayList<>(player.pvpKills)); openFriendsCondemnListMsg.updateMsg(10, new ArrayList<>(player.pvpKills));
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case VIEWCONDEMN: case VIEWCONDEMN:
@ -131,7 +131,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(12, sourceBuilding.getCondemned(), sourceBuilding.reverseKOS); openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(12, sourceBuilding.getCondemned(), sourceBuilding.reverseKOS);
openFriendsCondemnListMsg.configure(); openFriendsCondemnListMsg.configure();
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
//msg.updateMsg(12, DbManager.GuildQueries.) //msg.updateMsg(12, DbManager.GuildQueries.)
break; break;
@ -156,7 +156,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
sourceBuilding.getCondemned().remove(msg.getRemoveFriendID()); sourceBuilding.getCondemned().remove(msg.getRemoveFriendID());
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case TOGGLEACTIVE: case TOGGLEACTIVE:
@ -177,7 +177,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
condemn.setActive(msg.isReverseKOS()); condemn.setActive(msg.isReverseKOS());
openFriendsCondemnListMsg.setReverseKOS(condemn.active); openFriendsCondemnListMsg.setReverseKOS(condemn.active);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
case REVERSEKOS: case REVERSEKOS:
@ -276,7 +276,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(12, sourceBuilding.getCondemned(), sourceBuilding.reverseKOS); openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(12, sourceBuilding.getCondemned(), sourceBuilding.reverseKOS);
openFriendsCondemnListMsg.configure(); openFriendsCondemnListMsg.configure();
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
//ADD FRIEND BUILDING //ADD FRIEND BUILDING
@ -337,7 +337,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
openFriendsCondemnListMsg.configure(); openFriendsCondemnListMsg.configure();
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
//REMOVE from friends list. //REMOVE from friends list.
case REMOVEFRIEND: case REMOVEFRIEND:
@ -363,7 +363,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(26, sourceBuilding.getFriends()); openFriendsCondemnListMsg = new OpenFriendsCondemnListMsg(26, sourceBuilding.getFriends());
openFriendsCondemnListMsg.configure(); openFriendsCondemnListMsg.configure();
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
//view Friends //view Friends
@ -384,7 +384,7 @@ public class OpenFriendsCondemnListMsgHandler extends AbstractClientMsgHandler {
dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg); dispatch = Dispatch.borrow(player, openFriendsCondemnListMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break; break;
default: default:

18
src/engine/net/client/handlers/OrderNPCMsgHandler.java

@ -3,6 +3,7 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.math.FastMath; import engine.math.FastMath;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -11,7 +12,6 @@ import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.mbEnums.ProfitType; import engine.mbEnums.ProfitType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.*; import engine.objects.*;
@ -429,7 +429,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
manageCityAssetsMsg.setTargetID(building.getObjectUUID()); manageCityAssetsMsg.setTargetID(building.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(player, manageCityAssetsMsg); Dispatch dispatch = Dispatch.borrow(player, manageCityAssetsMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
@ -452,7 +452,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
outMsg.setUnknown54(1); outMsg.setUnknown54(1);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case CLIENT_REDEED_REQUEST: case CLIENT_REDEED_REQUEST:
@ -472,7 +472,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
modifySellProfit(orderNPCMsg, origin); modifySellProfit(orderNPCMsg, origin);
dispatch = Dispatch.borrow(player, orderNPCMsg); dispatch = Dispatch.borrow(player, orderNPCMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
case 10: case 10:
case 11: case 11:
@ -483,7 +483,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
modifyBuyProfit(orderNPCMsg, origin); modifyBuyProfit(orderNPCMsg, origin);
dispatch = Dispatch.borrow(player, orderNPCMsg); dispatch = Dispatch.borrow(player, orderNPCMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
@ -494,7 +494,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
ManageNPCMsg manageNPCMsg = new ManageNPCMsg(npc); ManageNPCMsg manageNPCMsg = new ManageNPCMsg(npc);
Dispatch dispatch = Dispatch.borrow(player, manageNPCMsg); Dispatch dispatch = Dispatch.borrow(player, manageNPCMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} else if (orderNPCMsg.getObjectType() == GameObjectType.Mob.ordinal()) { } else if (orderNPCMsg.getObjectType() == GameObjectType.Mob.ordinal()) {
@ -535,7 +535,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
manageCityAssetsMsg.setTargetType(building.getObjectType().ordinal()); manageCityAssetsMsg.setTargetType(building.getObjectType().ordinal());
manageCityAssetsMsg.setTargetID(building.getObjectUUID()); manageCityAssetsMsg.setTargetID(building.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(player, manageCityAssetsMsg); Dispatch dispatch = Dispatch.borrow(player, manageCityAssetsMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case 3: case 3:
@ -556,7 +556,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
outMsg.setUnknown54(1); outMsg.setUnknown54(1);
dispatch = Dispatch.borrow(player, outMsg); dispatch = Dispatch.borrow(player, outMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
break; break;
case 6: case 6:
@ -583,7 +583,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
ManageNPCMsg manageNPCMsg = new ManageNPCMsg(mob); ManageNPCMsg manageNPCMsg = new ManageNPCMsg(mob);
Dispatch dispatch = Dispatch.borrow(player, manageNPCMsg); Dispatch dispatch = Dispatch.borrow(player, manageNPCMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
return true; return true;

4
src/engine/net/client/handlers/PetCmdMsgHandler.java

@ -10,7 +10,7 @@ package engine.net.client.handlers;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.PetCmdMsg; import engine.net.client.msg.PetCmdMsg;
@ -75,7 +75,7 @@ public class PetCmdMsgHandler extends AbstractClientMsgHandler {
UpdateStateMsg rwss = new UpdateStateMsg(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(pet); rwss.setPlayer(pet);
DispatchMessage.sendToAllInRange(pet, rwss); DispatchManager.sendToAllInRange(pet, rwss);
} }
return true; return true;

4
src/engine/net/client/handlers/PetitionReceivedMsgHandler.java

@ -2,9 +2,9 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.PetitionReceivedMsg; import engine.net.client.msg.PetitionReceivedMsg;
@ -53,7 +53,7 @@ public class PetitionReceivedMsgHandler extends AbstractClientMsgHandler {
petitionReceivedMsg.unknown04 = 0; petitionReceivedMsg.unknown04 = 0;
Dispatch dispatch = Dispatch.borrow(playerCharacter, petitionReceivedMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, petitionReceivedMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

5
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -12,7 +12,6 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.*; import engine.mbEnums.*;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.CityZoneMsg; import engine.net.client.msg.CityZoneMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
@ -62,7 +61,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
PlaceAssetMsg pam = new PlaceAssetMsg(); PlaceAssetMsg pam = new PlaceAssetMsg();
pam.setActionType(4); pam.setActionType(4);
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), pam); 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 // 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 //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); 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 // Set maintenance date

4
src/engine/net/client/handlers/RandomMsgHandler.java

@ -9,8 +9,8 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.RandomMsg; import engine.net.client.msg.RandomMsg;
@ -59,7 +59,7 @@ public class RandomMsgHandler extends AbstractClientMsgHandler {
msg.setSourceID(source.getObjectUUID()); msg.setSourceID(source.getObjectUUID());
//send to all in range //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; return true;
} }

6
src/engine/net/client/handlers/RefineMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.RefineMsg; import engine.net.client.msg.RefineMsg;
@ -69,7 +69,7 @@ public class RefineMsgHandler extends AbstractClientMsgHandler {
//echo refine message back //echo refine message back
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
// if (type == 0 && token == 1488335491){ // if (type == 0 && token == 1488335491){
// dispatch = Dispatch.borrow(pc, msg); // 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 RefinerScreenMsg refinerScreenMsg = new RefinerScreenMsg(skillPower, npc.getSellPercent(playerCharacter)); //TODO set npc cost
dispatch = Dispatch.borrow(playerCharacter, refinerScreenMsg); dispatch = Dispatch.borrow(playerCharacter, refinerScreenMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
playerCharacter.recalculate(); playerCharacter.recalculate();
} }
return true; return true;

4
src/engine/net/client/handlers/RefinerScreenMsgHandler.java

@ -9,9 +9,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.RefinerScreenMsg; import engine.net.client.msg.RefinerScreenMsg;
@ -43,7 +43,7 @@ public class RefinerScreenMsgHandler extends AbstractClientMsgHandler {
msg.setUnknown02(0); //cost to refine? msg.setUnknown02(0); //cost to refine?
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg); Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

6
src/engine/net/client/handlers/RemoveFriendHandler.java

@ -10,9 +10,9 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.RemoveFriendMessage; import engine.net.client.msg.RemoveFriendMessage;
@ -33,12 +33,12 @@ public class RemoveFriendHandler extends AbstractClientMsgHandler {
PlayerFriends.RemoveFromFriends(msg.friendID, player.getObjectUUID()); PlayerFriends.RemoveFromFriends(msg.friendID, player.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(player, msg); Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
msg = new RemoveFriendMessage(msg.friendID); msg = new RemoveFriendMessage(msg.friendID);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
@Override @Override

6
src/engine/net/client/handlers/RemoveFromGroupHandler.java

@ -11,11 +11,11 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.group.GroupUpdateMsg; import engine.net.client.msg.group.GroupUpdateMsg;
@ -71,7 +71,7 @@ public class RemoveFromGroupHandler extends AbstractClientMsgHandler {
RemoveFromGroupMsg reply = new RemoveFromGroupMsg(); RemoveFromGroupMsg reply = new RemoveFromGroupMsg();
reply.setResponse(1); reply.setResponse(1);
Dispatch dispatch = Dispatch.borrow(source, reply); Dispatch dispatch = Dispatch.borrow(source, reply);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false; return false;
} }
@ -94,7 +94,7 @@ public class RemoveFromGroupHandler extends AbstractClientMsgHandler {
gim.setMessageType(3); gim.setMessageType(3);
gim.setPlayer(groupMember); gim.setPlayer(groupMember);
Dispatch dispatch = Dispatch.borrow(target, gim); Dispatch dispatch = Dispatch.borrow(target, gim);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }

6
src/engine/net/client/handlers/RepairBuildingMsgHandler.java

@ -2,12 +2,12 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.BuildingGroup; import engine.mbEnums.BuildingGroup;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.RepairBuildingMsg; import engine.net.client.msg.RepairBuildingMsg;
@ -70,14 +70,14 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler {
UpdateObjectMsg uom = new UpdateObjectMsg(targetBuilding, 3); UpdateObjectMsg uom = new UpdateObjectMsg(targetBuilding, 3);
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), uom); 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()); RepairBuildingMsg rbm = new RepairBuildingMsg(targetBuilding.getObjectUUID(), maxHP, missingHealth, repairCost, targetBuilding.getStrongboxValue());
dispatch = Dispatch.borrow(origin.getPlayerCharacter(), rbm); dispatch = Dispatch.borrow(origin.getPlayerCharacter(), rbm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
@Override @Override

10
src/engine/net/client/handlers/RepairMsgHandler.java

@ -10,11 +10,11 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -56,7 +56,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
repairMsg.setRepairWindowAck(npc); repairMsg.setRepairWindowAck(npc);
dispatch = Dispatch.borrow(player, repairMsg); dispatch = Dispatch.borrow(player, repairMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} else if (repairMsg.getMsgType() == 0) { //Request RepairObject } else if (repairMsg.getMsgType() == 0) { //Request RepairObject
@ -98,7 +98,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
toRepair.setCombat_health_current(max); toRepair.setCombat_health_current(max);
repairMsg.setupRepairAck(max - dur); repairMsg.setupRepairAck(max - dur);
dispatch = Dispatch.borrow(player, repairMsg); dispatch = Dispatch.borrow(player, repairMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
@ -133,7 +133,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
ugm.configure(); ugm.configure();
dispatch = Dispatch.borrow(player, ugm); dispatch = Dispatch.borrow(player, ugm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
//update durability to database //update durability to database
@ -148,7 +148,7 @@ public class RepairMsgHandler extends AbstractClientMsgHandler {
repairMsg.setupRepairAck(max - dur); repairMsg.setupRepairAck(max - dur);
dispatch = Dispatch.borrow(player, repairMsg); dispatch = Dispatch.borrow(player, repairMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
return true; return true;

12
src/engine/net/client/handlers/RequestEnterWorldHandler.java

@ -11,7 +11,7 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.*; import engine.net.client.msg.*;
import engine.objects.Account; import engine.objects.Account;
@ -70,7 +70,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
if (player.getLevel() == 1 && player.getBindBuildingID() == -1) { if (player.getLevel() == 1 && player.getBindBuildingID() == -1) {
SelectCityMsg scm = new SelectCityMsg(player, true); SelectCityMsg scm = new SelectCityMsg(player, true);
dispatch = Dispatch.borrow(player, scm); dispatch = Dispatch.borrow(player, scm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }
@ -81,7 +81,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
try { try {
WorldDataMsg wdm = new WorldDataMsg(); WorldDataMsg wdm = new WorldDataMsg();
dispatch = Dispatch.borrow(player, wdm); dispatch = Dispatch.borrow(player, wdm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
Logger.error("WORLDDATAMESSAGE" + e.getMessage()); Logger.error("WORLDDATAMESSAGE" + e.getMessage());
@ -92,7 +92,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
try { try {
WorldRealmMsg wrm = new WorldRealmMsg(); WorldRealmMsg wrm = new WorldRealmMsg();
dispatch = Dispatch.borrow(player, wrm); dispatch = Dispatch.borrow(player, wrm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
Logger.error("REALMMESSAGE" + e.getMessage()); Logger.error("REALMMESSAGE" + e.getMessage());
@ -101,7 +101,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
// Object Data // Object Data
CityDataMsg wom = new CityDataMsg(session, true); CityDataMsg wom = new CityDataMsg(session, true);
dispatch = Dispatch.borrow(player, wom); dispatch = Dispatch.borrow(player, wom);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
player.getTimestamps().put("EnterWorld", System.currentTimeMillis()); player.getTimestamps().put("EnterWorld", System.currentTimeMillis());
@ -153,7 +153,7 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler {
SendOwnPlayerMsg sopm = new SendOwnPlayerMsg(SessionManager.getSession(origin)); SendOwnPlayerMsg sopm = new SendOwnPlayerMsg(SessionManager.getSession(origin));
dispatch = Dispatch.borrow(player, sopm); dispatch = Dispatch.borrow(player, sopm);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
return true; return true;
} }

4
src/engine/net/client/handlers/RequestGuildListHandler.java

@ -14,7 +14,7 @@ import engine.exception.MsgSendException;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -46,7 +46,7 @@ public class RequestGuildListHandler extends AbstractClientMsgHandler {
dispatch = Dispatch.borrow(pc, msg); dispatch = Dispatch.borrow(pc, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true; return true;
} }

6
src/engine/net/client/handlers/RespawnMsgHandler.java

@ -14,7 +14,7 @@ import engine.job.JobScheduler;
import engine.jobs.RefreshGroupJob; import engine.jobs.RefreshGroupJob;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.MoveToPointMsg; import engine.net.client.msg.MoveToPointMsg;
@ -72,7 +72,7 @@ public class RespawnMsgHandler extends AbstractClientMsgHandler {
// TODO calculate any experience loss before this point // TODO calculate any experience loss before this point
msg.setPlayerExp(playerCharacter.getExp() + playerCharacter.getOverFlowEXP()); msg.setPlayerExp(playerCharacter.getExp() + playerCharacter.getOverFlowEXP());
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
MoveToPointMsg moveMsg = new MoveToPointMsg(); MoveToPointMsg moveMsg = new MoveToPointMsg();
moveMsg.setPlayer(playerCharacter); moveMsg.setPlayer(playerCharacter);
@ -82,7 +82,7 @@ public class RespawnMsgHandler extends AbstractClientMsgHandler {
moveMsg.setInBuildingFloor(-1); moveMsg.setInBuildingFloor(-1);
dispatch = Dispatch.borrow(playerCharacter, moveMsg); dispatch = Dispatch.borrow(playerCharacter, moveMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
MovementManager.sendRWSSMsg(playerCharacter); MovementManager.sendRWSSMsg(playerCharacter);

4
src/engine/net/client/handlers/SetCombatModeMsgHandler.java

@ -10,7 +10,7 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.mbEnums; import engine.mbEnums;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.SetCombatModeMsg; import engine.net.client.msg.SetCombatModeMsg;
@ -49,7 +49,7 @@ public class SetCombatModeMsgHandler extends AbstractClientMsgHandler {
UpdateStateMsg rwss = new UpdateStateMsg(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(playerCharacter); 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; return true;
} }

4
src/engine/net/client/handlers/ShowMsgHandler.java

@ -12,7 +12,7 @@ import engine.exception.MsgSendException;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ShowMsg; import engine.net.client.msg.ShowMsg;
@ -64,7 +64,7 @@ public class ShowMsgHandler extends AbstractClientMsgHandler {
msg.setRange01(tar.getRange()); msg.setRange01(tar.getRange());
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
return true; return true;
} }

4
src/engine/net/client/handlers/SocialMsgHandler.java

@ -10,7 +10,7 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.mbEnums.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.net.DispatchMessage; import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.SocialMsg; import engine.net.client.msg.SocialMsg;
@ -35,7 +35,7 @@ public class SocialMsgHandler extends AbstractClientMsgHandler {
if (player == null) if (player == null)
return true; 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; return true;
} }

8
src/engine/net/client/handlers/SwearInGuildHandler.java

@ -10,15 +10,11 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.*;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.mbEnums.GuildState; import engine.mbEnums.GuildState;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
@ -112,7 +108,7 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
SendGuildEntryMsg msg = new SendGuildEntryMsg(player); SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
dispatch = Dispatch.borrow(player, msg); dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
City.lastCityUpdate = System.currentTimeMillis(); City.lastCityUpdate = System.currentTimeMillis();

6
src/engine/net/client/handlers/SwearInHandler.java

@ -11,10 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.mbEnums; import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; 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!"); ChatManager.chatGuildInfo(source, target.getFirstName() + " has been sworn in as a full member!");
dispatch = Dispatch.borrow(source, new GuildListMsg(source.getGuild())); dispatch = Dispatch.borrow(source, new GuildListMsg(source.getGuild()));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchMessage.sendToAllInRange(target, new GuildInfoMsg(target, target.getGuild(), 2)); DispatchManager.sendToAllInRange(target, new GuildInfoMsg(target, target.getGuild(), 2));
return true; return true;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save