forked from PGR/ascnet
1
0
Fork 0

save comms progress

This commit is contained in:
rfi 2023-11-14 09:18:00 +07:00
parent 1a77d304a0
commit 726af535e1
1 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,12 @@ namespace AscNet.GameServer.Handlers
{ {
public int Code; public int Code;
} }
[MessagePackObject(true)]
public class ChangeCommunicationRequest
{
public long Id;
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#endregion #endregion
@ -40,6 +46,9 @@ namespace AscNet.GameServer.Handlers
[RequestPacketHandler("ChangeCommunicationRequest")] [RequestPacketHandler("ChangeCommunicationRequest")]
public static void ChangeCommunicationRequestHandler(Session session, Packet.Request packet) public static void ChangeCommunicationRequestHandler(Session session, Packet.Request packet)
{ {
ChangeCommunicationRequest request = MessagePackSerializer.Deserialize<ChangeCommunicationRequest>(packet.Content);
session.player.PlayerData.Communications.Add(request.Id);
session.SendResponse(new ChangeCommunicationResponse(), packet.Id); session.SendResponse(new ChangeCommunicationResponse(), packet.Id);
} }
} }