From fac6fe506f9c58c3d96b0f6bea67a04da4a64632 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 25 Aug 2018 18:50:11 -0400 Subject: [PATCH] unreal: use SJOIN in join() to work around weird TS corrupting bugs This seems to be what Unreal itself does anyways. --- protocols/unreal.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/protocols/unreal.py b/protocols/unreal.py index 32e697a..b3a4f9a 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -106,9 +106,14 @@ class UnrealProtocol(TS6BaseProtocol): """Joins a PyLink client to a channel.""" if not self.is_internal_client(client): raise LookupError('No such PyLink client exists.') - self._send_with_prefix(client, "JOIN %s" % channel) - self._channels[channel].users.add(client) - self.users[client].channels.add(channel) + + # Forward this on to SJOIN, as using JOIN in Unreal S2S seems to cause TS corruption bugs. + # This seems to be what Unreal itself does anyways. + if channel not in self.channels and prefix == '': + prefix = 'o' # Create new channels with the first joiner as op + else: + prefix = '' + self.sjoin(self.sid, channel, [(prefix, client)]) def sjoin(self, server, channel, users, ts=None, modes=set()): """Sends an SJOIN for a group of users to a channel.