mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 08:57:25 +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',
 | 
			
		||||
                    '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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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))
 | 
			
		||||
 | 
			
		||||
@ -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': '+'}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user