From ea34418f2d81e602f9d5e68308525a391042543f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 19 Jan 2023 16:22:37 -0500 Subject: [PATCH] Cleanup of duplicate errant guild definitions. --- src/engine/objects/Guild.java | 21 +++++---------------- src/engine/server/login/LoginServer.java | 2 +- src/engine/server/world/WorldServer.java | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/engine/objects/Guild.java b/src/engine/objects/Guild.java index a76f151e..74a16c48 100644 --- a/src/engine/objects/Guild.java +++ b/src/engine/objects/Guild.java @@ -51,7 +51,6 @@ public class Guild extends AbstractWorldObject { private final String name; private Guild nation; - private static Guild g; private final GuildTag guildTag; // TODO add these to database private String motto = ""; @@ -406,23 +405,8 @@ public class Guild extends AbstractWorldObject { /* * Utils */ - - - public static Guild getErrantGuild() { - return g; - } - - public static void CreateErrantGuild(){ - - g = new Guild( "None", Guild.getErrantNation(), 0, - "Anarchy", GuildTag.ERRANT, 0); - g.getObjectType(); - - } public boolean isErrant() { - if (this.getObjectUUID() == Guild.g.getObjectUUID()) - return true; return this.getObjectUUID() == Guild.errant.getObjectUUID(); } @@ -739,6 +723,11 @@ Guild.serializeForClientMsg(guild,writer, null, false); private static Guild errant; + public static Guild getErrantGuild() { + + return Guild.getErrantNation(); + } + public static Guild getErrantNation() { if (Guild.errant == null) Guild.errant = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0); diff --git a/src/engine/server/login/LoginServer.java b/src/engine/server/login/LoginServer.java index 5a44bd09..2933e51d 100644 --- a/src/engine/server/login/LoginServer.java +++ b/src/engine/server/login/LoginServer.java @@ -214,7 +214,7 @@ public class LoginServer { Race.loadAllRaces(); Logger.info("Initializing Errant Guild"); - Guild.CreateErrantGuild(); + Guild.getErrantGuild(); Logger.info("Loading All Guilds"); DbManager.GuildQueries.GET_ALL_GUILDS(); diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 9dce6c5a..8d3d34c0 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -269,7 +269,7 @@ public class WorldServer { ItemProductionManager.ITEMPRODUCTIONMANAGER.startMessagePump(); Logger.info("Initializing Errant Guild"); - Guild.CreateErrantGuild(); + Guild.getErrantGuild(); Logger.info("Initializing PowersManager."); // activate powers manager