From 9e1c68042d18e45011e65fe3f15cd9c3f7e6b8ad Mon Sep 17 00:00:00 2001 From: milimoe Date: Wed, 23 Jul 2025 01:09:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E7=A9=BA=E5=9B=9E=E8=BD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Server/Services/General.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FunGame.Server/Services/General.cs b/FunGame.Server/Services/General.cs index b58af5e..e423ddc 100644 --- a/FunGame.Server/Services/General.cs +++ b/FunGame.Server/Services/General.cs @@ -77,6 +77,7 @@ namespace Milimoe.FunGame.Server.Services public static void Write(string msg, InvokeMessageType type = InvokeMessageType.System, LogLevel level = LogLevel.Info, bool useLevel = true) { + if (msg.Trim() == "") return; if (type == InvokeMessageType.Warning) { level = LogLevel.Warning; @@ -87,7 +88,7 @@ namespace Milimoe.FunGame.Server.Services } if (!useLevel || (useLevel && (int)level >= (int)Config.LogLevelValue)) { - if (msg.Trim() != "") Console.Write("\r" + GetPrefix(type, level) + msg + "> "); + Console.Write("\r" + GetPrefix(type, level) + msg + "> "); Console.ResetColor(); } else Type(); @@ -95,6 +96,7 @@ namespace Milimoe.FunGame.Server.Services public static void WriteLine(string msg, InvokeMessageType type = InvokeMessageType.System, LogLevel level = LogLevel.Info, bool useLevel = true) { + if (msg.Trim() == "") return; if (type == InvokeMessageType.Warning) { level = LogLevel.Warning; @@ -105,13 +107,14 @@ namespace Milimoe.FunGame.Server.Services } if (!useLevel || ((int)level >= (int)Config.LogLevelValue)) { - if (msg.Trim() != "") Console.WriteLine("\r" + GetPrefix(type, level) + msg); + Console.WriteLine("\r" + GetPrefix(type, level) + msg); } Type(); } public static void WriteLine_Addons(string addon, string msg, InvokeMessageType type = InvokeMessageType.System, LogLevel level = LogLevel.Info, bool useLevel = true) { + if (msg.Trim() == "") return; if (type == InvokeMessageType.Warning) { level = LogLevel.Warning; @@ -122,7 +125,7 @@ namespace Milimoe.FunGame.Server.Services } if (!useLevel || ((int)level >= (int)Config.LogLevelValue)) { - if (msg.Trim() != "") Console.WriteLine("\r" + GetPrefix(type, level, addon) + msg); + Console.WriteLine("\r" + GetPrefix(type, level, addon) + msg); } Type(); }