ascnet/AscNet.GameServer/Handlers/PlayerModule.cs

30 lines
893 B
C#
Raw Normal View History

using AscNet.Common.MsgPack;
2023-11-11 07:28:21 +00:00
using MessagePack;
namespace AscNet.GameServer.Handlers
{
2023-11-11 07:28:21 +00:00
[MessagePackObject(true)]
public class ChangePlayerMarkRequest
{
public long MaskId;
}
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);
session.SendResponse(new ChangePlayerMarkResponse(), packet.Id);
}
}
}