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

unreal: request VHP capability so cloaked hosts for Unreal3.2 users are sent

(cherry picked from commit 671d6d1893)
This commit is contained in:
James Lu 2016-08-08 17:05:28 -07:00
parent 84daec0f07
commit f7b93e474c

View File

@ -323,7 +323,11 @@ class UnrealProtocol(TS6BaseProtocol):
# EAUTH - Early auth? (Unreal 4 linking protocol)
# NICKIP - Extends the NICK command used for introduction (for Unreal 3.2 servers)
# to include user IPs.
f('PROTOCTL SJ3 NOQUIT NICKv2 VL UMODE2 PROTOCTL NICKIP EAUTH=%s SID=%s' % (self.irc.serverdata["hostname"], self.irc.sid))
# VHP - Sends cloaked hosts of UnrealIRCd 3.2 users as the hostname. This is important
# because UnrealIRCd 3.2 only has one vHost field in its NICK command, and not two
# like UnrealIRCd 4.0 (cloaked host + displayed host). Without VHP, cloaking does
# not work for any UnrealIRCd 3.2 users.
f('PROTOCTL SJ3 NOQUIT NICKv2 VL UMODE2 PROTOCTL NICKIP EAUTH=%s SID=%s VHP' % (self.irc.serverdata["hostname"], self.irc.sid))
sdesc = self.irc.serverdata.get('serverdesc') or self.irc.botdata['serverdesc']
f('SERVER %s 1 U%s-h6e-%s :%s' % (host, self.proto_ver, self.irc.sid, sdesc))
f('NETINFO 1 %s %s * 0 0 0 :%s' % (self.irc.start_ts, self.proto_ver, self.irc.serverdata.get("netname", self.irc.name)))
@ -596,9 +600,10 @@ class UnrealProtocol(TS6BaseProtocol):
# internally by their nicks. In other words, we need to convert from this:
# <- NICK Global 3 1456843578 services novernet.com services.novernet.com 0 +ioS * :Global Noticer
# & nick hopcount timestamp username hostname server service-identifier-token :realname
# <- NICK GL32 2 1460221959 gl localhost unreal32.midnight.vpn 0 +iowx * fwAAAQ== :realname (with NICKIP enabled)
# With NICKIP and VHP enabled:
# <- NICK GL32 2 1470699865 gl localhost unreal32.midnight.vpn GL +iowx hidden-1C620195 AAAAAAAAAAAAAAAAAAAAAQ== :realname
# to this:
# <- :001 UID GL 0 1441306929 gl localhost 0018S7901 0 +iowx * midnight-1C620195 fwAAAQ== :realname
# <- :001 UID GL 0 1441306929 gl localhost 0018S7901 0 +iowx * hidden-1C620195 fwAAAQ== :realname
log.debug('(%s) got legacy NICK args: %s', self.irc.name, ' '.join(args))
new_args = args[:] # Clone the old args list
@ -609,7 +614,9 @@ class UnrealProtocol(TS6BaseProtocol):
self.legacy_nickcount += 1
new_args[5] = fake_uid
# Insert a fake cloaked host (just make it equal the real host, I don't care)
# This adds a dummy cloaked host (equal the real host) to put the displayed host in the
# right position. As long as the VHP capability is respected, this will propagate +x cloaked
# hosts from UnrealIRCd 3.2 users. Otherwise, +x host cloaking won't work!
new_args.insert(-2, args[4])
log.debug('(%s) translating legacy NICK args to: %s', self.irc.name, ' '.join(new_args))