Interface SetPacket

Sent by the client to write data to the server's data storage, that data can then be shared across worlds or just saved for later. Values for keys in the data storage can be retrieved with a GetPacket, or monitored with a SetNotifyPacket.

Additional arguments sent in this package will also be added to the SetReplyPacket it triggers.

interface SetPacket {
    cmd: "Set";
    default: JSONSerializable;
    key: string;
    operations: DataStorageOperation[];
    want_reply: boolean;
    [p: string]: JSONSerializable;
}

Indexable

Properties

cmd

The default value to use in case the key has no value on the server.

key: string

The key to manipulate.

operations: DataStorageOperation[]

Operations to apply to the value, multiple operations can be present, and they will be executed in order of appearance. See DataStorageOperation for information on supported operations.

want_reply: boolean

If set, the server will send a SetReplyPacket back to the client.