巅峰赛修改提交
parent
2c744690bc
commit
6fbed83b28
|
|
@ -87,10 +87,8 @@ function this.RequestTopMatchBaseInfo(func)
|
||||||
this.baseInfo.loser = msg.loser--是否被淘汰
|
this.baseInfo.loser = msg.loser--是否被淘汰
|
||||||
|
|
||||||
this.myBattleInfo = msg.championBattleInfo
|
this.myBattleInfo = msg.championBattleInfo
|
||||||
LogGreen("我的战斗双方uid "..this.myBattleInfo.myInfo.uid.." "..this.myBattleInfo.enemyInfo.uid)
|
|
||||||
this.RefreshBaseInfo()
|
this.RefreshBaseInfo()
|
||||||
-- 发送更新事件
|
-- 发送更新事件
|
||||||
LogRed("GameEvent.TopMatch.OnTopMatchDataUpdate 93")
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate)
|
Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate)
|
||||||
Log(string.format(Language[10108], msg.joinState, msg.progress, msg.endTime, msg.myrank))
|
Log(string.format(Language[10108], msg.joinState, msg.progress, msg.endTime, msg.myrank))
|
||||||
if func then func() end
|
if func then func() end
|
||||||
|
|
@ -113,7 +111,6 @@ function this.UpdateTopMatchStage(msg)
|
||||||
|
|
||||||
-- 刷新基础信息
|
-- 刷新基础信息
|
||||||
this.RefreshBaseInfo()
|
this.RefreshBaseInfo()
|
||||||
LogRed("GameEvent.TopMatch.OnTopMatchDataUpdate 115")
|
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate)
|
Game.GlobalEvent:DispatchEvent(GameEvent.TopMatch.OnTopMatchDataUpdate)
|
||||||
--刷新排行信息
|
--刷新排行信息
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.ATM_RankView.OnRankChange)
|
Game.GlobalEvent:DispatchEvent(GameEvent.ATM_RankView.OnRankChange)
|
||||||
|
|
@ -409,10 +406,10 @@ function this.Request_32_EliminationData(func)
|
||||||
if this.baseInfo.battleStage ~= TOP_MATCH_STAGE.ELIMINATION and this.baseInfo.battleStage~= TOP_MATCH_STAGE.OVER then return end
|
if this.baseInfo.battleStage ~= TOP_MATCH_STAGE.ELIMINATION and this.baseInfo.battleStage~= TOP_MATCH_STAGE.OVER then return end
|
||||||
|
|
||||||
NetManager.GetTopMatchEliminationInfo(1, function(msg)
|
NetManager.GetTopMatchEliminationInfo(1, function(msg)
|
||||||
-- LogRed("获取32强数据成功, 数据长度 = "..#msg.championBattlePairInfo)
|
LogPink("获取32强数据成功, 数据长度 = "..#msg.championBattlePairInfo)
|
||||||
-- for i = 1, #msg.championBattlePairInfo do
|
for i = 1, #msg.championBattlePairInfo do
|
||||||
-- LogPink("roundTImes "..msg.championBattlePairInfo[i].roundTImes.." .teamId "..msg.championBattlePairInfo[i].teamId.." .position ".. msg.championBattlePairInfo[i].position)
|
LogPink("roundTImes "..msg.championBattlePairInfo[i].roundTImes.." .teamId "..msg.championBattlePairInfo[i].teamId.." .position ".. msg.championBattlePairInfo[i].position)
|
||||||
-- end
|
end
|
||||||
this.EliminationData_32 = this.RequestEliminationDataMerge(msg.championBattlePairInfo)
|
this.EliminationData_32 = this.RequestEliminationDataMerge(msg.championBattlePairInfo)
|
||||||
-- this.EliminationData_32 = msg.championBattlePairInfo
|
-- this.EliminationData_32 = msg.championBattlePairInfo
|
||||||
if func then func() end
|
if func then func() end
|
||||||
|
|
@ -428,8 +425,9 @@ function this.Request_4_EliminationData(func)
|
||||||
|
|
||||||
NetManager.GetTopMatchEliminationInfo(2, function(msg)
|
NetManager.GetTopMatchEliminationInfo(2, function(msg)
|
||||||
-- this.EliminationData_4 = msg.championBattlePairInfo
|
-- this.EliminationData_4 = msg.championBattlePairInfo
|
||||||
|
LogPink("获取4强数据成功, 数据长度 = "..#msg.championBattlePairInfo)
|
||||||
this.EliminationData_4 = this.RequestEliminationDataMerge(msg.championBattlePairInfo)
|
this.EliminationData_4 = this.RequestEliminationDataMerge(msg.championBattlePairInfo)
|
||||||
-- Log("获取4强数据成功, 数据长度 = "..#this.EliminationData_4)
|
LogPink("获取4强数据成功, 数据长度 = "..#this.EliminationData_4)
|
||||||
if func then func() end
|
if func then func() end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -446,28 +444,50 @@ function this.RequestEliminationDataMerge(EliminationData)
|
||||||
table.insert(newEliminationData[curKey],EliminationDataV)
|
table.insert(newEliminationData[curKey],EliminationDataV)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- LogRed("newEliminationData, 数据长度 = "..LengthOfTable(newEliminationData))
|
LogPink("newEliminationData, 数据长度 = "..LengthOfTable(newEliminationData))
|
||||||
local datas = {}
|
local datas = {}
|
||||||
for newEliminationDataI, newEliminationDataV in pairs(newEliminationData) do
|
for newEliminationDataI, newEliminationDataV in pairs(newEliminationData) do
|
||||||
-- LogPink("newEliminationDataI "..newEliminationDataI)
|
-- LogPink("newEliminationDataI "..newEliminationDataI)
|
||||||
if newEliminationDataV and #newEliminationDataV > 0 then
|
if newEliminationDataV and #newEliminationDataV > 0 then
|
||||||
local singledata = newEliminationDataV[1]
|
local singledata = newEliminationDataV[1]
|
||||||
local fightResult = 0
|
local fightResult = 0 ---1 无记录 0前两场负 1 前两场胜 2 胜 3 负 4 胜负 5 负胜
|
||||||
for i = 1, #newEliminationDataV do
|
for i = 1, #newEliminationDataV do
|
||||||
fightResult = fightResult + newEliminationDataV[i].fightResult
|
if i == 1 and newEliminationDataV[i].fightResult == 0 then
|
||||||
if fightResult < 0 then
|
fightResult = 3
|
||||||
singledata.fightResult = -1
|
elseif i == 1 and newEliminationDataV[i].fightResult == 1 then
|
||||||
elseif fightResult == 0 then
|
fightResult = 2
|
||||||
singledata.fightResult = 0
|
elseif i == 1 and newEliminationDataV[i].fightResult == -1 then
|
||||||
elseif fightResult > 0 and fightResult < 2 then
|
LogPink("没考虑1 -1")
|
||||||
singledata.fightResult = 1
|
end
|
||||||
elseif fightResult >= 2 then
|
if i == 2 and newEliminationDataV[i].fightResult == 0 then
|
||||||
singledata.fightResult = 1
|
if fightResult == 3 then
|
||||||
|
fightResult = 0
|
||||||
|
elseif fightResult == 2 then
|
||||||
|
fightResult = 4
|
||||||
end
|
end
|
||||||
if newEliminationDataV[i].isGUess > 0 then
|
elseif i == 2 and newEliminationDataV[i].fightResult == 1 then
|
||||||
singledata.isGUess = newEliminationDataV[i].isGUess
|
if fightResult == 3 then
|
||||||
|
fightResult = 5
|
||||||
|
elseif fightResult == 2 then
|
||||||
|
fightResult = 1
|
||||||
end
|
end
|
||||||
|
elseif i == 2 and newEliminationDataV[i].fightResult == -1 then
|
||||||
|
LogPink("没考虑2 -1")
|
||||||
|
end
|
||||||
|
if i == 3 then
|
||||||
|
if fightResult == 4 then
|
||||||
|
fightResult = newEliminationDataV[i].fightResult
|
||||||
|
elseif fightResult == 5 then
|
||||||
|
fightResult = newEliminationDataV[i].fightResult
|
||||||
|
end
|
||||||
|
elseif i == 3 and newEliminationDataV[i].fightResult == -1 then
|
||||||
|
LogPink("没考虑3 -1")
|
||||||
|
end
|
||||||
|
if newEliminationDataV[i].isGUess <= 0 then
|
||||||
|
singledata.isGUess = newEliminationDataV[i].isGUess
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
singledata.fightResult = fightResult
|
||||||
-- LogPink("fightResult "..singledata.fightResult)
|
-- LogPink("fightResult "..singledata.fightResult)
|
||||||
-- LogPink("isGUess "..singledata.isGUess)
|
-- LogPink("isGUess "..singledata.isGUess)
|
||||||
-- newEliminationData_32V = singledata
|
-- newEliminationData_32V = singledata
|
||||||
|
|
@ -780,12 +800,12 @@ function this.GetRewardData()
|
||||||
end
|
end
|
||||||
--三局两胜获取显示数据
|
--三局两胜获取显示数据
|
||||||
function this.GetTwoOutOfThreeInfo(type)
|
function this.GetTwoOutOfThreeInfo(type)
|
||||||
local oldTwoOutOfThreeIndex = nil---历史记录(上次的结果 当前胜负根据战斗结果判断) 1 无记录 0前两场负 1 前两场胜 2 胜 3 负 4 胜负 5 负胜
|
local oldTwoOutOfThreeIndex = nil---历史记录(上次的结果 当前胜负根据战斗结果判断) -1 无记录 0前两场负 1 前两场胜 2 胜 3 负 4 胜负 5 负胜
|
||||||
local curBattleResult = nil--当前胜负 -1 未开始 0 负 1 胜
|
local curBattleResult = nil--当前胜负 -1 未开始 0 负 1 胜
|
||||||
if type == TOP_MATCH_STAGE.CHOOSE then--我的
|
if type == 1 then--我的
|
||||||
oldTwoOutOfThreeIndex = this.GetBaseData().process
|
oldTwoOutOfThreeIndex = this.GetBaseData().process
|
||||||
curBattleResult = this.GetBattleInfo().result
|
curBattleResult = this.GetBattleInfo().result
|
||||||
elseif type == TOP_MATCH_STAGE.ELIMINATION then--竞猜
|
elseif type == 2 then--竞猜
|
||||||
oldTwoOutOfThreeIndex = this.GetProcess()
|
oldTwoOutOfThreeIndex = this.GetProcess()
|
||||||
curBattleResult = this.GetBetBattleInfo().result
|
curBattleResult = this.GetBetBattleInfo().result
|
||||||
end
|
end
|
||||||
|
|
@ -881,15 +901,19 @@ function this.GetTwoOutOfThreeInfo(type)
|
||||||
return 2,0
|
return 2,0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--获取当前三局两胜是够结束
|
--获取当前三局两胜是否结束
|
||||||
function this.GetIsBattleEndState()
|
function this.GetIsBattleEndState(type)
|
||||||
local oldTwoOutOfThreeIndex = nil---历史记录(上次的结果 当前胜负根据战斗结果判断) 1 无记录 0前两场负 1 前两场胜 2 胜 3 负 4 胜负 5 负胜
|
local oldTwoOutOfThreeIndex = nil---历史记录(上次的结果 当前胜负根据战斗结果判断) -1 无记录 0前两场负 1 前两场胜 2 胜 3 负 4 胜负 5 负胜
|
||||||
if type == TOP_MATCH_STAGE.CHOOSE then--我的
|
if type == 1 then--我的
|
||||||
oldTwoOutOfThreeIndex = this.GetBaseData().process
|
oldTwoOutOfThreeIndex = this.GetBaseData().process
|
||||||
elseif type == TOP_MATCH_STAGE.ELIMINATION then--竞猜
|
elseif type == 2 then--竞猜
|
||||||
oldTwoOutOfThreeIndex = this.GetProcess()
|
oldTwoOutOfThreeIndex = this.GetProcess()
|
||||||
end
|
end
|
||||||
if oldTwoOutOfThreeIndex == 0 or oldTwoOutOfThreeIndex == 1 then
|
local baseData = ArenaTopMatchManager.GetBaseData()
|
||||||
|
-- 没开启或者开启没参赛都属于未参赛
|
||||||
|
local isJoin = baseData.joinState == 1
|
||||||
|
local isOver = baseData.progress == -2
|
||||||
|
if oldTwoOutOfThreeIndex == 0 or oldTwoOutOfThreeIndex == 1 and isJoin and not isOver then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -116,8 +116,8 @@ function this.SetInfoData(panelType, blueData, redData, textType, showScore,batt
|
||||||
this.FreshTeam(blueData.team, true)
|
this.FreshTeam(blueData.team, true)
|
||||||
this.FreshTeam(redData.team, false)
|
this.FreshTeam(redData.team, false)
|
||||||
this.RefreshTwoOutOfThreeData()
|
this.RefreshTwoOutOfThreeData()
|
||||||
LogGreen("ArenaTopMatchManager.GetIsBattleEndState() "..tostring( ArenaTopMatchManager.GetIsBattleEndState()))
|
|
||||||
this.awaitText:SetActive(ArenaTopMatchManager.GetIsBattleEndState())
|
this.awaitText:SetActive(ArenaTopMatchManager.GetIsBattleEndState(this.panelType))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 设置显隐
|
-- 设置显隐
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ function this.RefreshBaseShow()
|
||||||
LogGreen("betBattleInfo.enemyInfo.uid "..betBattleInfo.enemyInfo.uid)
|
LogGreen("betBattleInfo.enemyInfo.uid "..betBattleInfo.enemyInfo.uid)
|
||||||
LogGreen("betBattleInfo.myInfo.uid "..betBattleInfo.myInfo.uid)
|
LogGreen("betBattleInfo.myInfo.uid "..betBattleInfo.myInfo.uid)
|
||||||
local IsBeted = myBetTarget and myBetTarget ~= 0
|
local IsBeted = myBetTarget and myBetTarget ~= 0
|
||||||
local upWinNum,downWinNum = ArenaTopMatchManager.GetTwoOutOfThreeInfo(battleStage)
|
local upWinNum,downWinNum = ArenaTopMatchManager.GetTwoOutOfThreeInfo(2)
|
||||||
isCanGuessByBattleEndState = true
|
isCanGuessByBattleEndState = true
|
||||||
LogRed("isCanGuessByBattleEndState "..tostring(isCanGuessByBattleEndState))
|
LogRed("isCanGuessByBattleEndState "..tostring(isCanGuessByBattleEndState))
|
||||||
if battleStage == TOP_MATCH_STAGE.ELIMINATION then
|
if battleStage == TOP_MATCH_STAGE.ELIMINATION then
|
||||||
|
|
@ -287,7 +287,7 @@ function this.RefreshGuessTipView()
|
||||||
local isShow = ArenaTopMatchManager.GetcurIsShowDoGuessPopup()
|
local isShow = ArenaTopMatchManager.GetcurIsShowDoGuessPopup()
|
||||||
LogGreen("isShow "..tostring(isShow))
|
LogGreen("isShow "..tostring(isShow))
|
||||||
-- if
|
-- if
|
||||||
local upWinNum,downWinNum = ArenaTopMatchManager.GetTwoOutOfThreeInfo(TOP_MATCH_STAGE.ELIMINATION)
|
local upWinNum,downWinNum = ArenaTopMatchManager.GetTwoOutOfThreeInfo(2)
|
||||||
local isBattleEnd = (upWinNum >= 2 or downWinNum >= 2)
|
local isBattleEnd = (upWinNum >= 2 or downWinNum >= 2)
|
||||||
LogRed("三局两胜是否结束 "..tostring(isBattleEnd))
|
LogRed("三局两胜是否结束 "..tostring(isBattleEnd))
|
||||||
--打开竞猜提示(处于秋后算账)
|
--打开竞猜提示(处于秋后算账)
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ function this.SetPlayerInfo()
|
||||||
local myResult = -1
|
local myResult = -1
|
||||||
local blueInfo = nil
|
local blueInfo = nil
|
||||||
local redInfo = nil
|
local redInfo = nil
|
||||||
LogRed("battleInfo.result "..battleInfo.result)
|
LogPink("battleInfo.result "..battleInfo.result)
|
||||||
local battleEndResultSortState = true --true 战斗最终直接赋值 false 颠倒赋值
|
local battleEndResultSortState = true --true 战斗最终直接赋值 false 颠倒赋值
|
||||||
if attInfo.uid == PlayerManager.uid then
|
if attInfo.uid == PlayerManager.uid then
|
||||||
blueInfo = attInfo
|
blueInfo = attInfo
|
||||||
|
|
@ -173,7 +173,7 @@ function this.SetPlayerInfo()
|
||||||
end
|
end
|
||||||
battleEndResultSortState = false
|
battleEndResultSortState = false
|
||||||
end
|
end
|
||||||
LogRed("myResult "..myResult)
|
LogPink("myResult "..myResult)
|
||||||
--if battleInfo.result == 0 then -- 如果进攻方失败,则如果我是进攻方则我失败,反之胜利
|
--if battleInfo.result == 0 then -- 如果进攻方失败,则如果我是进攻方则我失败,反之胜利
|
||||||
-- myResult = attInfo.uid == PlayerManager.uid and 0 or 1
|
-- myResult = attInfo.uid == PlayerManager.uid and 0 or 1
|
||||||
--elseif battleInfo.result == 1 then -- 如果进攻方胜利,则如果我是进攻方则我胜利
|
--elseif battleInfo.result == 1 then -- 如果进攻方胜利,则如果我是进攻方则我胜利
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue