From 049562af5c017573ca3cbee86e1c2f55ab02db26 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 11 Aug 2023 07:47:23 -0400 Subject: [PATCH 1/2] Typo in help string fixed. --- src/engine/devcmd/cmds/SlotTestCmd.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/engine/devcmd/cmds/SlotTestCmd.java b/src/engine/devcmd/cmds/SlotTestCmd.java index 3da13617..bc31e7c2 100644 --- a/src/engine/devcmd/cmds/SlotTestCmd.java +++ b/src/engine/devcmd/cmds/SlotTestCmd.java @@ -60,7 +60,6 @@ public class SlotTestCmd extends AbstractDevCmd { return; } - for (BuildingLocation buildingLocation : BuildingManager._slotLocations.get(building.meshUUID)) outString += buildingLocation.getSlot() + buildingLocation.getLocation().toString() + "\r\n"; @@ -87,7 +86,7 @@ public class SlotTestCmd extends AbstractDevCmd { @Override protected String _getUsageString() { - return "./slottest n"; + return "./slottest n"; } From 9a12c9b044cfd67e52ed478b37f4f496527c53a3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 11 Aug 2023 08:20:01 -0400 Subject: [PATCH 2/2] Bugfix in character deletion. --- .../server/login/LoginServerMsgHandler.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/engine/server/login/LoginServerMsgHandler.java b/src/engine/server/login/LoginServerMsgHandler.java index 0e920b7d..dff76ce7 100644 --- a/src/engine/server/login/LoginServerMsgHandler.java +++ b/src/engine/server/login/LoginServerMsgHandler.java @@ -368,13 +368,13 @@ public class LoginServerMsgHandler implements NetMsgHandler { private void DeleteCharacter(DeleteCharacterMsg msg, ClientConnection origin) { try { - PlayerCharacter player; + PlayerCharacter playerCharacter; Session session; session = SessionManager.getSession(origin); - player = (PlayerCharacter) DbManager.getObject(GameObjectType.PlayerCharacter, msg.getCharacterUUID()); + playerCharacter = PlayerCharacter.getPlayerCharacter(msg.getCharacterUUID()); - if (player == null) { + if (playerCharacter == null) { Logger.error("Delete Error: PlayerID=" + msg.getCharacterUUID() + " not found."); this.sendCharacterSelectScreen(session); return; @@ -386,8 +386,8 @@ public class LoginServerMsgHandler implements NetMsgHandler { return; } - if (player.getAccount() != origin.getAccount()) { - Logger.error("Delete Error: Character " + player.getName() + " does not belong to account " + origin.getAccount().getUname()); + if (playerCharacter.getAccount().equals(session.getAccount()) == false) { + Logger.error("Delete Error: Character " + playerCharacter.getName() + " does not belong to account " + origin.getAccount().getUname()); this.sendCharacterSelectScreen(session); return; } @@ -395,21 +395,21 @@ public class LoginServerMsgHandler implements NetMsgHandler { //Can't delete as Guild Leader //TODO either find an error or just gdisband. - if (GuildStatusController.isGuildLeader(player.getGuildStatus())) { + if (GuildStatusController.isGuildLeader(playerCharacter.getGuildStatus())) { this.KickToLogin(MBServerStatics.LOGINERROR_UNABLE_TO_LOGIN, "Cannot delete a guild leader.", origin); return; } // check for active banes - if (LoginServer.getActiveBaneQuery(player)) { - Logger.info("Character " + player.getName() + " has unresolved bane"); + if (LoginServer.getActiveBaneQuery(playerCharacter)) { + Logger.info("Character " + playerCharacter.getName() + " has unresolved bane"); this.KickToLogin(MBServerStatics.LOGINERROR_UNABLE_TO_LOGIN, "Player has unresolved bane.", origin); return; } - player.getAccount().characterMap.remove(player.getObjectUUID()); - player.deactivateCharacter(); + playerCharacter.getAccount().characterMap.remove(playerCharacter.getObjectUUID()); + playerCharacter.deactivateCharacter(); // TODO Delete Equipment // Resend Character Select Screen.