diff --git a/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs b/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs index 0189c90..68ac83e 100644 --- a/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs +++ b/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs @@ -57,7 +57,8 @@ public static string Insert_Register(string Username, string Password, string Email) { - return $"{Constant.Command_Insert} {Constant.Command_Into} {TableName} ({Column_Username}, {Column_Password}, {Column_Email}, {Column_RegTime}) {Constant.Command_Values} ('{Username}', '{Password}', '{Email}', '{DateTime.Now}')"; + DateTime Now = DateTime.Now; + return $"{Constant.Command_Insert} {Constant.Command_Into} {TableName} ({Column_Username}, {Column_Password}, {Column_Email}, {Column_RegTime}, {Column_LastTime}) {Constant.Command_Values} ('{Username}', '{Password}', '{Email}', '{Now}', '{Now}')"; } } } diff --git a/FunGame.Desktop/UI/Login/Login.cs b/FunGame.Desktop/UI/Login/Login.cs index 047f503..b3a30af 100644 --- a/FunGame.Desktop/UI/Login/Login.cs +++ b/FunGame.Desktop/UI/Login/Login.cs @@ -74,6 +74,7 @@ namespace Milimoe.FunGame.Desktop.UI { GoToLogin.Enabled = false; if (await Login_Handler() == false) GoToLogin.Enabled = true; + else Dispose(); } private void ForgetPassword_Click(object sender, EventArgs e) @@ -91,11 +92,6 @@ namespace Milimoe.FunGame.Desktop.UI private EventResult SucceedLoginEvent(object sender, LoginEventArgs e) { - if (!IsDisposed) - { - if (InvokeRequired) Invoke(Close); - else Close(); - } RunTime.Main?.OnSucceedLoginEvent(e); return EventResult.Success; } diff --git a/FunGame.Desktop/UI/Register/Register.cs b/FunGame.Desktop/UI/Register/Register.cs index 5c02908..ae30181 100644 --- a/FunGame.Desktop/UI/Register/Register.cs +++ b/FunGame.Desktop/UI/Register/Register.cs @@ -120,7 +120,8 @@ namespace Milimoe.FunGame.Desktop.UI { string username = ((RegisterEventArgs)e).Username; string password = ((RegisterEventArgs)e).Password; - RunTime.Connector?.AutoLogin(username, password); + _ = LoginController.LoginAccount(username, password); + RunTime.Login?.Close(); return EventResult.Success; }