Fix IDE0039

This commit is contained in:
RoosterDragon
2023-02-19 11:56:54 +00:00
committed by abcdefg30
parent 4b3f7034b2
commit d4135d608e
67 changed files with 498 additions and 505 deletions

View File

@@ -37,24 +37,24 @@ namespace OpenRA.Server
var status = cache[map];
var failed = false;
Action<string> onLintFailure = message =>
void OnLintFailure(string message)
{
Log.Write("server", "Map {0} failed lint with error: {1}", map.Title, message);
failed = true;
};
}
Action<string> onLintWarning = _ => { };
void OnLintWarning(string _) { }
foreach (var customMapPassType in modData.ObjectCreator.GetTypesImplementing<ILintServerMapPass>())
{
try
{
var customMapPass = (ILintServerMapPass)modData.ObjectCreator.CreateBasic(customMapPassType);
customMapPass.Run(onLintFailure, onLintWarning, modData, map, rules);
customMapPass.Run(OnLintFailure, OnLintWarning, modData, map, rules);
}
catch (Exception e)
{
onLintFailure(e.ToString());
OnLintFailure(e.ToString());
}
}

View File

@@ -541,7 +541,7 @@ namespace OpenRA.Server
return;
}
Action completeConnection = () =>
void CompleteConnection()
{
lock (LobbyInfo)
{
@@ -602,13 +602,13 @@ namespace OpenRA.Server
else if (Map.Players.Players.Where(p => p.Value.Playable).All(p => !p.Value.AllowBots))
SendLocalizedMessageTo(newConn, BotsDisabled);
}
};
}
if (Type == ServerType.Local)
{
// Local servers can only be joined by the local client, so we can trust their identity without validation
client.Fingerprint = handshake.Fingerprint;
completeConnection();
CompleteConnection();
}
else if (!string.IsNullOrEmpty(handshake.Fingerprint) && !string.IsNullOrEmpty(handshake.AuthSignature))
{
@@ -678,7 +678,7 @@ namespace OpenRA.Server
DropClient(newConn);
}
else
completeConnection();
CompleteConnection();
}));
});
}
@@ -691,7 +691,7 @@ namespace OpenRA.Server
DropClient(newConn);
}
else
completeConnection();
CompleteConnection();
}
}
catch (Exception ex)