Members moved to WorldServer.
Root object no longer read from config.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<Zone> 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user