修复 ValidateClientParameters 可能未启用的 BUG

This commit is contained in:
milimoe 2025-11-26 00:45:05 +08:00
parent ffa839e9f1
commit 449cb1df9b
Signed by: milimoe
GPG Key ID: 9554D37E4B8991D0

View File

@ -154,20 +154,19 @@ namespace Milimoe.FunGame.Server.Controller
} }
} }
if (ValidateClientParameters is null) if (ValidateClientParameters != null)
{ {
return ""; foreach (Func<SocketObject, string> handler in ValidateClientParameters.GetInvocationList().Cast<Func<SocketObject, string>>())
}
foreach (Func<SocketObject, string> handler in ValidateClientParameters.GetInvocationList().Cast<Func<SocketObject, string>>())
{
string msg = handler(obj);
if (msg != "")
{ {
builder.AppendLine(msg); string msg = handler(obj);
ServerHelper.WriteLine(msg, InvokeMessageType.Error); if (msg != "")
{
builder.AppendLine(msg);
ServerHelper.WriteLine(msg, InvokeMessageType.Error);
}
} }
} }
return builder.ToString().Trim(); return builder.ToString().Trim();
} }
} }