mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-10-31 08:47:54 +00:00
30 lines
819 B
Python
30 lines
819 B
Python
#!/usr/bin/env python2
|
|
import json
|
|
import os
|
|
import requests
|
|
from pandac.PandaModules import *
|
|
|
|
|
|
username = os.environ['ttiUsername']
|
|
password = os.environ['ttiPassword']
|
|
distribution = ConfigVariableString('distribution', 'dev').getValue()
|
|
|
|
accountServerEndpoint = ConfigVariableString(
|
|
'account-server-endpoint',
|
|
'https://toontownunited.com/api/').getValue()
|
|
request = requests.post(
|
|
accountServerEndpoint + 'login/',
|
|
data={'n': username, 'p': password, 'dist': distribution})
|
|
|
|
try:
|
|
response = json.loads(request.text)
|
|
except ValueError:
|
|
print "Couldn't verify account credentials."
|
|
else:
|
|
if not response['success']:
|
|
print response['reason']
|
|
else:
|
|
os.environ['TTU_PLAYCOOKIE'] = response['token']
|
|
|
|
# Start the game:
|
|
import toontown.toonbase.ClientStart
|