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

unreal: fix server name of the uplink not being saved

Closes #268.
This commit is contained in:
James Lu 2016-07-11 16:20:10 -07:00
parent 2b60cbd59c
commit 64dd7e9387

View File

@ -421,20 +421,24 @@ class UnrealProtocol(TS6BaseProtocol):
"by the remote server. Your version of UnrealIRCd "
"is probably too old! (Got: %s, needed: %s)" %
(sorted(self.caps), sorted(self.needed_caps)))
sdesc = args[-1].split(" ")
# Get our protocol version :)
sdesc = args[-1].split(" ", 1)
# Get our protocol version. I really don't know why the version and the server
# description aren't two arguments instead of one... -GLolol
vline = sdesc[0].split('-', 1)
sdesc = " ".join(sdesc[1:])
try:
protover = int(vline[0].strip('U'))
except ValueError:
raise ProtocolError("Protocol version too old! (needs at least %s "
"(Unreal 4.0.0-rc1), got something invalid; "
"(Unreal 4.x), got something invalid; "
"is VL being sent?)" % self.min_proto_ver)
sdesc = args[-1][1:]
if protover < self.min_proto_ver:
raise ProtocolError("Protocol version too old! (needs at least %s "
"(Unreal 4.0.0-rc1), got %s)" % (self.min_proto_ver, protover))
self.irc.servers[numeric] = IrcServer(None, sname)
"(Unreal 4.x), got %s)" % (self.min_proto_ver, protover))
self.irc.servers[numeric] = IrcServer(None, sname, desc=sdesc)
# Set irc.connected to True, meaning that protocol negotiation passed.
log.debug('(%s) self.irc.connected set!', self.irc.name)