diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index a2c44be8..d4c992c5 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -180,7 +180,7 @@ function M:connect(host, groupId, callback) end end) else - self.connecting = false + self:disconnect() _mgr_client:destroy() if callback then callback({ ReturnCode = 101 }) diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 65603634..c51b072a 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -580,8 +580,22 @@ function M:EnterGroup(fgCtr, id) ViewUtil:CloseModalWait2() if res.ReturnCode ~= 0 then if res.ReturnCode == 101 then - ViewUtil:ShowModalWait2(0.01) - self:EnterGroup(fgCtr, id) + -- ViewUtil:ShowModalWait2(0.01) + -- self:EnterGroup(fgCtr, id) + local _curren_msg = + MsgWindow.new( + self._root_view, + '您的账号在另一个地点登录, 请确定您的账号是否泄密', + MsgWindow.MsgMode.OnlyOk + ) + PlayerPrefs.DeleteKey('session_id') + PlayerPrefs.Save() + _curren_msg.onOk:Add( + function() + RestartGame() + end + ) + _curren_msg:Show() return end ViewUtil.ErrorTip(res.ReturnCode, "获取房间列表列表失败") diff --git a/lua_probject/base_project/Game/ViewManager.lua b/lua_probject/base_project/Game/ViewManager.lua index c8ae6485..03b181e1 100644 --- a/lua_probject/base_project/Game/ViewManager.lua +++ b/lua_probject/base_project/Game/ViewManager.lua @@ -55,7 +55,7 @@ local function __NetTip(txt_msg) end local function __OnGameConnectAction(state) - --print("state:"..state) + -- print("state:" .. state) NetResetConnectWindow.CloseNetReset() if state == SocketCode.Connect then ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) @@ -63,9 +63,23 @@ local function __OnGameConnectAction(state) --这两种情况默认重连 elseif state == SocketCode.DisconnectByServer then -- __NetTip("网络断开连接!") - NetResetConnectWindow.ShowNetReset() - ControllerManager.reset_join_room = 0 - ControllerManager.ResetJionRoom() + -- NetResetConnectWindow.ShowNetReset() + local _curren_msg = + MsgWindow.new( + nil, + '您的账号在另一个地点登录, 请确定您的账号是否泄密', + MsgWindow.MsgMode.OnlyOk + ) + PlayerPrefs.DeleteKey('session_id') + PlayerPrefs.Save() + _curren_msg.onOk:Add( + function() + RestartGame() + end + ) + _curren_msg:Show() + -- ControllerManager.reset_join_room = 0 + -- ControllerManager.ResetJionRoom() elseif state == SocketCode.ExceptionOnConnect or state == SocketCode.NetworkException then -- __NetTip("请检查您的网络环境!") NetResetConnectWindow.ShowNetReset()