diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 4f7a12142c..1090e368fd 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -560,6 +560,31 @@ function this.AllEquipTreasureRequest(_index, func) end end) end + +--请求所有法相数据 +function this.GetAllFaXiangRequest(_index, func) + local data = PlayerInfoProto_pb.GetAllFaxiangEquipRequest() + data.page = _index + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.GET_ALL_FAXIANG_EQUIP_REQUEST, MessageTypeProto_pb.GET_ALL_FAXIANG_EQUIP_RESPONSE, msg, function(buffer) + local data = buffer:DataByte() + local msg = PlayerInfoProto_pb.GetAllFaxiangEquipResponse() + msg:ParseFromString(data) + LogError("11111111111111 msg.equips len=="..#msg.equips) + FaXiangManager.InitAllEquipTreasure(msg.equips) + if msg.isFinish then + LogError("11111111111111 2222222222222") + if func then + func(msg) + end + else + _index = _index +1 + LogError("11111111111111 ".._index) + this.GetAllFaXiangRequest(_index, func) + end + end) +end + --请求穿装备 function this.EquipWearRequest(_heroId, _equipIds,_type, func) local data = HeroInfoProto_pb.EquipWearRequest() @@ -584,6 +609,56 @@ function this.EquipWearRequest(_heroId, _equipIds,_type, func) end end) end + +--请求穿脱法相 +function this.WearFaxiangEquipRequest(_heroId,_faxiangId,_type,func) + local data = PlayerInfoProto_pb.WearFaxiangEquipRequest() + data.heroId = _heroId + data.type =_type + data.faxiangID=_faxiangId + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.WEAR_FAXIANG_EQUIP_REQUEST, MessageTypeProto_pb.WEAR_FAXIANG_EQUIP_RESPONSE, msg, function(buffer) + local data = buffer:DataByte() + --local msg = HeroInfoProto_pb.GetAllEquipResponse() + --msg:ParseFromString(data) + --设置战斗力脏数据 + if _type == 1 then + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip) + else + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.EquipTreasure) + end + if func then + func(msg) + end + end) +end + +--请求法相升级升星 +function this.StrongthenFaxiangEquipRequest(_faxiangId,_lv,_type,func) + local data = PlayerInfoProto_pb.StrongthenFaxiangEquipRequest() + data.faxiangID = _faxiangId + data.action =_type + data.targetLv=_lv + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.STRONGTHEN_FAXIANG_EQUIP_REQUEST, MessageTypeProto_pb.STRONGTHEN_FAXIANG_EQUIP_RESPONSE, msg, function(buffer) + local data = buffer:DataByte() + + --设置战斗力脏数据 + if _type == 1 then + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.Equip) + else + HeroPropManager.SetDirtyByType(_heroId, Hero_Prop_Type.EquipTreasure) + end + if func then + func(msg) + end + end) +end + + + + + --请求脱装备 function this.EquipUnLoadOptRequest(_heroId, _equipIds, _type,func) local data = HeroInfoProto_pb.EquipUnLoadOptRequest()