Repository navigation
Pairing a Player
Every connection is encrypted, and a server has to pair with the player before it may play on it. Pairing is done once per server: the player remembers it in its state file, and from then on that server just connects and plays.
There are two ways to pair. Both work from a terminal on the player's own host, and both end the same way:
$ sendspin-cli status | grep -E '^(trust|paired|pairing)'
trust: paired
paired servers: 1
pairing: nonetrust is about the server connected right now; paired servers counts the servers this
player holds a pairing for, connected or not. An unpaired server drops out of it.
last pairing says how the most recent attempt ended, and is none until one has:
paired with <server id>, failed with <server id> -- <reason>, or
abandoned by <server id>. It stays until the next attempt, so it answers "did that work?"
after the code is gone.
| Method | You carry to the server | Player setup | Use it when |
|---|---|---|---|
| Dynamic code | 6 digits, fresh each attempt | none | you can read the player's log or run status while pairing. This is the default |
| Static code | 8 digits you chose | pairing-code |
you want a code written down ahead of time, e.g. on a label |
Where a step says "in the server", it means the server's own screen for adding or pairing a player; the wording differs from server to server. To pair from a script or another system instead, see the pairing token.
The player makes up a 6-digit code for each attempt and shows it to you; you type it into the server.
-
In the server, choose this player and ask to pair with a code.
-
Read the code on the player's host, from the log or from
status:I cli: *** Pairing code: 211030 *** -- type it into the server to pair$ sendspin-cli status | grep pairing pairing: in progress with ZWOKuw7JVK2W… pairing code: 211030
-
Type it into the server.
The easiest way to read the code is the TUI. With
sendspin-cli tui open on the player's host, the code takes over the screen in large digits
the moment you start pairing, and the outcome follows it.
The code is withdrawn when the attempt ends, whichever way it ends. After repeated wrong
codes the player holds further attempts back until you run sendspin-cli pair confirm (see
the pairing window).
A code you choose once, for a player you cannot easily read a fresh code from.
-
Pick 8 random digits and give them to the player, in the config file:
pairing-code = 48151623--pairing-code 48151623works too, but a flag is visible to every local user inps. Anything that is not exactly 8 digits stops the player at startup. Restart the player after changing it. -
In the server, choose this player, ask to pair with its static code and type the 8 digits.
-
The player now waits for you to allow it:
I cli: A server is waiting to pair -- run 'sendspin-cli pair confirm' to let it, or 'sendspin-cli pair cancel' to refuse$ sendspin-cli pair confirm
A static code never changes, so every attempt with it needs that pair confirm: the code
alone does not let a server in. A player with a static code offers it instead of the
dynamic code.
pair confirm is this player's stand-in for pressing a button on a device. It answers the
attempt that is waiting, and then keeps a pairing window open for 5 minutes, during
which that server may retry without another confirm. The window closes early when a pairing
succeeds, when the connection drops, or after five failed attempts.
$ sendspin-cli status | grep pairing
pairing: in progress with YkOLFE2fZeml…
pairing window: open -- run 'sendspin-cli pair confirm' to let the server pair, or 'sendspin-cli pair cancel' to refuse itsendspin-cli pair cancel refuses a waiting attempt and closes the window. The
pairing window line is only there while an attempt is waiting on you.
A failed attempt is logged with its reason:
W cli: Pairing with server wn_sX1iDNhQ… failed: the pairing code did not match
-
sendspin-cli statussays nothing is listening — the player is not running, or it runs on another--port; see Finding the socket. - The player forgets its pairings on every restart — it has no state directory. See Running as a Service.
To let any server play without pairing at all, see
--allow-unpaired. The Linux and Windows
get-started scripts turn it on unless you answer no.
Get it running
Use it
- Configuration
- Pairing a Player
- Controlling the Player
- Using the TUI
- Running as a Service
- Advanced Usage
When it misbehaves