From 449cb1df9b23d4f92066ecf8247aa3cdbf695905 Mon Sep 17 00:00:00 2001 From: milimoe Date: Wed, 26 Nov 2025 00:45:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20ValidateClientParameters?= =?UTF-8?q?=20=E5=8F=AF=E8=83=BD=E6=9C=AA=E5=90=AF=E7=94=A8=E7=9A=84=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ConnectController.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/FunGame.Server/Controllers/ConnectController.cs b/FunGame.Server/Controllers/ConnectController.cs index 195f4f2..68726cb 100644 --- a/FunGame.Server/Controllers/ConnectController.cs +++ b/FunGame.Server/Controllers/ConnectController.cs @@ -154,20 +154,19 @@ namespace Milimoe.FunGame.Server.Controller } } - if (ValidateClientParameters is null) + if (ValidateClientParameters != null) { - return ""; - } - - foreach (Func handler in ValidateClientParameters.GetInvocationList().Cast>()) - { - string msg = handler(obj); - if (msg != "") + foreach (Func handler in ValidateClientParameters.GetInvocationList().Cast>()) { - builder.AppendLine(msg); - ServerHelper.WriteLine(msg, InvokeMessageType.Error); + string msg = handler(obj); + if (msg != "") + { + builder.AppendLine(msg); + ServerHelper.WriteLine(msg, InvokeMessageType.Error); + } } } + return builder.ToString().Trim(); } }