rename method to isEmptyGuild() so as not to confuse with GuildState.
This commit is contained in:
@@ -1457,7 +1457,7 @@ boolean updateCity = false;
|
||||
return;
|
||||
|
||||
//make sure mine belongs to guild
|
||||
if (mine.getOwningGuild().isErrant() || mine.getOwningGuild().getObjectUUID() != sourcePlayer.getGuild().getObjectUUID())
|
||||
if (mine.getOwningGuild().isEmptyGuild() || mine.getOwningGuild().getObjectUUID() != sourcePlayer.getGuild().getObjectUUID())
|
||||
return;
|
||||
|
||||
//make sure valid resource
|
||||
|
||||
@@ -80,7 +80,7 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
|
||||
if ( (player.getGuild() != null) &&
|
||||
(player.getGuild().isErrant() == false)) {
|
||||
(player.getGuild().isEmptyGuild() == false)) {
|
||||
ChatManager.chatGuildError(player,
|
||||
"You already belongs to a guild!");
|
||||
return true;
|
||||
|
||||
@@ -46,10 +46,10 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
Guild toGuild = null;
|
||||
toGuild = Guild.getGuild(msg.getSourceGuildID());
|
||||
if (toGuild.isErrant())
|
||||
if (toGuild.isEmptyGuild())
|
||||
return true;
|
||||
|
||||
if (player.getGuild().isErrant())
|
||||
if (player.getGuild().isEmptyGuild())
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
if (player.getGuild() != null && !player.getGuild().isErrant()) {
|
||||
if (player.getGuild() != null && !player.getGuild().isEmptyGuild()) {
|
||||
Guild.UpdateClientAlliancesForPlayer(player);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
|
||||
int target = msg.getTarget();
|
||||
PlayerCharacter source = origin.getPlayerCharacter();
|
||||
|
||||
if(source == null || source.getGuild().isErrant() || source.getGuild().getObjectUUID() == 0)
|
||||
if(source == null || source.getGuild().isEmptyGuild() || source.getGuild().getObjectUUID() == 0)
|
||||
return true;
|
||||
|
||||
if (GuildStatusController.isGuildLeader(source.getGuildStatus()) == false && GuildStatusController.isInnerCouncil(source.getGuildStatus()) == false)
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ClaimAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Errant players cannot claim
|
||||
|
||||
if (sourcePlayer.getGuild().isErrant())
|
||||
if (sourcePlayer.getGuild().isEmptyGuild())
|
||||
return true;
|
||||
|
||||
// Can't claim an object without a blueprint
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Errant players cannot rename
|
||||
|
||||
if (sourcePlayer.getGuild().isErrant())
|
||||
if (sourcePlayer.getGuild().isEmptyGuild())
|
||||
return true;
|
||||
|
||||
// Can't rename an object without a blueprint
|
||||
@@ -100,7 +100,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
|
||||
//dont rename if guild is null
|
||||
if (building.getGuild().isErrant())
|
||||
if (building.getGuild().isEmptyGuild())
|
||||
return true;
|
||||
|
||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
||||
@@ -131,7 +131,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (building.getGuild().isErrant())
|
||||
if (building.getGuild().isEmptyGuild())
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler {
|
||||
|
||||
guild = player.getGuild();
|
||||
|
||||
if (guild == null || guild.isErrant())
|
||||
if (guild == null || guild.isEmptyGuild())
|
||||
return true;
|
||||
|
||||
// Don't allow disbanding if a city is owned
|
||||
@@ -86,7 +86,7 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Remove us as a subguild of our nation
|
||||
|
||||
if (guild.getNation() != null && Guild.sameGuild(guild, guild.getNation()) == false && guild.getNation().isErrant() == false)
|
||||
if (guild.getNation() != null && Guild.sameGuild(guild, guild.getNation()) == false && guild.getNation().isEmptyGuild() == false)
|
||||
guild.getNation().removeSubGuild(guild);
|
||||
|
||||
// Update all online guild players
|
||||
|
||||
@@ -79,7 +79,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// get sourcePlayer guild. Verify sourcePlayer player is in guild
|
||||
|
||||
if (sourcePlayer.getGuild().getObjectUUID() == 0 || sourcePlayer.getGuild().isErrant()) {
|
||||
if (sourcePlayer.getGuild().getObjectUUID() == 0 || sourcePlayer.getGuild().isEmptyGuild()) {
|
||||
ChatManager.chatGuildError(sourcePlayer,
|
||||
"You cannot invite someone for errant!");
|
||||
return true;
|
||||
@@ -107,7 +107,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler {
|
||||
if (targetPlayer.isIgnoringPlayer(sourcePlayer))
|
||||
return true;
|
||||
|
||||
if ((targetPlayer.getGuild().isErrant() == false)) {
|
||||
if ((targetPlayer.getGuild().isEmptyGuild() == false)) {
|
||||
ChatManager.chatGuildError(sourcePlayer,
|
||||
targetPlayer.getFirstName() + " already belongs to a guild!");
|
||||
return true;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sourceGuild.isErrant()){
|
||||
if (sourceGuild.isEmptyGuild()){
|
||||
sendChat(source, "You must be in a guild to invite to sub.");
|
||||
return true;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sourceGuild.getNation().isErrant())
|
||||
if (sourceGuild.getNation().isEmptyGuild())
|
||||
return true;
|
||||
|
||||
//target must be in a guild
|
||||
|
||||
@@ -57,7 +57,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler {
|
||||
// get old Guild
|
||||
Guild oldGuild = playerCharacter.getGuild();
|
||||
|
||||
if (oldGuild == null || oldGuild.isErrant()) {
|
||||
if (oldGuild == null || oldGuild.isEmptyGuild()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,12 +129,12 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGuild().isErrant()){
|
||||
if (player.getGuild().isEmptyGuild()){
|
||||
ErrorPopupMsg.sendErrorMsg(player, "You do not belong to a guild!"); //Cannot sub as errant guild.
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGuild().getNation() != null && !player.getGuild().getNation().isErrant()){
|
||||
if (player.getGuild().getNation() != null && !player.getGuild().getNation().isEmptyGuild()){
|
||||
ErrorPopupMsg.sendErrorMsg(player, "You already belong to a nation!"); //Cannot sub as errant guild.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,19 +9,15 @@
|
||||
package engine.net.client.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.ArcMineWindowChangeMsg;
|
||||
import engine.net.client.msg.ClientNetMsg;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.net.client.msg.KeepAliveServerClientMsg;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.GuildStatusController;
|
||||
@@ -65,7 +61,7 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler {
|
||||
|
||||
Guild mineGuild = treeOfLife.getGuild();
|
||||
|
||||
if (mineGuild.isErrant())
|
||||
if (mineGuild.isEmptyGuild())
|
||||
return true;
|
||||
|
||||
if (!Guild.sameGuild(mineGuild, playerCharacter.getGuild()))
|
||||
|
||||
@@ -431,7 +431,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
if (building.getGuild() == null)
|
||||
continue;
|
||||
|
||||
if (building.getGuild().isErrant())
|
||||
if (building.getGuild().isEmptyGuild())
|
||||
continue;
|
||||
|
||||
if (!building.getGuild().equals(serverCity.getGuild()) && !building.getGuild().equals(serverCity.getBane().getOwner().getGuild()))
|
||||
@@ -1384,7 +1384,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
|
||||
|
||||
// Make sure it's not an errant tree
|
||||
|
||||
if ( (city.getGuild() == null || city.getGuild().isErrant() == true)) {
|
||||
if ( (city.getGuild() == null || city.getGuild().isEmptyGuild() == true)) {
|
||||
PlaceAssetMsg.sendPlaceAssetError(origin, 18, ""); //"There are no guild trees to be found"
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class TaxCityMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
|
||||
if (playerGuild == null || playerGuild.isErrant()){
|
||||
if (playerGuild == null || playerGuild.isEmptyGuild()){
|
||||
ErrorPopupMsg.sendErrorMsg(player, "You must belong to a guild to do that!");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class GuildTreeStatusMsg extends ClientNetMsg {
|
||||
canAccess = this.canModify();
|
||||
canBind = 0;
|
||||
|
||||
if (player.getGuild() != null && this.treeOfLife.getGuild() != null && !this.treeOfLife.getGuild().isErrant()
|
||||
if (player.getGuild() != null && this.treeOfLife.getGuild() != null && !this.treeOfLife.getGuild().isEmptyGuild()
|
||||
&& player.getGuild().getNation() == this.treeOfLife.getGuild().getNation())
|
||||
canBind = 1;
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg {
|
||||
writer.putInt(guild.getObjectType().ordinal());
|
||||
writer.putInt(guild.getObjectUUID());
|
||||
|
||||
if (!guild.getNation().isErrant()) {
|
||||
if (!guild.getNation().isEmptyGuild()) {
|
||||
writer.putInt(guild.getNation().getObjectType().ordinal());
|
||||
writer.putInt(guild.getNation().getObjectUUID());
|
||||
}else{
|
||||
@@ -741,7 +741,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg {
|
||||
writer.putInt(heraldryCharacter.getGuild().getObjectType().ordinal());
|
||||
writer.putInt(heraldryCharacter.getGuild().getObjectUUID());
|
||||
|
||||
if (!heraldryCharacter.getGuild().getNation().isErrant()) {
|
||||
if (!heraldryCharacter.getGuild().getNation().isEmptyGuild()) {
|
||||
writer.putInt(heraldryCharacter.getGuild().getNation().getObjectType().ordinal());
|
||||
writer.putInt(heraldryCharacter.getGuild().getNation().getObjectUUID());
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user