Remove requirement for server to explicitly generate maps.

This commit is contained in:
Paul Chote
2026-01-03 14:12:39 +00:00
committed by Gustas Kažukauskas
parent 156122f9e3
commit ed1ebd536b
11 changed files with 141 additions and 70 deletions

View File

@@ -656,23 +656,8 @@ namespace OpenRA.Mods.Common.Server
}
var m = server.ModData.MapCache[s];
if (m.Status == MapStatus.Available || m.Status == MapStatus.DownloadAvailable)
if (m.Status is MapStatus.Available or MapStatus.DownloadAvailable or MapStatus.Generatable or MapStatus.Generating)
SelectMap(m);
else if (m.Class == MapClassification.Generated)
{
if (m.Status == MapStatus.Generating)
{
// Wait up to 5 seconds for the map to be generated
var stopwatch = Stopwatch.StartNew();
while (m.Status == MapStatus.Generating && stopwatch.ElapsedMilliseconds < 5000)
Thread.Sleep(100);
}
if (m.Status == MapStatus.Available)
SelectMap(m);
else
QueryFailed();
}
else if (server.Settings.QueryMapRepository)
{
server.SendFluentMessageTo(conn, SearchingMap);