.Any(), .Count() -> .Count or .Length
This commit is contained in:
committed by
atlimit8
parent
6eb4fe8980
commit
79f321cb44
@@ -635,9 +635,9 @@ namespace OpenRA.Server
|
||||
|
||||
events.Add(new CallbackEvent(() =>
|
||||
{
|
||||
var notAuthenticated = Type == ServerType.Dedicated && profile == null && (Settings.RequireAuthentication || Settings.ProfileIDWhitelist.Any());
|
||||
var notAuthenticated = Type == ServerType.Dedicated && profile == null && (Settings.RequireAuthentication || Settings.ProfileIDWhitelist.Length > 0);
|
||||
var blacklisted = Type == ServerType.Dedicated && profile != null && Settings.ProfileIDBlacklist.Contains(profile.ProfileID);
|
||||
var notWhitelisted = Type == ServerType.Dedicated && Settings.ProfileIDWhitelist.Any() &&
|
||||
var notWhitelisted = Type == ServerType.Dedicated && Settings.ProfileIDWhitelist.Length > 0 &&
|
||||
(profile == null || !Settings.ProfileIDWhitelist.Contains(profile.ProfileID));
|
||||
|
||||
if (notAuthenticated)
|
||||
@@ -663,7 +663,7 @@ namespace OpenRA.Server
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Type == ServerType.Dedicated && (Settings.RequireAuthentication || Settings.ProfileIDWhitelist.Any()))
|
||||
if (Type == ServerType.Dedicated && (Settings.RequireAuthentication || Settings.ProfileIDWhitelist.Length > 0))
|
||||
{
|
||||
Log.Write("server", $"Rejected connection from {newConn.EndPoint}; Not authenticated.");
|
||||
SendOrderTo(newConn, "ServerError", RequiresForumAccount);
|
||||
|
||||
Reference in New Issue
Block a user