2023-10-14 15:05:58 +00:00
|
|
|
|
using AscNet.Common.MsgPack;
|
2023-10-14 17:20:25 +00:00
|
|
|
|
using MessagePack;
|
2023-10-14 15:05:58 +00:00
|
|
|
|
|
|
|
|
|
namespace AscNet.GameServer.Handlers
|
|
|
|
|
{
|
2023-10-14 17:20:25 +00:00
|
|
|
|
[MessagePackObject(true)]
|
2023-10-14 16:13:29 +00:00
|
|
|
|
public class GuideGroupFinishRequest
|
|
|
|
|
{
|
|
|
|
|
public int GroupId;
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-14 17:20:25 +00:00
|
|
|
|
[MessagePackObject(true)]
|
2023-10-14 16:13:29 +00:00
|
|
|
|
public class GuideGroupFinishResponse
|
|
|
|
|
{
|
|
|
|
|
public int Code;
|
|
|
|
|
public List<dynamic>? RewardGoodsList;
|
|
|
|
|
}
|
2023-11-11 01:12:11 +00:00
|
|
|
|
|
|
|
|
|
[MessagePackObject(true)]
|
|
|
|
|
public class GuideCompleteRequest
|
|
|
|
|
{
|
|
|
|
|
public int GuideGroupId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MessagePackObject(true)]
|
|
|
|
|
public class NotifyGuide
|
|
|
|
|
{
|
|
|
|
|
public int GuideGroupId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MessagePackObject(true)]
|
|
|
|
|
public class GuideCompleteResponse
|
|
|
|
|
{
|
|
|
|
|
public int Code;
|
|
|
|
|
public List<dynamic>? RewardGoodsList;
|
|
|
|
|
}
|
2023-10-14 16:13:29 +00:00
|
|
|
|
|
2023-10-14 15:05:58 +00:00
|
|
|
|
internal class GuideModule
|
|
|
|
|
{
|
|
|
|
|
[RequestPacketHandler("GuideOpenRequest")]
|
|
|
|
|
public static void GuideOpenRequestHandler(Session session, Packet.Request packet)
|
|
|
|
|
{
|
2024-04-06 01:27:56 +00:00
|
|
|
|
GuideCompleteRequest request = packet.Deserialize<GuideCompleteRequest>();
|
|
|
|
|
|
|
|
|
|
session.player.PlayerData.GuideData.Add(request.GuideGroupId);
|
|
|
|
|
session.SendPush(new NotifyGuide() { GuideGroupId = request.GuideGroupId });
|
2023-10-14 15:05:58 +00:00
|
|
|
|
session.SendResponse(new GuideOpenResponse(), packet.Id);
|
|
|
|
|
}
|
2023-10-14 16:13:29 +00:00
|
|
|
|
|
|
|
|
|
// TODO: Invalid, need proper types
|
2023-10-14 15:05:58 +00:00
|
|
|
|
[RequestPacketHandler("GuideGroupFinishRequest")]
|
|
|
|
|
public static void GuideGroupFinishRequestHandler(Session session, Packet.Request packet)
|
|
|
|
|
{
|
2023-10-14 16:13:29 +00:00
|
|
|
|
session.SendResponse(new GuideGroupFinishResponse(), packet.Id);
|
2023-10-14 15:05:58 +00:00
|
|
|
|
}
|
2023-11-11 01:12:11 +00:00
|
|
|
|
|
|
|
|
|
[RequestPacketHandler("GuideCompleteRequest")]
|
|
|
|
|
public static void GuideCompleteRequestHandler(Session session, Packet.Request packet)
|
|
|
|
|
{
|
|
|
|
|
GuideCompleteRequest request = MessagePackSerializer.Deserialize<GuideCompleteRequest>(packet.Content);
|
|
|
|
|
|
|
|
|
|
session.player.PlayerData.GuideData.Add(request.GuideGroupId);
|
|
|
|
|
session.SendPush(new NotifyGuide() { GuideGroupId = request.GuideGroupId });
|
|
|
|
|
session.SendResponse(new GuideCompleteResponse(), packet.Id);
|
|
|
|
|
}
|
2023-10-14 15:05:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|