Skip to content

Commit

Permalink
Add CheckPassword and CheckPasswordResult structured packet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Aug 2, 2024
1 parent c3a6c43 commit 477359e
Show file tree
Hide file tree
Showing 14 changed files with 2,105 additions and 87 deletions.
14 changes: 14 additions & 0 deletions Edelstein.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Network.Do
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Common.Crypto", "src\common\Edelstein.Common.Crypto\Edelstein.Common.Crypto.csproj", "{875EE192-E044-4C8D-941F-86C24C3FABF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Gameplay", "src\protocol\Edelstein.Protocol.Gameplay\Edelstein.Protocol.Gameplay.csproj", "{6EE946AC-42B7-4581-A12D-00BD57504225}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Gameplay.Login", "src\protocol\Edelstein.Protocol.Gameplay.Login\Edelstein.Protocol.Gameplay.Login.csproj", "{0C635DAF-1DF9-4DC1-9691-37B9F681C779}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -46,6 +50,8 @@ Global
{AF5AC908-62BB-48CE-99E8-83388738CCB1} = {82D7864B-19AD-484C-BD2E-897F05B5852C}
{0ED46D09-2617-4FBE-BFB4-D8B49BCE5C01} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087}
{875EE192-E044-4C8D-941F-86C24C3FABF7} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087}
{6EE946AC-42B7-4581-A12D-00BD57504225} = {82D7864B-19AD-484C-BD2E-897F05B5852C}
{0C635DAF-1DF9-4DC1-9691-37B9F681C779} = {82D7864B-19AD-484C-BD2E-897F05B5852C}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AF5AC908-62BB-48CE-99E8-83388738CCB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand All @@ -60,5 +66,13 @@ Global
{875EE192-E044-4C8D-941F-86C24C3FABF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{875EE192-E044-4C8D-941F-86C24C3FABF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{875EE192-E044-4C8D-941F-86C24C3FABF7}.Release|Any CPU.Build.0 = Release|Any CPU
{6EE946AC-42B7-4581-A12D-00BD57504225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EE946AC-42B7-4581-A12D-00BD57504225}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EE946AC-42B7-4581-A12D-00BD57504225}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EE946AC-42B7-4581-A12D-00BD57504225}.Release|Any CPU.Build.0 = Release|Any CPU
{0C635DAF-1DF9-4DC1-9691-37B9F681C779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C635DAF-1DF9-4DC1-9691-37B9F681C779}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C635DAF-1DF9-4DC1-9691-37B9F681C779}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C635DAF-1DF9-4DC1-9691-37B9F681C779}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using BinarySerialization;
using Edelstein.Protocol.Network.Packets;
using Edelstein.Protocol.Network.Packets.Types;

namespace Edelstein.Protocol.Gameplay.Login.Contracts.Packets;

public record LoginAccountInfoFrame : StructuredBasePacket
{
[FieldOrder(0)] public required int ID { get; init; }
[FieldOrder(1)] public byte Gender { get; init; }
[FieldOrder(2)] public byte GradeCode { get; init; }
[FieldOrder(3)] public short SubGradeCode { get; init; }
[FieldOrder(4)] public byte CountryID { get; init; }
[FieldOrder(5)] public required LPString NexonClubID { get; init; }

[FieldOrder(6)] public byte Unk1 { get; init; }
[FieldOrder(7)] public byte Unk2 { get; init; }
[FieldOrder(8)] public FDateTime ChatUnblockDate { get; init; } = new();
[FieldOrder(9)] public FDateTime RegisterDate { get; init; } = new();

[FieldOrder(10)] public int NumOfCharacter { get; init; } = 4;

[FieldOrder(11)] public bool Unk3 { get; init; } = true;
[FieldOrder(12)] public bool Unk4 { get; init; }
[FieldOrder(13)] public long ClientKey { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using BinarySerialization;
using Edelstein.Protocol.Network.Packets;
using Edelstein.Protocol.Network.Packets.Types;

namespace Edelstein.Protocol.Gameplay.Login.Contracts.Packets;

public record LoginBlockReasonFrame : StructuredBasePacket
{
[FieldOrder(0)] public required byte Reason { get; init; }
[FieldOrder(1)] public required FDateTime UnblockDate { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
namespace Edelstein.Protocol.Gameplay.Login.Contracts.Packets;

public enum LoginResultCode : byte
{
ProcFail = byte.MaxValue,
Success = 0x0,
TempBlocked = 0x1,
Blocked = 0x2,
Abandoned = 0x3,
IncorrectPassword = 0x4,
NotRegistered = 0x5,
DBFail = 0x6,
AlreadyConnected = 0x7,
NotConnectableWorld = 0x8,
Unknown = 0x9,
Timeout = 0xA,
NotAdult = 0xB,
AuthFail = 0xC,
ImpossibleIP = 0xD,
NotAuthorizedNexonID = 0xE,
NoNexonID = 0xF,
NotAuthorized = 0x10,
InvalidRegionInfo = 0x11,
InvalidBirthDate = 0x12,
PassportSuspended = 0x13,
IncorrectSSN2 = 0x14,
WebAuthNeeded = 0x15,
DeleteCharacterFailedOnGuildMaster = 0x16,
NotAgreedEULA = 0x17,
DeleteCharacterFailedEngaged = 0x18
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using BinarySerialization;
using Edelstein.Protocol.Network.Packets;
using Edelstein.Protocol.Network.Packets.Types;

namespace Edelstein.Protocol.Gameplay.Login.Contracts.Packets.Recv;

public record CheckPasswordPacket : StructuredRecvPacket
{
[FieldOrder(0)] public required LPString Username { get; init; }
[FieldOrder(1)] public required LPString Password { get; init; }

[FieldOrder(2)]
[FieldLength(0x10)]
public required byte[] MachineID { get; init; }

[FieldOrder(3)] public required int GameRoomClient { get; init; }
[FieldOrder(4)] public required byte GameStartMode { get; init; }
[FieldOrder(5)] public required bool Unk1 { get; init; } // bAdminclient (?)
[FieldOrder(6)] public required bool Unk2 { get; init; } // unsure

[FieldOrder(7)] public required int PartnerCode { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using BinarySerialization;
using Edelstein.Protocol.Network.Packets;

namespace Edelstein.Protocol.Gameplay.Login.Contracts.Packets.Send;

public record CheckPasswordResultPacket() : StructuredSendPacket(PacketSendOperation.CheckPasswordResult)
{
[FieldOrder(0)] public required LoginResultCode Result { get; init; }

[FieldOrder(1)] public byte Unk1 { get; init; } = 0; // nRegStatID
[FieldOrder(2)] public int Unk2 { get; init; } = 0; // nUseDay

[FieldOrder(3)]
[SerializeWhen(nameof(Result), LoginResultCode.Blocked)]
public LoginBlockReasonFrame? BlockReason { get; init; }

[FieldOrder(4)]
[SerializeWhen(nameof(Result), LoginResultCode.Success)]
public LoginAccountInfoFrame? AccountInfo { get; init; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\Edelstein.Protocol.Network\Edelstein.Protocol.Network.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit 477359e

Please sign in to comment.