Browse Source

rename method to isEmptyGuild() so as not to confuse with GuildState.

master
MagicBot 2 years ago
parent
commit
825f41e469
  1. 2
      src/engine/devcmd/cmds/MakeBaneCmd.java
  2. 2
      src/engine/gameManager/BuildingManager.java
  3. 4
      src/engine/gameManager/GuildManager.java
  4. 2
      src/engine/net/client/ClientMessagePump.java
  5. 2
      src/engine/net/client/handlers/AcceptInviteToGuildHandler.java
  6. 4
      src/engine/net/client/handlers/AllianceChangeMsgHandler.java
  7. 2
      src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java
  8. 2
      src/engine/net/client/handlers/BanishUnbanishHandler.java
  9. 2
      src/engine/net/client/handlers/ClaimAssetMsgHandler.java
  10. 6
      src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java
  11. 4
      src/engine/net/client/handlers/DisbandGuildHandler.java
  12. 4
      src/engine/net/client/handlers/InviteToGuildHandler.java
  13. 4
      src/engine/net/client/handlers/InviteToSubHandler.java
  14. 2
      src/engine/net/client/handlers/LeaveGuildHandler.java
  15. 4
      src/engine/net/client/handlers/MerchantMsgHandler.java
  16. 6
      src/engine/net/client/handlers/MineWindowChangeHandler.java
  17. 4
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  18. 2
      src/engine/net/client/handlers/TaxCityMsgHandler.java
  19. 2
      src/engine/net/client/msg/GuildTreeStatusMsg.java
  20. 4
      src/engine/net/client/msg/OpenFriendsCondemnListMsg.java
  21. 8
      src/engine/objects/Bane.java
  22. 16
      src/engine/objects/City.java
  23. 4
      src/engine/objects/Experience.java
  24. 22
      src/engine/objects/Guild.java
  25. 20
      src/engine/objects/Mine.java
  26. 2
      src/engine/objects/NPC.java
  27. 10
      src/engine/objects/PlayerCharacter.java
  28. 2
      src/engine/workthreads/HourlyJobThread.java

2
src/engine/devcmd/cmds/MakeBaneCmd.java

