How to use the quarry.types.uuid.UUID function in quarry

To help you get started, we’ve selected a few quarry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github barneygale / quarry / tests / types / test_types.py View on Github external
def test_uuid_from_offline_player():
    uuid = UUID.from_offline_player("Notch")
    assert isinstance(uuid, UUID)
    assert uuid.to_bytes() == bytes_vector
github barneygale / quarry / tests / types / test_types.py View on Github external
def test_uuid_from_hex_to_byte():
    uuid = UUID.from_hex(hex_vector)
    assert isinstance(uuid, UUID)
    assert uuid.to_bytes() == bytes_vector
github barneygale / quarry / quarry / net / auth.py View on Github external
def from_token(cls, client_token, access_token, display_name, uuid):
        obj = cls(client_token, access_token,
                  display_name, UUID.from_hex(uuid))
        return obj.validate()
github barneygale / quarry / quarry / net / server.py View on Github external
# 1.8.x
            else:
                pack_array = lambda a: self.buff_type.pack_varint(
                    len(a), max_bits=16) + a

            self.send_packet(
                "login_encryption_request",
                self.buff_type.pack_string(self.server_id),
                pack_array(self.factory.public_key),
                pack_array(self.verify_token))

        else:
            self.login_expecting = None
            self.display_name_confirmed = True
            self.uuid = UUID.from_offline_player(self.display_name)

            self.player_joined()
github barneygale / quarry / quarry / net / auth.py View on Github external
def _from_response(cls, response):
        return cls(
            response['clientToken'],
            response['accessToken'],
            response['selectedProfile']['name'],
            UUID.from_hex(response['selectedProfile']['id']))
github barneygale / quarry / quarry / net / server.py View on Github external
def auth_ok(self, data):
        """Called when auth with mojang succeeded (online mode only)"""
        self.display_name_confirmed = True
        self.uuid = UUID.from_hex(data['id'])

        self.player_joined()