Browse Source

DispatchManager is now an official manager singleton.

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

8
src/engine/InterestManagement/RealmMap.java

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

22
src/engine/InterestManagement/WorldGrid.java

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

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

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

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

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

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

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

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

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

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

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

29
src/engine/gameManager/ChatManager.java

@ -17,7 +17,6 @@ import engine.mbEnums.GameObjectType; @@ -17,7 +17,6 @@ import engine.mbEnums.GameObjectType;
import engine.mbEnums.ModType;
import engine.mbEnums.SourceType;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.MessageDispatcher;
import engine.net.client.ClientConnection;
import engine.net.client.handlers.ClientAdminCommandMsgHandler;
@ -87,7 +86,7 @@ public enum ChatManager { @@ -87,7 +86,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
}
@ -161,7 +160,7 @@ public enum ChatManager { @@ -161,7 +160,7 @@ public enum ChatManager {
// Make the Message
ChatSayMsg chatSayMsg = new ChatSayMsg(player, text);
DispatchMessage.dispatchMsgToInterestArea(pcSender, chatSayMsg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SAY_RANGE, true, true);
DispatchManager.dispatchMsgToInterestArea(pcSender, chatSayMsg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SAY_RANGE, true, true);
}
@ -171,7 +170,7 @@ public enum ChatManager { @@ -171,7 +170,7 @@ public enum ChatManager {
msg.setMessageType(4);
msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
Dispatch dispatch = Dispatch.borrow(targetPlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
/*
@ -195,7 +194,7 @@ public enum ChatManager { @@ -195,7 +194,7 @@ public enum ChatManager {
// Make the Message
ChatShoutMsg msg = new ChatShoutMsg(sender, text);
DispatchMessage.dispatchMsgToInterestArea(pcSender, msg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SHOUT_RANGE, true, true);
DispatchManager.dispatchMsgToInterestArea(pcSender, msg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SHOUT_RANGE, true, true);
}
@ -217,7 +216,7 @@ public enum ChatManager { @@ -217,7 +216,7 @@ public enum ChatManager {
// Make the Message
ChatGlobalMsg msg = new ChatGlobalMsg(sender, text);
DispatchMessage.dispatchMsgToAll(sender, msg, true);
DispatchManager.dispatchMsgToAll(sender, msg, true);
}
@ -284,13 +283,13 @@ public enum ChatManager { @@ -284,13 +283,13 @@ public enum ChatManager {
// Send dispatch to each player
Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
// Also send /tell to sender
if (pcSender != null) {
Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
} else
@ -349,7 +348,7 @@ public enum ChatManager { @@ -349,7 +348,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGuildMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
}
@ -404,7 +403,7 @@ public enum ChatManager { @@ -404,7 +403,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatICMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
}
@ -463,7 +462,7 @@ public enum ChatManager { @@ -463,7 +462,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGroupMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
}
@ -497,7 +496,7 @@ public enum ChatManager { @@ -497,7 +496,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
}
@ -733,7 +732,7 @@ public enum ChatManager { @@ -733,7 +732,7 @@ public enum ChatManager {
public static void chatPVP(String text) {
// Create message
ChatPvPMsg msg = new ChatPvPMsg(null, text);
DispatchMessage.dispatchMsgToAll(msg);
DispatchManager.dispatchMsgToAll(msg);
}
public static ChatSystemMsg CombatInfo(AbstractWorldObject source, AbstractWorldObject target) {
@ -844,7 +843,7 @@ public enum ChatManager { @@ -844,7 +843,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
}
@ -993,7 +992,7 @@ public enum ChatManager { @@ -993,7 +992,7 @@ public enum ChatManager {
chatSystemMsg.setChannel(channel);
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}

17
src/engine/gameManager/CombatManager.java

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

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

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

11
src/engine/gameManager/ForgeManager.java

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

15
src/engine/gameManager/GroupManager.java

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

7
src/engine/gameManager/GuildManager.java

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

3
src/engine/gameManager/LootManager.java

@ -10,7 +10,6 @@ package engine.gameManager; @@ -10,7 +10,6 @@ package engine.gameManager;
import engine.loot.*;
import engine.mbEnums;
import engine.net.DispatchMessage;
import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.*;
@ -96,7 +95,7 @@ public enum LootManager { @@ -96,7 +95,7 @@ public enum LootManager {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + item.template.item_base_name + ". Are you tough enough to take it?");
chatMsg.setMessageType(10);
chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
DispatchManager.dispatchMsgToAll(chatMsg);
}
}

15
src/engine/gameManager/MovementManager.java

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

3
src/engine/gameManager/NPCManager.java

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

49
src/engine/gameManager/PowersManager.java

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

4
src/engine/jobs/ActivateBaneJob.java

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

6
src/engine/jobs/DoorCloseJob.java

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

6
src/engine/jobs/TrackJob.java

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

3
src/engine/mobileAI/MobAI.java

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

12
src/engine/net/MessageDispatcher.java

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

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

@ -10,15 +10,11 @@ @@ -10,15 +10,11 @@
package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.gameManager.GuildManager;
import engine.gameManager.SessionManager;
import engine.gameManager.*;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg;
@ -86,9 +82,9 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler { @@ -86,9 +82,9 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler {
player.resetGuildStatuses();
Dispatch dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchMessage.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2));
DispatchManager.sendToAllInRange(player, new GuildInfoMsg(player, guild, 2));
player.incVer();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -10,8 +10,8 @@ @@ -10,8 +10,8 @@
package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.gameManager.DispatchManager;
import engine.mbEnums.DispatchChannel;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ChangeAltitudeMsg;
import engine.net.client.msg.ClientNetMsg;
@ -171,7 +171,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler { @@ -171,7 +171,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
// Add flight timer job to check stam and ground you when you run out
//MovementManager.addFlightTimer(pc, msg, MBServerStatics.FLY_FREQUENCY_MS);
//Send change altitude to all in range
DispatchMessage.dispatchMsgToInterestArea(pc, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
DispatchManager.dispatchMsgToInterestArea(pc, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
return true;

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

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

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

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

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

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

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

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

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

@ -12,10 +12,10 @@ package engine.net.client.handlers; @@ -12,10 +12,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.mbEnums;
import engine.mbEnums.BuildingGroup;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.*;
import engine.objects.*;
@ -115,10 +115,10 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { @@ -115,10 +115,10 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
GuildTreeStatusMsg gtsm = new GuildTreeStatusMsg(building, sourcePlayer);
gtsm.configure();
dispatch = Dispatch.borrow(sourcePlayer, gtsm);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
CityZoneMsg czm = new CityZoneMsg(2, playerZone.getLoc().x, playerZone.getLoc().y, playerZone.getLoc().z, playerCity.getCityName(), playerZone, mbEnums.CityBoundsType.ZONE.halfExtents, mbEnums.CityBoundsType.ZONE.halfExtents);
DispatchMessage.dispatchMsgToAll(czm);
DispatchManager.dispatchMsgToAll(czm);
break;
case BIND_TREE:
@ -152,7 +152,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { @@ -152,7 +152,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
sourcePlayer.setBindBuildingID(building.getObjectUUID());
dispatch = Dispatch.borrow(sourcePlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break;
case OPEN_CITY:
case CLOSE_CITY:
@ -171,7 +171,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { @@ -171,7 +171,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
}
dispatch = Dispatch.borrow(sourcePlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
break;
default:
break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -12,7 +12,6 @@ import engine.math.Vector3fImmutable; @@ -12,7 +12,6 @@ import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.*;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.CityZoneMsg;
import engine.net.client.msg.ClientNetMsg;
@ -62,7 +61,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -62,7 +61,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
PlaceAssetMsg pam = new PlaceAssetMsg();
pam.setActionType(4);
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), pam);
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
}
// Default method: Validates and places all buildings that do not
@ -786,7 +785,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -786,7 +785,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
//load the new city on the clients
CityZoneMsg czm = new CityZoneMsg(1, treeObject.getLoc().x, treeObject.getLoc().y, treeObject.getLoc().z, cityObject.getCityName(), zoneObject, mbEnums.CityBoundsType.ZONE.halfExtents, mbEnums.CityBoundsType.ZONE.halfExtents);
DispatchMessage.dispatchMsgToAll(czm);
DispatchManager.dispatchMsgToAll(czm);
// Set maintenance date

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -10,7 +10,7 @@ package engine.net.client.handlers; @@ -10,7 +10,7 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.mbEnums;
import engine.net.DispatchMessage;
import engine.gameManager.DispatchManager;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.SetCombatModeMsg;
@ -49,7 +49,7 @@ public class SetCombatModeMsgHandler extends AbstractClientMsgHandler { @@ -49,7 +49,7 @@ public class SetCombatModeMsgHandler extends AbstractClientMsgHandler {
UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(playerCharacter);
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
DispatchManager.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
return true;
}

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

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

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

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

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

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

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

@ -11,10 +11,10 @@ package engine.net.client.handlers; @@ -11,10 +11,10 @@ package engine.net.client.handlers;
import engine.exception.MsgSendException;
import engine.gameManager.ChatManager;
import engine.gameManager.DispatchManager;
import engine.gameManager.SessionManager;
import engine.mbEnums;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg;
@ -69,8 +69,8 @@ public class SwearInHandler extends AbstractClientMsgHandler { @@ -69,8 +69,8 @@ public class SwearInHandler extends AbstractClientMsgHandler {
ChatManager.chatGuildInfo(source, target.getFirstName() + " has been sworn in as a full member!");
dispatch = Dispatch.borrow(source, new GuildListMsg(source.getGuild()));
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchMessage.sendToAllInRange(target, new GuildInfoMsg(target, target.getGuild(), 2));
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.sendToAllInRange(target, new GuildInfoMsg(target, target.getGuild(), 2));
return true;
}

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

Loading…
Cancel
Save