mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-12 14:34:38 +01:00
implement more handler
This commit is contained in:
@@ -18,16 +18,16 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
[ProtocolHandler(NetMsgId.player_login_req)] // req id goes here
|
||||
public Packet PlayerLoginHandler(LoginReq req)
|
||||
{
|
||||
Log.Information("login_req received, contents: " + JsonSerializer.Serialize(req));
|
||||
//Log.Information("login_req received, contents: " + JsonSerializer.Serialize(req));
|
||||
|
||||
Log.Information("Building login resp...");
|
||||
//Log.Information("Building login resp...");
|
||||
|
||||
LoginResp loginResp = new LoginResp()
|
||||
{
|
||||
Token = "seggstoken",
|
||||
};
|
||||
|
||||
Log.Information("Sending login_resp packet: " + JsonSerializer.Serialize(loginResp));
|
||||
//Log.Information("Sending login_resp packet: " + JsonSerializer.Serialize(loginResp));
|
||||
return Packet.Create(NetMsgId.player_login_succeed_ack, loginResp);
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
return Packet.Create(NetMsgId.player_ping_succeed_ack, new Pong()
|
||||
{
|
||||
ServerTs = DateTime.Now.Ticks,
|
||||
ServerTs = 1736745112,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
19
Novaria.GameServer/Controllers/Api/ProtocolHandlers/Phone.cs
Normal file
19
Novaria.GameServer/Controllers/Api/ProtocolHandlers/Phone.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Google.Protobuf;
|
||||
using Novaria.Common.Core;
|
||||
using Proto;
|
||||
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
public class Phone : ProtocolHandlerBase
|
||||
{
|
||||
public Phone(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.phone_contacts_info_req)]
|
||||
public Packet PhoneContactsInfoHandler(Nil req)
|
||||
{
|
||||
return Packet.Create(NetMsgId.phone_contacts_info_succeed_ack, PcapParser.PcapParser.Instance.GetPcapPacket(NetMsgId.phone_contacts_info_succeed_ack));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Google.Protobuf;
|
||||
using Novaria.Common.Core;
|
||||
using Proto;
|
||||
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
public class Player : ProtocolHandlerBase
|
||||
{
|
||||
public Player(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.player_board_set_req)]
|
||||
public Packet PlayerBoardSetHandler(PlayerBoardSetReq req)
|
||||
{
|
||||
ChangeInfo changeInfo = new();
|
||||
|
||||
return Packet.Create(NetMsgId.player_board_set_succeed_ack, changeInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Novaria.GameServer/Controllers/Api/ProtocolHandlers/Plot.cs
Normal file
21
Novaria.GameServer/Controllers/Api/ProtocolHandlers/Plot.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Google.Protobuf;
|
||||
using Novaria.Common.Core;
|
||||
using Proto;
|
||||
namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
{
|
||||
public class Plot : ProtocolHandlerBase
|
||||
{
|
||||
public Plot(IProtocolHandlerFactory protocolHandlerFactory) : base(protocolHandlerFactory)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.plot_reward_receive_req)]
|
||||
public Packet PlotRewardReceiveHandler(UI32 req)
|
||||
{
|
||||
ChangeInfo resp = new ChangeInfo();
|
||||
|
||||
return Packet.Create(NetMsgId.plot_reward_receive_succeed_ack, resp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Google.Protobuf;
|
||||
using Novaria.Common.Core;
|
||||
using Proto;
|
||||
using Serilog;
|
||||
@@ -18,5 +19,29 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
|
||||
return Packet.Create(NetMsgId.region_boss_level_apply_succeed_ack, regionBossChangeInfo);
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.region_boss_level_settle_req)]
|
||||
public Packet RegionBossLevelSettleHandler(RegionBossLevelSettleReq req)
|
||||
{
|
||||
RegionBossLevelSettleResp regionBossLevelSettleResp = new RegionBossLevelSettleResp()
|
||||
{
|
||||
First = true,
|
||||
ThreeStar = true,
|
||||
Change = new(),
|
||||
//AwardItems = [],
|
||||
//FirstItems = [],
|
||||
//ThreeStarItems = [],
|
||||
Exp = 0,
|
||||
//SurpriseItems = [],
|
||||
NextPackage = ByteString.Empty
|
||||
};
|
||||
|
||||
regionBossLevelSettleResp.AwardItems.Add([]);
|
||||
regionBossLevelSettleResp.FirstItems.Add([]);
|
||||
regionBossLevelSettleResp.ThreeStarItems.Add([]);
|
||||
regionBossLevelSettleResp.SurpriseItems.Add([]);
|
||||
|
||||
return Packet.Create(NetMsgId.region_boss_level_settle_succeed_ack, regionBossLevelSettleResp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Novaria.GameServer.Controllers.Api.ProtocolHandlers
|
||||
}
|
||||
|
||||
[ProtocolHandler(NetMsgId.star_tower_info_req)] // req id goes here
|
||||
public Packet PlayerLoginHandler(Nil req)
|
||||
public Packet StarTowerInfoHandler(Nil req)
|
||||
{
|
||||
StarTowerInfo towerResp = new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user