equipment take off

This commit is contained in:
rfi 2023-12-09 09:23:54 +07:00
parent 5ac52d3dd1
commit 812c566f39
1 changed files with 27 additions and 0 deletions

View File

@ -49,6 +49,18 @@ namespace AscNet.GameServer.Handlers
public int Code;
}
[MessagePackObject(true)]
public class EquipTakeOffRequest
{
public List<int> EquipIds;
}
[MessagePackObject(true)]
public class EquipTakeOffResponse
{
public int Code;
}
[MessagePackObject(true)]
public class EquipLevelUpRequest
{
@ -207,5 +219,20 @@ namespace AscNet.GameServer.Handlers
session.SendResponse(new EquipPutOnResponse(), packet.Id);
}
[RequestPacketHandler("EquipTakeOffRequest")]
public static void EquipTakeOffRequestHandler(Session session, Packet.Request packet)
{
EquipTakeOffRequest request = packet.Deserialize<EquipTakeOffRequest>();
foreach (var equipId in request.EquipIds)
{
var equip = session.character.Equips.Find(x => x.Id == equipId);
if (equip is not null)
equip.CharacterId = 0;
}
session.SendResponse(new EquipTakeOffResponse(), packet.Id);
}
}
}