Poodletooth-iLand/toontown/toonbase/ClientStartRemoteDB.py

30 lines
767 B
Python
Raw Normal View History

2015-05-18 21:11:33 -05:00
#!/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',
2015-05-18 21:28:54 -05:00
'http://tigercat1.me/tmpremote/api/').getValue()
2015-05-18 21:11:33 -05:00
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']
2015-05-18 21:11:33 -05:00
# Start the game:
import toontown.toonbase.ClientStart