Browse Source

Cleanup of duplicate errant guild definitions.

master
MagicBot 2 years ago
parent
commit
ea34418f2d
  1. 21
      src/engine/objects/Guild.java
  2. 2
      src/engine/server/login/LoginServer.java
  3. 2
      src/engine/server/world/WorldServer.java

21
src/engine/objects/Guild.java

@ -51,7 +51,6 @@ public class Guild extends AbstractWorldObject {
private final String name; private final String name;
private Guild nation; private Guild nation;
private static Guild g;
private final GuildTag guildTag; private final GuildTag guildTag;
// TODO add these to database // TODO add these to database
private String motto = ""; private String motto = "";
@ -406,23 +405,8 @@ public class Guild extends AbstractWorldObject {
/* /*
* Utils * 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() { public boolean isErrant() {
if (this.getObjectUUID() == Guild.g.getObjectUUID())
return true;
return this.getObjectUUID() == Guild.errant.getObjectUUID(); return this.getObjectUUID() == Guild.errant.getObjectUUID();
} }
@ -739,6 +723,11 @@ Guild.serializeForClientMsg(guild,writer, null, false);
private static Guild errant; private static Guild errant;
public static Guild getErrantGuild() {
return Guild.getErrantNation();
}
public static Guild getErrantNation() { public static Guild getErrantNation() {
if (Guild.errant == null) if (Guild.errant == null)
Guild.errant = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0); Guild.errant = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0);

2
src/engine/server/login/LoginServer.java

@ -214,7 +214,7 @@ public class LoginServer {
Race.loadAllRaces(); Race.loadAllRaces();
Logger.info("Initializing Errant Guild"); Logger.info("Initializing Errant Guild");
Guild.CreateErrantGuild(); Guild.getErrantGuild();
Logger.info("Loading All Guilds"); Logger.info("Loading All Guilds");
DbManager.GuildQueries.GET_ALL_GUILDS(); DbManager.GuildQueries.GET_ALL_GUILDS();

2
src/engine/server/world/WorldServer.java

@ -269,7 +269,7 @@ public class WorldServer {
ItemProductionManager.ITEMPRODUCTIONMANAGER.startMessagePump(); ItemProductionManager.ITEMPRODUCTIONMANAGER.startMessagePump();
Logger.info("Initializing Errant Guild"); Logger.info("Initializing Errant Guild");
Guild.CreateErrantGuild(); Guild.getErrantGuild();
Logger.info("Initializing PowersManager."); Logger.info("Initializing PowersManager.");
// activate powers manager // activate powers manager

Loading…
Cancel
Save