Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_uuid_from_offline_player():
uuid = UUID.from_offline_player("Notch")
assert isinstance(uuid, UUID)
assert uuid.to_bytes() == bytes_vector
def test_uuid_from_hex_to_byte():
uuid = UUID.from_hex(hex_vector)
assert isinstance(uuid, UUID)
assert uuid.to_bytes() == bytes_vector
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()
# 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()
def _from_response(cls, response):
return cls(
response['clientToken'],
response['accessToken'],
response['selectedProfile']['name'],
UUID.from_hex(response['selectedProfile']['id']))
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()