3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-23 10:44:09 +01:00

protocols: initialize sidgen/uidgen in ts6_common

This commit is contained in:
James Lu 2016-04-05 18:34:54 -07:00
parent cb8ea473df
commit f620b5b4e8
4 changed files with 10 additions and 6 deletions

View File

@ -29,8 +29,6 @@ class InspIRCdProtocol(TS6BaseProtocol):
self.hook_map = {'FJOIN': 'JOIN', 'RSQUIT': 'SQUIT', 'FMODE': 'MODE',
'FTOPIC': 'TOPIC', 'OPERTYPE': 'MODE', 'FHOST': 'CHGHOST',
'FIDENT': 'CHGIDENT', 'FNAME': 'CHGNAME', 'SVSTOPIC': 'TOPIC'}
self.sidgen = utils.TS6SIDGenerator(self.irc)
self.uidgen = {}
self.min_proto_ver = 1202
self.proto_ver = 1202

View File

@ -22,8 +22,6 @@ class TS6Protocol(TS6BaseProtocol):
self.casemapping = 'rfc1459'
self.hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE', 'BMASK': 'MODE',
'EUID': 'UID'}
self.sidgen = utils.TS6SIDGenerator(self.irc)
self.uidgen = {}
# Track whether we've received end-of-burst from the uplink.
self.has_eob = False

View File

@ -14,6 +14,16 @@ from log import log
from classes import *
class TS6BaseProtocol(Protocol):
def __init__(self, irc):
super().__init__(irc)
# Dictionary of UID generators (one for each server) that the protocol module will fill in.
self.uidgen = {}
# SID generator for TS6.
self.sidgen = utils.TS6SIDGenerator(irc)
def _send(self, source, msg):
"""Sends a TS6-style raw command from a source numeric to the self.irc connection given."""
self.irc.send(':%s %s' % (source, msg))

View File

@ -29,8 +29,6 @@ class UnrealProtocol(TS6BaseProtocol):
'SVS2MODE': 'MODE', 'SJOIN': 'JOIN', 'SETHOST': 'CHGHOST',
'SETIDENT': 'CHGIDENT', 'SETNAME': 'CHGNAME',
'EOS': 'ENDBURST'}
self.uidgen = {}
self.sidgen = utils.TS6SIDGenerator(self.irc)
self.caps = {}
self.irc.prefixmodes = {'q': '~', 'a': '&', 'o': '@', 'h': '%', 'v': '+'}