-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Andoryuuta/login-server-patches
Login server patches
- Loading branch information
Showing
11 changed files
with
225 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Server.Logging; | ||
using Arrowgene.Ddon.Server.Network; | ||
using Arrowgene.Logging; | ||
using System.Text; | ||
|
||
namespace Arrowgene.Ddon.LoginServer.Handler | ||
{ | ||
public class ClientLoginHandler : PacketHandler<LoginClient> | ||
{ | ||
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ClientLoginHandler)); | ||
|
||
|
||
public ClientLoginHandler(DdonLoginServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override PacketId Id => PacketId.C2L_LOGIN_REQ; | ||
|
||
public override void Handle(LoginClient client, Packet packet) | ||
{ | ||
IBuffer recv = packet.AsBuffer(); | ||
ushort len = recv.ReadUInt16(Endianness.Big); | ||
string onetimeToken = recv.ReadString(len); | ||
|
||
/* | ||
PLATFORM_TYPE_NONE = 0x0, | ||
PLATFORM_TYPE_PC = 0x1, | ||
PLATFORM_TYPE_PS3 = 0x2, | ||
PLATFORM_TYPE_PS4 = 0x3, | ||
*/ | ||
byte inPlatform = recv.ReadByte(); | ||
|
||
Logger.Debug(client, $"Received OnetimeToken: {onetimeToken}"); | ||
|
||
client.OnetimeToken = onetimeToken; | ||
|
||
IBuffer buffer = new StreamBuffer(); | ||
buffer.WriteInt32(0); //us_error | ||
buffer.WriteInt32(0); //n_result | ||
|
||
// Onetime Token (MtString) | ||
byte[] utf8 = Encoding.UTF8.GetBytes(client.OnetimeToken); | ||
buffer.WriteUInt16((ushort)client.OnetimeToken.Length, Endianness.Big); | ||
buffer.WriteBytes(utf8); | ||
|
||
client.Send(new Packet(PacketId.L2C_LOGIN_RES, buffer.GetAllBytes(), PacketSource.Server)); | ||
} | ||
} | ||
} |
14 changes: 7 additions & 7 deletions
14
...on.LoginServer/Handler/ClientX1Handler.cs → ....LoginServer/Handler/ClientPingHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Server.Logging; | ||
using Arrowgene.Ddon.Server.Network; | ||
using Arrowgene.Logging; | ||
|
||
namespace Arrowgene.Ddon.LoginServer.Handler | ||
{ | ||
public class ClientX1Handler : PacketHandler<LoginClient> | ||
public class ClientPingHandler : PacketHandler<LoginClient> | ||
{ | ||
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ClientX1Handler)); | ||
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ClientPingHandler)); | ||
|
||
|
||
public ClientX1Handler(DdonLoginServer server) : base(server) | ||
public ClientPingHandler(DdonLoginServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override PacketId Id => PacketId.X1_REQ; | ||
public override PacketId Id => PacketId.C2L_PING_REQ; | ||
|
||
public override void Handle(LoginClient client, Packet packet) | ||
{ | ||
IBuffer buffer = new StreamBuffer(); | ||
buffer.WriteUInt32(0, Endianness.Big); | ||
buffer.WriteUInt32(0, Endianness.Big); | ||
buffer.WriteBytes(new byte[15]); | ||
client.Send(new Packet(PacketId.X1_RES, buffer.GetAllBytes(), PacketSource.Server)); | ||
|
||
client.Send(new Packet(PacketId.L2C_PING_RES, buffer.GetAllBytes(), PacketSource.Server)); | ||
} | ||
} | ||
} |
53 changes: 0 additions & 53 deletions
53
Arrowgene.Ddon.LoginServer/Handler/ClientSessionKeyHandler.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Arrowgene.Ddon.LoginServer/Handler/DeleteCharacterHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Arrowgene.Buffers; | ||
using Arrowgene.Ddon.Server.Logging; | ||
using Arrowgene.Ddon.Server.Network; | ||
using Arrowgene.Logging; | ||
using System.Text; | ||
|
||
namespace Arrowgene.Ddon.LoginServer.Handler | ||
{ | ||
public class DeleteCharacterHandler : PacketHandler<LoginClient> | ||
{ | ||
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(DeleteCharacterHandler)); | ||
|
||
public DeleteCharacterHandler(DdonLoginServer server) : base(server) | ||
{ | ||
} | ||
|
||
public override PacketId Id => PacketId.C2L_DELETE_CHARACTER_INFO_REQ; | ||
|
||
public override void Handle(LoginClient client, Packet packet) | ||
{ | ||
IBuffer recv = packet.AsBuffer(); | ||
uint characterID = recv.ReadUInt32(Endianness.Big); | ||
Logger.Debug(client, $"Tried to delete character with ID: {characterID}"); | ||
|
||
|
||
IBuffer buffer = new StreamBuffer(); | ||
buffer.WriteInt32(0); //us_error | ||
buffer.WriteUInt32(0, Endianness.Big); | ||
client.Send(new Packet(PacketId.L2C_DELETE_CHARACTER_INFO_RES, buffer.GetAllBytes(), PacketSource.Server)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.