mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-23 18:54:05 +01:00
protocols: initialize sidgen/uidgen in ts6_common
This commit is contained in:
parent
cb8ea473df
commit
f620b5b4e8
@ -29,8 +29,6 @@ class InspIRCdProtocol(TS6BaseProtocol):
|
|||||||
self.hook_map = {'FJOIN': 'JOIN', 'RSQUIT': 'SQUIT', 'FMODE': 'MODE',
|
self.hook_map = {'FJOIN': 'JOIN', 'RSQUIT': 'SQUIT', 'FMODE': 'MODE',
|
||||||
'FTOPIC': 'TOPIC', 'OPERTYPE': 'MODE', 'FHOST': 'CHGHOST',
|
'FTOPIC': 'TOPIC', 'OPERTYPE': 'MODE', 'FHOST': 'CHGHOST',
|
||||||
'FIDENT': 'CHGIDENT', 'FNAME': 'CHGNAME', 'SVSTOPIC': 'TOPIC'}
|
'FIDENT': 'CHGIDENT', 'FNAME': 'CHGNAME', 'SVSTOPIC': 'TOPIC'}
|
||||||
self.sidgen = utils.TS6SIDGenerator(self.irc)
|
|
||||||
self.uidgen = {}
|
|
||||||
|
|
||||||
self.min_proto_ver = 1202
|
self.min_proto_ver = 1202
|
||||||
self.proto_ver = 1202
|
self.proto_ver = 1202
|
||||||
|
@ -22,8 +22,6 @@ class TS6Protocol(TS6BaseProtocol):
|
|||||||
self.casemapping = 'rfc1459'
|
self.casemapping = 'rfc1459'
|
||||||
self.hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE', 'BMASK': 'MODE',
|
self.hook_map = {'SJOIN': 'JOIN', 'TB': 'TOPIC', 'TMODE': 'MODE', 'BMASK': 'MODE',
|
||||||
'EUID': 'UID'}
|
'EUID': 'UID'}
|
||||||
self.sidgen = utils.TS6SIDGenerator(self.irc)
|
|
||||||
self.uidgen = {}
|
|
||||||
|
|
||||||
# Track whether we've received end-of-burst from the uplink.
|
# Track whether we've received end-of-burst from the uplink.
|
||||||
self.has_eob = False
|
self.has_eob = False
|
||||||
|
@ -14,6 +14,16 @@ from log import log
|
|||||||
from classes import *
|
from classes import *
|
||||||
|
|
||||||
class TS6BaseProtocol(Protocol):
|
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):
|
def _send(self, source, msg):
|
||||||
"""Sends a TS6-style raw command from a source numeric to the self.irc connection given."""
|
"""Sends a TS6-style raw command from a source numeric to the self.irc connection given."""
|
||||||
self.irc.send(':%s %s' % (source, msg))
|
self.irc.send(':%s %s' % (source, msg))
|
||||||
|
@ -29,8 +29,6 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
'SVS2MODE': 'MODE', 'SJOIN': 'JOIN', 'SETHOST': 'CHGHOST',
|
'SVS2MODE': 'MODE', 'SJOIN': 'JOIN', 'SETHOST': 'CHGHOST',
|
||||||
'SETIDENT': 'CHGIDENT', 'SETNAME': 'CHGNAME',
|
'SETIDENT': 'CHGIDENT', 'SETNAME': 'CHGNAME',
|
||||||
'EOS': 'ENDBURST'}
|
'EOS': 'ENDBURST'}
|
||||||
self.uidgen = {}
|
|
||||||
self.sidgen = utils.TS6SIDGenerator(self.irc)
|
|
||||||
|
|
||||||
self.caps = {}
|
self.caps = {}
|
||||||
self.irc.prefixmodes = {'q': '~', 'a': '&', 'o': '@', 'h': '%', 'v': '+'}
|
self.irc.prefixmodes = {'q': '~', 'a': '&', 'o': '@', 'h': '%', 'v': '+'}
|
||||||
|
Loading…
Reference in New Issue
Block a user