Skip to content

Commit

Permalink
server select
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-heinz committed Jan 9, 2022
1 parent eea2af9 commit 88d10a8
Show file tree
Hide file tree
Showing 14 changed files with 3,972 additions and 19 deletions.
3 changes: 2 additions & 1 deletion Arrowgene.Ddon.Cli/Command/PcapDecryptCommand.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Arrowgene.Ddon.LoginServer.Dump;
using Arrowgene.Ddon.PacketLibrary;
using Arrowgene.Ddon.Server;
using Arrowgene.Ddon.Server.Network;
Expand Down Expand Up @@ -43,7 +44,7 @@ public CommandResultType Run(CommandParameter parameter)
packets.AddRange(pf.Read(plPacket.Data));
}

// string dump = PacketDump.DumpCSharpStruc(packets, "LoginDump");
string dump = PacketDump.DumpCSharpStruc(packets, "GameDump");


foreach (Packet packet in packets)
Expand Down
9 changes: 9 additions & 0 deletions Arrowgene.Ddon.GameServer/DdonGameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ public override GameClient NewClient(ITcpSocket socket)

private void LoadPacketHandler()
{
AddHandler(new CharacterDecideCharacterIdHandler(this));
AddHandler(new ClientChallengeHandler(this));
AddHandler(new ConnectionLoginHandler(this));
AddHandler(new ConnectionMoveOutServerHandler(this));
AddHandler(new ConnectionPingHandler(this));
AddHandler(new LoadingInfoLoadingGetInfoHandler(this));
AddHandler(new ServerGetGameSettingHandler(this));
AddHandler(new ServerGetRealTimeHandler(this));
AddHandler(new ServerGetServerListHandler(this));
AddHandler(new StageGetStageListHandler(this));
}
}
}
3,730 changes: 3,730 additions & 0 deletions Arrowgene.Ddon.GameServer/Dump/GameDump.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Arrowgene.Buffers;
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class CharacterDecideCharacterIdHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(CharacterDecideCharacterIdHandler));


public CharacterDecideCharacterIdHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_CHARACTER_DECIDE_CHARACTER_ID_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_13);
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/ConnectionLoginHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ConnectionLoginHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ConnectionLoginHandler));


public ConnectionLoginHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_CONNECTION_LOGIN_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_4);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ConnectionMoveOutServerHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ConnectionMoveOutServerHandler));


public ConnectionMoveOutServerHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_CONNECTION_MOVE_OUT_SERVER_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_29);
}
}
}
28 changes: 28 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/ConnectionPingHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Arrowgene.Buffers;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ConnectionPingHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ConnectionPingHandler));


public ConnectionPingHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_CONNECTION_PING_REQ;

public override void Handle(GameClient 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.S2C_CONNECTION_PING_RES, buffer.GetAllBytes(), PacketSource.Server));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class LoadingInfoLoadingGetInfoHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(LoadingInfoLoadingGetInfoHandler));


public LoadingInfoLoadingGetInfoHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_LOADING_INFO_LOADING_GET_INFO_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_21);
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/ServerGetGameSettingHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ServerGetGameSettingHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ServerGetGameSettingHandler));


public ServerGetGameSettingHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_SERVER_GET_GAME_SETTING_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_10);
}
}
}
28 changes: 28 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/ServerGetRealTimeHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Arrowgene.Buffers;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ServerGetRealTimeHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ServerGetRealTimeHandler));


public ServerGetRealTimeHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_SERVER_GET_REAL_TIME_REQ;

public override void Handle(GameClient 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.S2C_SERVER_GET_REAL_TIME_RES, buffer.GetAllBytes(), PacketSource.Server));
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/ServerGetServerListHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class ServerGetServerListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(ServerGetServerListHandler));


public ServerGetServerListHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_SERVER_GET_SERVER_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_23);
}
}
}
24 changes: 24 additions & 0 deletions Arrowgene.Ddon.GameServer/Handler/StageGetStageListHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Arrowgene.Ddon.GameServer.Dump;
using Arrowgene.Ddon.Server.Logging;
using Arrowgene.Ddon.Server.Network;
using Arrowgene.Logging;

namespace Arrowgene.Ddon.GameServer.Handler
{
public class StageGetStageListHandler : PacketHandler<GameClient>
{
private static readonly DdonLogger Logger = LogProvider.Logger<DdonLogger>(typeof(StageGetStageListHandler));


public StageGetStageListHandler(DdonGameServer server) : base(server)
{
}

public override PacketId Id => PacketId.C2S_STAGE_GET_STAGE_LIST_REQ;

public override void Handle(GameClient client, Packet packet)
{
client.Send(GameDump.Dump_19);
}
}
}
18 changes: 3 additions & 15 deletions Arrowgene.Ddon.LoginServer/Handler/ClientX1Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,9 @@ public ClientX1Handler(DdonLoginServer server) : base(server)
public override void Handle(LoginClient client, Packet packet)
{
IBuffer buffer = new StreamBuffer();
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);
buffer.WriteByte(0);

// buffer.WriteByte(0x1F); // str len ??
// buffer.WriteString("F3829860AD5A4"); // but it is shorter?
buffer.WriteByte((byte) client.SessionKey.Length);
buffer.WriteString(client.SessionKey);

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));
}
}
Expand Down
6 changes: 3 additions & 3 deletions Arrowgene.Ddon.LoginServer/Handler/GetCharacterListHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Handle(LoginClient client, Packet packet)
IBuffer buffer = new StreamBuffer();
buffer.WriteInt32(0, Endianness.Big); // error
buffer.WriteInt32(0, Endianness.Big); // result

CDataCharacterListInfo character = new CDataCharacterListInfo();
character.Element.FirstName = "Dragons";
character.Element.LastName = "Dogma";
Expand All @@ -34,9 +34,9 @@ public override void Handle(LoginClient client, Packet packet)
characters.Add(character);
EntitySerializer.Get<CDataCharacterListInfo>().WriteList(buffer, characters);
Packet response = new Packet(PacketId.L2C_GET_CHARACTER_LIST_RES, buffer.GetAllBytes(), PacketSource.Server);
client.Send(response);
// client.Send(response);

// client.Send(LoginDump.Dump_24);
client.Send(LoginDump.Dump_24);
}
}
}

0 comments on commit 88d10a8

Please sign in to comment.