Inlines method. upgraded protection
This commit is contained in:
@@ -312,7 +312,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
if (targetPC.getGuild() != null) {
|
||||
output += "Name: " + targetPC.getGuild().getName();
|
||||
output += newline;
|
||||
output += "State: " + targetPC.getGuild().getGuildState();
|
||||
output += "State: " + targetPC.getGuild().guildState;
|
||||
output += newline;
|
||||
output += "Realms Owned:" + targetPC.getGuild().getRealmsOwned();
|
||||
output += newline;
|
||||
@@ -320,7 +320,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += newline;
|
||||
output += "Nation Name: " + targetPC.getGuild().getNation().getName();
|
||||
output += newline;
|
||||
output += "Nation State: " + targetPC.getGuild().getNation().getGuildState();
|
||||
output += "Nation State: " + targetPC.getGuild().getNation().guildState;
|
||||
output += newline;
|
||||
output += "Realms Owned:" + targetPC.getGuild().getNation().getRealmsOwned();
|
||||
output += newline;
|
||||
|
||||
@@ -173,7 +173,7 @@ public class AbandonAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
sourceGuild.setCityUUID(0);
|
||||
sourceGuild.setGuildState(GuildState.Errant);
|
||||
sourceGuild.guildState = GuildState.Errant;
|
||||
sourceGuild.setNation(null);
|
||||
|
||||
// Transfer the city assets
|
||||
|
||||
@@ -81,7 +81,7 @@ public class AcceptSubInviteHandler extends AbstractClientMsgHandler {
|
||||
//all tests passed, let's Handle code
|
||||
//Update Target Guild State.
|
||||
|
||||
swornGuild.setGuildState(GuildState.Petitioner);
|
||||
swornGuild.guildState = GuildState.Petitioner;
|
||||
|
||||
//Add sub so GuildMaster can Swear in.
|
||||
|
||||
@@ -91,7 +91,7 @@ public class AcceptSubInviteHandler extends AbstractClientMsgHandler {
|
||||
//Let's send the message back.
|
||||
|
||||
msg.setUnknown02(1);
|
||||
msg.setResponse("Your guild is now a " + swornGuild.getGuildState().name() + '.');
|
||||
msg.setResponse("Your guild is now a " + swornGuild.guildState.name() + '.');
|
||||
dispatch = Dispatch.borrow(sourcePlayer, msg);
|
||||
DispatchManager.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
|
||||
@@ -75,12 +75,12 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (guild.getGuildState()) {
|
||||
switch (guild.guildState) {
|
||||
case Sworn:
|
||||
guild.setNation(Guild.getErrantNation());
|
||||
GuildManager.updateAllGuildTags(guild);
|
||||
GuildManager.updateAllGuildBinds(guild, null);
|
||||
guild.setGuildState(mbEnums.GuildState.Errant);
|
||||
guild.guildState = mbEnums.GuildState.Errant;
|
||||
break;
|
||||
case Province:
|
||||
case Protectorate:
|
||||
@@ -95,9 +95,9 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
|
||||
isNation = true;
|
||||
|
||||
if (isNation)
|
||||
guild.setGuildState(mbEnums.GuildState.Nation);
|
||||
guild.guildState = mbEnums.GuildState.Nation;
|
||||
else
|
||||
guild.setGuildState(mbEnums.GuildState.Sovereign);
|
||||
guild.guildState = mbEnums.GuildState.Sovereign;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (guild.getGuildState()) {
|
||||
switch (guild.guildState) {
|
||||
case Sworn:
|
||||
guild.setNation(null);
|
||||
GuildManager.updateAllGuildTags(guild);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class ChannelMuteMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
sourceGuild.setCityUUID(0);
|
||||
sourceGuild.setGuildState(GuildState.Errant);
|
||||
sourceGuild.guildState = GuildState.Errant;
|
||||
sourceGuild.setNation(null);
|
||||
|
||||
// Transfer the city assets
|
||||
|
||||
@@ -77,7 +77,7 @@ public class DismissGuildHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (toDismiss.getGuildState()) {
|
||||
switch (toDismiss.guildState) {
|
||||
case Sworn:
|
||||
|
||||
if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), WorldServer.worldUUID)) {
|
||||
|
||||
@@ -88,8 +88,8 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
// Validate that the player is the leader of a guild
|
||||
// that is not currently Sovereign *** BUG? Doesn't look right. isGuildLeader()?
|
||||
|
||||
if ((playerCharacter.getGuild().getGuildState() != GuildState.Sworn
|
||||
|| playerCharacter.getGuild().getGuildState() != GuildState.Errant) == false) {
|
||||
if ((playerCharacter.getGuild().guildState != GuildState.Sworn
|
||||
|| playerCharacter.getGuild().guildState != GuildState.Errant) == false) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 17, ""); // Your is not an errant or soverign guild
|
||||
return false;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Errant guilds cannot place assets
|
||||
|
||||
if (player.getGuild().getGuildState() == GuildState.Errant) {
|
||||
if (player.getGuild().guildState == GuildState.Errant) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 1, "Only sovereign or sworn guilds may place assets.");
|
||||
return false;
|
||||
}
|
||||
@@ -774,7 +774,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
playerCharacter.getGuild().setNation(playerCharacter.getGuild());
|
||||
playerNation = playerCharacter.getGuild();
|
||||
playerNation.setGuildState(GuildState.Sovereign);
|
||||
playerNation.guildState = GuildState.Sovereign;
|
||||
|
||||
// Update guild binds and tags
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
if (!Guild.canSwearIn(protectorate)) {
|
||||
ErrorPopupMsg.sendErrorMsg(player, protectorate.getGuildState().name() + "cannot be sworn in");
|
||||
ErrorPopupMsg.sendErrorMsg(player, protectorate.guildState.name() + "cannot be sworn in");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,22 +87,23 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
//shouldn't get here.
|
||||
if (protectorate.getGuildState().equals(GuildState.Petitioner))
|
||||
if (protectorate.guildState.equals(GuildState.Petitioner))
|
||||
GuildManager.updateAllGuildBinds(protectorate, nation.getOwnedCity());
|
||||
|
||||
//update Guild state.
|
||||
|
||||
if (protectorate.getNation().isEmptyGuild())
|
||||
protectorate.setGuildState(GuildState.Sworn);
|
||||
protectorate.guildState = GuildState.Sworn;
|
||||
else
|
||||
protectorate.setGuildState(GuildState.Protectorate);
|
||||
protectorate.guildState = GuildState.Protectorate;
|
||||
|
||||
protectorate.setNation(nation);
|
||||
GuildManager.updateAllGuildTags(protectorate);
|
||||
|
||||
if (nation.getGuildState() == GuildState.Sovereign &&
|
||||
protectorate.getGuildState().equals(GuildState.Protectorate))
|
||||
nation.setGuildState(GuildState.Nation);
|
||||
if (nation.guildState == GuildState.Sovereign) {
|
||||
if (protectorate.guildState.equals(GuildState.Protectorate))
|
||||
nation.guildState = GuildState.Nation;
|
||||
}
|
||||
|
||||
SendGuildEntryMsg msg = new SendGuildEntryMsg(player);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
|
||||
@@ -437,7 +437,7 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
|
||||
else
|
||||
writer.putInt((int) timeLeft / 1000); // Time remaing until bane/Seconds
|
||||
|
||||
if (attackerGuild.getGuildState() == GuildState.Sworn)
|
||||
if (attackerGuild.guildState == GuildState.Sworn)
|
||||
writer.putInt(4); //3 capture/errant,4 capture/sworn, 5 destroy/soveirgn.
|
||||
else
|
||||
writer.putInt(5);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class SendGuildEntryMsg extends ClientNetMsg {
|
||||
if (subsAndSovs.size() > 0) {
|
||||
|
||||
for (Guild guild : subsAndSovs) {
|
||||
int state = guild.getGuildState().getStateID();
|
||||
int state = guild.guildState.getStateID();
|
||||
|
||||
writer.putInt(guild.getObjectType().ordinal());
|
||||
writer.putInt(guild.getObjectUUID());
|
||||
|
||||
@@ -602,10 +602,10 @@ public class Building extends AbstractWorldObject {
|
||||
|
||||
this.isDeranking.compareAndSet(false, true);
|
||||
|
||||
if ((bane.getOwner().getGuild().getGuildState() == GuildState.Sovereign) ||
|
||||
(bane.getOwner().getGuild().getGuildState() == GuildState.Protectorate) ||
|
||||
(bane.getOwner().getGuild().getGuildState() == GuildState.Province) ||
|
||||
(bane.getOwner().getGuild().getGuildState() == GuildState.Nation))
|
||||
if ((bane.getOwner().getGuild().guildState == GuildState.Sovereign) ||
|
||||
(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;
|
||||
|
||||
@@ -813,10 +813,10 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
// Determine if this city is a nation capitol
|
||||
|
||||
if (this.getGuild().getGuildState() == GuildState.Nation)
|
||||
if (this.getGuild().guildState == GuildState.Nation)
|
||||
for (Guild sub : this.getGuild().getSubGuildList()) {
|
||||
|
||||
if ((sub.getGuildState() == GuildState.Protectorate) || (sub.getGuildState() == GuildState.Province)) {
|
||||
if ((sub.guildState == GuildState.Protectorate) || (sub.guildState == GuildState.Province)) {
|
||||
this.isCapital = 1;
|
||||
break;
|
||||
}
|
||||
@@ -1186,7 +1186,7 @@ public class City extends AbstractWorldObject {
|
||||
sourceGuild.setCityUUID(this.getObjectUUID());
|
||||
|
||||
sourceGuild.setNation(sourceGuild);
|
||||
sourceGuild.setGuildState(GuildState.Sovereign);
|
||||
sourceGuild.guildState = GuildState.Sovereign;
|
||||
GuildManager.updateAllGuildTags(sourceGuild);
|
||||
GuildManager.updateAllGuildBinds(sourceGuild, this);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class Guild extends AbstractWorldObject {
|
||||
private ArrayList<Guild> recommendList = new ArrayList<>();
|
||||
private ArrayList<Guild> subGuildList;
|
||||
private int nationUUID = 0;
|
||||
private GuildState guildState = GuildState.Errant;
|
||||
public GuildState guildState = GuildState.Errant;
|
||||
private String hash;
|
||||
private boolean ownerIsNPC;
|
||||
|
||||
@@ -901,14 +901,6 @@ public class Guild extends AbstractWorldObject {
|
||||
return motto;
|
||||
}
|
||||
|
||||
public GuildState getGuildState() {
|
||||
return guildState;
|
||||
}
|
||||
|
||||
public void setGuildState(GuildState guildState) {
|
||||
this.guildState = guildState;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the realmsOwned
|
||||
*/
|
||||
|
||||
@@ -63,7 +63,7 @@ public class DestroyCityThread implements Runnable {
|
||||
|
||||
//Successful Update of guild
|
||||
|
||||
formerGuild.setGuildState(mbEnums.GuildState.Errant);
|
||||
formerGuild.guildState = mbEnums.GuildState.Errant;
|
||||
formerGuild.setNation(null);
|
||||
formerGuild.setCityUUID(0);
|
||||
GuildManager.updateAllGuildTags(formerGuild);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class TransferCityThread implements Runnable {
|
||||
|
||||
if (formerGuild != null)
|
||||
if (DbManager.GuildQueries.SET_GUILD_OWNED_CITY(formerGuild.getObjectUUID(), 0)) {
|
||||
formerGuild.setGuildState(mbEnums.GuildState.Errant);
|
||||
formerGuild.guildState = mbEnums.GuildState.Errant;
|
||||
formerGuild.setNation(null);
|
||||
formerGuild.setCityUUID(0);
|
||||
GuildManager.updateAllGuildTags(formerGuild);
|
||||
|
||||
Reference in New Issue
Block a user