Exemple #1
0
 def __init__(self, *arg, **kw):
     BaseConnection.__init__(self, *arg, **kw)
     protocol = self.protocol
     address = self.peer.address
     self.total_blocks_removed = 0
     self.address = (address.host, address.port)
     self.respawn_time = protocol.respawn_time
     self.rapids = SlidingWindow(RAPID_WINDOW_ENTRIES)
     self.client_info = {}
Exemple #2
0
 def __init__(self, *arg, **kw) -> None:
     BaseConnection.__init__(self, *arg, **kw)
     protocol = self.protocol
     address = self.peer.address
     self.total_blocks_removed = 0
     self.address = (address.host, address.port)
     self.respawn_time = protocol.respawn_time
     self.rapids = SlidingWindow(RAPID_WINDOW_ENTRIES)
     self.client_info = {}
     self.proto_extensions = {}  # type: Dict[int, int]
     self.line_build_start_pos = None
Exemple #3
0
 def __init__(self, protocol):
     BaseConnection.__init__(self)
     self.protocol = protocol
     self.auth_val = random.randint(0, 0xFFFF)
     self.map = ByteWriter()
     self.connections = MultikeyDict()
     self.spammy = {Ping : 0, loaders.MapChunk : 0, 
         loaders.OrientationData : 0,
         loaders.PositionData : 0, loaders.InputData : 0}
     
     connect_request = ConnectionRequest()
     connect_request.auth_val = self.auth_val
     connect_request.client = True
     connect_request.version = self.get_version()
     self.send_loader(connect_request, False, 255)
Exemple #4
0
    def __init__(self, protocol):
        BaseConnection.__init__(self)
        self.protocol = protocol
        self.auth_val = random.randint(0, 0xFFFF)
        self.map = ByteWriter()
        self.connections = MultikeyDict()
        self.spammy = {
            Ping: 0,
            loaders.MapChunk: 0,
            loaders.OrientationData: 0,
            loaders.PositionData: 0,
            loaders.InputData: 0
        }

        connect_request = ConnectionRequest()
        connect_request.auth_val = self.auth_val
        connect_request.client = True
        connect_request.version = self.get_version()
        self.send_loader(connect_request, False, 255)
Exemple #5
0
 def packet_received(self, packet):
     if not self.displayed_id:
         print 'server id:', packet.connection_id
         self.displayed_id = True
     BaseConnection.packet_received(self, packet)
Exemple #6
0
 def packet_received(self, packet):
     if not self.displayed_id:
         print 'server id:', packet.connection_id
         self.displayed_id = True
     BaseConnection.packet_received(self, packet)