diff --git a/AscNet.GameServer/Handlers/FashionModule.cs b/AscNet.GameServer/Handlers/FashionModule.cs index 0a60b78..3e3d048 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); + } } }