Who a browser player is: login against the server's Drafter.Accounts, the signed
token a page hands its socket, and the sound levels kept in the account.
The accounts server is ExPilot.Accounts, as ExPilot.Server.start/1 names it.
Summary
Functions
What Cauldron2D.Net.Socket asks of the connect params: the token's pilot and their sound levels for the kind of client.
The kind of client a connect or join param names: "touch" is :touch, anything else :web.
The account's sound levels for a kind of client (:web unless given), %{sfx: level, music: level}, with the defaults where unset.
Check a name and password; {:ok, username} in the account's spelling.
The name the account plays under: its nickname, else its username.
The on_mount hook of the player's pages: the session's username, or back to the login.
Keep the account's sound levels for a kind of client, alongside whatever else that kind's settings hold.
Keep the account's nickname; blank means none. {:error, :taken} when another account plays under it.
Create an account; {:ok, username} or {:error, reason} as Drafter.Accounts.register/4 gives it.
A token naming username, good for a day.
The username a token names.
Functions
What Cauldron2D.Net.Socket asks of the connect params: the token's pilot and their sound levels for the kind of client.
@spec kind(term()) :: :web | :touch
The kind of client a connect or join param names: "touch" is :touch, anything else :web.
The account's sound levels for a kind of client (:web unless given), %{sfx: level, music: level}, with the defaults where unset.
Check a name and password; {:ok, username} in the account's spelling.
The name the account plays under: its nickname, else its username.
The on_mount hook of the player's pages: the session's username, or back to the login.
Keep the account's sound levels for a kind of client, alongside whatever else that kind's settings hold.
Keep the account's nickname; blank means none. {:error, :taken} when another account plays under it.
Create an account; {:ok, username} or {:error, reason} as Drafter.Accounts.register/4 gives it.
A token naming username, good for a day.
The username a token names.