Skip to content

StreamSyncedMeta

@vimp-mp/types 2.0.1

Interface · 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.

ts
interface StreamSyncedMeta

Members

deleteStreamSyncedMeta

ts
deleteStreamSyncedMeta(key: string): void

Deletes key and propagates the removal to streaming clients.

getStreamSyncedMeta

ts
getStreamSyncedMeta<T = unknown>(key: string): T | undefined

Returns undefined if the key is unset.

getStreamSyncedMetaKeys

ts
getStreamSyncedMetaKeys(): Array<string>

Returns all stream-synced metadata keys stored on the entity.

hasStreamSyncedMeta

ts
hasStreamSyncedMeta(key: string): boolean

Returns whether the entity has a value for key.

setStreamSyncedMeta

ts
setStreamSyncedMeta(key: string, value: unknown): void

Set 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.

VIMP developer documentation