From f457018f89e0e10f59d012172d60e48d22284adf Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 29 Jul 2016 00:37:07 -0700 Subject: [PATCH] unreal: remove mixed_link option; this is now implied pylink<->unreal4<->unreal3.2 links are stable enough. --- README.md | 2 +- example-conf.yml | 9 --------- protocols/unreal.py | 23 ++++++----------------- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 77fb4cb..14eeb59 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ These IRCds (in alphabetical order) are frequently tested and well supported. If * [charybdis](http://charybdis.io/) (3.5+ / git master) - module `ts6` * [InspIRCd](http://www.inspircd.org/) 2.0.x - module `inspircd` * [UnrealIRCd](https://www.unrealircd.org/) 4.x - module `unreal` - - Note: Support for mixed UnrealIRCd 3.2/4.0 networks is experimental, and requires you to enable a `mixed_link` option in the configuration. This may in turn void your support. + - Linking to UnrealIRCd 3.2 servers is only supported when using an UnrealIRCd 4.x server as a hub, with topology such as `pylink<->unreal4<->unreal3.2` ### Extended support diff --git a/example-conf.yml b/example-conf.yml index cb5d26f..2f139e4 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -191,15 +191,6 @@ servers: protocol: "unreal" autoconnect: 5 - # This option enables SUPER HACKY UNREAL 3.2 COMPAT mode, which allows - # PyLink to link to mixed Unreal 3.2/4.0 networks, using a 4.0 server - # as a direct uplink. - # THIS IS EXPERIMENTAL, NOT WELL TESTED, AND MAY SET YOUR HOUSE ON FIRE - # AND G-LINE EVERYONE ON YOUR NETWORK. - # We encourage you to upgrade so that all your servers are running the - # same IRCd version. - #mixed_link: true - # You can also define network-specific nicks and idents for various service # bots, using the configuration options "servicename_nick" and "servicename_ident". #pylink_nick: MagicServ diff --git a/protocols/unreal.py b/protocols/unreal.py index ae1f871..8e049e2 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -34,13 +34,6 @@ class UnrealProtocol(TS6BaseProtocol): # Some command aliases self.handle_svskill = self.handle_kill - # Toggle whether we're using super hack mode for Unreal 3.2 mixed links. - self.mixed_link = self.irc.serverdata.get('mixed_link') - - if self.mixed_link: - log.warning('(%s) mixed_link is experimental and may cause problems. ' - 'You have been warned!', self.irc.name) - def _expandPUID(self, uid): """ Returns the outgoing nick for the given UID. For PUIDs (used to store UID-less @@ -588,12 +581,12 @@ class UnrealProtocol(TS6BaseProtocol): def handle_nick(self, numeric, command, args): """Handles NICK changes, and legacy NICK introductions from pre-4.0 servers.""" - if self.mixed_link and len(args) > 2: + if len(args) > 2: # Handle legacy NICK introduction here. # I don't want to rewrite all the user introduction stuff, so I'll just reorder the arguments # so that handle_uid can handle this instead. # But since legacy nicks don't have any UIDs attached, we'll have to store the users - # internally by their nicks. In other words, we need to convert from this: + # internally using pseudo UIDs. 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) @@ -604,7 +597,9 @@ class UnrealProtocol(TS6BaseProtocol): new_args = args[:] # Clone the old args list servername = new_args[5].lower() # Get the name of the users' server. - # Fake a UID and put it where it belongs in the new-style UID command. + # Fake a UID and put it where it belongs in the new-style UID command. These take the + # NICK@COUNTER, where COUNTER is an int starting at 0 and incremented every time a new + # user joins. fake_uid = self.legacy_uidgen.next_uid(prefix=args[0]) new_args[5] = fake_uid @@ -617,13 +612,7 @@ class UnrealProtocol(TS6BaseProtocol): else: # Normal NICK change, just let ts6_common handle it. # :70MAAAAAA NICK GL-devel 1434744242 - try: - return super().handle_nick(numeric, command, args) - except KeyError: - log.exception('(%s) Malformed NICK command received. If you are linking PyLink to a ' - 'mixed UnrealIRCd 3.2/4.0 network, enable the mixed_link option in the ' - 'server config and restart your PyLink daemon.', self.irc.name) - self.irc.disconnect() + return super().handle_nick(numeric, command, args) def handle_mode(self, numeric, command, args): # <- :unreal.midnight.vpn MODE #test +bb test!*@* *!*@bad.net