2023-10-14 15:05:58 +00:00
|
|
|
|
using AscNet.Common.MsgPack;
|
2023-11-11 07:28:21 +00:00
|
|
|
|
using MessagePack;
|
2023-10-14 15:05:58 +00:00
|
|
|
|
|
|
|
|
|
namespace AscNet.GameServer.Handlers
|
|
|
|
|
{
|
2023-11-11 07:28:21 +00:00
|
|
|
|
[MessagePackObject(true)]
|
|
|
|
|
public class ChangePlayerMarkRequest
|
|
|
|
|
{
|
|
|
|
|
public long MaskId;
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-14 15:05:58 +00:00
|
|
|
|
internal class PlayerModule
|
|
|
|
|
{
|
|
|
|
|
[RequestPacketHandler("ChangePlayerMarkRequest")]
|
|
|
|
|
public static void ChangePlayerMarkRequestHandler(Session session, Packet.Request packet)
|
|
|
|
|
{
|
2023-11-11 07:28:21 +00:00
|
|
|
|
ChangePlayerMarkRequest request = MessagePackSerializer.Deserialize<ChangePlayerMarkRequest>(packet.Content);
|
|
|
|
|
|
|
|
|
|
if (session.player.PlayerData.Marks is null)
|
|
|
|
|
{
|
|
|
|
|
session.log.Debug("Marks is somehow null");
|
|
|
|
|
session.player.PlayerData.Marks = new();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
session.player.PlayerData.Marks.Add(request.MaskId);
|
2023-10-14 15:05:58 +00:00
|
|
|
|
session.SendResponse(new ChangePlayerMarkResponse(), packet.Id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|