群主搜索房间id和人物id无法点开观战

master
罗家炜 2025-06-23 01:19:44 +08:00
parent 11e7962f7f
commit 8b5c8c3489
2 changed files with 98 additions and 64 deletions

View File

@ -1,4 +1,3 @@
LoginController = {} LoginController = {}
@ -16,8 +15,8 @@ end
local _LocalConfigAllGame = { local _LocalConfigAllGame = {
10, 13, 14, 15, 16, 17, 22, 33, 65, 66, 67, 77, 88, 10, 13, 14, 15, 16, 17, 22, 33, 65, 66, 67, 77, 88,
101,102,103,104,105,106,107,108, 101, 102, 103, 104, 105, 106, 107,
108,
301, 201, 202, 203 301, 201, 202, 203
} }
@ -67,7 +66,6 @@ local function __Login(cmd,_data,callBack)
pt(data) pt(data)
ControllerManager.GroupClient = NetClient.new(data.groupWeb, "web_group", ConnectionProtocol.Web) ControllerManager.GroupClient = NetClient.new(data.groupWeb, "web_group", ConnectionProtocol.Web)
ControllerManager.GroupClient:setSession((data["session_id"] .. "," .. data["token"])) ControllerManager.GroupClient:setSession((data["session_id"] .. "," .. data["token"]))
end end
if (callBack ~= nil) then if (callBack ~= nil) then
@ -99,7 +97,6 @@ function M:IdPasswordLogin(uid,password,callback)
__Login(Protocol.WEB_ID_PASSWORD_LOGIN, _data, callback) __Login(Protocol.WEB_ID_PASSWORD_LOGIN, _data, callback)
end end
function M:Login(callback) function M:Login(callback)
local user = DataManager.SelfUser local user = DataManager.SelfUser
local _data = {} local _data = {}
@ -118,8 +115,6 @@ function M:QuickLogin(session_id,callback)
__Login(Protocol.WEB_QUICK_LOGIN, _data, callback) __Login(Protocol.WEB_QUICK_LOGIN, _data, callback)
end end
function M.OnEnter(self) function M.OnEnter(self)
--print("login controller enter") --print("login controller enter")
end end

View File

@ -81,6 +81,7 @@ end
function M:GetRecordData(index, qid) function M:GetRecordData(index, qid)
qid = qid or 0 qid = qid or 0
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local group = DataManager.groups:get(self.group_id)
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetGroupRecord(self.group_id, GetPlatform(), qid, index, 6, function(res) fgCtr:FG_GetGroupRecord(self.group_id, GetPlatform(), qid, index, 6, function(res)
printlog("ccccccccccccccccccccccccccccccccccccc") printlog("ccccccccccccccccccccccccccccccccccccc")
@ -102,10 +103,17 @@ function M:GetRecordData(index, qid)
if ctr_search.selectedIndex ~= 0 then if ctr_search.selectedIndex ~= 0 then
ctr_search.selectedIndex = 0 ctr_search.selectedIndex = 0
end end
else
if group.lev == 1 then
for i = 1, #records do
self.player_record_data[#self.player_record_data + 1] = self:deepcopy(records[i])
self.player_record_data[#self.player_record_data + 1] = self:deepcopy(records[i])
end
else else
for i = 1, #records do for i = 1, #records do
self.player_record_data[#self.player_record_data + 1] = records[i] self.player_record_data[#self.player_record_data + 1] = records[i]
end end
end
self.lst_player_record.numItems = #self.player_record_data self.lst_player_record.numItems = #self.player_record_data
ctr_search.selectedIndex = 2 ctr_search.selectedIndex = 2
end end
@ -196,17 +204,20 @@ end
function M:OnRenderRecordItem1(index, obj) function M:OnRenderRecordItem1(index, obj)
local data = self.tempRec[index + 1] local data = self.tempRec[index + 1]
data.seat = 2 - (index + 1) % 2
self:FillRecordItem(data, obj) self:FillRecordItem(data, obj)
end end
function M:OnRenderPlayerRecordItem(index, obj) function M:OnRenderPlayerRecordItem(index, obj)
local data = self.player_record_data[index + 1] local data = self.player_record_data[index + 1]
data.seat = 2 - (index + 1) % 2
self:FillRecordItem(data, obj) self:FillRecordItem(data, obj)
end end
function M:GetRecordByRoomid() function M:GetRecordByRoomid()
local qid = self._view:GetChild("tex_id").text local qid = self._view:GetChild("tex_id").text
ViewUtil.ShowModalWait() ViewUtil.ShowModalWait()
local group = DataManager.groups:get(self.group_id)
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
fgCtr:FG_GetRecordByRoomid(self.group_id, qid, GetPlatform(), function(res) fgCtr:FG_GetRecordByRoomid(self.group_id, qid, GetPlatform(), function(res)
if self._is_destroy then if self._is_destroy then
@ -220,8 +231,16 @@ function M:GetRecordByRoomid()
ViewUtil.ErrorTip(nil, "没有找到回放") ViewUtil.ErrorTip(nil, "没有找到回放")
return return
end end
if group.lev == 1 then
self.tempRec = {}
for i = 1, #res.Data.rec do
table.insert(self.tempRec, self:deepcopy(res.Data.rec[i]))
table.insert(self.tempRec, self:deepcopy(res.Data.rec[i]))
end
else
self.tempRec = res.Data.rec self.tempRec = res.Data.rec
self.lst_record_find.numItems = #res.Data.rec end
self.lst_record_find.numItems = #self.tempRec
self._view:GetController("search").selectedIndex = 1 self._view:GetController("search").selectedIndex = 1
end end
@ -353,6 +372,7 @@ function M:OnShowRecordInfo(rdata, ids)
if group.lev == 1 then if group.lev == 1 then
DataManager.CurrenRoom.self_player = DataManager.CurrenRoom:GetPlayerBySeat(rdata.seat) DataManager.CurrenRoom.self_player = DataManager.CurrenRoom:GetPlayerBySeat(rdata.seat)
end end
printlog("lingmeng seat", DataManager.CurrenRoom.self_player.seat)
-- if DataManager.SelfUser.playback[playback_id] ~= nil then -- if DataManager.SelfUser.playback[playback_id] ~= nil then
-- DataManager.SelfUser.playback[playback_id][i] = data -- DataManager.SelfUser.playback[playback_id][i] = data
-- else -- else
@ -393,4 +413,23 @@ function M:GenaratePlayBack(id, game_id, ...)
return tem return tem
end end
-- lua table 深拷贝
function M:deepcopy(object)
local lookup_table = {}
local function _copy(object)
if type(object) ~= 'table' then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
return M return M