DispatchManager is now an official manager singleton.

This commit is contained in:
2024-05-12 13:14:42 -04:00
parent ff17cacda7
commit 96ba17f67a
160 changed files with 642 additions and 718 deletions
+19 -20
View File
@@ -17,7 +17,6 @@ import engine.mbEnums;
import engine.mbEnums.*;
import engine.net.ByteBufferWriter;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.msg.AllianceChangeMsg;
import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.UpdateClientAlliancesMsg;
@@ -347,7 +346,7 @@ public class Guild extends AbstractWorldObject {
if (Guild.sameGuild(player.getGuild(), toUpdate)) {
Dispatch dispatch = Dispatch.borrow(player, ucam);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
@@ -357,7 +356,7 @@ public class Guild extends AbstractWorldObject {
public static void UpdateClientAlliancesForPlayer(PlayerCharacter toUpdate) {
UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(toUpdate.getGuild());
Dispatch dispatch = Dispatch.borrow(toUpdate, ucam);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
}
@@ -637,7 +636,7 @@ public class Guild extends AbstractWorldObject {
pc.setGuild(Guild.getErrantGuild());
pc.incVer();
DispatchMessage.sendToAllInRange(pc, new GuildInfoMsg(pc, Guild.getErrantGuild(), 2));
DispatchManager.sendToAllInRange(pc, new GuildInfoMsg(pc, Guild.getErrantGuild(), 2));
}
@@ -993,7 +992,7 @@ public class Guild extends AbstractWorldObject {
if (!Guild.sameGuild(player.getGuild(), this)) {
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_SAME_GUILD);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1001,7 +1000,7 @@ public class Guild extends AbstractWorldObject {
if (!GuildStatusController.isInnerCouncil(player.getGuildStatus()) && !GuildStatusController.isGuildLeader(player.getGuildStatus())) {
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1009,7 +1008,7 @@ public class Guild extends AbstractWorldObject {
if (!GuildStatusController.isFullMember(player.getGuildStatus())) {
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
}
@@ -1027,7 +1026,7 @@ public class Guild extends AbstractWorldObject {
if (recommendList.size() == 10) {
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1035,7 +1034,7 @@ public class Guild extends AbstractWorldObject {
ErrorPopupMsg.sendErrorMsg(player, "This guild is already recommonded!");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1058,7 +1057,7 @@ public class Guild extends AbstractWorldObject {
if (recommendList.size() == 10) {
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1066,7 +1065,7 @@ public class Guild extends AbstractWorldObject {
ErrorPopupMsg.sendErrorMsg(player, "This guild is already recommonded!");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1088,7 +1087,7 @@ public class Guild extends AbstractWorldObject {
if (allyList.size() == 10) {
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1096,7 +1095,7 @@ public class Guild extends AbstractWorldObject {
ErrorPopupMsg.sendErrorMsg(player, "This guild is already an Ally!");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1105,7 +1104,7 @@ public class Guild extends AbstractWorldObject {
Logger.error(this.getObjectUUID() + " Could not find alliance Guild");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1115,7 +1114,7 @@ public class Guild extends AbstractWorldObject {
Logger.error(this.getObjectUUID() + " failed to update alliance Database");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1132,7 +1131,7 @@ public class Guild extends AbstractWorldObject {
if (enemyList.size() == 10) {
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1140,7 +1139,7 @@ public class Guild extends AbstractWorldObject {
ErrorPopupMsg.sendErrorMsg(player, "This guild is already an Enemy!");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1149,7 +1148,7 @@ public class Guild extends AbstractWorldObject {
Logger.error(this.getObjectUUID() + " Could not find alliance Guild");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1159,7 +1158,7 @@ public class Guild extends AbstractWorldObject {
Logger.error(this.getObjectUUID() + " failed to update alliance Database");
msg.setMsgType((byte) 15);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return false;
}
@@ -1177,7 +1176,7 @@ public class Guild extends AbstractWorldObject {
// once here everything passed, send successMsg;
msg.setMsgType(AllianceChangeMsg.INFO_SUCCESS);
dispatch = Dispatch.borrow(player, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
return true;
}