mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
what if i like environ
This commit is contained in:
parent
2dfc68ed8b
commit
568eb60cca
2 changed files with 21 additions and 17 deletions
16
client.bat
16
client.bat
|
@ -10,23 +10,23 @@ echo.
|
||||||
set /P INPUT=
|
set /P INPUT=
|
||||||
set server=unset
|
set server=unset
|
||||||
|
|
||||||
if %INPUT%==1 set server=127.0.0.1
|
if %INPUT%==1 set TTU_GAMESERVER=127.0.0.1
|
||||||
if %INPUT%==3 set server=71.200.196.180
|
if %INPUT%==3 set TTU_GAMESERVER=71.200.196.180
|
||||||
|
|
||||||
if %server%==unset (
|
if %TTU_GAMESERVER%==unset (
|
||||||
echo.
|
echo.
|
||||||
set /P server=Gameserver:
|
set /P TTU_GAMESERVER=Gameserver:
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
set /P user=Username:
|
set /P TTU_PLAYCOOKIE=Username:
|
||||||
|
|
||||||
echo ===============================
|
echo ===============================
|
||||||
echo Starting Toontown United...
|
echo Starting Toontown United...
|
||||||
echo ppython: %PPYTHON_PATH%
|
echo ppython: %PPYTHON_PATH%
|
||||||
echo Username: %user%
|
echo Username: %TTU_PLAYCOOKIE%
|
||||||
echo Gameserver: %server%
|
echo Gameserver: %TTU_GAMESERVER%
|
||||||
echo ===============================
|
echo ===============================
|
||||||
|
|
||||||
%PPYTHON_PATH% -m toontown.toonbase.ClientStart %user% %server%
|
%PPYTHON_PATH% -m toontown.toonbase.ClientStart
|
||||||
pause
|
pause
|
|
@ -1,6 +1,8 @@
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
import os, sys, time, argparse
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
class LogAndOutput:
|
class LogAndOutput:
|
||||||
def __init__(self, orig, log):
|
def __init__(self, orig, log):
|
||||||
|
@ -21,13 +23,9 @@ class TTULauncher:
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('TTULauncher')
|
notify = DirectNotifyGlobal.directNotify.newCategory('TTULauncher')
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.logPrefix = 'united-'
|
|
||||||
self.http = HTTPClient()
|
self.http = HTTPClient()
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
self.logPrefix = 'united-'
|
||||||
parser.add_argument('token')
|
|
||||||
parser.add_argument('server')
|
|
||||||
self.args = parser.parse_args()
|
|
||||||
|
|
||||||
ltime = 1 and time.localtime()
|
ltime = 1 and time.localtime()
|
||||||
logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2], ltime[3], ltime[4], ltime[5])
|
logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2], ltime[3], ltime[4], ltime[5])
|
||||||
|
@ -45,10 +43,16 @@ class TTULauncher:
|
||||||
sys.stderr = logErr
|
sys.stderr = logErr
|
||||||
|
|
||||||
def getPlayToken(self):
|
def getPlayToken(self):
|
||||||
return self.args.token
|
return self.getValue('TTU_PLAYCOOKIE')
|
||||||
|
|
||||||
def getGameServer(self):
|
def getGameServer(self):
|
||||||
return self.args.server
|
return self.getValue('TTU_GAMESERVER')
|
||||||
|
|
||||||
|
def getValue(self, key, default = None):
|
||||||
|
return os.environ.get(key, default)
|
||||||
|
|
||||||
|
def setValue(self, key, value):
|
||||||
|
os.environ[key] = str(value)
|
||||||
|
|
||||||
def setPandaErrorCode(self):
|
def setPandaErrorCode(self):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue