forked from PGR/ascnet
1
0
Fork 0
ascnet/AscNet.GameServer/Handlers/PlayerModule.cs

30 lines
893 B
C#

using AscNet.Common.MsgPack;
using MessagePack;
namespace AscNet.GameServer.Handlers
{
[MessagePackObject(true)]
public class ChangePlayerMarkRequest
{
public long MaskId;
}
internal class PlayerModule
{
[RequestPacketHandler("ChangePlayerMarkRequest")]
public static void ChangePlayerMarkRequestHandler(Session session, Packet.Request packet)
{
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);
session.SendResponse(new ChangePlayerMarkResponse(), packet.Id);
}
}
}