Rework MapPreview custom rule handling.
The previous asynchronous approach did not work particularly well, leading to large janks when switching to custom maps or opening the mission browser. This commit introduces two key changes: * Rule loading for WorldActorInfo and PlayerActorInfo is made synchronous, in preparation for the next commit which will significantly optimize this path. * The full ruleset loading, which is required for map validation, is moved to the server-side and managed by a new ServerMapStatusCache. The previous syntax check is expanded to include the ability to run lint tests.
This commit is contained in:
@@ -15,6 +15,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Server;
|
||||
|
||||
namespace OpenRA.Network
|
||||
{
|
||||
@@ -218,10 +219,21 @@ namespace OpenRA.Network
|
||||
public bool IsEnabled => Value == "True";
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum MapStatus
|
||||
{
|
||||
Unknown = 0,
|
||||
Validating = 1,
|
||||
Playable = 2,
|
||||
Incompatible = 4,
|
||||
UnsafeCustomRules = 8,
|
||||
}
|
||||
|
||||
public class Global
|
||||
{
|
||||
public string ServerName;
|
||||
public string Map;
|
||||
public MapStatus MapStatus;
|
||||
public int RandomSeed = 0;
|
||||
public bool AllowSpectators = true;
|
||||
public string GameUid;
|
||||
|
||||
Reference in New Issue
Block a user