From a36eeeef63e26449324c71c9b7d4e108e4808391 Mon Sep 17 00:00:00 2001 From: Kyle Belanger Date: Sat, 13 Apr 2024 01:52:46 -0400 Subject: [PATCH] Some stubs for Dorm and Guild softlocks Dorm still has a few spots with invalid data which softlock. Guild will still softlock on trying to load guild entries, but I can't do much about that at the moment. --- AscNet.GameServer/Handlers/DormModule.cs | 46 ++++++++++++++++++ AscNet.GameServer/Handlers/GuildModule.cs | 31 +++++++++++++ AscNet.GameServer/Handlers/PlayerModule.cs | 38 +++++++++++++++ AscNet.GameServer/Handlers/ShopModule.cs | 54 ++++++++++++++-------- 4 files changed, 150 insertions(+), 19 deletions(-) create mode 100644 AscNet.GameServer/Handlers/DormModule.cs create mode 100644 AscNet.GameServer/Handlers/GuildModule.cs diff --git a/AscNet.GameServer/Handlers/DormModule.cs b/AscNet.GameServer/Handlers/DormModule.cs new file mode 100644 index 00000000..ede5ecba --- /dev/null +++ b/AscNet.GameServer/Handlers/DormModule.cs @@ -0,0 +1,46 @@ +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 DormEnterRequest + { + } + + [MessagePackObject(true)] + public class DormEnterResponse + { + public int Code; + } + + [MessagePackObject(true)] + public class DormitoryListRequest + { + } + + [MessagePackObject(true)] + public class DormitoryListResponse + { + 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 DormModule + { + [RequestPacketHandler("DormEnterRequest")] + public static void DormEnterRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new DormEnterResponse(), packet.Id); + } + + [RequestPacketHandler("DormitoryListRequest")] + public static void DormitoryListRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new DormitoryListResponse(), packet.Id); + } + } +} diff --git a/AscNet.GameServer/Handlers/GuildModule.cs b/AscNet.GameServer/Handlers/GuildModule.cs new file mode 100644 index 00000000..def91622 --- /dev/null +++ b/AscNet.GameServer/Handlers/GuildModule.cs @@ -0,0 +1,31 @@ +using AscNet.Common.MsgPack; +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 GuildListRecommendRequest + { + public int PageNo; + } + + [MessagePackObject(true)] + public class GuildListRecommendResponse + { + 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 GuildModule + { + [RequestPacketHandler("GuildListRecommendRequest")] + public static void GuildListRecommendRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new GuildListRecommendResponse(), packet.Id); + } + } +} diff --git a/AscNet.GameServer/Handlers/PlayerModule.cs b/AscNet.GameServer/Handlers/PlayerModule.cs index 970e46a2..372b066f 100644 --- a/AscNet.GameServer/Handlers/PlayerModule.cs +++ b/AscNet.GameServer/Handlers/PlayerModule.cs @@ -129,6 +129,32 @@ namespace AscNet.GameServer.Handlers public int Code; public List DisplayCharIdList; } + + [MessagePackObject(true)] + public class QueryPlayerDetailRequest + { + public int PlayerId; + } + + [MessagePackObject(true)] + public class QueryPlayerDetailResponse + { + public int Code; + } + + [MessagePackObject(true)] + public class SetAppearanceRequest + { + public int CharacterAppearanceType; + public dynamic? Characters; + public AppearanceSettingInfo AppearanceSettingInfo; + } + + [MessagePackObject(true)] + public class SetAppearanceResponse + { + public int Code; + } #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. #endregion @@ -234,5 +260,17 @@ namespace AscNet.GameServer.Handlers session.SendResponse(new SetDisplayCharIdFirstResponse() { DisplayCharIdList = session.player.PlayerData.DisplayCharIdList }, packet.Id); } + + [RequestPacketHandler("QueryPlayerDetailRequest")] + public static void QueryPlayerDetailRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new QueryPlayerDetailResponse() { Code = 1 }, packet.Id); + } + + [RequestPacketHandler("SetAppearanceRequest")] + public static void SetAppearanceRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new SetAppearanceResponse() { Code = 1 }, packet.Id); + } } } diff --git a/AscNet.GameServer/Handlers/ShopModule.cs b/AscNet.GameServer/Handlers/ShopModule.cs index 85d68dce..c857e887 100644 --- a/AscNet.GameServer/Handlers/ShopModule.cs +++ b/AscNet.GameServer/Handlers/ShopModule.cs @@ -1,28 +1,26 @@ using AscNet.Common.MsgPack; +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 GetShopBaseInfoRequest + { + } + + [MessagePackObject(true)] + public class GetShopBaseInfoResponse + { + 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 ShopModule { - /* TODO: Needs types - [RequestPacketHandler("GetShopBaseInfoRequest")] - public static void GetShopBaseInfoRequestHandler(Session session, Packet.Request packet) - { - } - */ - - [RequestPacketHandler("GetShopInfoReceiveRequest")] - public static void GetShopInfoReceiveRequestHandler(Session session, Packet.Request packet) - { - GetShopInfoResponse rsp = new() - { - Code = 0, - ClientShop = { } - }; - - session.SendResponse(rsp, packet.Id); - } - [RequestPacketHandler("GetShopInfoRequest")] public static void GetShopInfoRequestHandler(Session session, Packet.Request packet) { @@ -34,5 +32,23 @@ namespace AscNet.GameServer.Handlers session.SendResponse(rsp, packet.Id); } + + [RequestPacketHandler("GetShopInfoReceiveRequest")] + public static void GetShopInfoReceiveRequestHandler(Session session, Packet.Request packet) + { + GetShopInfoResponse rsp = new() + { + Code = 0, + ClientShop = { } + }; + + session.SendResponse(rsp, packet.Id); + } + + [RequestPacketHandler("GetShopBaseInfoRequest")] + public static void GetShopBaseInfoRequestHandler(Session session, Packet.Request packet) + { + session.SendResponse(new GetShopBaseInfoResponse(), packet.Id); + } } }