|
|
@ -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.
|
|
|
|