修复 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>>())
{
string msg = handler(obj);
if (msg != "")
foreach (Func<SocketObject, string> handler in ValidateClientParameters.GetInvocationList().Cast<Func<SocketObject, string>>())
{
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();
}
}