Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _req(self, endpoint, **data):
return http.request(
url=b"https://authserver.mojang.com/"+endpoint,
timeout=self.timeout,
err_type=ProfileException,
data=data)
def join(timeout, digest, access_token, uuid):
return http.request(
url=b"https://sessionserver.mojang.com/session/minecraft/join",
timeout=timeout,
err_type=AuthException,
data={
"accessToken": access_token,
"selectedProfile": uuid.to_hex(with_dashes=False),
"serverId": digest})
def has_joined(timeout, digest, username):
return http.request(
url=b"https://sessionserver.mojang.com/session/minecraft/hasJoined"
b"?username=" + username.encode('ascii') + \
b"&serverId=" + digest.encode('ascii'),
timeout=timeout,
err_type=AuthException,
expect_content=True)