Docs/Monitor.md

Monitor

Apps/Monitor, Blazor Server (interactive server render mode), http://localhost:8091. Cookie login with AdminPassword (ADMIN_PASSWORD in .env, default admin on a developer's machine only: refused with NOF_PRODUCTION), compared in constant time; 5 wrong passwords lock the login 5 minutes.

ClusterMonitor polls GET /api/state on the Orchestrator every second and every open page re-renders; actions go through OrchestratorAdmin with the X-Admin-Key header.

Page Content
Overview players, gateways, game servers, cells, mobs, messages/s; 5-minute charts of players, average tick, messages/s and game servers
Servers gateways and game servers with state, addresses, players, cells, mobs, tick, messages/s, memory, clock (how far its clock is from the Orchestrator's: the world time, see Architecture.md; orange over 50 ms: check NTP on its machine), last heartbeat, version, provider; + Gateway, + Game server, Remove (drain then stop); under them the last 24 h of each game server (tick, players, mobs, memory, a point every 5 min: GET /telemetry/metrics)
World map of the cells coloured by owner, players as dots, spawn circled; click a cell, pick a game server, Assign
Social The players' social life. Now: the players in the game, how many have their microphone off or the voices off (and who), the parties (each with its mode and members, ★ the leader, grey: not in the game; GET /api/parties on the Orchestrator, from Redis). Over a period (1 h, 24 h, 7 days, 30 days): each social kind (friend requests sent, accepted, refused or ended; party invitations, accepted, refused, left, put out, lead given, mode changed, joins; blocks, unblocks, reports; microphones and voices switched off and on) with how many times, by and towards how many players; the share of friend requests and invitations accepted, of joins done; the players most blocked and most reported; the last 300 social events (who, towards whom, value, detail, where), with a filter by player (GET /telemetry/social, see Social in Telemetry.md)
Reports The players' reports (the game's Players tab, see Players tab in Architecture.md): newest first, Open (not handled yet) or All, a filter by player; each with when, who was reported (character, account), by whom, the reason, the text, where the reporter stood, and Handled / Reopen (GET /db/reports, POST /db/reports/{id}/handled on the DbWorker)
Feedback The players' feedback (a picture of their view, a sentence, where they are; see Feedback.md): newest first, Open (not handled yet) or All, a filter by player, text or build; each with its number, when, the picture as a thumbnail (a click opens it full size, GET /feedback-image/{id} on the Monitor, signed in only), the text, the character and account, the build and profile, VR or desktop, the position (x, y, z) and where they looked, the context, and Handled / Reopen (GET /db/feedback, GET /db/feedback/{id}/image, POST /db/feedback/{id}/handled on the DbWorker)
Players every character, online or not (the list comes from the DbWorker, GET /db/players, most recently saved first, re-read every 10 s; the live state from the Orchestrator): online / last seen, name, account, its kind (player, or test / bot: made with the admin key, hidden from the players, see Test and bot accounts in Security.md), level, HP, gold, position, cell, gateway, game server; filters All / Online / Offline and a search by character or account name; Grant DEV / Revoke DEV (the account's DEV role: developer commands of the DEV tab, from the player's next login), Grant Bot / Revoke Bot (the Bot role: the developer moves and commands without the admin ones nor the DEV tab, a [bot] tag over its name; see Roles in Security.md), Kick (online players). Above them, Send to all: a message to every player online (up to 300 characters) with a countdown in minutes (0: none), a panel to read in the game (POST /api/announce on the Orchestrator, AnnounceRequest; each Gateway gets it with its next heartbeat and also gives it to whoever logs in before its end). The 300 most recently seen are listed: search to find the others
Arena the test arena's fights (from the Telemetry service, ClickHouse: GET /telemetry/arena/fights, the last 500; the fights flagged DEV, where dev locomotion or mob aggro off was used, are listed but left out of the numbers): by level gap (mob level − player level) the fights, the share won, the mean time of a win, the mean health lost, how many in a group; then each fight (player, level, weapons, armour, mobs, particularities, result, time, health lost, players, special attacks)
Loot what the players get from the mobs, kept for good (see Loot history in Telemetry.md): by item (species, rank, band of 10 levels): dropped, taken, lost, the share taken, the mean wait; then who got what (when, player, drop / take / lost, the item, from which mob, gold, wait); filters: period (24 h to all), player
Settings what the players choose in Options (GET /telemetry/settings, see Settings in Telemetry.md): for each setting, how many players, the share not on the default (sorted by it), the mean, the values in use with their players; filters: period, VR or desktop
Flights the players' glides (VR; GET /telemetry/flights, see Glides in Telemetry.md): the list (when, player, time, distance, heights, top speed, energy lost gliding / diving / climbing / braking, finesse: metres ahead per metre of energy, how it ended; filters: period, player); a click shows one: its numbers, the energy lost by what the hands did (time, metres, per second, share), its curves over time (height and energy, speed, the hands' and the path's pitch, the airbrake) and its track seen from above
Balance every mob's fight against the targets of Config/balance.json (GET /telemetry/fights/groups, see Balance targets in Telemetry.md): by rarity and level gap band, each value green within its target, red outside; by exact gap, species, particularity, player (the bots: their behaviour); the accuracy (the shots that hit over the shots fired), the charge (each shot's power over a full charge's) and the tempo (the full charge time over the time between a hand's shots) of the solo fights next to each, to keep balance.json's reference hitRate, power and tempo true; the last 50 fights (with the blasters held and the armour worn). Filters: period, world / arena / arena bots (BotClient --arena), alone only, with DEV tools
Events the game events (GET /telemetry/events, see Telemetry.md): filters by type (Special attacks, Deaths, Kills, Level ups), period (1 h to 30 days) and player; a table by type and species (count, mean mob level, mean value), a table per quest (GET /telemetry/quests/summary: taken, completed, handed in, abandoned, mean minutes to complete and to hand in, from the quest_* events), then the last 500 (when, player, mob, particularities, detail, value, position, server); Quests handed in filters those

Live pages: Blazor Server already keeps a WebSocket (SignalR) between each open browser and the Monitor, and sends the page's changes over it; no SSE or socket of our own. Pages fed by the Orchestrator re-render at each poll (every second); those fed by the Telemetry service re-read it while open (LiveRefresh: Events every 5 s, Arena and Flights every 10 s, Balance every 30 s, the Servers page's 24 h curves every 30 s), show when they last did (a green dot, red when the service does not answer) and can be paused. A closed page stops reading.

TelemetryReader reads the Telemetry service (Telemetry__Url, the worker key of DbWorker__Key); when it does not answer, those pages say so and the others work.

Starting instances needs a provider that can start them (Process or Docker); with Manual the buttons answer with an explanation.

The pages need _framework/blazor.web.js. It comes from a package the .NET SDK adds only when it sees .razor files at restore time, but the Docker build restores with the .csproj alone: Monitor.csproj sets RequiresAspNetWebAssets. Without it the image answers 404 for that file and the buttons do nothing.