private static void ProcessCharacterDeletionRequest(WorldClient Client, string Packet) { if (!Packet.Contains('|') || Client.Character != null || Client.Account == null) { Client.Send(new CharacterDeletionFailMessage()); return; } String[] split = Regex.Split(Packet.Substring(2), "\\|"); if (split.Length < 2) { Client.Send(new CharacterDeletionFailMessage()); return; } long characterId = long.Parse(split[0]); String reponse = split.Length > 1 ? split[1] : ""; if (!Client.Account.HasCharacter(characterId) || !reponse.ToLower().Equals(Client.Account.Reponse.ToLower())) { Client.Send(new CharacterDeletionFailMessage()); return; } if (!CharacterTable.Delete(Client.Account.Characters[characterId])) { Client.Send(new CharacterDeletionFailMessage()); return; } Client.Account.Characters.Remove(characterId); Client.Send(new CharactersListMessage(Client.Account.Characters)); }