From 663bfe462cb692e619d4ed87cb5a23ec442c1807 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 23 Sep 2017 22:35:55 -0700 Subject: [PATCH] classes: track hopcount in Server --- classes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/classes.py b/classes.py index f8e3496..2eed1c9 100644 --- a/classes.py +++ b/classes.py @@ -1630,6 +1630,13 @@ class Server(): self.desc = desc self._irc = irc + assert uplink is None or uplink in self._irc.servers, "Unknown uplink %s" % uplink + + if uplink is None: + self.hopcount = 1 + else: + self.hopcount = self._irc.servers[uplink].hopcount + 1 + # Has the server finished bursting yet? self.has_eob = False