diff --git a/build/data/NiraiStart.py b/build/data/NiraiStart.py index e5df545e..4140161f 100644 --- a/build/data/NiraiStart.py +++ b/build/data/NiraiStart.py @@ -73,4 +73,4 @@ if pack and pack != 'default': if not abort: # Run - import toontown.toonbase.ClientStart + import toontown.toonbase.ToontownStart diff --git a/dev/darwin/start-game-localhost.sh b/dev/darwin/start-game-localhost.sh index 0a9756c4..01c87d85 100644 --- a/dev/darwin/start-game-localhost.sh +++ b/dev/darwin/start-game-localhost.sh @@ -19,4 +19,4 @@ echo "Username: $ttsUsername" echo "Gameserver: $TTS_GAMESERVER" echo "===============================" -ppython -m toontown.toonbase.ClientStart +ppython -m toontown.toonbase.ToontownStart diff --git a/dev/darwin/start-game-remotedb.sh b/dev/darwin/start-game-remotedb.sh index 0aa0d440..7ff6dfab 100644 --- a/dev/darwin/start-game-remotedb.sh +++ b/dev/darwin/start-game-remotedb.sh @@ -23,4 +23,4 @@ echo "Username: $ttsUsername" echo "Gameserver: $TTS_GAMESERVER" echo "===============================" -ppython -m toontown.toonbase.ClientStartRemoteDB +ppython -m toontown.toonbase.ToontownStartRemoteDB diff --git a/dev/darwin/start-game.sh b/dev/darwin/start-game.sh index 7f32cfe0..aeb9c33f 100644 --- a/dev/darwin/start-game.sh +++ b/dev/darwin/start-game.sh @@ -21,4 +21,4 @@ echo "Username: $ttsUsername" echo "Gameserver: $TTS_GAMESERVER" echo "===============================" -ppython -m toontown.toonbase.ClientStart +ppython -m toontown.toonbase.ToontownStart diff --git a/dev/win32/start-game.bat b/dev/win32/start-game.bat index 61513d9a..908e6c45 100644 --- a/dev/win32/start-game.bat +++ b/dev/win32/start-game.bat @@ -60,11 +60,11 @@ echo =============================== cd ../../ if %INPUT%==2 ( - "C:\Panda3D-1.10.0\python\ppython.exe" -m toontown.toonbase.ClientStartRemoteDB + "C:\Panda3D-1.10.0\python\ppython.exe" -m toontown.toonbase.ToontownStartRemoteDB ) else if %INPUT%==4 ( - "C:\Panda3D-1.10.0\python\ppython.exe" -m toontown.toonbase.ClientStartRemoteDB + "C:\Panda3D-1.10.0\python\ppython.exe" -m toontown.toonbase.ToontownStartRemoteDB ) else ( - "C:\Panda3D-1.10.0\python\ppython.exe" -m toontown.toonbase.ClientStart + "C:\Panda3D-1.10.0\python\ppython.exe" -m toontown.toonbase.ToontownStart ) pause diff --git a/toontown/toonbase/ClientStart.py b/toontown/toonbase/ToontownStart.py old mode 100755 new mode 100644 similarity index 99% rename from toontown/toonbase/ClientStart.py rename to toontown/toonbase/ToontownStart.py index 2249570c..9941f1bb --- a/toontown/toonbase/ClientStart.py +++ b/toontown/toonbase/ToontownStart.py @@ -58,7 +58,7 @@ if __debug__: from direct.directnotify.DirectNotifyGlobal import directNotify -notify = directNotify.newCategory('ClientStart') +notify = directNotify.newCategory('ToontownStart') notify.setInfo(True) from otp.settings.Settings import Settings diff --git a/toontown/toonbase/ClientStartRemoteDB.py b/toontown/toonbase/ToontownStartRemoteDB.py old mode 100755 new mode 100644 similarity index 92% rename from toontown/toonbase/ClientStartRemoteDB.py rename to toontown/toonbase/ToontownStartRemoteDB.py index 6e67f875..2457ef3d --- a/toontown/toonbase/ClientStartRemoteDB.py +++ b/toontown/toonbase/ToontownStartRemoteDB.py @@ -1,30 +1,30 @@ -import json -import os -import requests -from panda3d.core import * - - -username = os.environ['ttsUsername'] -password = os.environ['ttsPassword'] - -accountServerEndpoint = 'http://www.toontownstride.com/api/' -session = requests.Session() -csrf_query = session.get(accountServerEndpoint + 'login/') -csrf = session.cookies.get_dict().get('csrftoken', '') -request = session.post( - accountServerEndpoint + 'login/', - data={'username': username, 'password': password, 'csrfmiddlewaretoken': csrf}) - -try: - response = json.loads('{'+request.text.split('{', 1)[1]) # so that we ignore the csrf token -except ValueError: - print "Couldn't verify account credentials." -else: - if response['status'] != 7: - print response['message'] - else: - os.environ['TTS_PLAYCOOKIE'] = response['token'] - os.environ['TTS_GAMESERVER'] = response['gameserver'] - - # Start the game: - import toontown.toonbase.ClientStart +import json +import os +import requests +from panda3d.core import * + + +username = os.environ['ttsUsername'] +password = os.environ['ttsPassword'] + +accountServerEndpoint = 'http://www.toontownstride.com/api/' +session = requests.Session() +csrf_query = session.get(accountServerEndpoint + 'login/') +csrf = session.cookies.get_dict().get('csrftoken', '') +request = session.post( + accountServerEndpoint + 'login/', + data={'username': username, 'password': password, 'csrfmiddlewaretoken': csrf}) + +try: + response = json.loads('{'+request.text.split('{', 1)[1]) # so that we ignore the csrf token +except ValueError: + print "Couldn't verify account credentials." +else: + if response['status'] != 7: + print response['message'] + else: + os.environ['TTS_PLAYCOOKIE'] = response['token'] + os.environ['TTS_GAMESERVER'] = response['gameserver'] + + # Start the game: + import toontown.toonbase.ToontownStart