handles draw and comms command

This commit is contained in:
rfi 2023-11-13 19:33:51 +07:00
parent 6c5aca3c3a
commit 1a77d304a0
3 changed files with 41 additions and 12 deletions

View File

@ -1,12 +0,0 @@
namespace AscNet.GameServer.Handlers
{
internal class CommunicationModule
{
/* TODO: Need types
[RequestPacketHandler("ChangeCommunicationRequest")]
public static void ChangeCommunicationRequestHandler(Session session, Packet.Request packet)
{
}
*/
}
}

View File

@ -0,0 +1,24 @@
using MessagePack;
namespace AscNet.GameServer.Handlers
{
#region MsgPackScheme
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[MessagePackObject(true)]
public class DrawGetDrawGroupListResponse
{
public int Code { get; set; }
public List<dynamic> DrawGroupInfoList { get; set; } = new();
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#endregion
internal class DrawModule
{
[RequestPacketHandler("DrawGetDrawGroupListRequest")]
public static void DrawGetDrawGroupListRequestHandler(Session session, Packet.Request packet)
{
session.SendResponse(new DrawGetDrawGroupListResponse(), packet.Id);
}
}
}

View File

@ -3,12 +3,23 @@ using MessagePack;
namespace AscNet.GameServer.Handlers namespace AscNet.GameServer.Handlers
{ {
#region MsgPackScheme
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[MessagePackObject(true)] [MessagePackObject(true)]
public class ChangePlayerMarkRequest public class ChangePlayerMarkRequest
{ {
public long MaskId; public long MaskId;
} }
[MessagePackObject(true)]
public class ChangeCommunicationResponse
{
public int Code;
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#endregion
internal class PlayerModule internal class PlayerModule
{ {
[RequestPacketHandler("ChangePlayerMarkRequest")] [RequestPacketHandler("ChangePlayerMarkRequest")]
@ -25,5 +36,11 @@ namespace AscNet.GameServer.Handlers
session.player.PlayerData.Marks.Add(request.MaskId); session.player.PlayerData.Marks.Add(request.MaskId);
session.SendResponse(new ChangePlayerMarkResponse(), packet.Id); session.SendResponse(new ChangePlayerMarkResponse(), packet.Id);
} }
[RequestPacketHandler("ChangeCommunicationRequest")]
public static void ChangeCommunicationRequestHandler(Session session, Packet.Request packet)
{
session.SendResponse(new ChangeCommunicationResponse(), packet.Id);
}
} }
} }