Skip to content

Link online players to their network traffic - #916

Open
sven-n wants to merge 1 commit into
masterfrom
claude/network-analyzer-deeplinks
Open

Link online players to their network traffic#916
sven-n wants to merge 1 commit into
masterfrom
claude/network-analyzer-deeplinks

Conversation

@sven-n

@sven-n sven-n commented Aug 29, 2026

Copy link
Copy Markdown
Member

Phase 4 of #895. The analyzer page can now be opened for a specific player, from the list of the online accounts and from the player list of the live map.

A route instead of a resolved id

The plan had the linking page resolve the connection id through IPacketCaptureService.Find(serverId, name) and link to network-analyzer/{id}. The analyzer page got a second route which takes the name instead:

/network-analyzer/player/{ServerId:int}/{PlayerName}

The lookup happens when the link is opened, not while the list is rendered, so a link can't go stale in a list which is a few seconds old — and the account list is a paged DataTable which doesn't refresh on its own at all. When the player is gone by the time the link is used, the page says so instead of showing an empty grid:

The requested connection isn't available (anymore). Please select one of the listed connections.

The note disappears as soon as a connection is selected in the sidebar.

PlayerName is matched against the character and the account name (that's what FindConnectionAsync(serverId, name) from phase 2 does), so the account name from the online list and the character name from the map both work.

The two links

  • LoggedIn.razor — a button next to Disconnect for each online account. The offline/AFK-trade players in the second table have no connection, so they don't get one (decision 1 of the issue).
  • MapPlayerList.razor — a button in the row of each player, next to Disconnect and Ban.

Both are only rendered when the analyzer is actually there: the admin panel page asks the service provider for an IPacketCaptureService, exactly like the menu entry does.

The Map project stays independent of the admin panel. It gets no reference to the analyzer: the route arrives as a cascading value from the hosting page — the same mechanism LiveMapRoute already uses — and without one no button is rendered. That's what happens in Dapr/GameServer.Host, which renders the map but has no analyzer page to link to.

Tests

5 new tests in MUnique.OpenMU.Web.Tests:

  • the connection of a player is captured when the page is opened through the deep link;
  • the note is shown when the named player isn't connected (and nothing is captured);
  • the note disappears when another connection is selected;
  • an online account is rendered with a link to network-analyzer/player/3/Test%20Account;
  • no link is rendered when the capture service isn't registered.

There is no component test for the map's button: a MapPlayerList row needs a Player with a selected character, which can only be reached through the real character selection — that's more test scaffolding than the markup is worth. The page-side of the same mechanism is covered by the two link tests above.

Verification

  • dotnet build src/MUnique.OpenMU.sln -p:ci=true → 0 errors, no warning from a file this PR touches.
  • Complete test suite: 0 failures (MUnique.OpenMU.Tests 802, Web.Tests 68, PlugIns.Tests 41, Persistence.Initialization.Tests 12/2 skipped, Network.Tests green).
  • No manual run against a live server — that's yours, as agreed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Pb82LmoaUVdZtBtQs7xrtA


Generated by Claude Code

The analyzer page can now be opened for a player, from the list of the
online accounts and from the player list of the live map.

Instead of resolving the connection id in the page which offers the link,
the analyzer page got a route which takes the server and the name:

  /network-analyzer/player/{ServerId:int}/{PlayerName}

The lookup then happens when the link is opened, so a link doesn't get
stale while the page which shows it is open. When the player is gone by
then, the page says so instead of silently showing nothing.

The map keeps its independence from the admin panel: the route is passed
down as a cascading value, just like the route of the live map itself, and
without one the button simply isn't rendered - which is what happens in the
game server host of the distributed deployment, where there is no analyzer
page to link to.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pb82LmoaUVdZtBtQs7xrtA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants