3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 11:39:25 +01:00

clientbot: reinitialize PUID generators on connect

Closes #448.
This commit is contained in:
James Lu 2017-05-12 19:57:24 -07:00
parent fd3236ddb7
commit cfec70730f

View File

@ -28,10 +28,6 @@ class ClientbotWrapperProtocol(Protocol):
self.ircv3_caps = set() self.ircv3_caps = set()
self.ircv3_caps_available = {} self.ircv3_caps_available = {}
# Initialize counter-based pseudo UID generators
self.uidgen = utils.PUIDGenerator('PUID')
self.sidgen = utils.PUIDGenerator('PSID')
# Tracks the users sent in a list of /who replies, so that users can be bursted all at once # Tracks the users sent in a list of /who replies, so that users can be bursted all at once
# when ENDOFWHO is received. # when ENDOFWHO is received.
self.who_received = set() self.who_received = set()
@ -57,6 +53,10 @@ class ClientbotWrapperProtocol(Protocol):
def connect(self): def connect(self):
"""Initializes a connection to a server.""" """Initializes a connection to a server."""
# (Re)initialize counter-based pseudo UID generators
self.uidgen = utils.PUIDGenerator('PUID')
self.sidgen = utils.PUIDGenerator('PSID')
self.has_eob = False self.has_eob = False
ts = self.irc.start_ts ts = self.irc.start_ts
f = lambda text: self.irc.send(text, queue=False) f = lambda text: self.irc.send(text, queue=False)