public override void OnDeleteCharacter(object sender, DeleteCharacterMessage message) { if (message.Result) { _characterSelected.Visible = false; _characterSelected.SetCharacter(null); var characterSlot = _characters.Where(x => x.Character != null && x.Character.Id == message.CharacterId).FirstOrDefault(); if (characterSlot != null) { characterSlot.SetCharacter(null); characterSlot.Visible = true; } } }
public static void HandleDeleteCharacterMessage(SimpleClient client, DeleteCharacterMessage message) { if (message.password == "111111") { CharacterManager.Instance.DeleteCharacter(client, message.characterId); } else { SendDeleteCharacterResultMessage(client, ErrorEnum.ERR_PASSWORD, message.characterId, 0); } SendCharactersListMessage(client, DateTime.UtcNow.GetUnixTimeStamp(), 0, (byte)client.Account.Characters.Count, 0, 0, client.Account.Characters.Where(x => !x.DeletedDate.HasValue).ToArray(), client.Account.Characters.Count(x => x.DeletedDate.HasValue), 0, 0, 0); foreach (var character in client.Account.Characters.Where(x => !x.DeletedDate.HasValue)) { SendCharacterSlotMessage(client, character, client.Account.Characters.Count(x => x.DeletedDate.HasValue)); } }
private void Handle(DeleteCharacterMessage message) { Account account = AccountManager.Instance.FindAccountById(message.AccountId); if (account == null) { Client.SendError(string.Format("Account {0} not found", message.AccountId)); } else { if (AccountManager.DeleteAccountCharacter(account, WorldServer, message.CharacterId)) { Client.ReplyRequest(new CommonOKMessage(), message); } else { Client.SendError(string.Format("Cannot delete {0} character from {1} account", message.CharacterId, message.AccountId)); } } }
public virtual void OnDeleteCharacter(object sender, DeleteCharacterMessage message) { }