diff --git a/src/engine/db/handlers/dbGuildHandler.java b/src/engine/db/handlers/dbGuildHandler.java index bcbe6b30..a4f1998e 100644 --- a/src/engine/db/handlers/dbGuildHandler.java +++ b/src/engine/db/handlers/dbGuildHandler.java @@ -13,7 +13,7 @@ import engine.Enum; import engine.Enum.GuildHistoryType; import engine.gameManager.DbManager; import engine.objects.*; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -419,7 +419,7 @@ public class dbGuildHandler extends dbHandlerBase { try (Connection connection = DbManager.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement("CALL `guild_CREATE`(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { - preparedStatement.setLong(1, MBServerStatics.worldUUID); + preparedStatement.setLong(1, WorldServer.worldUUID); preparedStatement.setLong(2, g.getGuildLeaderUUID()); preparedStatement.setString(3, g.getName()); preparedStatement.setInt(4, guildTag.backgroundColor01); diff --git a/src/engine/gameManager/ChatManager.java b/src/engine/gameManager/ChatManager.java index 758c12a7..10c502e3 100644 --- a/src/engine/gameManager/ChatManager.java +++ b/src/engine/gameManager/ChatManager.java @@ -407,7 +407,7 @@ DispatchMessage.dispatchMsgToAll(sender, msg, true); chatGuildMsg.setSourceType(sender.getObjectType().ordinal()); chatGuildMsg.setSourceID(sender.getObjectUUID()); chatGuildMsg.setSourceName(sender.getFirstName()); - chatGuildMsg.setUnknown03(MBServerStatics.worldMapID); // Server ID + chatGuildMsg.setUnknown03(WorldServer.worldMapID); // Server ID chatGuildMsg.setUnknown04(sender.getGuild() != null ? sender.getGuild() .getCharter() : 0); // Charter? chatGuildMsg.setUnknown05(GuildStatusController.getTitle(sender.getGuildStatus())); // Title? @@ -462,7 +462,7 @@ DispatchMessage.dispatchMsgToAll(sender, msg, true); chatICMsg.setSourceType(sender.getObjectType().ordinal()); chatICMsg.setSourceID(sender.getObjectUUID()); chatICMsg.setSourceName(sender.getFirstName()); - chatICMsg.setUnknown02(MBServerStatics.worldMapID); // Server ID + chatICMsg.setUnknown02(WorldServer.worldMapID); // Server ID chatICMsg.setUnknown03(GuildStatusController.getRank(sender.getGuildStatus())); // correct? chatICMsg.setUnknown04(GuildStatusController.getTitle(sender.getGuildStatus())); // correct? chatICMsg.setUnknown05(2); // unknown, seen 1 and 2 @@ -524,7 +524,7 @@ DispatchMessage.dispatchMsgToAll(sender, msg, true); chatGroupMsg.setSourceType(sender.getObjectType().ordinal()); chatGroupMsg.setSourceID(sender.getObjectUUID()); chatGroupMsg.setSourceName(sender.getFirstName()); - chatGroupMsg.setUnknown02(MBServerStatics.worldMapID); // Server ID + chatGroupMsg.setUnknown02(WorldServer.worldMapID); // Server ID // Send dispatch to each player diff --git a/src/engine/gameManager/ConfigManager.java b/src/engine/gameManager/ConfigManager.java index 658f6c33..a39e5264 100644 --- a/src/engine/gameManager/ConfigManager.java +++ b/src/engine/gameManager/ConfigManager.java @@ -59,7 +59,6 @@ public enum ConfigManager { MB_WORLD_MAPID, MB_WORLD_PORT, MB_WORLD_ACCESS_LVL, - MB_WORLD_UUID, MB_WORLD_WAREHOUSE_PUSH, MB_WORLD_MAINTENANCE, MB_WORLD_GREETING, diff --git a/src/engine/net/client/handlers/BreakFealtyHandler.java b/src/engine/net/client/handlers/BreakFealtyHandler.java index ba91fbf8..7d9a393c 100644 --- a/src/engine/net/client/handlers/BreakFealtyHandler.java +++ b/src/engine/net/client/handlers/BreakFealtyHandler.java @@ -24,7 +24,7 @@ import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.guild.BreakFealtyMsg; import engine.net.client.msg.guild.SendGuildEntryMsg; import engine.objects.*; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.session.Session; import java.util.ArrayList; @@ -75,9 +75,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler { } - - - if (!DbManager.GuildQueries.UPDATE_PARENT(guild.getObjectUUID(),MBServerStatics.worldUUID)) { + if (!DbManager.GuildQueries.UPDATE_PARENT(guild.getObjectUUID(), WorldServer.worldUUID)) { ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occurred. Please post details for to ensure transaction integrity"); return true; } @@ -141,7 +139,7 @@ public class BreakFealtyHandler extends AbstractClientMsgHandler { return true; } - if (!DbManager.GuildQueries.UPDATE_PARENT(guild.getObjectUUID(),MBServerStatics.worldUUID)) { + if (!DbManager.GuildQueries.UPDATE_PARENT(guild.getObjectUUID(), WorldServer.worldUUID)) { ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occurred. Please post details for to ensure transaction integrity"); return true; } diff --git a/src/engine/net/client/handlers/DismissGuildHandler.java b/src/engine/net/client/handlers/DismissGuildHandler.java index 57631c5f..b469ecac 100644 --- a/src/engine/net/client/handlers/DismissGuildHandler.java +++ b/src/engine/net/client/handlers/DismissGuildHandler.java @@ -24,7 +24,7 @@ import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.guild.DismissGuildMsg; import engine.net.client.msg.guild.SendGuildEntryMsg; import engine.objects.*; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.session.Session; import java.util.ArrayList; @@ -86,8 +86,8 @@ public class DismissGuildHandler extends AbstractClientMsgHandler { switch (toDismiss.getGuildState()) { case Sworn: - if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), MBServerStatics.worldUUID)) { - ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity"); + if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), WorldServer.worldUUID)) { + ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity"); return true; } nation.getSubGuildList().remove(toDismiss); @@ -97,7 +97,7 @@ public class DismissGuildHandler extends AbstractClientMsgHandler { break; case Province: - if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(),MBServerStatics.worldUUID)) { + if (!DbManager.GuildQueries.UPDATE_PARENT(toDismiss.getObjectUUID(), WorldServer.worldUUID)) { ErrorPopupMsg.sendErrorMsg(player, "A Serious error has occured. Please post details for to ensure transaction integrity"); return true; } diff --git a/src/engine/net/client/handlers/RequestEnterWorldHandler.java b/src/engine/net/client/handlers/RequestEnterWorldHandler.java index ddd017c5..833d4156 100644 --- a/src/engine/net/client/handlers/RequestEnterWorldHandler.java +++ b/src/engine/net/client/handlers/RequestEnterWorldHandler.java @@ -18,6 +18,7 @@ import engine.objects.AbstractWorldObject; import engine.objects.Account; import engine.objects.PlayerCharacter; import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.session.Session; import org.pmw.tinylog.Logger; @@ -60,10 +61,10 @@ public class RequestEnterWorldHandler extends AbstractClientMsgHandler { Account acc = SessionManager.getAccount(origin); - if (acc.status.ordinal() < MBServerStatics.worldAccessLevel.ordinal() || MBServerStatics.blockLogin) { - origin.disconnect(); - return true; - } + if (acc.status.ordinal() < WorldServer.worldAccessLevel.ordinal() || MBServerStatics.blockLogin) { + origin.disconnect(); + return true; + } // Brand new character. Send the city select screen diff --git a/src/engine/net/client/msg/ServerInfoMsg.java b/src/engine/net/client/msg/ServerInfoMsg.java index 0dd387ab..d14a7138 100644 --- a/src/engine/net/client/msg/ServerInfoMsg.java +++ b/src/engine/net/client/msg/ServerInfoMsg.java @@ -17,6 +17,7 @@ import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.server.MBServerStatics; import engine.server.login.LoginServer; +import engine.server.world.WorldServer; public class ServerInfoMsg extends ClientNetMsg { @@ -49,9 +50,9 @@ public class ServerInfoMsg extends ClientNetMsg { // wsis.serializeForClientMsg(writer); // } writer.putInt(1); - - writer.putInt(MBServerStatics.worldMapID); - writer.putString(ConfigManager.MB_WORLD_NAME.getValue()); + + writer.putInt(WorldServer.worldMapID); + writer.putString(ConfigManager.MB_WORLD_NAME.getValue()); if (LoginServer.population < MBServerStatics.LOW_POPULATION) writer.putInt(0); //Land Rush else if (LoginServer.population < MBServerStatics.NORMAL_POPULATION) diff --git a/src/engine/net/client/msg/WorldDataMsg.java b/src/engine/net/client/msg/WorldDataMsg.java index c9391d84..66095499 100644 --- a/src/engine/net/client/msg/WorldDataMsg.java +++ b/src/engine/net/client/msg/WorldDataMsg.java @@ -19,7 +19,7 @@ import engine.net.ByteBufferReader; import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.objects.Zone; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import org.pmw.tinylog.Logger; public class WorldDataMsg extends ClientNetMsg { @@ -74,7 +74,7 @@ public class WorldDataMsg extends ClientNetMsg { writer.putInt(512); writer.putInt(384); - writer.putInt(MBServerStatics.worldMapID); + writer.putInt(WorldServer.worldMapID); writer.putInt(0x00000000); writer.putInt(getTotalMapSize(root) + 1); diff --git a/src/engine/net/client/msg/chat/ChatCSRMsg.java b/src/engine/net/client/msg/chat/ChatCSRMsg.java index f70450a7..8fe806b9 100644 --- a/src/engine/net/client/msg/chat/ChatCSRMsg.java +++ b/src/engine/net/client/msg/chat/ChatCSRMsg.java @@ -17,7 +17,7 @@ import engine.net.ByteBufferWriter; import engine.net.client.ClientConnection; import engine.net.client.Protocol; import engine.objects.AbstractWorldObject; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.session.Session; public class ChatCSRMsg extends AbstractChatMsg { @@ -71,8 +71,8 @@ public class ChatCSRMsg extends AbstractChatMsg { writer.putInt(this.source.getObjectUUID()); writer.putInt(this.unknown01); writer.putString(this.message); - writer.putString(this.source.getName()); - writer.putInt(MBServerStatics.worldMapID); + writer.putString(this.source.getName()); + writer.putInt(WorldServer.worldMapID); } } diff --git a/src/engine/net/client/msg/chat/ChatCityMsg.java b/src/engine/net/client/msg/chat/ChatCityMsg.java index 67b64309..f8e060d4 100644 --- a/src/engine/net/client/msg/chat/ChatCityMsg.java +++ b/src/engine/net/client/msg/chat/ChatCityMsg.java @@ -18,7 +18,7 @@ import engine.net.client.Protocol; import engine.objects.AbstractCharacter; import engine.objects.AbstractGameObject; import engine.objects.AbstractWorldObject; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; public class ChatCityMsg extends AbstractChatMsg { @@ -80,8 +80,8 @@ public class ChatCityMsg extends AbstractChatMsg { writer.putString(""); writer.putInt(0); } else { - writer.putString(((AbstractCharacter) this.source).getFirstName()); - writer.putInt(MBServerStatics.worldMapID); + writer.putString(((AbstractCharacter) this.source).getFirstName()); + writer.putInt(WorldServer.worldMapID); } } diff --git a/src/engine/net/client/msg/chat/ChatGlobalMsg.java b/src/engine/net/client/msg/chat/ChatGlobalMsg.java index c3561417..650901ab 100644 --- a/src/engine/net/client/msg/chat/ChatGlobalMsg.java +++ b/src/engine/net/client/msg/chat/ChatGlobalMsg.java @@ -16,7 +16,7 @@ import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.objects.AbstractCharacter; import engine.objects.AbstractWorldObject; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; public class ChatGlobalMsg extends AbstractChatMsg { @@ -79,8 +79,8 @@ public class ChatGlobalMsg extends AbstractChatMsg { writer.putString(""); writer.putInt(0); } else { - writer.putString(((AbstractCharacter) this.source).getFirstName()); - writer.putInt(MBServerStatics.worldMapID); + writer.putString(((AbstractCharacter) this.source).getFirstName()); + writer.putInt(WorldServer.worldMapID); } writer.putInt(0); writer.putInt(0); diff --git a/src/engine/net/client/msg/chat/ChatSayMsg.java b/src/engine/net/client/msg/chat/ChatSayMsg.java index c8137cb8..a0a0b525 100644 --- a/src/engine/net/client/msg/chat/ChatSayMsg.java +++ b/src/engine/net/client/msg/chat/ChatSayMsg.java @@ -18,7 +18,7 @@ import engine.net.client.Protocol; import engine.objects.AbstractCharacter; import engine.objects.AbstractGameObject; import engine.objects.AbstractWorldObject; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; public class ChatSayMsg extends AbstractChatMsg { @@ -84,8 +84,8 @@ public class ChatSayMsg extends AbstractChatMsg { writer.putString(""); writer.putInt(0); } else { - writer.putString(((AbstractCharacter) this.source).getFirstName()); - writer.putInt(MBServerStatics.worldMapID); + writer.putString(((AbstractCharacter) this.source).getFirstName()); + writer.putInt(WorldServer.worldMapID); } } } diff --git a/src/engine/net/client/msg/chat/ChatShoutMsg.java b/src/engine/net/client/msg/chat/ChatShoutMsg.java index 91442752..e9571a37 100644 --- a/src/engine/net/client/msg/chat/ChatShoutMsg.java +++ b/src/engine/net/client/msg/chat/ChatShoutMsg.java @@ -16,7 +16,7 @@ import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.objects.AbstractCharacter; import engine.objects.AbstractWorldObject; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; public class ChatShoutMsg extends AbstractChatMsg { @@ -73,8 +73,8 @@ public class ChatShoutMsg extends AbstractChatMsg { writer.putString(""); writer.putInt(0); } else { - writer.putString(((AbstractCharacter) this.source).getFirstName()); - writer.putInt(MBServerStatics.worldMapID); + writer.putString(((AbstractCharacter) this.source).getFirstName()); + writer.putInt(WorldServer.worldMapID); } } } diff --git a/src/engine/net/client/msg/chat/ChatTellMsg.java b/src/engine/net/client/msg/chat/ChatTellMsg.java index 43d98098..61c62be7 100644 --- a/src/engine/net/client/msg/chat/ChatTellMsg.java +++ b/src/engine/net/client/msg/chat/ChatTellMsg.java @@ -16,7 +16,7 @@ import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.objects.AbstractCharacter; import engine.objects.AbstractWorldObject; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; public class ChatTellMsg extends AbstractChatMsg { @@ -106,19 +106,19 @@ public class ChatTellMsg extends AbstractChatMsg { if (this.target != null) { writer.putInt(this.target.getObjectType().ordinal()); writer.putInt(this.target.getObjectUUID()); - if (AbstractWorldObject.IsAbstractCharacter(target)) { - writer.putString(((AbstractCharacter) this.target).getFirstName()); - } else { - writer.putString(this.target.getName()); - } - } else { - writer.putInt(this.targetType); - writer.putInt(this.targetID); - writer.putString(this.targetName); - } - writer.putInt(MBServerStatics.worldMapID); - writer.putInt(MBServerStatics.worldMapID); - } + if (AbstractWorldObject.IsAbstractCharacter(target)) { + writer.putString(((AbstractCharacter) this.target).getFirstName()); + } else { + writer.putString(this.target.getName()); + } + } else { + writer.putInt(this.targetType); + writer.putInt(this.targetID); + writer.putString(this.targetName); + } + writer.putInt(WorldServer.worldMapID); + writer.putInt(WorldServer.worldMapID); + } /** * @return the target diff --git a/src/engine/net/client/msg/login/InvalidNameMsg.java b/src/engine/net/client/msg/login/InvalidNameMsg.java index 10dc4b77..246176d4 100644 --- a/src/engine/net/client/msg/login/InvalidNameMsg.java +++ b/src/engine/net/client/msg/login/InvalidNameMsg.java @@ -15,7 +15,7 @@ import engine.net.ByteBufferReader; import engine.net.ByteBufferWriter; import engine.net.client.Protocol; import engine.net.client.msg.ClientNetMsg; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; public class InvalidNameMsg extends ClientNetMsg { @@ -48,9 +48,9 @@ public class InvalidNameMsg extends ClientNetMsg { @Override protected void _serialize(ByteBufferWriter writer) { writer.putString(this.FirstName); - writer.putString(this.LastName); - writer.putInt(MBServerStatics.worldMapID); - writer.putInt(errorCode); + writer.putString(this.LastName); + writer.putInt(WorldServer.worldMapID); + writer.putInt(errorCode); } /** diff --git a/src/engine/objects/City.java b/src/engine/objects/City.java index 30cb5a6c..ef5f349a 100644 --- a/src/engine/objects/City.java +++ b/src/engine/objects/City.java @@ -30,6 +30,7 @@ import engine.net.client.msg.TaxResourcesMsg; import engine.net.client.msg.ViewResourcesMessage; import engine.powers.EffectsBase; import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.workthreads.DestroyCityThread; import engine.workthreads.TransferCityThread; import org.pmw.tinylog.Logger; @@ -1125,7 +1126,7 @@ public class City extends AbstractWorldObject { // claiming your new tree and set as Landed if (!sourceNation.isEmptyGuild() && sourceNation != sourceGuild) { - if (!DbManager.GuildQueries.UPDATE_PARENT(sourceGuild.getObjectUUID(), MBServerStatics.worldUUID)) { + if (!DbManager.GuildQueries.UPDATE_PARENT(sourceGuild.getObjectUUID(), WorldServer.worldUUID)) { ChatManager.chatGuildError((PlayerCharacter) sourcePlayer, "A Serious error has occurred. Please post details for to ensure transaction integrity"); return; } diff --git a/src/engine/objects/Guild.java b/src/engine/objects/Guild.java index 650bca72..c5ed1599 100644 --- a/src/engine/objects/Guild.java +++ b/src/engine/objects/Guild.java @@ -31,7 +31,7 @@ import engine.net.client.msg.AllianceChangeMsg; import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.UpdateClientAlliancesMsg; import engine.net.client.msg.guild.GuildInfoMsg; -import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -805,9 +805,9 @@ public class Guild extends AbstractWorldObject { } - if (MBServerStatics.worldUUID == nationUUID && this.cityUUID != 0) + if (WorldServer.worldUUID == nationUUID && this.cityUUID != 0) this.nation = this; - else if (nationUUID == 0 || (MBServerStatics.worldUUID == nationUUID && this.cityUUID == 0)) { + else if (nationUUID == 0 || (WorldServer.worldUUID == nationUUID && this.cityUUID == 0)) { this.nation = Guild.getErrantGuild(); this.nmotd = ""; } else @@ -919,7 +919,7 @@ public class Guild extends AbstractWorldObject { // Update database - if (!DbManager.GuildQueries.UPDATE_PARENT(subGuild.getObjectUUID(), MBServerStatics.worldUUID)) + if (!DbManager.GuildQueries.UPDATE_PARENT(subGuild.getObjectUUID(), WorldServer.worldUUID)) Logger.debug("Failed to set Nation Guild for Guild with UID " + subGuild.getObjectUUID()); // Guild without any subs is no longer a nation diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index f4543603..f225c1be 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -39,6 +39,7 @@ import engine.powers.EffectsBase; import engine.server.MBServerStatics; import engine.server.login.LoginServer; import engine.server.login.LoginServerMsgHandler; +import engine.server.world.WorldServer; import engine.util.MiscUtils; import org.joda.time.DateTime; import org.pmw.tinylog.Logger; @@ -1995,7 +1996,7 @@ public class PlayerCharacter extends AbstractCharacter { writer.putInt(0); writer.putString(ConfigManager.MB_WORLD_NAME.getValue()); - writer.putInt(MBServerStatics.worldMapID); + writer.putInt(WorldServer.worldMapID); writer.put((byte) 1); // End Datablock byte writer.putInt(0); // Unsure, Pad? @@ -2315,9 +2316,9 @@ public class PlayerCharacter extends AbstractCharacter { if (playerCharacter.account == null) serverUp = 0; - if ((playerCharacter.account.status.equals(AccountStatus.ADMIN) == false) && - (playerCharacter.account.status.equals(MBServerStatics.worldAccessLevel) == false)) - serverUp = 0; + if ((playerCharacter.account.status.equals(AccountStatus.ADMIN) == false) && + (playerCharacter.account.status.equals(WorldServer.worldAccessLevel) == false)) + serverUp = 0; writer.putInt(serverUp); writer.putInt(0); // effects, not sure used by players diff --git a/src/engine/server/MBServerStatics.java b/src/engine/server/MBServerStatics.java index 06d17acb..f65b4d96 100644 --- a/src/engine/server/MBServerStatics.java +++ b/src/engine/server/MBServerStatics.java @@ -10,7 +10,6 @@ package engine.server; import engine.Enum; -import engine.gameManager.ConfigManager; import engine.math.Vector3fImmutable; public class MBServerStatics { @@ -794,7 +793,4 @@ public class MBServerStatics { public static String VETERAN = "Veteran"; public static String ELITE = "Elite"; - public static int worldMapID = Integer.parseInt(ConfigManager.MB_WORLD_MAPID.getValue()); - public static int worldUUID = Integer.parseInt(ConfigManager.MB_WORLD_UUID.getValue()); - public static Enum.AccountStatus worldAccessLevel = Enum.AccountStatus.valueOf(ConfigManager.MB_WORLD_ACCESS_LVL.getValue()); } diff --git a/src/engine/server/login/LoginServer.java b/src/engine/server/login/LoginServer.java index ea66b02f..6664ad41 100644 --- a/src/engine/server/login/LoginServer.java +++ b/src/engine/server/login/LoginServer.java @@ -21,6 +21,7 @@ import engine.net.client.msg.login.ServerStatusMsg; import engine.net.client.msg.login.VersionInfoMsg; import engine.objects.*; import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.util.ByteUtils; import engine.util.ThreadUtils; import org.pmw.tinylog.Configurator; @@ -326,10 +327,10 @@ public class LoginServer { boolean isUp = isRunning; - if (MBServerStatics.worldAccessLevel.ordinal() > ac.status.ordinal()) + if (WorldServer.worldAccessLevel.ordinal() > ac.status.ordinal()) isUp = false; - LoginServer.serverStatusMsg.setServerID(MBServerStatics.worldMapID); + LoginServer.serverStatusMsg.setServerID(WorldServer.worldMapID); LoginServer.serverStatusMsg.setIsUp(isUp ? (byte) 1 : (byte) 0); clientConnection.sendMsg(LoginServer.serverStatusMsg); } diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index 2632be6f..fff2eb8b 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -68,6 +68,9 @@ import static java.lang.System.exit; public class WorldServer { + public static int worldMapID = Integer.parseInt(ConfigManager.MB_WORLD_MAPID.getValue()); + public static int worldUUID = 1; // Root object in database + public static Enum.AccountStatus worldAccessLevel = Enum.AccountStatus.valueOf(ConfigManager.MB_WORLD_ACCESS_LVL.getValue()); private static LocalDateTime bootTime = LocalDateTime.now(); public boolean isRunning = false; @@ -428,7 +431,7 @@ public class WorldServer { Logger.info("World data loaded."); //set default accesslevel for server *** Refactor who two separate variables? - MBServerStatics.accessLevel = MBServerStatics.worldAccessLevel; + MBServerStatics.accessLevel = worldAccessLevel; Logger.info("Default access level set to " + MBServerStatics.accessLevel); Logger.info("Initializing Network"); @@ -495,10 +498,10 @@ public class WorldServer { ArrayList rootParent; - rootParent = DbManager.ZoneQueries.GET_MAP_NODES(MBServerStatics.worldUUID); + rootParent = DbManager.ZoneQueries.GET_MAP_NODES(worldUUID); if (rootParent.isEmpty()) { - Logger.error("populateWorldBuildings: No entries found in worldMap for parent " + MBServerStatics.worldUUID); + Logger.error("populateWorldBuildings: No entries found in worldMap for parent " + worldUUID); return; }