Realm count updated properly.
This commit is contained in:
@@ -314,7 +314,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += newline;
|
||||
output += "State: " + targetPC.getGuild().guildState;
|
||||
output += newline;
|
||||
output += "Realms Owned:" + targetPC.getGuild().getRealmsOwned();
|
||||
output += "Realms Owned:" + targetPC.getGuild().realmsOwned;
|
||||
output += newline;
|
||||
output += "====Nation====";
|
||||
output += newline;
|
||||
@@ -322,7 +322,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += newline;
|
||||
output += "Nation State: " + targetPC.getGuild().getNation().guildState;
|
||||
output += newline;
|
||||
output += "Realms Owned:" + targetPC.getGuild().getNation().getRealmsOwned();
|
||||
output += "Realms Owned:" + targetPC.getGuild().getNation().realmsOwned;
|
||||
output += newline;
|
||||
output += "Guild Rank:" + (GuildStatusController.getRank(targetPC.getGuildStatus()) + targetPC.getGuild().getRealmsOwnedFlag());
|
||||
}
|
||||
|
||||
@@ -106,6 +106,9 @@ public class DismissGuildHandler extends AbstractClientMsgHandler {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity");
|
||||
return true;
|
||||
}
|
||||
if (toDismiss.guildState.equals(mbEnums.GuildState.Province))
|
||||
nation.realmsOwned = nation.realmsOwned - 1;
|
||||
|
||||
nation.getSubGuildList().remove(toDismiss);
|
||||
toDismiss.guildState = mbEnums.GuildState.Sovereign;
|
||||
toDismiss.setNation(toDismiss);
|
||||
@@ -131,7 +134,6 @@ public class DismissGuildHandler extends AbstractClientMsgHandler {
|
||||
|
||||
City.lastCityUpdate = System.currentTimeMillis();
|
||||
|
||||
|
||||
ArrayList<PlayerCharacter> guildMembers = SessionManager.getActivePCsInGuildID(nation.getObjectUUID());
|
||||
|
||||
for (PlayerCharacter member : guildMembers) {
|
||||
|
||||
@@ -107,6 +107,11 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
||||
protectorate.guildState.equals(GuildState.Province))
|
||||
nation.guildState = GuildState.Nation;
|
||||
|
||||
// Nation realm count update
|
||||
|
||||
if (protectorate.guildState.equals(GuildState.Province))
|
||||
nation.realmsOwned = nation.realmsOwned + 1;
|
||||
|
||||
SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Guild extends AbstractWorldObject {
|
||||
private String icmotd = "";
|
||||
private String nmotd = "";
|
||||
private int guildLeaderUUID;
|
||||
private int realmsOwned;
|
||||
public int realmsOwned;
|
||||
private int cityUUID = 0;
|
||||
private int mineTime;
|
||||
private ArrayList<PlayerCharacter> banishList;
|
||||
@@ -797,20 +797,6 @@ public class Guild extends AbstractWorldObject {
|
||||
return motto;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the realmsOwned
|
||||
*/
|
||||
public int getRealmsOwned() {
|
||||
return realmsOwned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param realmsOwned the realmsOwned to set
|
||||
*/
|
||||
public void setRealmsOwned(int realmsOwned) {
|
||||
this.realmsOwned = realmsOwned;
|
||||
}
|
||||
|
||||
public void removeSubGuild(Guild subGuild) {
|
||||
|
||||
// Update database
|
||||
|
||||
@@ -333,11 +333,12 @@ public class Realm {
|
||||
}
|
||||
|
||||
if (!guild.getNation().equals(guild)) {
|
||||
guild.getNation().setRealmsOwned(guild.getNation().getRealmsOwned() + 1);
|
||||
Guild guild1 = guild.getNation();
|
||||
guild1.realmsOwned = guild.getNation().realmsOwned + 1;
|
||||
GuildManager.updateAllGuildTags(guild.getNation());
|
||||
}
|
||||
|
||||
guild.setRealmsOwned(guild.getRealmsOwned() + 1);
|
||||
guild.realmsOwned = guild.realmsOwned + 1;
|
||||
GuildManager.updateAllGuildTags(guild);
|
||||
|
||||
AbstractCharacter.removeAllBlessings(player);
|
||||
@@ -509,9 +510,11 @@ public class Realm {
|
||||
DataWarehouse.pushToWarehouse(realmRecord);
|
||||
|
||||
// No longer own a realm
|
||||
this.getRulingCity().getGuild().setRealmsOwned(this.getRulingCity().getGuild().getRealmsOwned() - 1);
|
||||
if (!this.getRulingCity().getGuild().getNation().equals(this.getRulingCity().getGuild()))
|
||||
this.getRulingCity().getGuild().getNation().setRealmsOwned(this.getRulingCity().getGuild().getNation().getRealmsOwned() - 1);
|
||||
Guild guild1 = this.getRulingCity().getGuild();
|
||||
guild1.realmsOwned = this.getRulingCity().getGuild().realmsOwned - 1;
|
||||
|
||||
if (!guild1.getNation().equals(guild1))
|
||||
guild1.getNation().realmsOwned -= 1;
|
||||
|
||||
// Configure realm
|
||||
this.charterType = 0;
|
||||
|
||||
Reference in New Issue
Block a user