mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
31 lines
822 B
Python
31 lines
822 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://toontownunlimited.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
|