From e35b5bcff8f451ef181457a9ff44ebca736f8b1c Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期三, 22 八月 2018 10:49:36 +0800
Subject: [PATCH] 1652 从wifi状态下,切换到4g后,游戏重连回到登入界面,但是不能点击【进入游戏】
---
System/Login/LoginModel.cs | 63 +++++++++++++++++++++----------
1 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/System/Login/LoginModel.cs b/System/Login/LoginModel.cs
index 00020e9..952f531 100644
--- a/System/Login/LoginModel.cs
+++ b/System/Login/LoginModel.cs
@@ -15,8 +15,7 @@
public SDKUtility.FP_LoginOk sdkLoginResult;
public SDKUtility.FP_CheckIDAuthentication sdkIDCheckIDAuthentication;
- public string localSaveAccountName
- {
+ public string localSaveAccountName {
get { return LocalSave.GetString(USER_ACCOUNT); }
set { LocalSave.SetString(USER_ACCOUNT, value); }
}
@@ -25,22 +24,19 @@
public event Action accountBindOkEvent;
bool m_ReconnecBackGround = false;
- public bool reconnectBackGround
- {
+ public bool reconnectBackGround {
get { return m_ReconnecBackGround; }
set { m_ReconnecBackGround = value; }
}
bool m_OnCreateRole = false;
- public bool onCreateRole
- {
+ public bool onCreateRole {
get { return m_OnCreateRole; }
set { m_OnCreateRole = value; }
}
bool m_Busy = false;
- public bool busy
- {
+ public bool busy {
get { return m_Busy; }
set { m_Busy = value; }
}
@@ -144,17 +140,27 @@
}
busy = true;
- reconnectBackGround = false;
- accountBuf = _account;
- localSaveAccountName = accountBuf;
- ipBuf = _ip;
- portBuf = _port;
- gamePortBuf = _gamePort;
- ConnectGameServer(ipBuf, gamePortBuf);
+ try
+ {
+ reconnectBackGround = false;
+ accountBuf = _account;
+ localSaveAccountName = accountBuf;
+ ipBuf = _ip;
+ portBuf = _port;
+ gamePortBuf = _gamePort;
- GameNetSystem.Instance.OnAccountLogin();
- NetLinkWin.Show();
+ ConnectGameServer(ipBuf, gamePortBuf);
+
+ GameNetSystem.Instance.OnAccountLogin();
+ NetLinkWin.Show();
+ }
+ catch (Exception ex)
+ {
+ Debug.Log(ex);
+ busy = false;
+ }
+
}
public void AccountLogin(string _ip, int _port, int _gamePort)
@@ -175,9 +181,16 @@
busy = true;
reconnectBackGround = true;
- ConnectGameServer(ipBuf, gamePortBuf);
-
- NetLinkWin.Show();
+ try
+ {
+ ConnectGameServer(ipBuf, gamePortBuf);
+ NetLinkWin.Show();
+ }
+ catch (Exception ex)
+ {
+ Debug.Log(ex);
+ busy = false;
+ }
}
private void OnAccountLogin(bool _ok, string _result)
@@ -212,7 +225,15 @@
}
localSaveAccountName = accountBuf;
- ConnectGameServer(ipBuf, gamePortBuf);
+ try
+ {
+ ConnectGameServer(ipBuf, gamePortBuf);
+ }
+ catch (Exception ex)
+ {
+ busy = false;
+ Debug.Log(ex);
+ }
}
void ConnectGameServer(string _ip, int _port)
--
Gitblit v1.8.0