feat(master): report the UGC server in the server list and wait for it on shutdown

The server list now carries whether master starts the UGC server, whether it
is connected and the pid it was started as. Settings reloads reach it like
auth and chat, and shutdown waits for it. The UGC server sends its totals and
storage with its traffic reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 09:23:16 -05:00
parent d835e18c92
commit 69803448bb
6 changed files with 54 additions and 5 deletions

View File

@@ -353,7 +353,16 @@ TEST(MasterPacketsTests, ServerListMatchesLegacy) {
entry.port = instance.port;
entry.isPrivate = instance.isPrivate ? 1 : 0;
}
EXPECT_PACKET_EQ(Written([&](RakNet::BitStream& b) { LegacyMaster::WriteServerList(b, true, count % 2, instances); }), StructPacket(response));
response.ugcEnabled = 1;
response.ugcOnline = count % 2;
response.ugcPid = 4242 + count;
// The legacy list, then the UGC server's state
EXPECT_PACKET_EQ(Written([&](RakNet::BitStream& b) {
LegacyMaster::WriteServerList(b, true, count % 2, instances);
b.Write<uint8_t>(1);
b.Write<uint8_t>(count % 2);
b.Write<uint32_t>(4242 + count);
}), StructPacket(response));
RakNet::BitStream stream; LoadPayload(stream, response);
const auto legacy = LegacyMaster::ReadServerList(stream);
@@ -365,6 +374,9 @@ TEST(MasterPacketsTests, ServerListMatchesLegacy) {
EXPECT_EQ(legacy.instances[i].ip, copy.instances[i].ip.string);
EXPECT_EQ(legacy.instances[i].isPrivate, copy.instances[i].isPrivate != 0);
}
EXPECT_EQ(copy.ugcEnabled, 1);
EXPECT_EQ(copy.ugcOnline, count % 2);
EXPECT_EQ(copy.ugcPid, 4242 + count);
ExpectTruncatedFails(response);
}
}