mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user