arcadible.tickets
A ticket for one of your game's own servers: proof, signed by Arcadible, of the game, the build, and the player, which your server checks with the Server SDK. It's in the Arcadible SDK, the package and the hosted script alike. Your game's function needs none of this: functions.fetch carries the ticket for you.
interface Tickets {
get(server: string): Promise<string>;
}
Members
| Member | Description |
|---|---|
get(server) | A ticket for one of your game's servers |
get(server)
get(server: string): Promise<string>
A short-lived ticket for server, your server's address, as your game lists it in client.server_origins: any URL of it. Send it as your game connects, and never read it.
const ticket = await arcadible.tickets.get("https://api.example.com");
const res = await fetch("https://api.example.com/match", {
headers: { Authorization: `Bearer ${ticket}` },
});
- Send it in an
Authorizationheader, or a WebSocket's first message, never in a URL, where it would be logged. - Call it each time you need one. It gives the same ticket while that one is good, and a new one once it isn't, so a call is cheap.
- It's opaque: your game sends it as it came. What it says is your server's to check, with
tickets.check, and only Arcadible's signature makes it proof. - A ticket your server refused as
expiredis cured by a new one: callgetagain. - Fails with
invalidfor what isn't a server's address, or a server your game doesn't list;busyfor too many tickets in a short time;unavailablewhen one can't be had now, such as offline; andunsupportedoff Arcadible, or on a play page from before tickets.
Under arc serve
arc serve signs its own tickets, as channel local, and a server of yours checks them with the Server SDK pointed at it (the Server SDK under arc serve). A server on your own machine needs no listing, and arc serve prints the address that points your server at it once server_origins lists one.