Referencia
Esta página se muestra en inglés.
friends
A game's lobby lists the viewer's Play Strawberry friends who are playing this game, and joins one.
Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.
WIT declarations
use uuid.{uuid};
use player.{player};
use server.{friend-status};
use player-data.{value};
record data-key {
namespace: string,
key: string,
}
record friend-here {
id: uuid,
name: string,
status: friend-status,
can-join: bool,
server: string,
session: option<string>,
data: list<option<value>>,
}
resource friends-job {
poll: func() -> option<result<list<friend-here>, string>>;
}
enum join-refusal {
no-permission,
not-verified,
friend-unavailable,
full,
maintenance,
server-unavailable,
paid-access-required,
party-elsewhere,
busy,
bedrock,
other-protocol,
not-admitted,
no-answer,
}
resource join-job {
poll: func() -> option<result<_, join-refusal>>;
}
friends-here: func(viewer: borrow<player>, reads: list<data-key>) -> friends-job;
join-friend: func(viewer: borrow<player>, friend: uuid) -> join-job;