mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-22 02:08:56 +01:00
Update arbitrary request example to follow better practices
This commit is contained in:
parent
41d8e0a0c4
commit
c7b71d87a7
@ -48,10 +48,11 @@ You may make any arbitary request to the Yggdrasil service with
|
||||
---------------
|
||||
An example of making an arbitary request can be seen here::
|
||||
|
||||
url = "https://sessionserver.mojang.com/session/minecraft/join"
|
||||
server_id = encryption.generate_verification_hash(packet.server_id, secret, packet.public_key)
|
||||
url = authentication.BASE_URL + "session/minecraft/join"
|
||||
server_id = encryption.generate_verification_hash(packet.server_id, secret, packet.public_key)
|
||||
payload = {'accessToken': self.connection.login_response.access_token,
|
||||
'selectedProfile': self.connection.login_response.profile_id,
|
||||
'serverId': server_id}
|
||||
|
||||
response = authentication.make_request(url, {'accessToken': self.connection.login_response.access_token,
|
||||
'selectedProfile': self.connection.login_response.profile_id,
|
||||
'serverId': server_id})
|
||||
authentication.make_request(url, payload)
|
||||
|
||||
|
@ -250,12 +250,13 @@ class LoginReactor(PacketReactor):
|
||||
|
||||
# A server id of '-' means the server is in offline mode
|
||||
if packet.server_id != '-':
|
||||
url = "https://sessionserver.mojang.com/session/minecraft/join"
|
||||
url = authentication.BASE_URL + "session/minecraft/join"
|
||||
server_id = encryption.generate_verification_hash(packet.server_id, secret, packet.public_key)
|
||||
payload = {'accessToken': self.connection.login_response.access_token,
|
||||
'selectedProfile': self.connection.login_response.profile_id,
|
||||
'serverId': server_id}
|
||||
|
||||
authentication.make_request(url, {'accessToken': self.connection.login_response.access_token,
|
||||
'selectedProfile': self.connection.login_response.profile_id,
|
||||
'serverId': server_id})
|
||||
authentication.make_request(url, payload)
|
||||
|
||||
encryption_response = EncryptionResponsePacket()
|
||||
encryption_response.shared_secret = encrypted_secret
|
||||
|
Loading…
Reference in New Issue
Block a user