From 2f66e1deca9dd0327de94ca48bd064b44c9d58e4 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 16 Oct 2025 13:44:34 +0200 Subject: [PATCH] Fix logic error in server duplicate check --- server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index e35c817..cddd2b5 100755 --- a/server.py +++ b/server.py @@ -589,7 +589,7 @@ class Server: self.updateCount = 1 self.meta["clients_top"] = self.totalClients = self.meta["clients"] - # check if this server is a logical duplicate of the other one. + # check if *this* server is a logical duplicate of the other one def is_duplicate(self, other: 'Server'): if self.port == other.port and self.address.lower() == other.address.lower(): # if everything matches it's not a duplicate but literally the same @@ -625,10 +625,11 @@ class ServerList: i, server = self.getWithIndex(ip, port) return server - def checkDuplicate(self, other_server): + # returns true if the given server shouldn't be on the list + def checkDuplicate(self, other_server: Server): with self.lock: for server in self.list: - if server.is_duplicate(other_server): + if other_server.is_duplicate(server): return True return False