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 { @@ -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 = "";
@ -407,22 +406,7 @@ public class Guild extends AbstractWorldObject { @@ -407,22 +406,7 @@ 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); @@ -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);

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

@ -214,7 +214,7 @@ public class LoginServer { @@ -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();

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

@ -269,7 +269,7 @@ public class WorldServer { @@ -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

Loading…
Cancel
Save