From 1dfec462cc727e0b8cc2c425063f39cee509c4b0 Mon Sep 17 00:00:00 2001 From: rfi Date: Thu, 18 Jan 2024 07:53:07 +0700 Subject: [PATCH] fashion UnLock... --- AscNet.GameServer/Handlers/FashionModule.cs | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/AscNet.GameServer/Handlers/FashionModule.cs b/AscNet.GameServer/Handlers/FashionModule.cs index 0a60b78d..3e3d0480 100644 --- a/AscNet.GameServer/Handlers/FashionModule.cs +++ b/AscNet.GameServer/Handlers/FashionModule.cs @@ -7,6 +7,18 @@ 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 FashionUnLockRequest + { + public uint FashionId { get; set; } + } + + [MessagePackObject(true)] + public class FashionUnLockResponse + { + public int Code { get; set; } + } + [MessagePackObject(true)] public class FashionUseRequest { @@ -40,5 +52,21 @@ namespace AscNet.GameServer.Handlers session.SendResponse(new FashionUseResponse(), packet.Id); } + + [RequestPacketHandler("FashionUnLockRequest")] + public static void HandleFashionUnLockRequestHandler(Session session, Packet.Request packet) + { + FashionUnLockRequest req = packet.Deserialize(); + var fashion = session.character.Fashions.Find(x => x.Id == req.FashionId); + if (fashion is not null && fashion.IsLock) + { + fashion.IsLock = false; + FashionSyncNotify fashionSync = new(); + fashionSync.FashionList.Add(fashion); + session.SendPush(fashionSync); + } + + session.SendResponse(new FashionUnLockResponse(), packet.Id); + } } }