mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-15 07:54:36 +01:00
some handlers, dh pubkey negative problem still not solved...
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
26
Novaria.SDKServer/Controllers/Api/ProtocolHandlers/Mail.cs
Normal file
26
Novaria.SDKServer/Controllers/Api/ProtocolHandlers/Mail.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user