StreamSyncedMeta
@vimp-mp/types 2.0.1Interface · Server API
Metadata replicated with an entity to clients that currently stream it. Values are JSON-serialized on write and parsed back on read, so stored values must round-trip through JSON.stringify.
Updates fan out only to players currently streaming this entity (server uses the same per-type visibility manager that drives StreamIn/Out). When the entity is destroyed all keys are dropped automatically.
interface StreamSyncedMetaMembers
deleteStreamSyncedMeta
deleteStreamSyncedMeta(key: string): voidDeletes key and propagates the removal to streaming clients.
getStreamSyncedMeta
getStreamSyncedMeta<T = unknown>(key: string): T | undefinedReturns undefined if the key is unset.
getStreamSyncedMetaKeys
getStreamSyncedMetaKeys(): Array<string>Returns all stream-synced metadata keys stored on the entity.
hasStreamSyncedMeta
hasStreamSyncedMeta(key: string): booleanReturns whether the entity has a value for key.
setStreamSyncedMeta
setStreamSyncedMeta(key: string, value: unknown): voidSet or replace one key. The value is forwarded to every player currently streaming this entity, plus included in the snapshot for any future stream-in. Use deleteStreamSyncedMeta rather than undefined when the key must be removed.