神将置换卡bug修改
parent
2985c1f5a2
commit
7bb73f1175
|
@ -7039,5 +7039,33 @@ function NetManager.SendGmBuyGoodRequest(_id,func)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---神将置换卡使用置换
|
||||||
|
function NetManager.SendHeroChangeRequest(_heroDId1,_heroDId2,_itemId,func)
|
||||||
|
local oldWarPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||||
|
local data = HeroInfoProto_pb.HeroChangeRequest()
|
||||||
|
data.heroID1=_heroDId1
|
||||||
|
data.heroID2=_heroDId2
|
||||||
|
data.itemID=_itemId
|
||||||
|
local msg = data:SerializeToString()
|
||||||
|
Network:SendMessageWithCallBack(MessageTypeProto_pb.HERO_CHANGE_REQUEST,MessageTypeProto_pb.HERO_CHANGE_RESPONSE,msg,function(buffer)
|
||||||
|
local data = buffer:DataByte()
|
||||||
|
local msg = HeroInfoProto_pb.HeroChangeResponse()
|
||||||
|
msg:ParseFromString(data)
|
||||||
|
for i = 1, #msg.heros do
|
||||||
|
HeroManager.UpdateHeroDatas(msg.heros[i])
|
||||||
|
end
|
||||||
|
HeroPropManager.SetDirtyByType(_heroDId1, Hero_Prop_Type.Base)
|
||||||
|
HeroPropManager.SetDirtyByType(_heroDId2, Hero_Prop_Type.Base)
|
||||||
|
NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)
|
||||||
|
local tempPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||||
|
if oldWarPower ~= tempPower then
|
||||||
|
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPower,newValue = tempPower})
|
||||||
|
end
|
||||||
|
if func then
|
||||||
|
func(msg)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return this
|
return this
|
Loading…
Reference in New Issue