some handlers, dh pubkey negative problem still not solved...

This commit is contained in:
raphaeIl
2025-01-13 09:11:16 -05:00
parent aae2dc6b55
commit ab8953908e
13 changed files with 19796 additions and 4447 deletions

View File

@@ -0,0 +1,20 @@
using Novaria.Common.Core;
using Proto;
using Serilog;
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
{
public class ActivityDetail : ProtocolHandlerBase
{
public ActivityDetail(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
{
}
[ProtocolHandler(NetMsgId.activity_detail_req)] // req id goes here
public Packet PlayerLoginHandler(Nil req)
{
return Packet.Create(NetMsgId.activity_detail_succeed_ack, PcapParser.PcapParser.Instance.GetPcapPacket(NetMsgId.activity_detail_succeed_ack));
}
}
}

View File

@@ -55,7 +55,7 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
byte[] real_key = AeadTool.key3;
// load from pcap
PcapParser.PcapParser.Instance.Parse("first_instant_join.json");
PcapParser.PcapParser.Instance.Parse("all_mainmenu_packets.json");
PlayerInfo pcapPlayerInfo = (PlayerInfo)PcapParser.PcapParser.Instance.GetPcapPacket(NetMsgId.player_data_succeed_ack);
@@ -69,14 +69,14 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
return Packet.Create(NetMsgId.player_data_succeed_ack, pcapPlayerInfo);
}
//[ProtocolHandler(NetMsgId.player_reg_req)]
//public Packet PlayerRegHandler(PlayerReg req)
//{
// Log.Information("player_reg_req received, contents: " + JsonSerializer.Serialize(req));
[ProtocolHandler(NetMsgId.player_ping_req)]
public Packet PlayerRegHandler(PlayerReg req)
{
return Packet.Create(NetMsgId.player_ping_succeed_ack, new Pong()
{
ServerTs = DateTime.Now.Ticks,
});
}
// //Log.Information("Sending PlayerInfo packet: " + JsonSerializer.Serialize(playerInfoResp));
// return null;
//}
}
}

View File

@@ -0,0 +1,26 @@
using Novaria.Common.Core;
using Proto;
using Serilog;
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
{
public class Mail : ProtocolHandlerBase
{
public Mail(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
{
}
[ProtocolHandler(NetMsgId.mail_list_req)] // req id goes here
public Packet PlayerLoginHandler(Nil req)
{
Mails mailListResp = (Mails)PcapParser.PcapParser.Instance.GetPcapPacket(NetMsgId.mail_list_succeed_ack);
mailListResp.List[0].Subject = "夏萝莉是小楠梁";
mailListResp.List[1].Subject = "夏萝莉是小楠梁";
mailListResp.List[2].Subject = "夏萝莉是小楠梁";
return Packet.Create(NetMsgId.mail_list_succeed_ack, mailListResp);
}
}
}

View File

@@ -0,0 +1,26 @@
using Novaria.Common.Core;
using Proto;
using Serilog;
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
{
public class ResidentShop : ProtocolHandlerBase
{
public ResidentShop(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
{
}
[ProtocolHandler(NetMsgId.resident_shop_get_req)] // req id goes here
public Packet PlayerLoginHandler(ResidentShopGetReq req)
{
ResidentShopGetResp resp = new ResidentShopGetResp();
resp.Shops.Add(new Proto.ResidentShop() { Id = 1, RefreshTime = 1 });
resp.Shops.Add(new Proto.ResidentShop() { Id = 2, RefreshTime = 1 });
resp.Shops.Add(new Proto.ResidentShop() { Id = 3, RefreshTime = 1 });
return Packet.Create(NetMsgId.resident_shop_get_succeed_ack, resp);
}
}
}