【新功能】罗浮争锋排行榜增加跨服切磋功能

dev_chengFeng
zhangqiang 2021-07-28 15:48:35 +08:00
parent d7009c9950
commit 9a2d9c70a7
5 changed files with 76 additions and 30 deletions

View File

@ -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"

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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()