forked from PGR/ascnet
1
0
Fork 0

equip lock

This commit is contained in:
rfi 2023-12-03 17:44:40 +07:00
parent 2cfa17006c
commit e5aa565eb2
1 changed files with 32 additions and 0 deletions

View File

@ -9,6 +9,19 @@ namespace AscNet.GameServer.Handlers
{ {
#region MsgPackScheme #region MsgPackScheme
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[MessagePackObject(true)]
public class EquipUpdateLockRequest
{
public int EquipId;
public bool IsLock;
}
[MessagePackObject(true)]
public class EquipUpdateLockResponse
{
public int Code;
}
[MessagePackObject(true)] [MessagePackObject(true)]
public class EquipLevelUpRequest public class EquipLevelUpRequest
{ {
@ -70,5 +83,24 @@ namespace AscNet.GameServer.Handlers
session.SendResponse(rsp, packet.Id); session.SendResponse(rsp, packet.Id);
} }
[RequestPacketHandler("EquipUpdateLockRequest")]
public static void EquipUpdateLockRequestHandler(Session session, Packet.Request packet)
{
EquipUpdateLockRequest request = packet.Deserialize<EquipUpdateLockRequest>();
var response = new EquipUpdateLockResponse();
var equip = session.character.Equips.Find(x => x.Id == request.EquipId);
if (equip is null)
{
// EquipManagerGetCharEquipBySiteNotFound
response.Code = 20021012;
}
else
{
equip.IsLock = request.IsLock;
}
session.SendResponse(response, packet.Id);
}
} }
} }