From 3b2bbf3c2626adb3aa6e42d98f9b7cc38555e51c Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Tue, 28 May 2024 12:07:40 -0700 Subject: [PATCH] Fix login reply banned message. Fix character delete workflow. --- EOLib/Domain/Character/CharacterManagementActions.cs | 6 +++--- EOLib/Domain/Login/LoginActions.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EOLib/Domain/Character/CharacterManagementActions.cs b/EOLib/Domain/Character/CharacterManagementActions.cs index f25ab75a5..7a352a40a 100644 --- a/EOLib/Domain/Character/CharacterManagementActions.cs +++ b/EOLib/Domain/Character/CharacterManagementActions.cs @@ -26,7 +26,7 @@ public CharacterManagementActions(IPacketSendService packetSendService, public async Task RequestCharacterCreation() { var packet = new CharacterRequestClientPacket(); - var response= await _packetSendService.SendEncodedPacketAndWaitAsync(packet); + var response = await _packetSendService.SendEncodedPacketAndWaitAsync(packet); if (response is CharacterReplyServerPacket responsePacket) return (int)responsePacket.ReplyCode; @@ -69,7 +69,7 @@ public async Task RequestCharacterDelete() if (!(response is CharacterPlayerServerPacket responsePacket)) throw new EmptyPacketReceivedException(); - return responsePacket.CharacterId; + return responsePacket.SessionId; } public async Task DeleteCharacter(int deleteRequestID) @@ -86,7 +86,7 @@ public async Task DeleteCharacter(int deleteRequestID) if (!(response is CharacterReplyServerPacket responsePacket)) throw new EmptyPacketReceivedException(); - if (responsePacket.ReplyCodeData is CharacterReplyServerPacket.ReplyCodeDataDeleted dataDeleted && dataDeleted.Characters.Any()) + if (responsePacket.ReplyCodeData is CharacterReplyServerPacket.ReplyCodeDataDeleted dataDeleted) { _characterSelectorRepository.Characters = dataDeleted.Characters .Select(Character.FromCharacterSelectionListEntry).ToList(); diff --git a/EOLib/Domain/Login/LoginActions.cs b/EOLib/Domain/Login/LoginActions.cs index eade18b3e..33a16fa29 100644 --- a/EOLib/Domain/Login/LoginActions.cs +++ b/EOLib/Domain/Login/LoginActions.cs @@ -210,7 +210,7 @@ private static bool IsInvalidResponse(IPacket response, out LoginReplyServerPack ReplyCode = LoginReply.Banned, ReplyCodeData = new LoginReplyServerPacket.ReplyCodeDataBanned() }; - return true; + return false; } return !(response.Family == PacketFamily.Login && response.Action == PacketAction.Reply);