From daa84a1fef5da9d9872555b236f326286cb4131f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 28 Dec 2024 04:27:26 -0600 Subject: [PATCH] added MB_WORLD_TESTMODE to config manager and file --- src/engine/gameManager/ConfigManager.java | 1 + src/engine/gameManager/DevCmdManager.java | 26 ++++++++++++----------- src/engine/objects/PlayerCharacter.java | 3 +++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/engine/gameManager/ConfigManager.java b/src/engine/gameManager/ConfigManager.java index 7541a4e1..ae7f3302 100644 --- a/src/engine/gameManager/ConfigManager.java +++ b/src/engine/gameManager/ConfigManager.java @@ -65,6 +65,7 @@ public enum ConfigManager { MB_WORLD_MAINTENANCE, MB_WORLD_GREETING, MB_WORLD_KEYCLONE_MAX, + MB_WORLD_TESTMODE, MB_USE_RUINS, // Mobile AI modifiers diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 7ba967bf..1590590b 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -180,18 +180,20 @@ public enum DevCmdManager { //kill any commands not available to everyone on production server //only admin level can run dev commands on production boolean playerAllowed = false; - switch(adc.getMainCmdString()){ - case "printresists": - case "printstats": - case "printskills": - case "printpowers": - case "gimme": - case "goto": - case"teleportmode": - playerAllowed = true; - if(!a.status.equals(Enum.AccountStatus.ADMIN)) - target = pcSender; - break; + if(ConfigManager.MB_WORLD_TESTMODE.getValue().equals("true")) { + switch (adc.getMainCmdString()) { + case "printresists": + case "printstats": + case "printskills": + case "printpowers": + case "gimme": + case "goto": + case "teleportmode": + playerAllowed = true; + if (!a.status.equals(Enum.AccountStatus.ADMIN)) + target = pcSender; + break; + } } if (!playerAllowed && !a.status.equals(Enum.AccountStatus.ADMIN)) { Logger.info("Account " + a.getUname() + "attempted to use dev command " + cmd); diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 7dd9ad9e..aafe3a16 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -4895,6 +4895,9 @@ public class PlayerCharacter extends AbstractCharacter { } public static boolean checkIfBoxed(PlayerCharacter player){ + if(ConfigManager.MB_WORLD_TESTMODE.getValue().equals("true")) { + return false; + } try { String machineID = player.getClientConnection().machineID; ArrayList sameMachine = new ArrayList<>();