@ -80,7 +80,7 @@ public class MakeBaneCmd extends AbstractDevCmd {
if (player.getGuild().isErrant()) { if (player.getGuild().isEmptyGuild()) {
throwbackError(pc, "Errant's can not place banes"); throwbackError(pc, "Errant's can not place banes");
return; return;
} }

2
src/engine/gameManager/BuildingManager.java

@ -328,7 +328,7 @@ public enum BuildingManager {
if (building.getOwner().equals(player)) if (building.getOwner().equals(player))
return true; return true;
if (player.getGuild().isErrant()) if (player.getGuild().isEmptyGuild())
return false; return false;
if (building.getGuild().isGuildLeader(player.getObjectUUID())) if (building.getGuild().isGuildLeader(player.getObjectUUID()))

4
src/engine/gameManager/GuildManager.java

@ -61,13 +61,13 @@ public enum GuildManager {
if (origin == null) if (origin == null)
return false; return false;
if (playerCharacter.getGuild().isErrant() == false && GuildStatusController.isGuildLeader(playerCharacter.getGuildStatus())) if (playerCharacter.getGuild().isEmptyGuild() == false && GuildStatusController.isGuildLeader(playerCharacter.getGuildStatus()))
return false; return false;
if (playerCharacter.getGuild() != null && playerCharacter.getGuild().isGuildLeader(playerCharacter.getObjectUUID())) if (playerCharacter.getGuild() != null && playerCharacter.getGuild().isGuildLeader(playerCharacter.getObjectUUID()))
return false; return false;
if (playerCharacter.getGuild() != null && !playerCharacter.getGuild().isErrant()){ if (playerCharacter.getGuild() != null && !playerCharacter.getGuild().isEmptyGuild()){
if (DbManager.GuildQueries.ADD_TO_GUILDHISTORY(playerCharacter.getGuildUUID(), playerCharacter, DateTime.now(), GuildHistoryType.LEAVE)){ if (DbManager.GuildQueries.ADD_TO_GUILDHISTORY(playerCharacter.getGuildUUID(), playerCharacter, DateTime.now(), GuildHistoryType.LEAVE)){
GuildHistory guildHistory = new GuildHistory(playerCharacter.getGuildUUID(),playerCharacter.getGuild().getName(),DateTime.now(), GuildHistoryType.LEAVE) ; GuildHistory guildHistory = new GuildHistory(playerCharacter.getGuildUUID(),playerCharacter.getGuild().getName(),DateTime.now(), GuildHistoryType.LEAVE) ;
playerCharacter.getGuildHistory().add(guildHistory); playerCharacter.getGuildHistory().add(guildHistory);

2
src/engine/net/client/ClientMessagePump.java

@ -1457,7 +1457,7 @@ boolean updateCity = false;
return; return;
//make sure mine belongs to guild //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; return;
//make sure valid resource //make sure valid resource

2
src/engine/net/client/handlers/AcceptInviteToGuildHandler.java

@ -80,7 +80,7 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler {
return true; return true;
if ( (player.getGuild() != null) && if ( (player.getGuild() != null) &&
(player.getGuild().isErrant() == false)) { (player.getGuild().isEmptyGuild() == false)) {
ChatManager.chatGuildError(player, ChatManager.chatGuildError(player,
"You already belongs to a guild!"); "You already belongs to a guild!");
return true; return true;

4
src/engine/net/client/handlers/AllianceChangeMsgHandler.java

@ -46,10 +46,10 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler {
Guild toGuild = null; Guild toGuild = null;
toGuild = Guild.getGuild(msg.getSourceGuildID()); toGuild = Guild.getGuild(msg.getSourceGuildID());
if (toGuild.isErrant()) if (toGuild.isEmptyGuild())
return true; return true;
if (player.getGuild().isErrant()) if (player.getGuild().isEmptyGuild())
return true; return true;

2
src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java

@ -133,7 +133,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler {
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
} }
if (player.getGuild() != null && !player.getGuild().isErrant()) { if (player.getGuild() != null && !player.getGuild().isEmptyGuild()) {
Guild.UpdateClientAlliancesForPlayer(player); Guild.UpdateClientAlliancesForPlayer(player);
} }
return true; return true;

2
src/engine/net/client/handlers/BanishUnbanishHandler.java

@ -42,7 +42,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler {
int target = msg.getTarget(); int target = msg.getTarget();
PlayerCharacter source = origin.getPlayerCharacter(); 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; return true;
if (GuildStatusController.isGuildLeader(source.getGuildStatus()) == false && GuildStatusController.isInnerCouncil(source.getGuildStatus()) == false) if (GuildStatusController.isGuildLeader(source.getGuildStatus()) == false && GuildStatusController.isInnerCouncil(source.getGuildStatus()) == false)

2
src/engine/net/client/handlers/ClaimAssetMsgHandler.java

@ -90,7 +90,7 @@ public class ClaimAssetMsgHandler extends AbstractClientMsgHandler {
// Errant players cannot claim // Errant players cannot claim
if (sourcePlayer.getGuild().isErrant()) if (sourcePlayer.getGuild().isEmptyGuild())
return true; return true;
// Can't claim an object without a blueprint // Can't claim an object without a blueprint

6
src/engine/net/client/handlers/ClaimGuildTreeMsgHandler.java

@ -85,7 +85,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
// Errant players cannot rename // Errant players cannot rename
if (sourcePlayer.getGuild().isErrant()) if (sourcePlayer.getGuild().isEmptyGuild())
return true; return true;
// Can't rename an object without a blueprint // Can't rename an object without a blueprint
@ -100,7 +100,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
return true; return true;
//dont rename if guild is null //dont rename if guild is null
if (building.getGuild().isErrant()) if (building.getGuild().isEmptyGuild())
return true; return true;
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building)) if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
@ -131,7 +131,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
return true; return true;
} }
if (building.getGuild().isErrant()) if (building.getGuild().isEmptyGuild())
return true; return true;

4
src/engine/net/client/handlers/DisbandGuildHandler.java

@ -52,7 +52,7 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler {
guild = player.getGuild(); guild = player.getGuild();
if (guild == null || guild.isErrant()) if (guild == null || guild.isEmptyGuild())
return true; return true;
// Don't allow disbanding if a city is owned // 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 // 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); guild.getNation().removeSubGuild(guild);
// Update all online guild players // Update all online guild players

4
src/engine/net/client/handlers/InviteToGuildHandler.java

@ -79,7 +79,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler {
// get sourcePlayer guild. Verify sourcePlayer player is in guild // 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, ChatManager.chatGuildError(sourcePlayer,
"You cannot invite someone for errant!"); "You cannot invite someone for errant!");
return true; return true;
@ -107,7 +107,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler {
if (targetPlayer.isIgnoringPlayer(sourcePlayer)) if (targetPlayer.isIgnoringPlayer(sourcePlayer))
return true; return true;
if ((targetPlayer.getGuild().isErrant() == false)) { if ((targetPlayer.getGuild().isEmptyGuild() == false)) {
ChatManager.chatGuildError(sourcePlayer, ChatManager.chatGuildError(sourcePlayer,
targetPlayer.getFirstName() + " already belongs to a guild!"); targetPlayer.getFirstName() + " already belongs to a guild!");
return true; return true;

4
src/engine/net/client/handlers/InviteToSubHandler.java

@ -68,7 +68,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
return true; return true;
} }
if (sourceGuild.isErrant()){ if (sourceGuild.isEmptyGuild()){
sendChat(source, "You must be in a guild to invite to sub."); sendChat(source, "You must be in a guild to invite to sub.");
return true; return true;
} }
@ -80,7 +80,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
return true; return true;
} }
if (sourceGuild.getNation().isErrant()) if (sourceGuild.getNation().isEmptyGuild())
return true; return true;
//target must be in a guild //target must be in a guild

2
src/engine/net/client/handlers/LeaveGuildHandler.java

@ -57,7 +57,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler {
// get old Guild // get old Guild
Guild oldGuild = playerCharacter.getGuild(); Guild oldGuild = playerCharacter.getGuild();
if (oldGuild == null || oldGuild.isErrant()) { if (oldGuild == null || oldGuild.isEmptyGuild()) {
return true; return true;
} }

4
src/engine/net/client/handlers/MerchantMsgHandler.java

@ -129,12 +129,12 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
return; return;
} }
if (player.getGuild().isErrant()){ if (player.getGuild().isEmptyGuild()){
ErrorPopupMsg.sendErrorMsg(player, "You do not belong to a guild!"); //Cannot sub as errant guild. ErrorPopupMsg.sendErrorMsg(player, "You do not belong to a guild!"); //Cannot sub as errant guild.
return; 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. ErrorPopupMsg.sendErrorMsg(player, "You already belong to a nation!"); //Cannot sub as errant guild.
return; return;
} }

6
src/engine/net/client/handlers/MineWindowChangeHandler.java

@ -9,19 +9,15 @@
package engine.net.client.handlers; package engine.net.client.handlers;
import engine.Enum; import engine.Enum;
import engine.Enum.DispatchChannel;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.ArcMineWindowChangeMsg; import engine.net.client.msg.ArcMineWindowChangeMsg;
import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.KeepAliveServerClientMsg;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.Guild; import engine.objects.Guild;
import engine.objects.GuildStatusController; import engine.objects.GuildStatusController;
@ -65,7 +61,7 @@ public class MineWindowChangeHandler extends AbstractClientMsgHandler {
Guild mineGuild = treeOfLife.getGuild(); Guild mineGuild = treeOfLife.getGuild();
if (mineGuild.isErrant()) if (mineGuild.isEmptyGuild())
return true; return true;
if (!Guild.sameGuild(mineGuild, playerCharacter.getGuild())) if (!Guild.sameGuild(mineGuild, playerCharacter.getGuild()))

4
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -431,7 +431,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
if (building.getGuild() == null) if (building.getGuild() == null)
continue; continue;
if (building.getGuild().isErrant()) if (building.getGuild().isEmptyGuild())
continue; continue;
if (!building.getGuild().equals(serverCity.getGuild()) && !building.getGuild().equals(serverCity.getBane().getOwner().getGuild())) 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 // 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" PlaceAssetMsg.sendPlaceAssetError(origin, 18, ""); //"There are no guild trees to be found"
return false; return false;
} }

2
src/engine/net/client/handlers/TaxCityMsgHandler.java

@ -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!"); ErrorPopupMsg.sendErrorMsg(player, "You must belong to a guild to do that!");
return true; return true;
} }

2
src/engine/net/client/msg/GuildTreeStatusMsg.java

@ -100,7 +100,7 @@ public class GuildTreeStatusMsg extends ClientNetMsg {
canAccess = this.canModify(); canAccess = this.canModify();
canBind = 0; 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()) && player.getGuild().getNation() == this.treeOfLife.getGuild().getNation())
canBind = 1; canBind = 1;

4
src/engine/net/client/msg/OpenFriendsCondemnListMsg.java

@ -644,7 +644,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg {
writer.putInt(guild.getObjectType().ordinal()); writer.putInt(guild.getObjectType().ordinal());
writer.putInt(guild.getObjectUUID()); writer.putInt(guild.getObjectUUID());
if (!guild.getNation().isErrant()) { if (!guild.getNation().isEmptyGuild()) {
writer.putInt(guild.getNation().getObjectType().ordinal()); writer.putInt(guild.getNation().getObjectType().ordinal());
writer.putInt(guild.getNation().getObjectUUID()); writer.putInt(guild.getNation().getObjectUUID());
}else{ }else{
@ -741,7 +741,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg {
writer.putInt(heraldryCharacter.getGuild().getObjectType().ordinal()); writer.putInt(heraldryCharacter.getGuild().getObjectType().ordinal());
writer.putInt(heraldryCharacter.getGuild().getObjectUUID()); 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().getObjectType().ordinal());
writer.putInt(heraldryCharacter.getGuild().getNation().getObjectUUID()); writer.putInt(heraldryCharacter.getGuild().getNation().getObjectUUID());
}else{ }else{

8
src/engine/objects/Bane.java

@ -120,7 +120,7 @@ public final class Bane {
baningGuild = player.getGuild(); baningGuild = player.getGuild();
if (baningGuild.getNation().isErrant()) { if (baningGuild.getNation().isEmptyGuild()) {
PlaceAssetMsg.sendPlaceAssetError( origin, 55, ""); // You must be in a Nation PlaceAssetMsg.sendPlaceAssetError( origin, 55, ""); // You must be in a Nation
return false; return false;
} }
@ -464,7 +464,7 @@ public final class Bane {
public static Bane getBaneByAttackerGuild(Guild guild) { public static Bane getBaneByAttackerGuild(Guild guild) {
if (guild == null || guild.isErrant()) if (guild == null || guild.isEmptyGuild())
return null; return null;
ArrayList<Bane> baneList; ArrayList<Bane> baneList;
@ -620,10 +620,10 @@ public final class Bane {
return isErrant; return isErrant;
if (this.getOwner().getGuild().isErrant() == true) if (this.getOwner().getGuild().isEmptyGuild() == true)
return isErrant; return isErrant;
if (this.getOwner().getGuild().getNation().isErrant() == true) if (this.getOwner().getGuild().getNation().isEmptyGuild() == true)
return isErrant; return isErrant;
// Bane passes validation // Bane passes validation

16
src/engine/objects/City.java

@ -159,7 +159,7 @@ public class City extends AbstractWorldObject {
if (this.motto.isEmpty()){ if (this.motto.isEmpty()){
Guild guild = this.getGuild(); Guild guild = this.getGuild();
if (guild != null && guild.isErrant() == false) if (guild != null && guild.isEmptyGuild() == false)
this.motto = guild.getMotto(); this.motto = guild.getMotto();
} }
@ -489,7 +489,7 @@ public class City extends AbstractWorldObject {
// Begin serializing nation guild info // Begin serializing nation guild info
if (rulingNation.isErrant()){ if (rulingNation.isEmptyGuild()){
writer.putInt(rulingGuild.getObjectType().ordinal()); writer.putInt(rulingGuild.getObjectType().ordinal());
writer.putInt(rulingGuild.getObjectUUID()); writer.putInt(rulingGuild.getObjectUUID());
} }
@ -502,7 +502,7 @@ public class City extends AbstractWorldObject {
// Serialize nation name // Serialize nation name
if (rulingNation.isErrant()) if (rulingNation.isEmptyGuild())
writer.putString("None"); writer.putString("None");
else else
writer.putString(rulingNation.getName()); writer.putString(rulingNation.getName());
@ -516,7 +516,7 @@ public class City extends AbstractWorldObject {
writer.putInt(city.population); writer.putInt(city.population);
if (rulingNation.isErrant()) if (rulingNation.isEmptyGuild())
writer.putString(" "); writer.putString(" ");
else else
writer.putString(Guild.GetGL(rulingNation).getFirstName() + ' ' + Guild.GetGL(rulingNation).getLastName()); writer.putString(Guild.GetGL(rulingNation).getFirstName() + ' ' + Guild.GetGL(rulingNation).getLastName());
@ -1126,7 +1126,7 @@ public class City extends AbstractWorldObject {
sourceNation = sourcePlayer.getGuild().getNation(); sourceNation = sourcePlayer.getGuild().getNation();
if (sourceGuild.isErrant()) if (sourceGuild.isEmptyGuild())
return; return;
//cant claim tree with owned tree. //cant claim tree with owned tree.
@ -1147,7 +1147,7 @@ public class City extends AbstractWorldObject {
// If currently a sub of another guild, desub when // If currently a sub of another guild, desub when
// claiming your new tree and set as Landed // claiming your new tree and set as Landed
if (!sourceNation.isErrant() && sourceNation != sourceGuild) { if (!sourceNation.isEmptyGuild() && sourceNation != sourceGuild) {
if (!DbManager.GuildQueries.UPDATE_PARENT(sourceGuild.getObjectUUID(), MBServerStatics.worldUUID)) { if (!DbManager.GuildQueries.UPDATE_PARENT(sourceGuild.getObjectUUID(), MBServerStatics.worldUUID)) {
ChatManager.chatGuildError((PlayerCharacter) sourcePlayer, "A Serious error has occurred. Please post details for to ensure transaction integrity"); ChatManager.chatGuildError((PlayerCharacter) sourcePlayer, "A Serious error has occurred. Please post details for to ensure transaction integrity");
return; return;
@ -1221,7 +1221,7 @@ public class City extends AbstractWorldObject {
if (sourceGuild == null) if (sourceGuild == null)
return false; return false;
if (sourceGuild.isErrant()) if (sourceGuild.isEmptyGuild())
return false; return false;
cityZone = this.parentZone; cityZone = this.parentZone;
@ -1364,7 +1364,7 @@ public class City extends AbstractWorldObject {
} }
if (playerGuild == null || playerGuild.isErrant()){ if (playerGuild == null || playerGuild.isEmptyGuild()){
ErrorPopupMsg.sendErrorMsg(player, "You must belong to a guild to do that!"); ErrorPopupMsg.sendErrorMsg(player, "You must belong to a guild to do that!");
return true; return true;
} }

4
src/engine/objects/Experience.java

@ -403,7 +403,7 @@ public class Experience {
xp -= (penalty * 0.01) * xp; xp -= (penalty * 0.01) * xp;
// Errant Penalty Calculation // Errant Penalty Calculation
if (pc.getGuild().isErrant()) if (pc.getGuild().isEmptyGuild())
xp *= 0.6; xp *= 0.6;
} }
@ -431,7 +431,7 @@ public class Experience {
// Errant penalty // Errant penalty
if (xp != 1) if (xp != 1)
if (killer.getGuild().isErrant()) if (killer.getGuild().isEmptyGuild())
xp *= .6; xp *= .6;
// Grant XP // Grant XP

22
src/engine/objects/Guild.java

@ -37,8 +37,6 @@ import org.pmw.tinylog.Logger;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -322,7 +320,7 @@ public class Guild extends AbstractWorldObject {
if (ac == null) if (ac == null)
return false; return false;
// errant guilds cant be guild leader. // errant guilds cant be guild leader.
if (this.isErrant()) if (this.isEmptyGuild())
return false; return false;
if (!DbManager.GuildQueries.SET_GUILD_LEADER(ac.getObjectUUID(), this.getObjectUUID())) { if (!DbManager.GuildQueries.SET_GUILD_LEADER(ac.getObjectUUID(), this.getObjectUUID())) {
@ -348,7 +346,7 @@ public class Guild extends AbstractWorldObject {
if (ac == null) if (ac == null)
return false; return false;
// errant guilds cant be guild leader. // errant guilds cant be guild leader.
if (this.isErrant()) if (this.isEmptyGuild())
return false; return false;
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) if (ac.getObjectType().equals(GameObjectType.PlayerCharacter))
@ -401,7 +399,7 @@ public class Guild extends AbstractWorldObject {
* Utils * Utils
*/ */
public boolean isErrant() { public boolean isEmptyGuild() {
return this.getObjectUUID() == Guild.errantGuild.getObjectUUID(); return this.getObjectUUID() == Guild.errantGuild.getObjectUUID();
} }
@ -415,7 +413,7 @@ public class Guild extends AbstractWorldObject {
public static boolean sameGuildExcludeErrant(Guild a, Guild b) { public static boolean sameGuildExcludeErrant(Guild a, Guild b) {
if (a == null || b == null) if (a == null || b == null)
return false; return false;
if (a.isErrant() || b.isErrant()) if (a.isEmptyGuild() || b.isEmptyGuild())
return false; return false;
return a.getObjectUUID() == b.getObjectUUID(); return a.getObjectUUID() == b.getObjectUUID();
} }
@ -423,7 +421,7 @@ public class Guild extends AbstractWorldObject {
public static boolean sameGuildIncludeErrant(Guild a, Guild b) { public static boolean sameGuildIncludeErrant(Guild a, Guild b) {
if (a == null || b == null) if (a == null || b == null)
return false; return false;
if (a.isErrant() || b.isErrant()) if (a.isEmptyGuild() || b.isEmptyGuild())
return true; return true;
return a.getObjectUUID() == b.getObjectUUID(); return a.getObjectUUID() == b.getObjectUUID();
} }
@ -445,7 +443,7 @@ public class Guild extends AbstractWorldObject {
return true; return true;
if (a.nation == null || b.nation == null) if (a.nation == null || b.nation == null)
return false; return false;
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isErrant(); return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
} }
public boolean isGuildLeader(int uuid) { public boolean isGuildLeader(int uuid) {
@ -465,7 +463,7 @@ public class Guild extends AbstractWorldObject {
*/ */
public void removePlayer(PlayerCharacter pc, GuildHistoryType historyType) { public void removePlayer(PlayerCharacter pc, GuildHistoryType historyType) {
if (this.isErrant()) { if (this.isEmptyGuild()) {
Logger.warn("Attempted to remove a PlayerCharacter (" + pc.getObjectUUID() + ") from an errant guild."); Logger.warn("Attempted to remove a PlayerCharacter (" + pc.getObjectUUID() + ") from an errant guild.");
return; return;
} }
@ -830,9 +828,9 @@ public class Guild extends AbstractWorldObject {
this.guildState = GuildState.Nation; this.guildState = GuildState.Nation;
else if (this.nation.equals(this)) else if (this.nation.equals(this))
this.guildState = GuildState.Sovereign; this.guildState = GuildState.Sovereign;
else if (!this.nation.isErrant() && this.cityUUID != 0) else if (!this.nation.isEmptyGuild() && this.cityUUID != 0)
this.guildState = GuildState.Province; this.guildState = GuildState.Province;
else if (!this.nation.isErrant()) else if (!this.nation.isEmptyGuild())
this.guildState = GuildState.Sworn; this.guildState = GuildState.Sworn;
else else
this.guildState = GuildState.Errant; this.guildState = GuildState.Errant;
@ -1253,7 +1251,7 @@ public class Guild extends AbstractWorldObject {
if (guild == null) if (guild == null)
return roster; return roster;
if (guild.isErrant()) if (guild.isEmptyGuild())
return roster; return roster;
if (DbManager.getList(GameObjectType.PlayerCharacter) == null) if (DbManager.getList(GameObjectType.PlayerCharacter) == null)

20
src/engine/objects/Mine.java

@ -104,7 +104,7 @@ public class Mine extends AbstractGameObject {
this.owningGuild = Guild.getGuild(ownerUID); this.owningGuild = Guild.getGuild(ownerUID);
Guild nation = null; Guild nation = null;
if (this.owningGuild.isErrant()) { if (this.owningGuild.isEmptyGuild()) {
this.guildName = ""; this.guildName = "";
this.guildTag = GuildTag.ERRANT; this.guildTag = GuildTag.ERRANT;
nation = Guild.getErrantGuild(); nation = Guild.getErrantGuild();
@ -115,7 +115,7 @@ public class Mine extends AbstractGameObject {
nation = this.owningGuild.getNation(); nation = this.owningGuild.getNation();
} }
if (!nation.isErrant()) { if (!nation.isEmptyGuild()) {
this.nationName = nation.getName(); this.nationName = nation.getName();
this.nationTag = nation.getGuildTag(); this.nationTag = nation.getGuildTag();
} else { } else {
@ -152,10 +152,10 @@ public class Mine extends AbstractGameObject {
return; return;
if (mine.getGuild().isErrant()) if (mine.getGuild().isEmptyGuild())
return; return;
if (mine.getGuild().getNation().isErrant()) if (mine.getGuild().getNation().isEmptyGuild())
return; return;
if (mine.getTimeStamp("MineAttack") > System.currentTimeMillis()) if (mine.getTimeStamp("MineAttack") > System.currentTimeMillis())
@ -298,7 +298,7 @@ public class Mine extends AbstractGameObject {
// If a mine is active serialize current datetime irrespective // If a mine is active serialize current datetime irrespective
// of any claim. // of any claim.
if (mineNatonGuild.isErrant() == false && mine.isActive == false) { if (mineNatonGuild.isEmptyGuild() == false && mine.isActive == false) {
int guildWOO = mineNatonGuild.getNation().getMineTime(); int guildWOO = mineNatonGuild.getNation().getMineTime();
LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO); LocalDateTime guildMineTime = mineOpenTime.withHour(guildWOO);
@ -401,10 +401,10 @@ public class Mine extends AbstractGameObject {
playerGuild = playerCharacter.getGuild(); playerGuild = playerCharacter.getGuild();
if (playerGuild.isErrant()) if (playerGuild.isEmptyGuild())
return false; return false;
if (playerGuild.getNation().isErrant()) if (playerGuild.getNation().isEmptyGuild())
return false; return false;
//Get a count of nation mines, can't go over capital tol rank. //Get a count of nation mines, can't go over capital tol rank.
@ -523,7 +523,7 @@ public class Mine extends AbstractGameObject {
return false; return false;
} }
if (this.owningGuild.isErrant() || this.owningGuild.getNation().isErrant()) if (this.owningGuild.isEmptyGuild() || this.owningGuild.getNation().isEmptyGuild())
return false; return false;
//Update ownership to map //Update ownership to map
@ -580,7 +580,7 @@ public class Mine extends AbstractGameObject {
} }
public boolean depositMineResources() { public boolean depositMineResources() {
if (this.owningGuild.isErrant()) if (this.owningGuild.isEmptyGuild())
return false; return false;
if (this.owningGuild.getOwnedCity() == null) if (this.owningGuild.getOwnedCity() == null)
@ -667,7 +667,7 @@ public class Mine extends AbstractGameObject {
if (this.isExpansion()) if (this.isExpansion())
return (int) totalModded; return (int) totalModded;
if (this.owningGuild.isErrant() == false) { if (this.owningGuild.isEmptyGuild() == false) {
if (this.owningGuild.getOwnedCity() != null) { if (this.owningGuild.getOwnedCity() != null) {
float distanceSquared = this.owningGuild.getOwnedCity().getLoc().distanceSquared2D(mineBuilding.getLoc()); float distanceSquared = this.owningGuild.getOwnedCity().getLoc().distanceSquared2D(mineBuilding.getLoc());

2
src/engine/objects/NPC.java

@ -262,7 +262,7 @@ public class NPC extends AbstractCharacter {
else else
this.guild = Guild.getGuild(guildID); this.guild = Guild.getGuild(guildID);
if (guildID != 0 && (this.guild == null || this.guild.isErrant())) if (guildID != 0 && (this.guild == null || this.guild.isEmptyGuild()))
NPC.Oprhans.add(currentID); NPC.Oprhans.add(currentID);
else if(this.building == null && buildingID > 0) { else if(this.building == null && buildingID > 0) {
NPC.Oprhans.add(currentID); NPC.Oprhans.add(currentID);

10
src/engine/objects/PlayerCharacter.java

@ -529,7 +529,7 @@ public class PlayerCharacter extends AbstractCharacter {
aN = attacker.getGuild().getNation(); aN = attacker.getGuild().getNation();
if (this.getGuild() != null) if (this.getGuild() != null)
tN = this.getGuild().getNation(); tN = this.getGuild().getNation();
if (aN == null || tN == null || aN.isErrant() || Guild.sameGuild(aN, tN) || this.isDeathShroud()) { if (aN == null || tN == null || aN.isEmptyGuild() || Guild.sameGuild(aN, tN) || this.isDeathShroud()) {
//skip giving xp if same guild or attacker is errant, or target is in death shroud. //skip giving xp if same guild or attacker is errant, or target is in death shroud.
} else { } else {
doPVPEXP = true; doPVPEXP = true;
@ -1458,7 +1458,7 @@ public class PlayerCharacter extends AbstractCharacter {
Building returnBuilding; Building returnBuilding;
if (player.getGuild() == null || player.getGuild().isErrant()) if (player.getGuild() == null || player.getGuild().isEmptyGuild())
return null; return null;
if (player.getGuild().getOwnedCity() == null){ if (player.getGuild().getOwnedCity() == null){
@ -1899,7 +1899,7 @@ public void dismissNecroPets() {
Guild g = this.guild; Guild g = this.guild;
if (g == null || g.isErrant() || GuildStatusController.isGuildLeader(guildStatus)) if (g == null || g.isEmptyGuild() || GuildStatusController.isGuildLeader(guildStatus))
return; return;
//check level //check level
@ -4584,7 +4584,7 @@ public void dismissNecroPets() {
int guildID = 0; int guildID = 0;
if (!value.isErrant()) if (!value.isEmptyGuild())
guildID = value.getObjectUUID(); guildID = value.getObjectUUID();
DbManager.PlayerCharacterQueries.UPDATE_GUILD(this, guildID); DbManager.PlayerCharacterQueries.UPDATE_GUILD(this, guildID);
super.setGuild(value); super.setGuild(value);
@ -5306,7 +5306,7 @@ public void dismissNecroPets() {
public static int GetPlayerRealmTitle(PlayerCharacter player){ public static int GetPlayerRealmTitle(PlayerCharacter player){
if (player.getGuild().isErrant()) if (player.getGuild().isEmptyGuild())
return 0; return 0;
if (!player.getGuild().isGuildLeader(player.getObjectUUID())) if (!player.getGuild().isGuildLeader(player.getObjectUUID()))
return 0; return 0;

2
src/engine/workthreads/HourlyJobThread.java

@ -183,7 +183,7 @@ public class HourlyJobThread implements Runnable {
// Open Errant Mines // Open Errant Mines
if (mine.getOwningGuild().isErrant()) { if (mine.getOwningGuild().isEmptyGuild()) {
mine.handleStartMineWindow(); mine.handleStartMineWindow();
Mine.setLastChange(System.currentTimeMillis()); Mine.setLastChange(System.currentTimeMillis());
continue; continue;

Loading…
Cancel
Save