public sealed class NetworkRulesRegistryWhich rules apply to which object.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One default and a per-object override, which is the shape the policy takes at run time. The authoring shape is a .vxnetrules asset referenced by a prefab — a NetworkRulesAsset, imported into the content build and named on a prefab node by NetworkRulesReference, both in Vixen.Net.Engine because they need the engine's generators.
⚠ Which is why there are two tables here and not one. The by-object table is a NetworkId, allocated when something spawns; a named one is an asset, loaded before anything has spawned at all. A registry with only the first would have nowhere to put a policy file until the moment it was already too late to apply it.
The registry is also the only place that knows both the rules and the ownership, which is why the questions live here rather than on NetworkRules: a rule about the owner is not a question a policy can answer on its own.
Fields and properties (3)
public NetworkRules DefaultWhat applies to an object that has not been given anything more specific.
public int OverrideCountHow many objects have rules of their own.
public int NamedCountHow many policy files have been loaded.
Methods (12)
public NetworkRulesRegistry(NetworkOwnership ownership)Creates a registry over an ownership table.
public void Set(NetworkId id, NetworkRules rules)Gives one object its own rules.
public void Load(string name, NetworkRules rules)Loads a policy file under the name a prefab refers to it by.
public bool TryGetNamed(string name, out NetworkRules? rules)The policy loaded under a name, if one was.
public bool Clear(NetworkId id)Puts an object back on the default rules.
public NetworkRules For(NetworkId id)The rules that apply to an object.
public bool MayCallServerRpc(NetworkId id, PlayerId requester, bool requiresOwnership)Whether a client may invoke a server call on an object.
public bool MayChangeOwner(NetworkId id, PlayerId requester)Whether a client may hand an object to somebody else.
public bool MaySpawn(NetworkId id, PlayerId requester)Whether a client may ask the server to create one of these.
public bool MayDespawn(NetworkId id, PlayerId requester)Whether a client may ask the server to destroy an object.
public bool MayWrite(NetworkId id, PlayerId requester)Whether a client may write an object's replicated state.
public int OnOwnerLeft(PlayerId player, List<DisconnectAction> actions)Works out what should happen to everything a departing player owned, and does the part of it that is ownership's to do.
Used by (20)
- NetworkAnimatorApplySystemVixen.Net.Animation
- NetworkAnimatorCaptureSystemVixen.Net.Animation
- NetworkAnimatorTestsVixen.Net.Animation.Tests
- NetworkAudioApplySystemVixen.Net.Audio
- NetworkAudioCaptureSystemVixen.Net.Audio
- NetworkAudioTestsVixen.Net.Audio.Tests
- NetworkBonesApplySystemVixen.Net.Animation
- NetworkBonesCaptureSystemVixen.Net.Animation
- NetworkDisconnectTestsVixen.Net.Engine.Tests
- NetworkRigidBodyCaptureSystemVixen.Net.Physics
- NetworkRigidBodyCorrectionSystemVixen.Net.Physics
- NetworkRigidBodyTestsVixen.Net.Physics.Tests
- NetworkRulesContentVixen.Net.Engine.Content
- NetworkRulesContentTestsVixen.Net.Engine.Content.Tests
- NetworkRulesReferenceTestsVixen.Net.Engine.Tests
- NetworkRulesTestsVixen.Net.Tests
- NetworkSpawnerVixen.Net.Engine
- PredictedOwnershipSystemVixen.Net
- PredictionWiringTestsVixen.Net.Tests
- RpcRouterVixen.Net