diff --git a/FunGame.Server/Controllers/DataRequestController.cs b/FunGame.Server/Controllers/DataRequestController.cs index 38f53d7..51ef0ee 100644 --- a/FunGame.Server/Controllers/DataRequestController.cs +++ b/FunGame.Server/Controllers/DataRequestController.cs @@ -315,7 +315,7 @@ namespace Milimoe.FunGame.Server.Controller if (SQLHelper.Result == SQLResult.Success) { ServerHelper.WriteLine("[CreateRoom] Master: " + user.Username + " RoomID: " + roomid); - DataRow? dr = SQLHelper.ExecuteDataRow(RoomQuery.Select_IsExistRoom(SQLHelper, roomid)); + DataRow? dr = SQLHelper.ExecuteDataRow(RoomQuery.Select_RoomByRoomId(SQLHelper, roomid)); if (dr != null) { room = Factory.GetRoom(dr, user); @@ -355,7 +355,7 @@ namespace Milimoe.FunGame.Server.Controller string roomid = DataRequest.GetDictionaryJsonObject(requestData, "roomid") ?? "-1"; bool isMaster = DataRequest.GetDictionaryJsonObject(requestData, "isMaster"); - if (roomid != "-1" && FunGameSystem.RoomList.IsExist(roomid)) + if (roomid != "-1" && FunGameSystem.RoomList.Exists(roomid)) { Room room = FunGameSystem.RoomList[roomid]; RoomEventArgs eventArgs = new(room); @@ -403,7 +403,7 @@ namespace Milimoe.FunGame.Server.Controller } else if (SQLHelper != null) { - SQLHelper.ExecuteDataSet(RoomQuery.Select_IsExistRoom(SQLHelper, roomid)); + SQLHelper.ExecuteDataSet(RoomQuery.Select_RoomByRoomId(SQLHelper, roomid)); if (SQLHelper.Success) { FunGameSystem.RoomList.IntoRoom(roomid, Server.User); @@ -897,7 +897,7 @@ namespace Milimoe.FunGame.Server.Controller string newModule = DataRequest.GetDictionaryJsonObject(requestData, "module") ?? ""; string newMap = DataRequest.GetDictionaryJsonObject(requestData, "map") ?? ""; User user = Server.User; - if (roomid != "-1" && FunGameSystem.RoomList.IsExist(roomid)) + if (roomid != "-1" && FunGameSystem.RoomList.Exists(roomid)) { Room room = FunGameSystem.RoomList[roomid]; RoomEventArgs eventArgs = new(room); @@ -973,7 +973,7 @@ namespace Milimoe.FunGame.Server.Controller string roomid = DataRequest.GetDictionaryJsonObject(requestData, "roomid") ?? "-1"; User newMaster = DataRequest.GetDictionaryJsonObject(requestData, "newMaster") ?? Factory.GetUser(); - if (roomid != "-1" && FunGameSystem.RoomList.IsExist(roomid) && newMaster.Id != 0) + if (roomid != "-1" && FunGameSystem.RoomList.Exists(roomid) && newMaster.Id != 0) { Room room = FunGameSystem.RoomList[roomid]; RoomEventArgs eventArgs = new(room); diff --git a/FunGame.Server/Main.cs b/FunGame.Server/Main.cs index 3290139..4cdb7cd 100644 --- a/FunGame.Server/Main.cs +++ b/FunGame.Server/Main.cs @@ -16,7 +16,7 @@ HTTPListener? WebSocketListener = null; ServerHelper.WriteLine("正在读取配置文件并初始化服务 . . ."); // 检查是否存在配置文件 -if (!INIHelper.ExistINIFile()) +if (!INIHelper.INIFileExists()) { ServerHelper.WriteLine("未检测到配置文件,将自动创建配置文件 . . ."); INIHelper.Init(Config.FunGameType); diff --git a/FunGame.Server/Models/ConnectProperties.cs b/FunGame.Server/Models/ConnectProperties.cs index b4df997..04f14b3 100644 --- a/FunGame.Server/Models/ConnectProperties.cs +++ b/FunGame.Server/Models/ConnectProperties.cs @@ -20,7 +20,7 @@ namespace Milimoe.FunGame.Server.Models { if (Name == "" && DataSource == "" && Port == "" && DataBase == "" && User == "" && Password == "") { - if (INIHelper.ExistINIFile()) + if (INIHelper.INIFileExists()) { DataSource = INIHelper.ReadINI("MySQL", "DBServer"); Port = INIHelper.ReadINI("MySQL", "DBPort"); @@ -41,7 +41,7 @@ namespace Milimoe.FunGame.Server.Models { if (DataSource == "") { - if (INIHelper.ExistINIFile()) + if (INIHelper.INIFileExists()) { DataSource = INIHelper.ReadINI("SQLite", "DataSource"); } diff --git a/FunGame.Server/Services/DataRequestService.cs b/FunGame.Server/Services/DataRequestService.cs index 6e20f8d..6bdf87a 100644 --- a/FunGame.Server/Services/DataRequestService.cs +++ b/FunGame.Server/Services/DataRequestService.cs @@ -73,7 +73,7 @@ namespace Milimoe.FunGame.Server.Services internal static (string Msg, RegInvokeType Type, bool Success) HandleNoVerifyCode(SQLHelper sqlHelper, MailSender? mailSender, string username, string email, string clientName) { // 先检查账号是否重复 - sqlHelper.ExecuteDataSet(UserQuery.Select_IsExistUsername(sqlHelper, username)); + sqlHelper.ExecuteDataSet(UserQuery.Select_UserByUsername(sqlHelper, username)); if (sqlHelper.Result == SQLResult.Success) { ServerHelper.WriteLine(clientName + " 账号已被注册"); @@ -81,7 +81,7 @@ namespace Milimoe.FunGame.Server.Services } // 检查邮箱是否重复 - sqlHelper.ExecuteDataSet(UserQuery.Select_IsExistEmail(sqlHelper, email)); + sqlHelper.ExecuteDataSet(UserQuery.Select_UserByEmail(sqlHelper, email)); if (sqlHelper.Result == SQLResult.Success) { ServerHelper.WriteLine(clientName + " 邮箱已被注册"); diff --git a/FunGame.Server/Services/FunGameSystem.cs b/FunGame.Server/Services/FunGameSystem.cs index 7bdfe98..9cdf474 100644 --- a/FunGame.Server/Services/FunGameSystem.cs +++ b/FunGame.Server/Services/FunGameSystem.cs @@ -85,7 +85,7 @@ namespace Milimoe.FunGame.Server.Services SQLMode.SQLite => new SQLiteHelper(), _ => null, }); - if (INIHelper.ExistINIFile()) + if (INIHelper.INIFileExists()) { string useMySQL = INIHelper.ReadINI("MySQL", "UseMySQL").Trim(); string useSQLite = INIHelper.ReadINI("SQLite", "UseSQLite").Trim(); @@ -238,7 +238,7 @@ namespace Milimoe.FunGame.Server.Services ServerHelper.Error(e); } } - + /// /// Web API 启动完成回调 /// diff --git a/FunGame.Server/Services/General.cs b/FunGame.Server/Services/General.cs index 1b5eef1..1e913b2 100644 --- a/FunGame.Server/Services/General.cs +++ b/FunGame.Server/Services/General.cs @@ -148,7 +148,7 @@ namespace Milimoe.FunGame.Server.Services private static Hashtable GetServerSettingHashtable() { Hashtable settings = []; - if (INIHelper.ExistINIFile()) + if (INIHelper.INIFileExists()) { settings.Add("LogLevel", INIHelper.ReadINI("Console", "LogLevel")); settings.Add("Name", INIHelper.ReadINI("Server", "Name")); @@ -260,7 +260,7 @@ namespace Milimoe.FunGame.Server.Services { if (SenderMailAddress == "" && SenderName == "" && SenderPassword == "" && SmtpHost == "") { - if (INIHelper.ExistINIFile()) + if (INIHelper.INIFileExists()) { if (bool.TryParse(INIHelper.ReadINI("Mailer", "UseMailSender").ToLower(), out bool use)) { diff --git a/FunGame.WebAPI/Program.cs b/FunGame.WebAPI/Program.cs index e3a544f..40c84cd 100644 --- a/FunGame.WebAPI/Program.cs +++ b/FunGame.WebAPI/Program.cs @@ -37,7 +37,7 @@ try ServerHelper.WriteLine("正在读取配置文件并初始化服务 . . ."); // 检查是否存在配置文件 - if (!INIHelper.ExistINIFile()) + if (!INIHelper.INIFileExists()) { ServerHelper.WriteLine("未检测到配置文件,将自动创建配置文件 . . ."); INIHelper.Init(Config.FunGameType);