diff --git a/lua_probject/base_project/Game/Controller/LoddyController.lua b/lua_probject/base_project/Game/Controller/LoddyController.lua
index d0887a2b..45c4b21e 100644
--- a/lua_probject/base_project/Game/Controller/LoddyController.lua
+++ b/lua_probject/base_project/Game/Controller/LoddyController.lua
@@ -474,3 +474,14 @@ function M:GetGiftDiamondRecord(data, callback)
end
end)
end
+
+--获取客服信息
+function M:GetServiceInfo(data, callback)
+ local _client = ControllerManager.WebClient
+ local _data = {}
+ _client:send(Protocol.WEB_GET_SERVICEINFO, _data, function(res)
+ if (callback ~= nil) then
+ callback(res)
+ end
+ end)
+end
diff --git a/lua_probject/base_project/Game/ExtendHotupdate.lua b/lua_probject/base_project/Game/ExtendHotupdate.lua
index 34439364..210969d5 100644
--- a/lua_probject/base_project/Game/ExtendHotupdate.lua
+++ b/lua_probject/base_project/Game/ExtendHotupdate.lua
@@ -17,9 +17,34 @@ local function __ShowTip(_version_view, text, callback)
end
end
+local function __update_check_size(data, onback, _version_view)
+ print("===================updateCheck")
+ local tex_tip = _version_view:GetChild("tex_info")
+ local totalSize = 0
+ for k, game_data in ipairs(data) do
+ local asset_path = game_data["bundle"]:gsub("\r\n", "")
+ asset_path = string.gsub(asset_path, "%.", "/")
+ local local_version = Version.DEFUALT
+ local server_version = Version(game_data["version"])
+ local version_update = Hotupdate(asset_path .. "/", local_version, server_version)
+ version_update.AssetName = game_data["name"]
+ version_update:SetTipCallback(function(text, callback)
+ __ShowTip(_version_view, text, callback)
+ end)
+ version_update:LoadAssetSize()
+ while (not version_update.Done) do
+ coroutine.step()
+ end
+ game_data["size"] = version_update.Size
+ totalSize = totalSize + version_update.Size
+ end
+ onback(totalSize, true)
+end
+
local function __update_check(data, onback, _version_view)
print("===================updateCheck")
local tex_tip = _version_view:GetChild("tex_info")
+ local download_size = 0
for k, game_data in ipairs(data) do
local asset_path = game_data["bundle"]:gsub("\r\n", "")
asset_path = string.gsub(asset_path, "%.", "/")
@@ -32,12 +57,18 @@ local function __update_check(data, onback, _version_view)
end)
version_update:LoadAsset()
while (not version_update.Done) do
- onback(version_update.Progress, false)
- tex_tip.text = version_update.TextTip
+ if game_data["size"] then
+ printlog("lingmeng down", download_size, version_update.Progress, game_data["size"])
+ onback(
+ download_size + (version_update.Progress > 1 and 1 or version_update.Progress) * game_data["size"], false)
+ else
+ onback(version_update.Progress, false)
+ tex_tip.text = version_update.TextTip
+ end
coroutine.step()
end
+ download_size = download_size + game_data["size"]
ResourcesManager.ReadAssetConfig(asset_path)
- onback(0, false)
end
onback(1, true)
end
@@ -58,20 +89,34 @@ function ExtendHotupdate.UpdateGameList(list, callback)
end
local _version_view = UIPackage.CreateObjectFromURL("ui://Hotupdate/Version")
- -- _version_view.x = (GRoot.inst.width - _version_view.width) / 2
- _version_view:GetChild("tex_info").text = "正在检查资源。。。"
+ _version_view:GetChild("tex_info").text = "正在检查游戏资源"
local _pd = _version_view:GetChild("pb_progress")
_pd.value = 0
GRoot.inst:AddChild(_version_view)
_version_view:MakeFullScreen()
_version_view:AddRelation(GRoot.inst, RelationType.Size)
- coroutine.start(__update_check, list, function(progress, finish)
- _pd.value = progress * 100
+ local toltal_size = 0
+ _version_view:GetTransition('check'):Play(-1, 0, function()
+
+ end)
+ coroutine.start(__update_check_size, list, function(totalSize, finish)
if (finish) then
- callback()
- _version_view:Dispose()
- _version_view = nil
+ toltal_size = totalSize
+ _version_view:GetTransition('check'):Stop()
+ _version_view:GetChild("tex_info_check").text = ""
+ coroutine.start(__update_check, list, function(progress, finish)
+ if (finish) then
+ _pd.value = 100
+ callback()
+ _version_view:Dispose()
+ _version_view = nil
+ else
+ _pd.value = progress / toltal_size * 100
+ _version_view:GetChild("tex_info").text = string.format("%.1fMB / %.1fMB", progress / 1024 / 1024,
+ toltal_size / 1024 / 1024)
+ end
+ end, _version_view)
end
end, _version_view)
end
diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua
index d9da503b..ed738614 100644
--- a/lua_probject/base_project/Game/Protocol.lua
+++ b/lua_probject/base_project/Game/Protocol.lua
@@ -47,6 +47,8 @@ Protocol = {
ACC_GET_USERINFO = "acc/get_change_user_info",
---代理获取赠送房卡记录
ACC_GET_DIAMONDRECORD = "acc/get_recharge_diamo_list",
+ ---获取客服信息
+ WEB_GET_SERVICEINFO = "acc/get_customer_service",
----index----
-- 获取公告
WEB_UPDATE_NOTICE = "index/get_notice",
diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua
index ef999a3a..86c13459 100644
--- a/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua
+++ b/lua_probject/base_project/Game/View/Family/FamilyNumberRecord.lua
@@ -499,7 +499,6 @@ function M:RecordItemDetailRender(round, allDate, rdata, obj)
obj:GetChild('text_round').text = round
obj:GetChild('text_time').text = os.date("%Y-%m-%d\n%H:%M:%S", tonumber(allDate.createTime))
local list = obj:GetChild('list_score')
- rdata = json.decode(rdata)
list:RemoveChildrenToPool();
for i = 1, #rdata do
local obj2 = list:AddItemFromPool()
@@ -672,16 +671,26 @@ function M:RecursionGetNumberRecord(fgCtr, groupId, uid, index)
[tonumber(info[string.format("is_read_%s", uid)]) + 1]
info.totalScore = json.decode(info.totalScore)
local totalScore
- for i = 1, #info.totalScore do
- if info.totalScore[i].accId == uid then
- totalScore = info.totalScore[i].score
- if i ~= 1 then
+ local s_index = 1
+ for j = 1, #info.totalScore do
+ if info.totalScore[j].accId == uid then
+ totalScore = info.totalScore[j].score
+ if j ~= 1 then
+ s_index = j
local fristInfo = info.totalScore[1]
- info.totalScore[1] = info.totalScore[i]
- info.totalScore[i] = fristInfo
+ info.totalScore[1] = info.totalScore[j]
+ info.totalScore[j] = fristInfo
end
end
end
+ for j = 1, tonumber(info.round) do
+ local rdata = info[string.format("round_%d", j)]
+ rdata = json.decode(rdata)
+ local fristInfo = rdata[1]
+ rdata[1] = rdata[s_index]
+ rdata[s_index] = fristInfo
+ info[string.format("round_%d", j)] = rdata
+ end
if info.round ~= "1" or totalScore ~= 0 then
table.insert(tempTableChild, info)
tempTableChild.totalScore = tempTableChild.totalScore + totalScore
diff --git a/lua_probject/base_project/Game/View/Lobby/LobbyService.lua b/lua_probject/base_project/Game/View/Lobby/LobbyService.lua
index 01db724c..2821afe5 100644
--- a/lua_probject/base_project/Game/View/Lobby/LobbyService.lua
+++ b/lua_probject/base_project/Game/View/Lobby/LobbyService.lua
@@ -17,10 +17,10 @@ function M:init(url)
self._listView_main = self._view:GetChild('list')
self._listView_main.itemRenderer = function(index, obj)
local info = self._data_services[index + 1]
- obj.text = info.wx
- obj:GetChild('text_title').text = string.format("%s:", info.title)
+ obj.text = info.service_link
+ obj:GetChild('text_title').text = string.format("%s:", info.service_name)
obj:GetChild('btn_copy').onClick:Set(function()
- GameApplication.Instance:CopyToClipboard(info.wx) --湘北
+ GameApplication.Instance:CopyToClipboard(info.service_link) --湘北
ViewUtil.ErrorTip(-1, "复制成功")
end)
end
@@ -29,8 +29,21 @@ function M:init(url)
end
function M:GetService()
- self._data_services = { { title = "游戏客服", wx = "youxikefuweixing" }, { title = "黎川代理", wx = "lichuandaili" } }
- self._listView_main.numItems = #self._data_services
+ ViewUtil:ShowModalWait2(0.1)
+ local lobbyCtr = ControllerManager.GetController(LoddyController)
+ lobbyCtr:GetServiceInfo({}, function(res)
+ if res.ReturnCode ~= 0 then
+ ViewUtil.CloseModalWait2()
+ ViewUtil.ErrorTip(res.ReturnCode, "客服信息正在更新")
+ return
+ else
+ pt("GetService", res)
+ self._data_services = res.Data.services
+ self._listView_main.numItems = #self._data_services
+ ViewUtil.CloseModalWait2()
+ self:Show()
+ end
+ end)
end
return M
diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua
index 1f9196e5..4a5d6c56 100644
--- a/lua_probject/base_project/Game/View/LobbyView.lua
+++ b/lua_probject/base_project/Game/View/LobbyView.lua
@@ -167,7 +167,7 @@ function M:InitView(url)
local btn_customerService = self._view:GetChild("btn_customerService")
btn_customerService.onClick:Add(function()
local lobbyService = LobbyService.new()
- lobbyService:Show()
+ -- lobbyService:Show()
end)
local btn_invite = self._view:GetChild("btn_invite")
diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua
index 09bd3fac..b9aea33d 100644
--- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua
+++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua
@@ -196,6 +196,12 @@ function M:LoadConfigToDetailOnlyPlay(data, hpdata)
returnString = string.format("%s倍", hpData.times / 1000)
end
+ returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
+
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
@@ -253,6 +259,10 @@ function M:LoadConfigToDetail(data, hpdata)
end
returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua
index 572bab14..f901e7e2 100644
--- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua
+++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua
@@ -192,6 +192,12 @@ function M:LoadConfigToDetailOnlyPlay(data, hpdata)
returnString = string.format("%s倍", hpData.times / 1000)
end
+ returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
+
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
@@ -248,6 +254,10 @@ function M:LoadConfigToDetail(data, hpdata)
end
returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua
index 13876f63..20016b0e 100644
--- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua
+++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua
@@ -177,6 +177,12 @@ function M:LoadConfigToDetailOnlyPlay(data, hpdata)
returnString = string.format("%s倍", hpData.times / 1000)
end
+ returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
+
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮 可自摸" or "必须自摸")
end
@@ -215,6 +221,10 @@ function M:LoadConfigToDetail(data, hpdata)
returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
+
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮 可自摸" or "必须自摸")
end
diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua
index 9fabef3b..c55d7290 100644
--- a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua
+++ b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua
@@ -205,6 +205,12 @@ function M:LoadConfigToDetailOnlyPlay(data, hpdata)
returnString = string.format("%s倍", hpData.times / 1000)
end
+ returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
+
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
@@ -262,6 +268,9 @@ function M:LoadConfigToDetail(data, hpdata)
returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
if configData.zimo then
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
end
diff --git a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua
index c9edd5ca..8a6b7e47 100644
--- a/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua
+++ b/lua_probject/extend_project/extend/poker/runfast/EXGameInfo.lua
@@ -308,6 +308,10 @@ function M:LoadConfigToDetail(data, hpdata)
end
returnString = string.format("%s人数%s人", returnString, configData.maxPlayers)
+
+ if hpData then
+ returnString = string.format("%s %s", returnString, hpData.maxRound)
+ end
if configData.leaf then
returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "15张手牌" or "16张手牌")
end
diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua
index 79989cb7..5c4c59e3 100644
--- a/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua
+++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_PlayerBackView.lua
@@ -17,7 +17,8 @@ local RunFast_Record_Event = {
Evt_Pass = 'pass',
Evt_NewRound = 'newindex',
Evt_result = 'result',
- Evt_Result = 'Result'
+ Evt_Result = 'Result',
+ Evt_Opt = 'prompt'
}
local default_bg = 1
@@ -81,6 +82,8 @@ function M:InitView(url)
else
self._view:GetChild('roominfo_panel1'):GetChild('tex_beishu').text = ''
end
+ self._ctr_inClear = self._view:GetController('Inclear')
+
self._cardCheck = RunFast_CardCheck:InitFlag()
self._gamectr._cardCheck = self._cardCheck
@@ -91,6 +94,7 @@ function M:InitView(url)
self._cmdmap[RunFast_Record_Event.Evt_Pass] = self.CmdPass
self._cmdmap[RunFast_Record_Event.Evt_NewRound] = self.CmdNewRound
self._cmdmap[RunFast_Record_Event.Evt_result] = self.Cmdresult
+ self._cmdmap[RunFast_Record_Event.Evt_Opt] = self.CmdOpt
end
function M:NewPlayerPokerInfoView(view, index)
@@ -156,6 +160,12 @@ function M:ShowStep(index)
p.out_card_list = step.player_card_data[i].out_card_list
p.hand_left_count = #p.hand_list
+ if step.cmd == RunFast_Record_Event.Evt_Opt and step.seat == p.seat then
+ info._view:GetController('out_card_option2').selectedIndex = 1
+ else
+ info._view:GetController('out_card_option2').selectedIndex = 0
+ end
+
if p.seat ~= self._room.self_player.seat then
info:UpdateHandPoker(p.hand_list, false, true)
else
@@ -195,17 +205,94 @@ function M:ShowStep(index)
end
end
if step.cmd == RunFast_Record_Event.Evt_result then
- local result = step.result
+ local data = step.data
+ local over = 0
+ local info = data.win.info
+ local win_seat = data.win.winseat
+ local remaincards = {}
+ -- local energyTab = arg[5]
+ local otherpoker_list = self._view:GetChild("otherpoker_list")
+ local card_info = self._player_card_info[self:GetPos(self._room.self_player.seat)]
+ if self.dismissWin ~= nil then
+ self.dismissWin:Destroy()
+ end
+ self.dismissWin = nil
+ if self.MypokerList ~= nil then
+ -- body
+ card_info:Clear()
+ card_info:InitPoker(self.MypokerList, false)
+ self.MypokerList = nil
+ end
+ if otherpoker_list ~= nil then
+ -- body
+ otherpoker_list:RemoveChildrenToPool()
+ otherpoker_list.visible = true
+ end
- for i = 1, #result do
- local card_info = self._player_card_info[self:GetPos(result[i].seat)]
+ if self.destory_win ~= nil then
+ coroutine.stop(self.destory_win)
+ end
- if result[i].entrust ~= nil and result[i].entrust == true then
- local head_info = self._player_info[self:GetPos(result[i].seat)]
- head_info:MarkTuoguan()
+ self.destory_win = nil
+ self.destory_win = coroutine.start(function()
+ if win_seat == self._room.self_player.seat then
+ ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/end_music.mp3")
+ else
+ ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/lose_music.mp3")
end
- -- head_info:UpdateScore(result[i].score)
- card_info:PlayScore(result[i].score, false, step.win_seat == result[i].seat)
+ coroutine.stop(self._leftClock_continue)
+ for i = 1, #self._player_card_info do
+ local card_info = self._player_card_info[i]
+ card_info._ctr_time_clock.selectedIndex = 0
+ self._left_time = 0
+ end
+
+ for i = 1, #info do
+ local player = info[i]
+ local p = self._room:GetPlayerBySeat(player.seat)
+ local head_info = self._player_info[self:GetPos(player.seat)]
+ head_info:SetBaoDan(false)
+
+ head_info._view:GetChild('text_jifen').text = player.score
+ head_info:PlayScore(player.score, win_seat == player.seat)
+ end
+
+ coroutine.wait(2)
+
+ self.result_view = RunFast_ResultView.new(self, info, self._room.room_id, over, win_seat, 0,
+ remaincards)
+ self.result_view:SetDestroryCallback(function()
+ for i = 1, #self._player_card_info do
+ local card_info = self._player_card_info[i]
+ card_info.ctr_outpoker.selectedIndex = 0
+ if card_info._ctr_resultOut then
+ card_info._ctr_resultOut.selectedIndex = 0
+ end
+ end
+ end)
+ self.result_view:Show()
+ self.result_view._root_view:RemoveFromParent()
+ self._view:AddChildAt(self.result_view._root_view,
+ self._view:GetChildIndex(self._view:GetChild('mask_tips')) - 1)
+ if self.WinItem_view ~= nil then
+ self.WinItem_view:Dispose()
+ self.WinItem_view = nil
+ end
+ if self.rank_view ~= nil then
+ self.rank_view:Dispose()
+ self.rank_view = nil
+ end
+
+ if self._room.self_player.entrust == true then
+ local btn_confirm = self.result_view._view:GetChild("btn_confirm")
+ btn_confirm.onClick:Call()
+ end
+ ViewUtil.PlaySound("RunFastNew_PK", "extend/poker/runfast/sound/end_music.mp3")
+ end)
+ if over == 1 then
+ -- body
+ self:UnmarkSelfTuoguan()
+ ControllerManager.ChangeController(LoddyController)
end
end
if step.cmd == RunFast_Record_Event.Evt_Result then
@@ -278,8 +365,7 @@ end
function M:Cmdresult(cmd, index)
local data = self:CopyLastStep(index)
data.cmd = cmd.cmd
- data.result = cmd.data.result
- data.win_seat = cmd.seat
+ data.data = cmd.data
end
function M:CmdResult(cmd, index)
@@ -292,6 +378,12 @@ function M:CmdResult(cmd, index)
end
end
+function M:CmdOpt(cmd, index)
+ local data = self:CopyLastStep(index)
+ data.cmd = cmd.cmd
+ data.seat = cmd.seat
+end
+
function M:CopyLastStep(index)
local step = {}
local last_step = self._step[index]
diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua
index 953c9820..4bf1581a 100644
--- a/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua
+++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_ResultView.lua
@@ -56,11 +56,10 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards)
self._view:GetChild('btn_nextRound').onClick:Set(function()
if over == 0 then
- self:Destroy()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:ConformToNextGame()
- self._root_runFast:ClearOk()
self._root_runFast._ctr_inClear.selectedIndex = 0
+ self:Destroy()
else
self._view:GetController('over').selectedIndex = 1
end
@@ -68,10 +67,10 @@ function M:init(url, data, roomid, over, win_seat, dissolve, remaincards)
self.ClearReady = function()
if over == 0 then
- self:Destroy()
local _gamectr = ControllerManager.GetController(GameController)
_gamectr:ConformToNextGame()
self._root_runFast:ClearOk()
+ self:Destroy()
else
self._view:GetController('over').selectedIndex = 1
end
diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_1.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_1.xml
index 36bbe60a..8336911e 100644
--- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_1.xml
+++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_1.xml
@@ -6,6 +6,7 @@
+
@@ -23,7 +24,7 @@
-
+
@@ -116,6 +117,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml
index 3a526f26..1640baa4 100644
--- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml
+++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_2.xml
@@ -2,8 +2,9 @@
-
+
+
@@ -59,7 +60,7 @@
-
+
@@ -77,6 +78,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml
index 24d57922..a944fc12 100644
--- a/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml
+++ b/wb_new_ui/assets/Extend_Poker_RunFastNew/Main_New/Player_card_info_3.xml
@@ -2,8 +2,9 @@
-
+
+
@@ -59,7 +60,7 @@
-
+
@@ -76,6 +77,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/wb_new_ui/assets/Hotupdate/Version.xml b/wb_new_ui/assets/Hotupdate/Version.xml
index 497b29db..4dd72708 100644
--- a/wb_new_ui/assets/Hotupdate/Version.xml
+++ b/wb_new_ui/assets/Hotupdate/Version.xml
@@ -5,11 +5,16 @@
-
+
+
+
+
+
+
@@ -27,4 +32,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes b/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes
index 80e04671..4f2357ed 100644
Binary files a/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes and b/wb_unity_pro/Assets/ART/extend/poker/runfast/ui/Extend_Poker_RunFastNew_fui.bytes differ
diff --git a/wb_unity_pro/Assets/Resources/base/embed/ui/Hotupdate_fui.bytes b/wb_unity_pro/Assets/Resources/base/embed/ui/Hotupdate_fui.bytes
index 4c7e4e82..b794deb4 100644
Binary files a/wb_unity_pro/Assets/Resources/base/embed/ui/Hotupdate_fui.bytes and b/wb_unity_pro/Assets/Resources/base/embed/ui/Hotupdate_fui.bytes differ
diff --git a/wb_unity_pro/Assets/Scripts/HotUpdate.cs b/wb_unity_pro/Assets/Scripts/HotUpdate.cs
index 23dff037..da0b7cb3 100644
--- a/wb_unity_pro/Assets/Scripts/HotUpdate.cs
+++ b/wb_unity_pro/Assets/Scripts/HotUpdate.cs
@@ -5,6 +5,7 @@ using System.IO;
using taurus.client;
using taurus.unity;
using UnityEngine;
+using UnityEngine.Networking;
public class Version
{
@@ -321,7 +322,96 @@ public class Hotupdate {
Progress = 1;
}
-
+ public void LoadAssetSize()
+ {
+ GameApplication.Instance.StartCoroutine(__LoadAssetSize());
+ }
+
+ IEnumerator __LoadAssetSize()
+ {
+ Size = 0;
+ bool _decompression = true;
+ string dir = ResourcesManager.PACK_PATH + _base_path;
+ if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
+ string rv = dir + "version.txt";
+ Version local_version1 = GetLocalVersion(_base_path);
+ if (local_version1 != null)
+ {
+ _local_version = local_version1;
+ _decompression = _local_version.ContainAll(_server_version);
+ }
+
+ //如果没有发现本地文件,解压APP包
+ if ((_with_pack & LOCAL_PACK) != 0 && _decompression)
+ {
+
+ var path = Application.streamingAssetsPath + string.Format("/{0}/{1}asset_pack{2}.bytes", ResourcesManager.OS_Dir, _base_path, _server_version.ToString());
+#if !UNITY_EDITOR && UNITY_ANDROID
+ var www = new WWW(path);
+ yield return www;
+ var data = www.bytes;
+ www.Dispose();
+ www = null;
+#else
+ var data = File.ReadAllBytes(path);
+#endif
+
+ var zip_path = ResourcesManager.PACK_PATH + "asset_pack.bytes";
+ File.WriteAllBytes(zip_path, data);
+ data = null;
+ System.GC.Collect();
+ var finsh = false;
+ var tem_state = 0;
+ VerCheck.Instance.StartCoroutine(__UnPack(_server_version, (state) =>
+ {
+ tem_state = state;
+ finsh = state == 0;
+ }, 0.3f));
+ while (!finsh)
+ {
+ if (tem_state > 10)
+ {
+ if (__ShowTip("解压资源包时出问题,请重新下载客户端!", () =>
+ {
+ __DeleteOldPack();
+ Application.Quit();
+ }))
+ {
+ __DeleteOldPack();
+ Application.Quit();
+ }
+ yield break;
+ }
+ yield return null;
+ }
+ local_version1 = _local_version;
+ _stage = 0.3f;
+ }
+
+ if ((_with_pack & SERVER_PACK) != 0)
+ {
+ var update_pack2 = local_version1 == null || local_version1.ContainAll(_server_version);
+
+ if (update_pack2)
+ {
+ var down = false;
+ var _ratio = 1 - _stage;
+ VerCheck.Instance.StartCoroutine(GetAssetSize((size) =>
+ {
+ Size = size;
+ down = true;
+ }, _server_version));
+ while (!down)
+ {
+ yield return null;
+ }
+ }
+ }
+
+ Done = true;
+ Progress = 1;
+ }
+
IEnumerator __UnPack(Version version,System.Action onback, float ratio)
{
TextTip = "正在解压资源包不消耗流量,请耐心等待";
@@ -424,6 +514,60 @@ public class Hotupdate {
}
}
+ IEnumerator GetAssetSize(System.Action downcall, Version version)
+ {
+ var pack_path = string.Format("{0}asset_pack{1}.bytes", _base_path, version.ToString());
+
+ string osPath = ResourcesManager.OS_Dir;
+#if UNITY_ANDROID && !UNITY_EDITOR
+ if (GameApplication.Instance.isAndroid64bit == false)
+ {
+ //if (isBuild32lua)
+ //{
+ // osPath=osPath+"32";
+ //}
+ osPath=osPath+"32";
+ }
+#endif
+
+ var url = "";
+ if (VerCheck.Instance.isGFF == false && VerCheck.Instance.isDXYGFF == false)
+ url = string.Format("{0}/{1}/{2}", Hotupdate.PackUrl, osPath, pack_path);
+ else
+ url = string.Format("{0}/{1}/{2}", "http://" + VerCheck.Instance.conn.ip + ":" + VerCheck.Instance.conn.port + "/NewFKN", osPath, pack_path);
+
+ url = string.Format("{0}/{1}/{2}", Hotupdate.PackUrl, osPath, pack_path);
+ if (Application.platform == RuntimePlatform.WindowsEditor)
+ Debug.Log("check_url:" + url);
+ using (UnityWebRequest head = UnityWebRequest.Head(url))
+ {
+ yield return head.SendWebRequest();
+#if UNITY_2020_2_OR_NEWER
+ if (head.result == UnityWebRequest.Result.Success)
+#else
+ if (!head.isNetworkError && !head.isHttpError)
+#endif
+ {
+ string len = head.GetResponseHeader("Content-Length");
+ if (!string.IsNullOrEmpty(len) && long.TryParse(len, out long size))
+ {
+ if (downcall != null) downcall(size);
+ yield return null;
+ }
+ else
+ {
+ Debug.LogWarning($"无法获取文件大小: {url}");
+ yield return 0L;
+ }
+ }
+ else
+ {
+ Debug.LogError($"获取文件大小失败: {head.error}");
+ yield return 0L;
+ }
+ }
+ }
+
bool __ShowTip(string text,System.Action callback)
{
if (this._tip_callback != null)
@@ -456,4 +600,9 @@ public class Hotupdate {
{
get;set;
}
+
+ public float Size
+ {
+ get; set;
+ }
}
diff --git a/wb_unity_pro/Assets/Scripts/VerCheck.cs b/wb_unity_pro/Assets/Scripts/VerCheck.cs
index 266e32af..cbb74046 100644
--- a/wb_unity_pro/Assets/Scripts/VerCheck.cs
+++ b/wb_unity_pro/Assets/Scripts/VerCheck.cs
@@ -180,13 +180,13 @@ public class VerCheck : MonoBehaviour
while (request1!=null && request1.isDone==false)
{
//Debug.LogError("wwwwwwwwwwwwwwwwwww11111111111111111111111");
- if(processdownTimeOut)
+ if (Time.time-timeOut>downTimeOut)
{
ShowTip("资源配置下载失败,请检查您的网络设置!", () =>
@@ -282,6 +282,8 @@ public class VerCheck : MonoBehaviour
IEnumerator CheckAssetConfig(Version server_version)
{
GObject v_tex_info = _version_view.GetChild("tex_info");
+ GObject v_tex_info_check = _version_view.GetChild("tex_info_check");
+ Transition t_check = _version_view.GetTransition("check");
Version local_version = Hotupdate.GetLocalVersion(string.Empty);
ArrayList asset_config_list = null;
string asset_config_text = null;
@@ -337,27 +339,64 @@ public class VerCheck : MonoBehaviour
yield break;
}
//
- v_tex_info.text = "正在检查资源。。。";
+ v_tex_info.text = "正在检查资源";
GSlider _pd = _version_view.GetChild("pb_progress").asSlider;
_pd.value = 0.0;
+ //开始检查所有资源
+ bool size_check = false;
+ long total_size = 0;
+ StartCoroutine(VersionUpdateCheckSize2(asset_config_list, (all_size, finish) =>
+ {
+ total_size = all_size;
+ size_check = finish;
+ }));
+ t_check.Play(-1, 0, () => { });
+ while (!size_check)
+ {
+ yield return null;
+ }
+ t_check.Stop();
+ v_tex_info_check.text = string.Empty;
+ Debug.Log($"总大小:{(total_size / 1024f / 1024f):F2} MB");
bool ver_check = false;
StartCoroutine(VersionUpdateCheck(asset_config_list, (progress, finish) =>
{
- _pd.value = progress * 100f;
- ver_check = finish;
- }, v_tex_info));
+ if (ver_check)
+ {
+ _pd.value = 100f;
+ ver_check = finish;
+ }
+ else
+ {
+ v_tex_info.text = $"正在下载资源({(progress / 1024f / 1024f):F2} MB/{(total_size / 1024f / 1024f):F2} MB)";
+ _pd.value = progress / total_size * 100f;
+ ver_check = finish;
+ }
+ }));
while (!ver_check)
{
yield return null;
}
+ bool unZip_check = false;
+ v_tex_info.text = "正在解压文件(该过程不消耗流量)";
+ _pd.value = 100f;
+ StartCoroutine(VersionUpdateUnZip(asset_config_list, (finish) =>
+ {
+ unZip_check = finish;
+ }));
+ t_check.Play(-1, 0, () => { });
+ while (!unZip_check)
+ {
+ yield return null;
+ }
+ t_check.Stop();
+ v_tex_info_check.text = string.Empty;
string arv = string.Format("{0}asset_config{1}.json", ResourcesManager.PACK_PATH, server_version.ToString());
File.WriteAllText(arv, asset_config_text, System.Text.Encoding.UTF8);
string rv = ResourcesManager.PACK_PATH + "version.txt";
File.WriteAllText(rv, server_version.ToString(), System.Text.Encoding.UTF8);
-
-
}
else
{
@@ -418,7 +457,7 @@ public class VerCheck : MonoBehaviour
}
GameApplication.AppVersion.FillData(server_version);
- v_tex_info.text = "正在加载资源请稍后。。";
+ //v_tex_info.text = "正在加载资源请稍后。。";
//ResourcesManager.Init();
yield return null;
_version_view.Dispose();
@@ -431,35 +470,20 @@ public class VerCheck : MonoBehaviour
///
///
///
+ ///
///
- IEnumerator VersionUpdateCheck(ArrayList asset_config_list, System.Action onback, FairyGUI.GObject tip)
+ IEnumerator VersionUpdateCheck(ArrayList asset_config_list, System.Action onback)
{
Version local_version = Version.DEFUALT;
+ float download_size = 0;
for(int i=0;i< asset_config_list.Count; ++i)
{
var tem = asset_config_list[i] as Hashtable;
- //if (GameApplication.HideSdk)
- //{
- // if (!tem.ContainsKey("check")) continue;
- // if (!(bool)tem["check"]) continue;
- //}
-
string b_path = "base/" + tem["name"].ToString();
Hotupdate version_update = new Hotupdate(b_path + "/", local_version, new Version((string)tem["ver"]));
version_update.AssetName = b_path;
version_update.HideDetail = true;
- #if UNITY_ANDROID && !UNITY_EDITOR
- //if (GameApplication.Instance.isAndroid64bit==false)
- //{
- // if (tem["name"].ToString()=="base_script")
- // {
- // version_update.isBuild32lua = true;
- // }
- //}
-#endif
-
-
version_update.SetTipCallback((text,callback)=>
{
@@ -468,15 +492,126 @@ public class VerCheck : MonoBehaviour
version_update.LoadAsset();
while (!version_update.Done)
{
- onback(version_update.Progress, false);
- tip.text = version_update.TextTip;
+ onback(download_size + version_update.Progress* (float)tem["size"], false);
yield return null;
}
+ download_size += (float)tem["size"];
ResourcesManager.ReadAssetConfig(b_path);
}
onback(1, true);
}
+ ///
+ /// 检查基本更新包大小
+ ///
+ ///
+ ///
+ ///
+ ///
+ IEnumerator VersionUpdateCheckSize(ArrayList asset_config_list, System.Action onback)
+ {
+ Version local_version_one = Version.DEFUALT;
+ long totalSize = 0;
+ for (int i = 0; i < asset_config_list.Count; ++i)
+ {
+ var tem_one = asset_config_list[i] as Hashtable;
+ string b_path_one = "base/" + tem_one["name"].ToString();
+ local_version_one = Hotupdate.GetLocalVersion(b_path_one);
+ var update_pack2 = local_version_one == null || local_version_one.ContainAll(new Version((string)tem_one["ver"]));
+ string osPath = ResourcesManager.OS_Dir;
+ if (update_pack2)
+ {
+ var pack_path = string.Format("{0}/asset_pack{1}.bytes", b_path_one, (string)tem_one["ver"]);
+ var url = "";
+ if (VerCheck.Instance.isGFF == false && VerCheck.Instance.isDXYGFF == false)
+ url = string.Format("{0}/{1}/{2}", Hotupdate.PackUrl, osPath, pack_path);
+ else
+ url = string.Format("{0}/{1}/{2}", "http://" + VerCheck.Instance.conn.ip + ":" + VerCheck.Instance.conn.port + "/NewFKN", osPath, pack_path);
+
+ url = string.Format("{0}/{1}/{2}", Hotupdate.PackUrl, osPath, pack_path);
+ if (Application.platform == RuntimePlatform.WindowsEditor)
+ Debug.Log("check_url:" + url);
+ using (UnityWebRequest head = UnityWebRequest.Head(url))
+ {
+ yield return head.SendWebRequest();
+#if UNITY_2020_2_OR_NEWER
+ if (head.result == UnityWebRequest.Result.Success)
+#else
+ if (!head.isNetworkError && !head.isHttpError)
+#endif
+ {
+ string len = head.GetResponseHeader("Content-Length");
+ if (!string.IsNullOrEmpty(len) && long.TryParse(len, out long size))
+ {
+ totalSize += size;
+ tem_one["size"] = size;
+ yield return null;
+ }
+ else
+ {
+ Debug.LogWarning($"无法获取文件大小: {url}");
+ yield return 0L;
+ }
+ }
+ else
+ {
+ Debug.LogError($"获取文件大小失败: {head.error}");
+ yield return 0L;
+ }
+ }
+ }
+ }
+ onback(totalSize, true);
+ }
+
+ IEnumerator VersionUpdateCheckSize2(ArrayList asset_config_list, System.Action onback)
+ {
+ Version local_version = Version.DEFUALT;
+ long totalSize = 0;
+ for (int i = 0; i < asset_config_list.Count; ++i)
+ {
+ var tem = asset_config_list[i] as Hashtable;
+
+ string b_path = "base/" + tem["name"].ToString();
+ Hotupdate version_update = new Hotupdate(b_path + "/", local_version, new Version((string)tem["ver"]));
+ version_update.AssetName = b_path;
+ version_update.HideDetail = true;
+
+ version_update.SetTipCallback((text, callback) =>
+ {
+ ShowTip(text, callback);
+ });
+ version_update.LoadAssetSize();
+ while (!version_update.Done)
+ {
+ yield return null;
+ }
+ tem["size"] = version_update.Size;
+ totalSize += (long)version_update.Size;
+ ResourcesManager.ReadAssetConfig(b_path);
+ }
+ onback(totalSize, true);
+ }
+ ///
+ /// 解压下载的资源文件
+ ///
+ ///
+ ///
+ ///
+ IEnumerator VersionUpdateUnZip(ArrayList asset_config_list, System.Action onback)
+ {
+ for (int i = 0; i < asset_config_list.Count; ++i)
+ {
+ var tem = asset_config_list[i] as Hashtable;
+
+ string b_path = "base/" + tem["name"].ToString();
+ ResourcesManager.ReadAssetConfig(b_path);
+ yield return null;
+ }
+ onback(true);
+ }
+
+
#if UNITY_ANDROID
IEnumerator DownApp(string appurl,string version)
{
diff --git a/wb_unity_pro/Assets/Source/Generate/HotupdateWrap.cs b/wb_unity_pro/Assets/Source/Generate/HotupdateWrap.cs
index dca256c1..df0fa1af 100644
--- a/wb_unity_pro/Assets/Source/Generate/HotupdateWrap.cs
+++ b/wb_unity_pro/Assets/Source/Generate/HotupdateWrap.cs
@@ -9,6 +9,7 @@ public class HotupdateWrap
L.BeginClass(typeof(Hotupdate), typeof(System.Object));
L.RegFunction("GetLocalVersion", GetLocalVersion);
L.RegFunction("LoadAsset", LoadAsset);
+ L.RegFunction("LoadAssetSize", LoadAssetSize);
L.RegFunction("SetTipCallback", SetTipCallback);
L.RegFunction("New", _CreateHotupdate);
L.RegFunction("__tostring", ToLua.op_ToString);
@@ -18,6 +19,7 @@ public class HotupdateWrap
L.RegVar("HideDetail", get_HideDetail, set_HideDetail);
L.RegVar("Progress", get_Progress, set_Progress);
L.RegVar("Done", get_Done, set_Done);
+ L.RegVar("Size", get_Size, set_Size);
L.EndClass();
}
@@ -90,6 +92,22 @@ public class HotupdateWrap
}
}
+ [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+ static int LoadAssetSize(IntPtr L)
+ {
+ try
+ {
+ ToLua.CheckArgsCount(L, 1);
+ Hotupdate obj = (Hotupdate)ToLua.CheckObject(L, 1);
+ obj.LoadAssetSize();
+ return 0;
+ }
+ catch (Exception e)
+ {
+ return LuaDLL.toluaL_exception(L, e);
+ }
+ }
+
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int SetTipCallback(IntPtr L)
{
@@ -221,6 +239,25 @@ public class HotupdateWrap
}
}
+ [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+ static int get_Size(IntPtr L)
+ {
+ object o = null;
+
+ try
+ {
+ o = ToLua.ToObject(L, 1);
+ Hotupdate obj = (Hotupdate)o;
+ float ret = obj.Size;
+ LuaDLL.lua_pushnumber(L, ret);
+ return 1;
+ }
+ catch(Exception e)
+ {
+ return LuaDLL.toluaL_exception(L, e, o, "attempt to index Size on a nil value");
+ }
+ }
+
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int set_isBuild32lua(IntPtr L)
{
@@ -334,5 +371,24 @@ public class HotupdateWrap
return LuaDLL.toluaL_exception(L, e, o, "attempt to index Done on a nil value");
}
}
+
+ [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+ static int set_Size(IntPtr L)
+ {
+ object o = null;
+
+ try
+ {
+ o = ToLua.ToObject(L, 1);
+ Hotupdate obj = (Hotupdate)o;
+ float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
+ obj.Size = arg0;
+ return 0;
+ }
+ catch(Exception e)
+ {
+ return LuaDLL.toluaL_exception(L, e, o, "attempt to index Size on a nil value");
+ }
+ }
}