Play Strawberry Docs
Referencia

Esta página se muestra en inglés.

values

The value bus: short texts a script publishes that any script reads or watches.

Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.

WIT declarations

text
use uuid.{uuid};
use event.{extension-event};

variant value-scope {
    all,
    player(uuid),
}

enum value-error {
    bad-key,
    value-too-long,
    too-many-keys,
    player-offline,
    reserved-namespace,
    bad-publisher,
    too-many-watches,
}

record value-change {
    publisher: string,
    key: string,
    player: option<uuid>,
    value: option<string>,
}

publish: func(scope: value-scope, key: string, value: string) -> result<_, value-error>;
unpublish: func(scope: value-scope, key: string);
clear: func();
read: func(publisher: string, key: string, player: option<uuid>) -> option<string>;
watch: func(publisher: string, key: string) -> result<_, value-error>;
unwatch: func(publisher: string, key: string);
changes: func(event: borrow<extension-event>) -> list<value-change>;

En esta página