From 15cfb0af8c299866c8ff269b4633b2eb9e6b0ff3 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Fri, 15 Dec 2023 13:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Simple/ClientCore/Manager/AppLogin.cs | 2 +- Simple/ClientCore/Manager/UserDataManager.cs | 15 +++++++-------- Simple/ClientCore/Network/NetworkHelper.cs | 4 ---- 3 files changed, 8 insertions(+), 13 deletions(-) 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() { //指定接收服务器数据事件