feat(dashboard): Network summary has each server's port and machine

The dashboard keeps master's server list endpoints and joins them into the
Network summary: its listening port and its machine as a token, since the
summary goes to every open page. The connection list maps the tokens to
addresses for viewers with network_ips. The dashboard reports its web port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-30 02:13:41 -05:00
parent a93f5f810b
commit b0819df5b6
6 changed files with 124 additions and 15 deletions

View File

@@ -94,6 +94,7 @@
#include "WorldView.h"
#include "PrometheusMetrics.h"
#include "Traffic.h"
#include "TrafficHistory.h"
#include "master/ServerTraffic.h"
#include "master/Profiling.h"
#include "Performance.h"
@@ -135,6 +136,7 @@ namespace ServerState {
uint32_t g_UgcPid{};
std::vector<WorldInstanceInfo> g_WorldInstances{};
std::vector<WorldInstanceInfo> g_PendingWorlds{};
std::map<std::string, ServerEndpoint> g_Endpoints{};
std::mutex g_StatusMutex{};
}
@@ -238,6 +240,12 @@ namespace {
}
}
ServerState::g_Endpoints.clear();
for (const auto& endpoint : list.endpoints) {
const auto key = TrafficHistory::KeyFor(static_cast<uint16_t>(endpoint.type), endpoint.zoneID, endpoint.instanceID);
ServerState::g_Endpoints[key] = { endpoint.ip.string, endpoint.port, endpoint.host.string };
}
LOG_DEBUG("Received server list: auth=%s chat=%s ugc=%s worlds=%u",
list.authOnline ? "online" : "offline",
list.chatOnline ? "online" : "offline",
@@ -451,6 +459,8 @@ int main(int argc, char** argv) {
&Game::lastSignal,
masterPassword
);
// Master (and the Network page) show the port browsers use
g_Server->SetAdvertisedPort(ourPort);
Game::server = g_Server;
// What the worker threads read from the CDClient and the settings, read now on this thread: workers never query