Browse Source

Merge remote-tracking branch 'origin/master' into bugfix-gold-healing

master
MagicBot 1 year ago
parent
commit
9f541813ef
  1. 3
      src/engine/devcmd/cmds/SlotTestCmd.java
  2. 20
      src/engine/server/login/LoginServerMsgHandler.java

3
src/engine/devcmd/cmds/SlotTestCmd.java

@ -60,7 +60,6 @@ public class SlotTestCmd extends AbstractDevCmd {
return; return;
} }
for (BuildingLocation buildingLocation : BuildingManager._slotLocations.get(building.meshUUID)) for (BuildingLocation buildingLocation : BuildingManager._slotLocations.get(building.meshUUID))
outString += buildingLocation.getSlot() + buildingLocation.getLocation().toString() + "\r\n"; outString += buildingLocation.getSlot() + buildingLocation.getLocation().toString() + "\r\n";
@ -87,7 +86,7 @@ public class SlotTestCmd extends AbstractDevCmd {
@Override @Override
protected String _getUsageString() { protected String _getUsageString() {
return "./slottest <target builing> n"; return "./slottest <target building> n";
} }

20
src/engine/server/login/LoginServerMsgHandler.java

@ -368,13 +368,13 @@ public class LoginServerMsgHandler implements NetMsgHandler {
private void DeleteCharacter(DeleteCharacterMsg msg, ClientConnection origin) { private void DeleteCharacter(DeleteCharacterMsg msg, ClientConnection origin) {
try { try {
PlayerCharacter player; PlayerCharacter playerCharacter;
Session session; Session session;
session = SessionManager.getSession(origin); 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."); Logger.error("Delete Error: PlayerID=" + msg.getCharacterUUID() + " not found.");
this.sendCharacterSelectScreen(session); this.sendCharacterSelectScreen(session);
return; return;
@ -386,8 +386,8 @@ public class LoginServerMsgHandler implements NetMsgHandler {
return; return;
} }
if (player.getAccount() != origin.getAccount()) { if (playerCharacter.getAccount().equals(session.getAccount()) == false) {
Logger.error("Delete Error: Character " + player.getName() + " does not belong to account " + origin.getAccount().getUname()); Logger.error("Delete Error: Character " + playerCharacter.getName() + " does not belong to account " + origin.getAccount().getUname());
this.sendCharacterSelectScreen(session); this.sendCharacterSelectScreen(session);
return; return;
} }
@ -395,21 +395,21 @@ public class LoginServerMsgHandler implements NetMsgHandler {
//Can't delete as Guild Leader //Can't delete as Guild Leader
//TODO either find an error or just gdisband. //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); this.KickToLogin(MBServerStatics.LOGINERROR_UNABLE_TO_LOGIN, "Cannot delete a guild leader.", origin);
return; return;
} }
// check for active banes // check for active banes
if (LoginServer.getActiveBaneQuery(player)) { if (LoginServer.getActiveBaneQuery(playerCharacter)) {
Logger.info("Character " + player.getName() + " has unresolved bane"); Logger.info("Character " + playerCharacter.getName() + " has unresolved bane");
this.KickToLogin(MBServerStatics.LOGINERROR_UNABLE_TO_LOGIN, "Player has unresolved bane.", origin); this.KickToLogin(MBServerStatics.LOGINERROR_UNABLE_TO_LOGIN, "Player has unresolved bane.", origin);
return; return;
} }
player.getAccount().characterMap.remove(player.getObjectUUID()); playerCharacter.getAccount().characterMap.remove(playerCharacter.getObjectUUID());
player.deactivateCharacter(); playerCharacter.deactivateCharacter();
// TODO Delete Equipment // TODO Delete Equipment
// Resend Character Select Screen. // Resend Character Select Screen.

Loading…
Cancel
Save