From 70036f2f3d39fc23b2d810592b7854506d5ecd33 Mon Sep 17 00:00:00 2001 From: Mili Date: Mon, 13 Mar 2023 23:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=B0=E5=BD=95=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E6=97=B6=E9=97=B4=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Core/Library/SQLScript/Entity/User.cs | 15 ++++++++++----- FunGame.Desktop/UI/Main/Main.cs | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/FunGame.Core/Library/SQLScript/Entity/User.cs b/FunGame.Core/Library/SQLScript/Entity/User.cs index c1c0207..94615a2 100644 --- a/FunGame.Core/Library/SQLScript/Entity/User.cs +++ b/FunGame.Core/Library/SQLScript/Entity/User.cs @@ -41,19 +41,24 @@ return $"{Select_Users} {Constant.Command_Where} {Where}'"; } + public static string Select_CheckAutoKey(string Username, string AutoKey) + { + return $"{Select_Users} {Constant.Command_Where} {Column_Username} = '{Username}' and {Column_AutoKey} = '{AutoKey}'"; + } + public static string Update_CheckLogin(string Username, string IP) { return $"{Constant.Command_Update} {TableName} {Constant.Command_Set} {Column_LastTime} = '{DateTime.Now}', {Column_LastIP} = '{IP}' {Constant.Command_Where} {Column_Username} = '{Username}'"; } + + public static string Update_GameTime(string Username, int GameTimeMinutes) + { + return $"{Constant.Command_Update} {TableName} {Constant.Command_Set} {Column_GameTime} = {Column_GameTime} + {GameTimeMinutes} {Constant.Command_Where} {Column_Username} = '{Username}'"; + } 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}')"; } - - public static string Select_CheckAutoKey(string Username, string AutoKey) - { - return $"{Select_Users} {Constant.Command_Where} {Column_Username} = '{Username}' and {Column_AutoKey} = '{AutoKey}'"; - } } } diff --git a/FunGame.Desktop/UI/Main/Main.cs b/FunGame.Desktop/UI/Main/Main.cs index 9143f7f..31d4486 100644 --- a/FunGame.Desktop/UI/Main/Main.cs +++ b/FunGame.Desktop/UI/Main/Main.cs @@ -675,7 +675,7 @@ namespace Milimoe.FunGame.Desktop.UI WritelnGameInfo(msg); if (Usercfg.LoginUser != null && !SwitchTalkMessage(text)) { - MainController?.Chat(msg); + MainController?.Chat(" [ " + Usercfg.LoginUserName + " ] 说: " + text); } TalkText.Text = ""; if (isLeave) TalkText_Leave(); // 回车不离开焦点