From 9a2d9c70a73ea64ac74ed5b24d04d1daa7ad7bdc Mon Sep 17 00:00:00 2001 From: zhangqiang <657634622@qq.com> Date: Wed, 28 Jul 2021 15:48:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=8A=9F=E8=83=BD=E3=80=91?= =?UTF-8?q?=E7=BD=97=E6=B5=AE=E4=BA=89=E9=94=8B=E6=8E=92=E8=A1=8C=E6=A6=9C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B7=A8=E6=9C=8D=E5=88=87=E7=A3=8B=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Message/ArenaInfoProto_pb.lua | 13 ++++- .../View/JumpServerHightLadderFormation.lua | 37 ++++++++++++-- .../~Lua/Modules/Net/NetManager.lua | 3 +- .../~Lua/Modules/Player/PlayerManager.lua | 5 +- .../~Lua/Modules/Popup/PlayerInfoPopup.lua | 48 ++++++++++--------- 5 files changed, 76 insertions(+), 30 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua b/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua index 7f0d84c04d..e8cc6ae153 100644 --- a/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua +++ b/Assets/ManagedResources/~Lua/Message/ArenaInfoProto_pb.lua @@ -30,6 +30,7 @@ ARENARECORDINFORESPONSE_ARENARECORDINFO_FIELD = protobuf.FieldDescriptor(); PLAYWITHSBREQUEST = protobuf.Descriptor(); PLAYWITHSBREQUEST_CHALLENGEUID_FIELD = protobuf.FieldDescriptor(); PLAYWITHSBREQUEST_MYTEAMID_FIELD = protobuf.FieldDescriptor(); +PLAYWITHSBREQUEST_CROSS_FIELD = protobuf.FieldDescriptor(); PLAYWITHSBRESPONSE = protobuf.Descriptor(); PLAYWITHSBRESPONSE_FIGHTDATA_FIELD = protobuf.FieldDescriptor(); CHAMPIONGETINFORESPONSE = protobuf.Descriptor(); @@ -327,11 +328,21 @@ PLAYWITHSBREQUEST_MYTEAMID_FIELD.default_value = 0 PLAYWITHSBREQUEST_MYTEAMID_FIELD.type = 5 PLAYWITHSBREQUEST_MYTEAMID_FIELD.cpp_type = 1 +PLAYWITHSBREQUEST_CROSS_FIELD.name = "cross" +PLAYWITHSBREQUEST_CROSS_FIELD.full_name = ".rpc.protocols.PlayWithSbRequest.cross" +PLAYWITHSBREQUEST_CROSS_FIELD.number = 3 +PLAYWITHSBREQUEST_CROSS_FIELD.index = 2 +PLAYWITHSBREQUEST_CROSS_FIELD.label = 1 +PLAYWITHSBREQUEST_CROSS_FIELD.has_default_value = false +PLAYWITHSBREQUEST_CROSS_FIELD.default_value = 0 +PLAYWITHSBREQUEST_CROSS_FIELD.type = 5 +PLAYWITHSBREQUEST_CROSS_FIELD.cpp_type = 1 + PLAYWITHSBREQUEST.name = "PlayWithSbRequest" PLAYWITHSBREQUEST.full_name = ".rpc.protocols.PlayWithSbRequest" PLAYWITHSBREQUEST.nested_types = {} PLAYWITHSBREQUEST.enum_types = {} -PLAYWITHSBREQUEST.fields = {PLAYWITHSBREQUEST_CHALLENGEUID_FIELD, PLAYWITHSBREQUEST_MYTEAMID_FIELD} +PLAYWITHSBREQUEST.fields = {PLAYWITHSBREQUEST_CHALLENGEUID_FIELD, PLAYWITHSBREQUEST_MYTEAMID_FIELD, PLAYWITHSBREQUEST_CROSS_FIELD} PLAYWITHSBREQUEST.is_extendable = false PLAYWITHSBREQUEST.extensions = {} PLAYWITHSBRESPONSE_FIGHTDATA_FIELD.name = "fightData" diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/JumpServerHightLadderFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/JumpServerHightLadderFormation.lua index edc4e47090..feff863399 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/View/JumpServerHightLadderFormation.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/JumpServerHightLadderFormation.lua @@ -6,8 +6,12 @@ local this = JumpServerHightLadderFormation this.IsNeedChangeFormation = false --- 初始化 -function this.Init(root) +this.isDemonstrateTheir = false +this.pData = nil +function this.Init(root,_isDemonstrateTheir,_pData)--isDemonstrateTheir是否是切磋 this.root = root + this.isDemonstrateTheir = _isDemonstrateTheir or false + this.pData = _pData or nil this.InitView() end --- 获取需要显示的编队id @@ -29,19 +33,44 @@ function this.On_Btn2_Click() PopupTipPanel.ShowTip(string.format(Language[10701], 1)) return end - this.root:ClosePanel() - -- 如果未打开则打开 + if this.isDemonstrateTheir then + -- 请求开始挑战 + PlayerManager.RequestPlayWithSomeOne(this.pData.uid, FormationTypeDef.JUMPSERVER_HIGHTLADDER, this.pData.name, function(result) + this.root:ClosePanel() + + local arg = {} + arg.result = result.result + arg.blue = {} + arg.blue.uid = PlayerManager.uid + arg.blue.name = PlayerManager.nickName + arg.blue.head = PlayerManager.head + arg.blue.frame = HeadManager.GetCurFrameId() + arg.red= {} + arg.red.uid = this.pData.uid + arg.red.name = this.pData.name + arg.red.head = this.pData.head + arg.red.frame = this.pData.headFrame + + -- 不用回放直接显示结果 + UIManager.OpenPanel(UIName.ArenaResultPopup, arg) + end,this.isDemonstrateTheir) + else + this.root:ClosePanel() + -- 如果未打开则打开 + end end -- function this.InitView() this.root.bg:SetActive(true) this.root.btn_2:SetActive(true) this.root.btn_2_lab.text = Language[10715] + if this.isDemonstrateTheir then + this.root.btn_2_lab.text = Language[10729] + end this.root.btn_1:SetActive(true) this.root.btn_1_lab.text = Language[10710] this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.JumpServerHightLadder }) - end function this.On_Btn1_Click() diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 10e8375718..530997d3ed 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -1781,10 +1781,11 @@ function this.RequestGetFriendInfo(type, func) end -- 好友切磋 -function this.RequestPlayWithSomeOne(uid, teamId, func) +function this.RequestPlayWithSomeOne(uid, teamId,isDemonstrateTheir, func) local data = ArenaInfoProto_pb.PlayWithSbRequest() data.challengeUid = uid data.myteamId = teamId + data.cross = isDemonstrateTheir and 1 or 0 local msg = data:SerializeToString() Network:SendMessageWithCallBack(MessageTypeProto_pb.PLAY_WITH_SB_REQUEST, MessageTypeProto_pb.PLAY_WITH_SB_RESPONSE, msg, function(buffer) local data = buffer:DataByte() diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua index 65c2665680..fb3a93da55 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua @@ -330,12 +330,13 @@ end -------------------------------------------- -- 切磋 -function this.RequestPlayWithSomeOne(uid, teamId, tname, func) +function this.RequestPlayWithSomeOne(uid, teamId, tname, func,_isDemonstrateTheir) if uid == PlayerManager.uid then PopupTipPanel.ShowTip(Language[11398]) return end - NetManager.RequestPlayWithSomeOne(uid, teamId, function(msg) + local isDemonstrateTheir = _isDemonstrateTheir or false + NetManager.RequestPlayWithSomeOne(uid, teamId,isDemonstrateTheir, function(msg) local fightData = BattleManager.GetBattleServerData({fightData = msg.fightData}, 1) if tname then tname = PlayerManager.nickName .."|" .. tname diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua index b78e49ec3c..f66939bc1b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/PlayerInfoPopup.lua @@ -3,7 +3,7 @@ local PlayerInfoPopup = Inherit(BasePanel) local this = PlayerInfoPopup local netserverName = nil local XiuXianSkillConfig = ConfigManager.GetConfig(ConfigName.XiuXianSkillConfig) - +local isNpc = false--是否是机器人 local _ViewConfig = { [PLAYER_INFO_VIEW_TYPE.NORMAL] = { formationType = FormationTypeDef.FORMATION_NORMAL, @@ -50,7 +50,8 @@ local _ViewConfig = { formationType = FormationTypeDef.JUMPSERVER_HIGHTLADDER, tip = "罗浮争锋阵容:", btnType = { - {name = "挑战", func = 6}, + -- {name = "挑战", func = 6}, + {name = "切磋", func = 6}, } }, } @@ -157,6 +158,7 @@ function PlayerInfoPopup:OnOpen(playerId, viewType,serverName) this._PlayerId = playerId this._ViewType = viewType or PLAYER_INFO_VIEW_TYPE.NORMAL this.serverName = serverName--跨服加的服务器数据 + isNpc = this._PlayerId <= 1000000 -- 界面类型修正 if this._ViewType == PLAYER_INFO_VIEW_TYPE.NORMAL and GoodFriendManager.IsInBlackList(this._PlayerId) then this._ViewType = PLAYER_INFO_VIEW_TYPE.GO_TO_BLACK @@ -415,7 +417,7 @@ function this.RefreshBtnShow() end -- 判断该界面类型是否有按钮显示 LogYellow("this._ViewType "..this._ViewType.." "..tostring(not JumpServerManager.GetCurPersonInfo())) - if not this._Config or not this._Config.btnType or (this._ViewType == PLAYER_INFO_VIEW_TYPE.JUPMSERVER and not JumpServerManager.GetCurPersonInfo()) then + if not this._Config or not this._Config.btnType or isNpc then--or (this._ViewType == PLAYER_INFO_VIEW_TYPE.JUPMSERVER and not JumpServerManager.GetCurPersonInfo()) this.boxLine:SetActive(false) this.btnBox:SetActive(false) this.addFriendBtn:SetActive(false) @@ -492,26 +494,28 @@ function this.BeatHim() end -- 跨服天梯 function this.JumpServerBattle() - local JoinRank = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).JoinRank - if not JumpServerManager.GetHightLadderDataEnterable() then - PopupTipPanel.ShowTip("本服千战逐胜台前"..JoinRank.."名可以参加") - return - end - local JumpPanel = UIManager.GetOpenPanel(UIName.JumpServerHightLadderPanel) - if not JumpPanel then return end - local curData = JumpServerManager.GetCurPersonInfo() - if not curData then return end this:ClosePanel() - JumpPanel.BuyVipFun(1,1,function() - --直接战斗 - JumpServerManager.StarFightHightLadder(curData,0,function(msg) - PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1)--更新特权 - JumpPanel = UIManager.GetOpenPanel(UIName.JumpServerHightLadderPanel) - JumpPanel.RefreshBuyNum() - JumpPanel.OnShowPanel() - JumpServerManager.SetCurPersonInfo(nil) - end) - end) + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.JUMPSERVER_HIGHTLADDER,true, this._PlayerData) + -- local JoinRank = ConfigManager.GetConfigData(ConfigName.MServerArenaSetting,1).JoinRank + -- if not JumpServerManager.GetHightLadderDataEnterable() then + -- PopupTipPanel.ShowTip("本服千战逐胜台前"..JoinRank.."名可以参加") + -- return + -- end + -- local JumpPanel = UIManager.GetOpenPanel(UIName.JumpServerHightLadderPanel) + -- if not JumpPanel then return end + -- local curData = JumpServerManager.GetCurPersonInfo() + -- if not curData then return end + -- this:ClosePanel() + -- JumpPanel.BuyVipFun(1,1,function() + -- --直接战斗 + -- JumpServerManager.StarFightHightLadder(curData,0,function(msg) + -- PrivilegeManager.RefreshPrivilegeUsedTimes(PRIVILEGE_TYPE.JUMPSERVER_GIGHTLADDER_MIANFEINUM, 1)--更新特权 + -- JumpPanel = UIManager.GetOpenPanel(UIName.JumpServerHightLadderPanel) + -- JumpPanel.RefreshBuyNum() + -- JumpPanel.OnShowPanel() + -- JumpServerManager.SetCurPersonInfo(nil) + -- end) + -- end) end --界面关闭时调用(用于子类重写) function PlayerInfoPopup:OnClose()