Skip to content

IMetadata

Interface · Namespace OMX.ModAPI · Assembly OMX.ModAPI.Shared.dll

public interface IMetadata

An entity’s key/value metadata as one resource sees it. Every resource can read every qualified key; a resource writes only its own namespace. Own keys may be written as either name or modid:name; the host adds the namespace to short names.

MetadataScope.Local is this side’s own table and changes immediately. The replicated scopes belong to the authority: a server resource writes them on any entity; a client resource may only ask for a change on its own player or vehicle, and the change appears (and IMetadata.Changed fires) once the authority has accepted it.

Extension methods: TypedMetadata.Get, TypedMetadata.Set, TypedMetadata.Remove

IEventSource<MetadataChange> Changed { get; }
EntityId Entity { get; }
NetworkValue? Get(string key, MetadataScope scope = MetadataScope.Local);

Parameters

Returns NetworkValue?

string[] Keys(MetadataScope scope = MetadataScope.Local);

Parameters

Returns string[]

void Remove(string key, MetadataScope scope = MetadataScope.Local);

Parameters

void Set(string key, NetworkValue value, MetadataScope scope = MetadataScope.Local);

Parameters