ItemUseRequest stub to prevent softlock when using consumables

This commit is contained in:
Kyle Belanger 2024-04-13 00:47:55 -04:00
parent 3e2caf704d
commit aae1314558
2 changed files with 25 additions and 2 deletions

View File

@ -3,6 +3,8 @@ 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)] [MessagePackObject(true)]
public class GuideGroupFinishRequest public class GuideGroupFinishRequest
{ {
@ -34,6 +36,8 @@ namespace AscNet.GameServer.Handlers
public int Code; public int Code;
public List<dynamic>? RewardGoodsList; public List<dynamic>? RewardGoodsList;
} }
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#endregion
internal class GuideModule internal class GuideModule
{ {

View File

@ -11,6 +11,19 @@ namespace AscNet.GameServer.Handlers
public int MoneyCard; public int MoneyCard;
public int Count; public int Count;
} }
[MessagePackObject(true)]
public class ItemUseRequest
{
public int Id;
public int Count;
}
[MessagePackObject(true)]
public class ItemUseResponse
{
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
@ -26,5 +39,11 @@ namespace AscNet.GameServer.Handlers
MoneyCard = 0 MoneyCard = 0
}, packet.Id); }, packet.Id);
} }
[RequestPacketHandler("ItemUseRequest")]
public static void ItemUseRequest(Session session, Packet.Request packet)
{
session.SendResponse(new ItemUseResponse() { Code = 1 }, packet.Id);
}
} }
} }