Logic cleanup pass for protectorate logic
This commit is contained in:
@@ -87,17 +87,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
|
|||||||
protectorate.setNation(protectorate);
|
protectorate.setNation(protectorate);
|
||||||
GuildManager.updateAllGuildTags(protectorate);
|
GuildManager.updateAllGuildTags(protectorate);
|
||||||
GuildManager.updateAllGuildBinds(protectorate, protectorate.getOwnedCity());
|
GuildManager.updateAllGuildBinds(protectorate, protectorate.getOwnedCity());
|
||||||
|
protectorate.guildState = mbEnums.GuildState.Sovereign;
|
||||||
boolean isNation = false;
|
|
||||||
|
|
||||||
for (Guild subGuild : protectorate.getSubGuildList())
|
|
||||||
if (subGuild.getOwnedCity() != null)
|
|
||||||
isNation = true;
|
|
||||||
|
|
||||||
if (isNation)
|
|
||||||
protectorate.guildState = mbEnums.GuildState.Nation;
|
|
||||||
else
|
|
||||||
protectorate.guildState = mbEnums.GuildState.Sovereign;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,28 +95,18 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
|
|||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||||
|
|
||||||
//Update Map.
|
|
||||||
|
|
||||||
final Session s = SessionManager.getSession(player);
|
|
||||||
|
|
||||||
City.lastCityUpdate = System.currentTimeMillis();
|
City.lastCityUpdate = System.currentTimeMillis();
|
||||||
|
|
||||||
|
|
||||||
ArrayList<PlayerCharacter> guildMembers = SessionManager.getActivePCsInGuildID(protectorate.getObjectUUID());
|
ArrayList<PlayerCharacter> guildMembers = SessionManager.getActivePCsInGuildID(protectorate.getObjectUUID());
|
||||||
|
|
||||||
for (PlayerCharacter member : guildMembers) {
|
for (PlayerCharacter member : guildMembers)
|
||||||
ChatManager.chatGuildInfo(member, protectorate.getName() + " has broke fealty from " + nation.getName() + '!');
|
ChatManager.chatGuildInfo(member, protectorate.getName() + " has broke fealty from " + nation.getName() + '!');
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<PlayerCharacter> breakFealtyMembers = SessionManager.getActivePCsInGuildID(nation.getObjectUUID());
|
ArrayList<PlayerCharacter> breakFealtyMembers = SessionManager.getActivePCsInGuildID(nation.getObjectUUID());
|
||||||
|
|
||||||
for (PlayerCharacter member : breakFealtyMembers) {
|
for (PlayerCharacter member : breakFealtyMembers)
|
||||||
ChatManager.chatGuildInfo(member, protectorate.getName() + " has broken fealty from " + nation.getName() + '!');
|
ChatManager.chatGuildInfo(member, protectorate.getName() + " has broken fealty from " + nation.getName() + '!');
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nation.getSubGuildList().contains(protectorate)) {
|
if (!nation.getSubGuildList().contains(protectorate)) {
|
||||||
|
|||||||
@@ -89,16 +89,6 @@ public class DismissGuildHandler extends AbstractClientMsgHandler {
|
|||||||
toDismiss.setNation(Guild.getErrantNation());
|
toDismiss.setNation(Guild.getErrantNation());
|
||||||
GuildManager.updateAllGuildBinds(toDismiss, null);
|
GuildManager.updateAllGuildBinds(toDismiss, null);
|
||||||
|
|
||||||
break;
|
|
||||||
case Province:
|
|
||||||
if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), WorldServer.worldUUID)) {
|
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
nation.getSubGuildList().remove(toDismiss);
|
|
||||||
toDismiss.guildState = mbEnums.GuildState.Sovereign;
|
|
||||||
toDismiss.setNation(toDismiss);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Petitioner:
|
case Petitioner:
|
||||||
|
|
||||||
@@ -111,6 +101,7 @@ public class DismissGuildHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case Protectorate:
|
case Protectorate:
|
||||||
|
case Province:
|
||||||
if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), WorldServer.worldUUID)) {
|
if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), WorldServer.worldUUID)) {
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity");
|
ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity");
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -99,10 +99,9 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
|||||||
protectorate.setNation(nation);
|
protectorate.setNation(nation);
|
||||||
GuildManager.updateAllGuildTags(protectorate);
|
GuildManager.updateAllGuildTags(protectorate);
|
||||||
|
|
||||||
if (nation.guildState == GuildState.Sovereign) {
|
if (nation.guildState == GuildState.Sovereign)
|
||||||
if (protectorate.guildState.equals(GuildState.Protectorate))
|
if (protectorate.guildState.equals(GuildState.Protectorate))
|
||||||
nation.guildState = GuildState.Nation;
|
nation.guildState = GuildState.Nation;
|
||||||
}
|
|
||||||
|
|
||||||
SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
|
SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -602,13 +602,10 @@ public class Building extends AbstractWorldObject {
|
|||||||
|
|
||||||
this.isDeranking.compareAndSet(false, true);
|
this.isDeranking.compareAndSet(false, true);
|
||||||
|
|
||||||
if ((bane.getOwner().getGuild().guildState == GuildState.Sovereign) ||
|
if (bane.getOwner().getGuild().guildState == GuildState.Sworn)
|
||||||
(bane.getOwner().getGuild().guildState == GuildState.Protectorate) ||
|
|
||||||
(bane.getOwner().getGuild().guildState == GuildState.Province) ||
|
|
||||||
(bane.getOwner().getGuild().guildState == GuildState.Nation))
|
|
||||||
siegeResult = SiegeResult.DESTROY;
|
|
||||||
else
|
|
||||||
siegeResult = SiegeResult.CAPTURE;
|
siegeResult = SiegeResult.CAPTURE;
|
||||||
|
else
|
||||||
|
siegeResult = SiegeResult.DESTROY;
|
||||||
|
|
||||||
// Remove realm if city had one
|
// Remove realm if city had one
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user