public static class NetworkRulesContentFills a NetworkRulesRegistry out of Assets, by label.
Remarks
The half Load was written for and nothing supplied. A .vxnetrules is imported, written into a bundle and addressed — and then, until this existed, the only way into the registry was a hand-written Load(name, rules) per file on every peer. NetworkPrefabContent makes exactly this argument about prefabs one question over: a list written twice is a list that drifts, and the drift is silent.
⚠ Silent in a particular way here, and worse than for a prefab. A prefab the client never registered is a spawn it drops, which shows. A policy the server never loaded leaves every node naming it on Default — server-authoritative, so nothing unsafe happens — and the symptom is a game rule that does not work: a weapon nobody can pick up, with a policy file in the project that reads exactly right. NetworkSpawner.UnresolvedRules is the counter that catches it after the fact; this is what stops it happening.
Nothing about the registry is sent, and it does not have to be. A policy is keyed by the name it calls itself and named by NetworkRulesReference on authored content, so a server and a client that read the same build agree without a handshake — the same property NetworkPrefabContent relies on, for the same reason. In practice only a server asks the questions, but a listen server is both ends of one process and a client that predicts ownership reads the same policy.
Fields and properties (1)
public const string LabelThe label a content build puts on the group its policies live in.
Methods (3)
public static ValueTask<NetworkRulesLoad> LoadAsync(NetworkRulesRegistry registry, AssetManager assets, CancellationToken cancellation = default(CancellationToken))Loads every policy under Label.
public static ValueTask<NetworkRulesLoad> LoadAsync(NetworkRulesRegistry registry, AssetManager assets, IEnumerable<string> labels, CancellationToken cancellation = default(CancellationToken))Loads every policy under some labels.
public static ValueTask<NetworkRulesLoad> LoadFromAsync(NetworkRulesRegistry registry, AssetManager assets, IEnumerable<string> addresses, CancellationToken cancellation = default(CancellationToken))Loads a named set of addresses.
Used by (1)
- NetworkRulesContentTestsVixen.Net.Engine.Content.Tests