def reject_with_reason(self, reason): rejection = build_packet( packets.Packets.CONNECT_RESPONSE, packets.connect_response().build( Container(success=False, client_id=0, reject_reason=reason))) self.protocol.transport.write(rejection) self.protocol.transport.loseConnection()
def after_connect_response(self, data): connection_parameters = connect_response().parse(data.data) if not connection_parameters.success: self.protocol.transport.loseConnection() else: self.protocol.player.client_id = connection_parameters.client_id self.protocol.player.logged_in = True self.logger.info("Player %s (UUID: %s, IP: %s) logged in" % ( self.protocol.player.name, self.protocol.player.uuid, self.protocol.transport.getPeer().host))
def after_connect_response(self, data): try: c = connect_response().parse(data.data) if c.success: self.factory.broadcast( self.protocol.player.colored_name(self.config.colors) + " logged in.", 0, "", "Announcer") except AttributeError: return except: self.logger.exception("Unknown error in after_connect_response.") return
def after_connect_response(self, data): connection_parameters = connect_response().parse(data.data) if not connection_parameters.success: self.protocol.transport.loseConnection() else: self.protocol.player.client_id = connection_parameters.client_id self.protocol.player.logged_in = True self.logger.info( "Player %s (UUID: %s, IP: %s) logged in" % (self.protocol.player.name, self.protocol.player.uuid, self.protocol.transport.getPeer().host))
def after_connect_response(self, data): try: c = connect_response().parse(data.data) if c.success: self.factory.broadcast( self.protocol.player.colored_name(self.config.colors) + " logged in.", 0, "Announcer") except AttributeError: return except: self.logger.exception("Unknown error in after_connect_response.") return
def reject_with_reason(self, reason): # here there be magic... ask Carrots or Teihoo about this... magic_sector = "AQAAAAwAAAAy+gofAAX14QD/Z2mAAJiWgAUFYWxwaGEMQWxwaGEgU2VjdG9yAAAAELIfhbMFQWxwaGEHAgt0aHJlYXRMZXZlbAYCBAIEAg51bmxvY2tlZEJpb21lcwYHBQRhcmlkBQZkZXNlcnQFBmZvcmVzdAUEc25vdwUEbW9vbgUGYmFycmVuBQ1hc3Rlcm9pZGZpZWxkBwcCaWQFBWFscGhhBG5hbWUFDEFscGhhIFNlY3RvcgpzZWN0b3JTZWVkBISWofyWZgxzZWN0b3JTeW1ib2wFFy9jZWxlc3RpYWwvc2VjdG9yLzEucG5nCGh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MFBmJhcnJlbgUNYXN0ZXJvaWRmaWVsZAcIAmlkBQdzZWN0b3J4BG5hbWUFCFggU2VjdG9yCnNlY3RvclNlZWQEmPDzkpxuDHNlY3RvclN5bWJvbAUXL2NlbGVzdGlhbC9zZWN0b3IveC5wbmcIaHVlU2hpZnQEgTQIcHZwRm9yY2UDAQZwcmVmaXgFAVgPd29ybGRQYXJhbWV0ZXJzBwILdGhyZWF0TGV2ZWwGAgQKBBQOdW5sb2NrZWRCaW9tZXMGDgUEYXJpZAUGZGVzZXJ0BQhzYXZhbm5haAUGZm9yZXN0BQRzbm93BQRtb29uBQZqdW5nbGUFCmdyYXNzbGFuZHMFBW1hZ21hBQl0ZW50YWNsZXMFBnR1bmRyYQUIdm9sY2FuaWMFBmJhcnJlbgUNYXN0ZXJvaWRmaWVsZA==" unlocked_sector_magic = base64.decodestring( magic_sector.encode("ascii")) rejection = build_packet( packets.Packets.CONNECT_RESPONSE, packets.connect_response().build( Container(success=False, client_id=0, reject_reason=reason)) + unlocked_sector_magic) self.protocol.transport.write(rejection) self.protocol.transport.loseConnection()
def reject_with_reason(self, reason): rejection = build_packet( packets.Packets.CONNECT_RESPONSE, packets.connect_response().build( Container( success=False, client_id=0, reject_reason=reason ) ) ) self.protocol.transport.write(rejection) self.protocol.transport.loseConnection()
def on_connect_response(self, data): try: connection_parameters = connect_response().parse(data.data) if not connection_parameters.success: self.protocol.transport.loseConnection() else: self.protocol.player.client_id = connection_parameters.client_id self.protocol.player.logged_in = True self.logger.info("Player %s (UUID: %s, IP: %s) logged in" % ( self.protocol.player.name, self.protocol.player.uuid, self.protocol.transport.getPeer().host)) except: self.logger.exception("Exception in on_connect_response, player info may not have been logged.") finally: return True
def reject_with_reason(self, reason): magic_sector = "AQAAAAwAAAAy+gofAAX14QD/Z2mAAJiWgAUFYWxwaGEMQWxwaGEgU2VjdG9yAAAAELIfhbMFQWxwaGEHAgt0aHJlYXRMZXZlbAYCBAIEAg51bmxvY2tlZEJpb21lcwYHBQR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zJHNwFYBwILdGhyZWF0TGV2ZWwGAgQKBBQOdW5sb2NrZWRCaW9tZXMGDgUEYXJpZAUGZGVzZXJ0BQhzYXZhbm5haAUGZm9yZXN0BQRzbm93BQRtb29uBQZqdW5nbGUFCmdyYXNzbGFuZHMFBW1hZ21hBQl0ZW50YWNsZXMFBnR1bmRyYQUIdm9sY2FuaWMFBmJhcnJlbgUNYXN0ZXJvaWRmaWVsZAcIAmlkBQdzZWN0b3J4BG5hbWUFCFggU2VjdG9yCnNlY3RvclNlZWQEmPDzkpxuDHNlY3RvclN5bWJvbAUXL2NlbGVzdGlhbC9zZWN0b3IveC5wbmcIaHVlU2hpZnQEgTQIcHZwRm9yY2UDAQZwcmVmaXgFAVgPd29ybGRQYXJhbWV0ZXJzBwILdGhyZWF0TGV2ZWwGAgQKBBQOdW5sb2NrZWRCaW9tZXMGDgUEYXJpZAUGZGVzZXJ0BQhzYXZhbm5haAUGZm9yZXN0BQRzbm93BQRtb29uBQZqdW5nbGUFCmdyYXNzbGFuZHMFBW1hZ21hBQl0ZW50YWNsZXMFBnR1bmRyYQUIdm9sY2FuaWMFBmJhcnJlbgUNYXN0ZXJvaWRmaWVsZA==" unlocked_sector_magic = base64.decodestring(magic_sector.encode("ascii")) rejection = build_packet( packets.Packets.CONNECT_RESPONSE, packets.connect_response().build( Container( success=False, client_id=0, reject_reason=reason ) ) + unlocked_sector_magic ) self.protocol.transport.write(rejection) self.protocol.transport.loseConnection()