mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
fix(master): a server list's outdated flags are read all or none
A list cut short inside the flags was read as if complete; an older master's list, which has none, still reads. The test checks every cut. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -297,7 +297,9 @@ namespace MasterPackets {
|
||||
VALIDATE_READ(bitStream.Read(endpoint.port));
|
||||
VALIDATE_READ(bitStream.Read(endpoint.host));
|
||||
}
|
||||
if (bitStream.GetNumberOfUnreadBits() >= instances.size() * 8) {
|
||||
// Each world's outdated flag, when the master is new enough to send them: all of them or none
|
||||
if (bitStream.GetNumberOfUnreadBits() > 0) {
|
||||
if (bitStream.GetNumberOfUnreadBits() < instances.size() * 8) return false;
|
||||
for (auto& instance : instances) VALIDATE_READ(bitStream.Read(instance.outdated));
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user