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.
This commit is contained in:
Kyle Belanger 2024-04-13 01:52:46 -04:00
parent abe7e6639b
commit a36eeeef63
4 changed files with 150 additions and 19 deletions

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -129,6 +129,32 @@ namespace AscNet.GameServer.Handlers
public int Code; public int Code;
public List<long> DisplayCharIdList; public List<long> 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. #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#endregion #endregion
@ -234,5 +260,17 @@ namespace AscNet.GameServer.Handlers
session.SendResponse(new SetDisplayCharIdFirstResponse() { DisplayCharIdList = session.player.PlayerData.DisplayCharIdList }, packet.Id); 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);
}
} }
} }

View File

@ -1,28 +1,26 @@
using AscNet.Common.MsgPack; using AscNet.Common.MsgPack;
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)]
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 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")] [RequestPacketHandler("GetShopInfoRequest")]
public static void GetShopInfoRequestHandler(Session session, Packet.Request packet) public static void GetShopInfoRequestHandler(Session session, Packet.Request packet)
{ {
@ -34,5 +32,23 @@ namespace AscNet.GameServer.Handlers
session.SendResponse(rsp, packet.Id); 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);
}
} }
} }