forked from PGR/ascnet
equipment take off
This commit is contained in:
parent
5ac52d3dd1
commit
812c566f39
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue