diff --git a/Simple/ClientCore/Manager/AppLogin.cs b/Simple/ClientCore/Manager/AppLogin.cs index 9286847..abd5660 100644 --- a/Simple/ClientCore/Manager/AppLogin.cs +++ b/Simple/ClientCore/Manager/AppLogin.cs @@ -26,7 +26,7 @@ namespace ClientCore.Manager if (msg.Status == LoginResultStatus.Ok) { App.log.Debug("登录成功"); - App.user.InitMainUserData(msg); + App.user.InitMainUserData(App.user.userdata.Account); } else { diff --git a/Simple/ClientCore/Manager/UserDataManager.cs b/Simple/ClientCore/Manager/UserDataManager.cs index 526a2df..e87ec07 100644 --- a/Simple/ClientCore/Manager/UserDataManager.cs +++ b/Simple/ClientCore/Manager/UserDataManager.cs @@ -20,14 +20,13 @@ namespace ClientCore.Manager //注册重连成功事件,以便后续自动登录 App.networkHelper.OnReConnected += OnReConnected; } - - MainUserDataBase user = new MainUserDataBase(); - public bool IsLoggedIn => user.IsLoggedIn; + public MainUserDataBase userdata { get;private set; } = new MainUserDataBase(); + public bool IsLoggedIn => userdata.IsLoggedIn; public void InitMainUserData(string UName) { - user.Account = UName; - user.IsLoggedIn = true; + userdata.Account = UName; + userdata.IsLoggedIn = true; //以及其他数据初始化 //... } @@ -37,7 +36,7 @@ namespace ClientCore.Manager /// public void LoginOutData() { - user.IsLoggedIn = false; + userdata.IsLoggedIn = false; //以及其他数据清理 //... } @@ -48,9 +47,9 @@ namespace ClientCore.Manager public void OnReConnected() { //如果之前已登录,则重新登录 - if (user.IsLoggedIn) + if (userdata.IsLoggedIn) { - App.login.Login(user.Account); + App.login.Login(userdata.Account); } } } diff --git a/Simple/ClientCore/Network/NetworkHelper.cs b/Simple/ClientCore/Network/NetworkHelper.cs index 5c9923b..3ef9407 100644 --- a/Simple/ClientCore/Network/NetworkHelper.cs +++ b/Simple/ClientCore/Network/NetworkHelper.cs @@ -13,10 +13,6 @@ namespace ClientCore.Network /// public class NetworkHelper : NetworkHelperCore { - /// - /// 网络库调试日志输出 - /// - public event OnLogOutHandler OnLogOut; public NetworkHelper() { //指定接收服务器数据事件