ActEquipChuanPushCtrl.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using FL.Data.Items;
  2. using System.Collections.Generic;
  3. using XGame.Database;
  4. using XGame.Framework.Network;
  5. namespace FL.Network
  6. {
  7. public class ActEquipChuanPushCtrl : MsgController<ActEquipChuanPush>
  8. {
  9. protected override void OnProcess(ActEquipChuanPush message, object context)
  10. {
  11. //XGame.Log.Info("接受到201301消息ActEquipChuanPushCtrl");
  12. if (message == null) return;
  13. List<EEquipType> changeEquipPartList = new List<EEquipType>();
  14. foreach (var item in message.chuan)
  15. {
  16. //XGame.Log.Info($"穿上的装备部位:{item.buwei}");
  17. EquipAttr wearEquip = EquipData.Instance.GetWearEquipData((EEquipType)item.buwei);
  18. if (wearEquip == null)
  19. {
  20. wearEquip = new EquipAttr();
  21. }
  22. wearEquip.Init(EquipmentTableRepo.Get(item.equipId), wearEquip.Id);
  23. wearEquip.Level = item.level;
  24. wearEquip.FightingPower = item.power;
  25. wearEquip.Attributes.Clear();
  26. foreach (var attr in item.eps)
  27. {
  28. wearEquip.Attributes.SetValue((EAttributeType)attr.epid, attr.val);
  29. }
  30. EquipData.Instance.ChangeWearEquipData((EEquipType)item.buwei, wearEquip);
  31. changeEquipPartList.Add((EEquipType)item.buwei);
  32. }
  33. EventSingle.Instance.Notify(EventDefine.OnChangeEquip, changeEquipPartList);
  34. }
  35. }
  36. }