def has_joined(timeout, digest, display_name): return http.request( url=b"https://sessionserver.mojang.com/session/minecraft/hasJoined" b"?username="******"&serverId=" + digest.encode('ascii'), timeout=timeout, err_type=AuthException, expect_content=True)
def has_joined(timeout, digest, display_name, remote_host=None): url = b"https://sessionserver.mojang.com/session/minecraft/hasJoined" + \ b"?username="******"&serverId=" + digest.encode('ascii') if remote_host is not None: url += b"&ip=" + remote_host.encode('ascii') return http.request(url=url, timeout=timeout, err_type=AuthException, expect_content=True)
def has_joined(timeout, digest, display_name, remote_host=None): url = b"https://sessionserver.mojang.com/session/minecraft/hasJoined" + \ b"?username="******"&serverId=" + digest.encode('ascii') if remote_host is not None: url += b"&ip=" + remote_host.encode('ascii') return http.request( url=url, timeout=timeout, err_type=AuthException, expect_content=True)
def join(self, digest, refresh=True): d1 = http.request( url=b"https://sessionserver.mojang.com/session/minecraft/join", timeout=self.timeout, err_type=AuthException, data={ "accessToken": self.access_token, "selectedProfile": self.uuid.to_hex(with_dashes=False), "serverId": digest}) if not refresh: return d1 else: d0 = defer.Deferred() def _errback(err): self.refresh().chainDeferred( self.join(digest, refresh=False).chainDeferred(d0)) d1.addCallbacks(d0.callback, _errback) return d0
def _request(cls, endpoint, **data): return http.request(url=b"https://authserver.mojang.com/" + endpoint, timeout=cls.timeout, err_type=ProfileException, data=data)
def _request(cls, endpoint, **data): return http.request( url=b"https://authserver.mojang.com/"+endpoint, timeout=cls.timeout, err_type=ProfileException, data=data)