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