Skip to main content

Web Apps and APIs

Portal​

The portal (port 8082) uses ASP.NET Core Identity with cookies. Its look is a moonlit parchment theme (wwwroot/css/night.css). Its pages:

pagewhat it is
/home: the three steps in, the features list (what is built, with screenshots where there are any) and a short "coming later" list
/QuickStartfour steps from a key to the game world, and what to do if you can't sign in
/GuideFirst bow: from empty hands to a bow and arrows — ask Anyxa for an axe, sell firewood, buy tools, train Carpentry to 10, make the bow and arrows
/Characterslist and delete characters (they are made in the game client)
/Playa play token for test tools; not linked from the site, since the client signs in with email and password
/Account/Registercreate an account; needs a registration key, typed in or carried by the link as ?key=
/Account/Login, /Account/Logoutsign in and out

The screenshots are taken by the client's --shots mode (Testing with Bots).

API endpoints​

MethodPathAuthDescription
GET/api/account/mecookieCurrent user profile and characters
GET/api/account/characterscookieUser's characters
POST/api/account/playtokencookieIssue JWT for a character
POST/api/gameauth/tokenemail and passwordIssue JWT from the game's login screen
POST/api/telemetrysink keyReceive a telemetry capture (Deployment)
GET/healthnoneHealth check

Play token response:

{
"token": "<jwt>",
"host": "127.0.0.1",
"port": 7777
}

Configuration​

Important environment variables:

  • ConnectionStrings__Default
  • Jwt__Secret
  • Jwt__Issuer
  • Jwt__Audience
  • GameServer__Host
  • GameServer__Port
  • Seed__AdminEmail
  • Seed__AdminPassword: in Production both apps refuse to start while this is unset or still the default, so set ADMIN_PASSWORD in .env
  • DataProtection__KeysPath: a folder that outlives the container, for the keys that sign cookies. Compose sets it to a named volume, so a redeploy does not sign everyone out
  • RateLimits__Login, RateLimits__Register, RateLimits__GameAuth: tries one address gets (10 a minute, 20 in ten minutes, 120 a minute). Raise RateLimits__GameAuth for a load test that signs in more clients than that from one machine
  • Portal__PublicUrl (admin only): the portal's address, for the register links on the Registration keys page

Sign-in protection​

  • Ten wrong passwords in a row lock an account for five minutes, on the portal, the admin and the game client's sign-in alike. A right password clears the count, and an admin password reset clears a lock.
  • Sign-in and register tries are limited per address (above). Over the limit the answer is HTTP 429.
  • A banned account is refused on the portal and by /api/gameauth/* (HTTP 403 with the reason to show), as well as by the game server.
  • Both apps read X-Forwarded-For and X-Forwarded-Proto from a proxy on a private address (Caddy), so the limits count the visitor's own address and the sign-in cookie is marked Secure over https.

Admin panel​

The admin app shares the same database and Identity configuration. Admin pages require the Admin role. For how to use it, see Using the Admin Panel.

Features:

  • dashboard with server heartbeat and counts
  • player search and ban
  • server controls:
    • broadcast
    • kick
    • state change
    • graceful shutdown request
  • audit log view
  • content pages for items, materials, node types, placed nodes (with Respawn all nodes), recipes, skills, creatures, creature kinds, spawners, quests, calendar events and NPCs; see GM Tools for the full list and how edits reach the game server
  • the NPC editor at /Npcs: services, a conversation map, relationship rules and per-player standings (NPCs and the Economy)
  • a character page at /Players/Character, which shows and sets a character's hidden karma