Repository navigation
Owners account
The account owner: who may play and who is playing. It holds game tokens, session keys, the sessions in the world, and the suspensions changed while the server runs. How it fits the server is on Owners.
The account owner never reads the database itself: sign-on hands it an account's credentials as they were read at login. A login then passes it twice.
- Once sign-on proves the password, the owner issues a game token. Each account has one live token at a time, so a new one replaces the last.
- The login connection redeems it. The token is used up whether or not the redeem succeeds, and it's refused when it's unknown or expired, when the account name differs (ignoring case), or when the account is suspended. On success the owner makes a session key of 16 random bytes and an echo value, both with the token's lifetime.
- The world connection redeems the session key. The echo and the account name have to match, and a suspension stored since the key was issued still applies.
A second login replaces the first. The earlier session is kicked and disconnected, and the new one takes its place. A session that closes takes the account offline only if it's still the current one.
Admin changes arrive from the command layer: creating an account, and suspending or lifting a suspension. Each one goes to the write-behind queue, and its answer waits for the commit.
| Change | Rule |
|---|---|
| A new suspension | Combines with what's already in force: the later end wins, and an indefinite one beats any end |
| A lift | The only change that sets aside the suspension the account's credentials carried |
| A suspension that applies now | Kicks the account's session at once |
- Every login refusal sends the client's general result, and a kick sends reason 0, until the numbered ones are verified.
- An expired token stays counted until the next token is issued or redeemed.
| Piece | Path |
|---|---|
| The account owner | Source/NexusTomorrow.Owners/Account/ |
| Tests | Tests/NexusTomorrow.Owners.Tests/ |
Start here
How the server works
- Server core design
- Host
- Gateway
- Owners
- Persistence
- Command layer
- Harness
- Map scheduler design
- Timer wheel design
The protocol
Working on it