forked from MagicBane/Server
Refactored out method
This commit is contained in:
@@ -72,15 +72,8 @@ public class SwearInGuildHandler extends AbstractClientMsgHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (protectorate.guildState.equals(GuildState.Petitioner) == false) {
|
if (protectorate.guildState.equals(GuildState.Petitioner) == false)
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "This guild has already sworn fealty!");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
if (!Guild.canSwearIn(protectorate)) {
|
|
||||||
ErrorPopupMsg.sendErrorMsg(player, protectorate.guildState.name() + "cannot be sworn in");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false) {
|
||||||
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
|
ErrorPopupMsg.sendErrorMsg(player, "Your do not have such authority!");
|
||||||
|
|||||||
@@ -206,23 +206,6 @@ public class Guild extends AbstractWorldObject {
|
|||||||
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canSwearIn(Guild toSub) {
|
|
||||||
|
|
||||||
boolean canSwear = false;
|
|
||||||
|
|
||||||
switch (toSub.guildState) {
|
|
||||||
|
|
||||||
case Protectorate:
|
|
||||||
case Petitioner:
|
|
||||||
canSwear = true;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
canSwear = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return canSwear;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void _serializeForClientMsg(Guild guild, ByteBufferWriter writer) {
|
public static void _serializeForClientMsg(Guild guild, ByteBufferWriter writer) {
|
||||||
Guild.serializeForClientMsg(guild, writer, null, false);
|
Guild.serializeForClientMsg(guild, writer, null, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user