Başvuru
Bu sayfa İngilizce gösteriliyor.
sub-servers
The other servers of a server's group, and moving a player to one.
Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.
WIT declarations
use uuid.{uuid};
use connection-check.{checked-connection};
use event.{extension-event};
record bedrock-handoff {
%from: string,
data: list<u8>,
}
enum role {
main,
sub,
}
enum state {
stopped,
starting,
running,
stopping,
crashed,
}
record server-info {
id: string,
name: string,
role: role,
state: state,
players: u32,
max-players: u32,
}
record sub-server-spec {
name: string,
template: option<string>,
plugins: option<list<string>>,
max-players: option<u32>,
}
enum refusal {
no-permission,
no-place,
unknown-server,
not-running,
full,
offline,
bedrock,
other-protocol,
not-admitted,
too-much-data,
busy,
no-answer,
}
resource move-job {
poll: func() -> option<result<list<uuid>, refusal>>;
}
resource server-job {
poll: func() -> option<result<server-info, refusal>>;
}
this-server: func() -> server-info;
%list: func() -> list<server-info>;
move-players: func(players: list<uuid>, to: option<string>, data: option<list<u8>>) -> move-job;
create-server: func(spec: sub-server-spec) -> server-job;
start-server: func(id: string) -> server-job;
stop-server: func(id: string) -> server-job;
places: func() -> tuple<u32, u32>;
arrival: func(event: borrow<extension-event>) -> option<tuple<uuid, string, option<list<u8>>>>;
checked-bedrock-handoff: func(connection: borrow<checked-connection>) -> option<bedrock-handoff>;
move-failure: func(event: borrow<extension-event>) -> option<tuple<uuid, refusal>>;
state-change: func(event: borrow<extension-event>) -> option<server-info>;