Poodletooth-iLand/toontown/toonbase/ClientStartRemoteDB.py
Master Jumblespeed 6f93be4677 fixes
2015-05-18 22:28:54 -04:00

29 lines
No EOL
757 B
Python
Executable file

#!/usr/bin/env python2
import json
import os
import requests
from pandac.PandaModules import *
username = os.environ['ttsUsername']
password = os.environ['ttsPassword']
accountServerEndpoint = ConfigVariableString(
'account-server-endpoint',
'http://tigercat1.me/tmpremote/api/').getValue()
request = requests.post(
accountServerEndpoint + 'login/',
data={'n': username, 'p': password})
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['TTS_PLAYCOOKIE'] = response['token']
# Start the game:
import toontown.toonbase.ClientStart