mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-11 20:52:42 +01:00
clientbot: store external server names raw instead of using server name mangling
This commit is contained in:
parent
ee5a884328
commit
51d8d3b3b8
@ -56,7 +56,7 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
|
|||||||
"""Initializes a connection to a server."""
|
"""Initializes a connection to a server."""
|
||||||
# (Re)initialize counter-based pseudo UID generators
|
# (Re)initialize counter-based pseudo UID generators
|
||||||
self.uidgen = utils.PUIDGenerator('PUID')
|
self.uidgen = utils.PUIDGenerator('PUID')
|
||||||
self.sidgen = utils.PUIDGenerator('PSID')
|
self.sidgen = utils.PUIDGenerator('ClientbotInternalSID')
|
||||||
|
|
||||||
self.has_eob = False
|
self.has_eob = False
|
||||||
ts = self.start_ts
|
ts = self.start_ts
|
||||||
@ -123,7 +123,13 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
|
|||||||
STUB: Pretends to spawn a new server with a subset of the given options.
|
STUB: Pretends to spawn a new server with a subset of the given options.
|
||||||
"""
|
"""
|
||||||
name = name.lower()
|
name = name.lower()
|
||||||
sid = self.sidgen.next_sid(prefix=name)
|
if internal:
|
||||||
|
# Use a custom pseudo-SID format for internal servers to prevent any server name clashes
|
||||||
|
sid = self.sidgen.next_sid(prefix=name)
|
||||||
|
else:
|
||||||
|
# For others servers, just use the server name as the SID.
|
||||||
|
sid = name
|
||||||
|
|
||||||
self.servers[sid] = Server(uplink, name, internal=internal)
|
self.servers[sid] = Server(uplink, name, internal=internal)
|
||||||
return sid
|
return sid
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user