mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-02-10 08:00:05 +00:00
Remove computers from both lookups when they timeout
In 5d8c46c7e61117ede5d6315efc81a4ae498f34ba, we switched to using UUIDs for looking up computers (rather than an integer ID). However, for compatibility in some of the command code, we need to maintain the old integer lookup map. Most of the code was updated to handle this, *except* the code to remove a computer from the registry. This meant that we'd fail to remove a computer from the UUID lookup map, so computers ended up in a phantom state where they were destroyed, but still accessible. This is not an issue on 1.20.4, because the legacy int lookup map was removed. Fixes #1760
This commit is contained in:
parent
57c72711bb
commit
286f969f94
@ -42,13 +42,14 @@ public class ServerComputerRegistry {
|
||||
}
|
||||
|
||||
void update() {
|
||||
var it = getComputers().iterator();
|
||||
var it = computersByInstanceId.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
var computer = it.next();
|
||||
if (computer.hasTimedOut()) {
|
||||
computer.unload();
|
||||
computer.onRemoved();
|
||||
it.remove();
|
||||
computersByInstanceUuid.remove(computer.getInstanceUUID());
|
||||
} else {
|
||||
computer.tickServer();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user