From 7585f902c4bc423b84cd0ce5bda668dd27ba44a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Wed, 9 Apr 2025 15:33:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=8A=9A=E5=B7=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/Controller/LoginController.lua | 63 +------------------ .../base_project/Game/ExtendManager.lua | 15 ++--- .../base_project/Game/View/FamilyView.lua | 1 + .../base_project/Game/View/LoginView.lua | 1 - 4 files changed, 11 insertions(+), 69 deletions(-) diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index b7226d07..9355cced 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -18,6 +18,7 @@ local _LocalConfigAllGame = { } local FilterGame = function(games) + pt(games) local tempGames = {} for k, v in pairs(games) do v.bundle = v.bundle:gsub("\r\n", "") @@ -72,67 +73,7 @@ local function __Login(cmd, _data, callBack) end) end -local function __LoginNew(cmd, _data, callBack) - local _client = ControllerManager.WebClient - _client:send(cmd, _data, function(res) - printlog("1111111111111111222222222222") - -- pt(cmd) - -- pt(res) - if (res.Data.type == 0) then - local data = res.Data - print(data.userData) - local userInfo = stringToTAble(data.userData) - printlog("===========================loginuserqian=======================") - for k, v in pairs(userInfo) do - printlog(k) - printlog(v) - end - printlog("===========================loginuserqian=======================") - local user = DataManager.SelfUser - user.acc = userInfo.acc - user.account_id = userInfo.id - user.diamo = userInfo.diamo - user.nick_name = userInfo.nick - user.sex = userInfo.sex - user.head_url = userInfo.portrait - user.room_id = userInfo.roomid - user.group_id = userInfo.groupId - user.type = userInfo.type - user.agent = userInfo.mng - - user.real_info = userInfo.real_info - user.phone = userInfo.phone - user.address = userInfo.address - printlog("===========================loginuser=======================") - printlog(user.acc) - for k, v in pairs(user) do - printlog(k) - printlog(v) - end - printlog("===========================loginuser=======================") - user.games = FilterGame(data.games) - - - - if Application.platform == RuntimePlatform.WindowsPlayer or Application.platform == RuntimePlatform.WindowsEditor then - --GameApplication.Instance.printLog = true - else - --GameApplication.Instance.printLog = user.type == 2 - end - - _client:setSession(data.session_id .. "," .. data.token) - printlog("11111111111111111111111111111111") - pt(data) - ControllerManager.GroupClient = NetClient.new(data.groupWeb, "web_group", ConnectionProtocol.Web) - ControllerManager.GroupClient:setSession((data["session_id"] .. "," .. data["token"])) - end - - if (callBack ~= nil) then - callBack(res) - end - end) -end --手机登录 function M:GetPhoneCode(phone, callback) @@ -151,7 +92,7 @@ function M:PhoneLogin(phone, code, callback) local _data = {} _data["phone"] = phone _data["code"] = code - __LoginNew(Protocol.WEB_PHONE_LOGIN, _data, callback) + __Login(Protocol.WEB_PHONE_LOGIN, _data, callback) end --手机密码登录 diff --git a/lua_probject/base_project/Game/ExtendManager.lua b/lua_probject/base_project/Game/ExtendManager.lua index 8b4188aa..bf4c8465 100644 --- a/lua_probject/base_project/Game/ExtendManager.lua +++ b/lua_probject/base_project/Game/ExtendManager.lua @@ -3,7 +3,7 @@ require "Game.IGameInfo" --- -- a net ExtendManager ExtendManager = { - + } local _extendMap = {} @@ -12,9 +12,9 @@ local _isUpdate = false local _isInit = false local function __new_config(data) - local ec = reimport(data.bundle ..".ExtendConfig") - --print("初始化ExtendManager===>>>"..data.bundle) - --pt(data) + local ec = reimport(data.bundle .. ".ExtendConfig") + --print("初始化ExtendManager===>>>"..data.bundle) + --pt(data) local config = ec.new() ec.game_data = data _extendMap[data.game_id] = config @@ -25,8 +25,8 @@ function ExtendManager.Init(game_list) print("==========================================================ExtendManager") pt(game_list) if _isInit then return end - for i=1,#game_list do - local game = game_list[i] + for i = 1, #game_list do + local game = game_list[i] __new_config(game) end @@ -35,6 +35,7 @@ end -- 更新扩展玩法到最新数据 function ExtendManager.UpdateExtend(data) + print("==========================================xtendManager.UpdateExtend") if not data then return end local tem = _extendMap[data.game_id] if tem and (not GameApplication.Instance.buildApp) then @@ -70,4 +71,4 @@ end function ExtendManager.Destroy() _extendMap = {} _isInit = false -end \ No newline at end of file +end diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 0c873b63..06c70a86 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -348,6 +348,7 @@ function M:UpdateFamilyRoom(fgCtr, id) else local newIndex = index - #roomList + 1 local config = ExtendManager.GetExtendConfig(playList[newIndex].gameId) + print("=======================================layList[newIndex].gameId", playList[newIndex].gameId) local mode = config:GetGameInfo() local gamePlay = mode:LoadConfigToDetail(playList[newIndex].config) obj:GetChild('Label_gameRule').title = gamePlay diff --git a/lua_probject/base_project/Game/View/LoginView.lua b/lua_probject/base_project/Game/View/LoginView.lua index 5a870a62..425458d7 100644 --- a/lua_probject/base_project/Game/View/LoginView.lua +++ b/lua_probject/base_project/Game/View/LoginView.lua @@ -167,7 +167,6 @@ local function __login_response(self, response) __goto_lobby(response) end - if user.update ~= 0 then ExtendHotupdate.UpdateGameList(user.games, f_enterLobby) else