Play Strawberry Belgeler
Başvuru

Bu sayfa İngilizce gösteriliyor.

login-gate

The login gate's form before an unverified player joins the world (offline-mode servers).

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

How to use it: guide.

WIT declarations

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

record form-field {
    key: string,
    label: string,
    max-length: u32,
}

enum button-kind {
    submit,
    leave,
}

record form-button {
    id: string,
    label: string,
    kind: button-kind,
}

record form {
    title: string,
    body: list<string>,
    error: option<string>,
    fields: list<form-field>,
    buttons: list<form-button>,
}

variant gate-error {
    gone,
    busy,
    invalid-form(string),
    already-online,
    not-running,
}

resource pending-connection {
    id: func() -> u64;
    name: func() -> string;
    uuid: func() -> uuid;
    verification: func() -> verification;
    locale: func() -> string;
    address: func() -> option<string>;
    address-key: func() -> option<string>;
    show-form: func(form: form) -> result<_, gate-error>;
    clear-form: func() -> result<_, gate-error>;
    set-timeout: func(seconds: u32) -> result<u32, gate-error>;
    admit: func() -> result<_, gate-error>;
    refuse: func(message: string) -> result<_, gate-error>;
}

record form-response {
    button: string,
    values: list<tuple<string, string>>,
}

enum closed-reason {
    lost,
    left,
    timed-out,
    refused,
    malformed,
    unavailable,
}

record pre-join-closed {
    id: u64,
    name: string,
    uuid: uuid,
    reason: closed-reason,
}

connection: func(event: borrow<extension-event>) -> option<pending-connection>;
response: func(event: borrow<extension-event>) -> option<tuple<pending-connection, form-response>>;
closed: func(event: borrow<extension-event>) -> option<pre-join-closed>;

Bu sayfada