Skip to content

Commit

Permalink
Fix login reply banned message. Fix character delete workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed May 28, 2024
1 parent 920c325 commit 3b2bbf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions EOLib/Domain/Character/CharacterManagementActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public CharacterManagementActions(IPacketSendService packetSendService,
public async Task<int> 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;
Expand Down Expand Up @@ -69,7 +69,7 @@ public async Task<int> RequestCharacterDelete()
if (!(response is CharacterPlayerServerPacket responsePacket))
throw new EmptyPacketReceivedException();

return responsePacket.CharacterId;
return responsePacket.SessionId;
}

public async Task<CharacterReply> DeleteCharacter(int deleteRequestID)
Expand All @@ -86,7 +86,7 @@ public async Task<CharacterReply> 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();
Expand Down
2 changes: 1 addition & 1 deletion EOLib/Domain/Login/LoginActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3b2bbf3

Please sign in to comment.