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 { @@ -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");
return;
}

2
src/engine/gameManager/BuildingManager.java

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

4
src/engine/gameManager/GuildManager.java

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

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

@ -1457,7 +1457,7 @@ boolean updateCity = false; @@ -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

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

@ -80,7 +80,7 @@ public class AcceptInviteToGuildHandler extends AbstractClientMsgHandler { @@ -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;

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

@ -46,10 +46,10 @@ public class AllianceChangeMsgHandler extends AbstractClientMsgHandler { @@ -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;

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

@ -133,7 +133,7 @@ public class ArcLoginNotifyMsgHandler extends AbstractClientMsgHandler { @@ -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;

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

@ -42,7 +42,7 @@ public class BanishUnbanishHandler extends AbstractClientMsgHandler { @@ -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)

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

@ -90,7 +90,7 @@ public class ClaimAssetMsgHandler extends AbstractClientMsgHandler { @@ -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

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

@ -85,7 +85,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler { @@ -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 { @@ -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 { @@ -131,7 +131,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
return true;
}
if (building.getGuild().isErrant())
if (building.getGuild().isEmptyGuild())
return true;

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

@ -52,7 +52,7 @@ public class DisbandGuildHandler extends AbstractClientMsgHandler { @@ -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 { @@ -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

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

@ -79,7 +79,7 @@ public class InviteToGuildHandler extends AbstractClientMsgHandler { @@ -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 { @@ -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;

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

@ -68,7 +68,7 @@ public class InviteToSubHandler extends AbstractClientMsgHandler { @@ -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 { @@ -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

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

@ -57,7 +57,7 @@ public class LeaveGuildHandler extends AbstractClientMsgHandler { @@ -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;
}

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

@ -129,12 +129,12 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler { @@ -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;
}

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

@ -9,19 +9,15 @@ @@ -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 { @@ -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()))

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

@ -431,7 +431,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -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 { @@ -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;
}

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

@ -68,7 +68,7 @@ public class TaxCityMsgHandler extends AbstractClientMsgHandler { @@ -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;
}

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

@ -100,7 +100,7 @@ public class GuildTreeStatusMsg extends ClientNetMsg { @@ -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;

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

@ -644,7 +644,7 @@ public class OpenFriendsCondemnListMsg extends ClientNetMsg { @@ -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 { @@ -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{

8
src/engine/objects/Bane.java

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

16
src/engine/objects/City.java

@ -159,7 +159,7 @@ public class City extends AbstractWorldObject { @@ -159,7 +159,7 @@ public class City extends AbstractWorldObject {
if (this.motto.isEmpty()){
Guild guild = this.getGuild();
if (guild != null && guild.isErrant() == false)
if (guild != null && guild.isEmptyGuild() == false)
this.motto = guild.getMotto();
}
@ -489,7 +489,7 @@ public class City extends AbstractWorldObject { @@ -489,7 +489,7 @@ public class City extends AbstractWorldObject {
// Begin serializing nation guild info
if (rulingNation.isErrant()){
if (rulingNation.isEmptyGuild()){
writer.putInt(rulingGuild.getObjectType().ordinal());
writer.putInt(rulingGuild.getObjectUUID());
}
@ -502,7 +502,7 @@ public class City extends AbstractWorldObject { @@ -502,7 +502,7 @@ public class City extends AbstractWorldObject {
// Serialize nation name
if (rulingNation.isErrant())
if (rulingNation.isEmptyGuild())
writer.putString("None");
else
writer.putString(rulingNation.getName());
@ -516,7 +516,7 @@ public class City extends AbstractWorldObject { @@ -516,7 +516,7 @@ public class City extends AbstractWorldObject {
writer.putInt(city.population);
if (rulingNation.isErrant())
if (rulingNation.isEmptyGuild())
writer.putString(" ");
else
writer.putString(Guild.GetGL(rulingNation).getFirstName() + ' ' + Guild.GetGL(rulingNation).getLastName());
@ -1126,7 +1126,7 @@ public class City extends AbstractWorldObject { @@ -1126,7 +1126,7 @@ public class City extends AbstractWorldObject {
sourceNation = sourcePlayer.getGuild().getNation();
if (sourceGuild.isErrant())
if (sourceGuild.isEmptyGuild())
return;
//cant claim tree with owned tree.
@ -1147,7 +1147,7 @@ public class City extends AbstractWorldObject { @@ -1147,7 +1147,7 @@ public class City extends AbstractWorldObject {
// If currently a sub of another guild, desub when
// 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)) {
ChatManager.chatGuildError((PlayerCharacter) sourcePlayer, "A Serious error has occurred. Please post details for to ensure transaction integrity");
return;
@ -1221,7 +1221,7 @@ public class City extends AbstractWorldObject { @@ -1221,7 +1221,7 @@ public class City extends AbstractWorldObject {
if (sourceGuild == null)
return false;
if (sourceGuild.isErrant())
if (sourceGuild.isEmptyGuild())
return false;
cityZone = this.parentZone;
@ -1364,7 +1364,7 @@ public class City extends AbstractWorldObject { @@ -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!");
return true;
}

4
src/engine/objects/Experience.java

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

22
src/engine/objects/Guild.java

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

20
src/engine/objects/Mine.java

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

2
src/engine/objects/NPC.java

@ -262,7 +262,7 @@ public class NPC extends AbstractCharacter { @@ -262,7 +262,7 @@ public class NPC extends AbstractCharacter {
else
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);
else if(this.building == null && buildingID > 0) {
NPC.Oprhans.add(currentID);

10
src/engine/objects/PlayerCharacter.java

@ -529,7 +529,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -529,7 +529,7 @@ public class PlayerCharacter extends AbstractCharacter {
aN = attacker.getGuild().getNation();
if (this.getGuild() != null)
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.
} else {
doPVPEXP = true;
@ -1458,7 +1458,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -1458,7 +1458,7 @@ public class PlayerCharacter extends AbstractCharacter {
Building returnBuilding;
if (player.getGuild() == null || player.getGuild().isErrant())
if (player.getGuild() == null || player.getGuild().isEmptyGuild())
return null;
if (player.getGuild().getOwnedCity() == null){
@ -1899,7 +1899,7 @@ public void dismissNecroPets() { @@ -1899,7 +1899,7 @@ public void dismissNecroPets() {
Guild g = this.guild;
if (g == null || g.isErrant() || GuildStatusController.isGuildLeader(guildStatus))
if (g == null || g.isEmptyGuild() || GuildStatusController.isGuildLeader(guildStatus))
return;
//check level
@ -4584,7 +4584,7 @@ public void dismissNecroPets() { @@ -4584,7 +4584,7 @@ public void dismissNecroPets() {
int guildID = 0;
if (!value.isErrant())
if (!value.isEmptyGuild())
guildID = value.getObjectUUID();
DbManager.PlayerCharacterQueries.UPDATE_GUILD(this, guildID);
super.setGuild(value);
@ -5306,7 +5306,7 @@ public void dismissNecroPets() { @@ -5306,7 +5306,7 @@ public void dismissNecroPets() {
public static int GetPlayerRealmTitle(PlayerCharacter player){
if (player.getGuild().isErrant())
if (player.getGuild().isEmptyGuild())
return 0;
if (!player.getGuild().isGuildLeader(player.getObjectUUID()))
return 0;

2
src/engine/workthreads/HourlyJobThread.java

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

Loading…
Cancel
Save