mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 03:35:12 -06:00
Remove LeaveToPayDialog and a few Disney launchers
This commit is contained in:
parent
702d65198d
commit
9f29fb2011
12 changed files with 3 additions and 490 deletions
|
@ -4,8 +4,6 @@ from direct.fsm import State
|
|||
from direct.gui.DirectGui import *
|
||||
from direct.showbase import DirectObject
|
||||
from pandac.PandaModules import *
|
||||
|
||||
from otp.login import LeaveToPayDialog
|
||||
from otp.login import PrivacyPolicyPanel
|
||||
from otp.login import SecretFriendsInfoPanel
|
||||
from otp.otpbase import OTPLocalizer
|
||||
|
@ -59,7 +57,6 @@ class ChatManager(DirectObject.DirectObject):
|
|||
self.chatPrivacyPolicy = None
|
||||
self.secretChatActivated = None
|
||||
self.problemActivatingChat = None
|
||||
self.leaveToPayDialog = None
|
||||
self.fsm = ClassicFSM.ClassicFSM('chatManager', [State.State('off', self.enterOff, self.exitOff),
|
||||
State.State('mainMenu', self.enterMainMenu, self.exitMainMenu),
|
||||
State.State('speedChat', self.enterSpeedChat, self.exitSpeedChat),
|
||||
|
@ -70,7 +67,6 @@ class ChatManager(DirectObject.DirectObject):
|
|||
State.State('whisperSpeedChat', self.enterWhisperSpeedChat, self.exitWhisperSpeedChat),
|
||||
State.State('whisperSpeedChatPlayer', self.enterWhisperSpeedChatPlayer, self.exitWhisperSpeedChatPlayer),
|
||||
State.State('openChatWarning', self.enterOpenChatWarning, self.exitOpenChatWarning),
|
||||
State.State('leaveToPayDialog', self.enterLeaveToPayDialog, self.exitLeaveToPayDialog),
|
||||
State.State('unpaidChatWarning', self.enterUnpaidChatWarning, self.exitUnpaidChatWarning),
|
||||
State.State('noSecretChatAtAll', self.enterNoSecretChatAtAll, self.exitNoSecretChatAtAll),
|
||||
State.State('noSecretChatAtAllAndNoWhitelist', self.enterNoSecretChatAtAllAndNoWhitelist, self.exitNoSecretChatAtAllAndNoWhitelist),
|
||||
|
@ -409,19 +405,6 @@ class ChatManager(DirectObject.DirectObject):
|
|||
def exitOpenChatWarning(self):
|
||||
self.notify.error('called exitOpenChatWarning() on parent class')
|
||||
|
||||
def enterLeaveToPayDialog(self):
|
||||
if self.leaveToPayDialog == None:
|
||||
self.leaveToPayDialog = LeaveToPayDialog.LeaveToPayDialog(self.paidNoParentPassword)
|
||||
self.leaveToPayDialog.setCancel(self.__handleLeaveToPayCancel)
|
||||
self.leaveToPayDialog.show()
|
||||
return
|
||||
|
||||
def exitLeaveToPayDialog(self):
|
||||
if self.leaveToPayDialog:
|
||||
self.leaveToPayDialog.destroy()
|
||||
self.leaveToPayDialog = None
|
||||
return
|
||||
|
||||
def enterUnpaidChatWarning(self):
|
||||
self.notify.error('called enterUnpaidChatWarning() on parent class')
|
||||
|
||||
|
@ -506,9 +489,6 @@ class ChatManager(DirectObject.DirectObject):
|
|||
def exitTrueFriendTeaserPanel(self):
|
||||
self.notify.error('called exitTrueFriendTeaserPanel () on parent class')
|
||||
|
||||
def __handleLeaveToPayCancel(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __secretFriendsInfoDone(self):
|
||||
self.fsm.request('activateChat')
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ from otp.login import HTTPUtil
|
|||
from otp.login import LoginTTUAccount
|
||||
from otp.login.CreateAccountScreen import CreateAccountScreen
|
||||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLauncherGlobals
|
||||
from otp.otpbase import OTPLocalizer
|
||||
from otp.otpgui import OTPDialog
|
||||
from toontown.chat.ChatGlobals import *
|
||||
|
@ -1104,10 +1103,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
leakedGarbage = self.detectLeakedGarbage()
|
||||
if leakedTasks or leakedEvents or leakedIvals or leakedGarbage:
|
||||
errorCode = base.getExitErrorCode()
|
||||
if errorCode >= OTPLauncherGlobals.NonErrorExitStateStart and errorCode <= OTPLauncherGlobals.NonErrorExitStateEnd:
|
||||
logFunc = self.notify.warning
|
||||
allowExit = True
|
||||
elif __debug__ and not PythonUtil.configIsToday('temp-disable-leak-detection'):
|
||||
if __debug__ and not PythonUtil.configIsToday('temp-disable-leak-detection'):
|
||||
logFunc = self.notify.error
|
||||
allowExit = False
|
||||
else:
|
||||
|
|
|
@ -1,95 +0,0 @@
|
|||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLauncherGlobals
|
||||
from otp.otpbase import OTPLocalizer
|
||||
from direct.gui.DirectGui import *
|
||||
from pandac.PandaModules import *
|
||||
import os
|
||||
|
||||
class LeaveToPayDialog:
|
||||
|
||||
def __init__(self, paidUser, destructorHook = None, doneFunc = None):
|
||||
self.destructorHook = destructorHook
|
||||
self.dialog = None
|
||||
self.okHandler = self.__handleLeaveToPayOK
|
||||
self.cancelHandler = self.__handleLeaveToPayCancel
|
||||
self.paidUser = paidUser
|
||||
self.doneFunc = doneFunc
|
||||
return
|
||||
|
||||
def setOK(self, handler):
|
||||
self.okHandler = handler
|
||||
|
||||
def setCancel(self, handler):
|
||||
self.cancelHandler = handler
|
||||
|
||||
def show(self):
|
||||
if self.paidUser:
|
||||
if base.cr.productName in ['DisneyOnline-AP',
|
||||
'DisneyOnline-UK',
|
||||
'JP',
|
||||
'FR']:
|
||||
directFrameText = OTPLocalizer.LeaveToEnableChatUK
|
||||
directButtonYesText = OTPLocalizer.LeaveToEnableChatUKYes
|
||||
directButtonNoText = OTPLocalizer.LeaveToEnableChatUKNo
|
||||
else:
|
||||
directFrameText = OTPLocalizer.LeaveToSetParentPassword
|
||||
directButtonYesText = OTPLocalizer.LeaveToSetParentPasswordYes
|
||||
directButtonNoText = OTPLocalizer.LeaveToSetParentPasswordNo
|
||||
else:
|
||||
directFrameText = OTPLocalizer.LeaveToPay
|
||||
directButtonYesText = OTPLocalizer.LeaveToPayYes
|
||||
directButtonNoText = OTPLocalizer.LeaveToPayNo
|
||||
if self.dialog == None:
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
okButtonImage = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
|
||||
cancelButtonImage = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr'))
|
||||
self.dialog = DirectFrame(parent=aspect2dp, pos=(0.0, 0.0, 0.0), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(0.9, 1.0, 0.5), text=directFrameText, text_align=TextNode.ALeft, text_wordwrap=14, text_scale=OTPLocalizer.LTPDdirectFrameText, text_pos=(-0.4, 0.15), textMayChange=0)
|
||||
DirectButton(self.dialog, image=okButtonImage, relief=None, text=directButtonYesText, text_scale=OTPLocalizer.LTPDdirectButtonYesText, text_pos=(0.0, -0.1), textMayChange=0, pos=(-0.23, 0.0, -0.1), command=self.okHandler)
|
||||
DirectButton(self.dialog, image=cancelButtonImage, relief=None, text=directButtonNoText, text_scale=OTPLocalizer.LTPDdirectButtonNoText, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.23, 0.0, -0.1), command=self.cancelHandler)
|
||||
buttons.removeNode()
|
||||
self.dialog.show()
|
||||
return
|
||||
|
||||
def hide(self):
|
||||
self.dialog.hide()
|
||||
|
||||
def destroy(self):
|
||||
if self.destructorHook:
|
||||
self.destructorHook()
|
||||
if self.dialog:
|
||||
self.dialog.hide()
|
||||
self.dialog.destroy()
|
||||
self.destructorHook
|
||||
self.dialog = None
|
||||
self.okHandler = None
|
||||
self.cancelHandler = None
|
||||
return
|
||||
|
||||
def removed(self):
|
||||
if hasattr(self, 'dialog') and self.dialog:
|
||||
return self.dialog.removed()
|
||||
else:
|
||||
return 1
|
||||
|
||||
def __handleLeaveToPayOK(self):
|
||||
self.destroy()
|
||||
errorCode = None
|
||||
if self.paidUser:
|
||||
if base.cr.productName in ['DisneyOnline-AP',
|
||||
'DisneyOnline-UK',
|
||||
'JP',
|
||||
'DE',
|
||||
'FR']:
|
||||
errorCode = OTPLauncherGlobals.ExitEnableChat
|
||||
else:
|
||||
errorCode = OTPLauncherGlobals.ExitSetParentPassword
|
||||
else:
|
||||
errorCode = OTPLauncherGlobals.ExitPurchase
|
||||
base.setExitErrorCode(errorCode)
|
||||
base.cr.loginFSM.request('shutdown', [errorCode])
|
||||
return
|
||||
|
||||
def __handleLeaveToPayCancel(self):
|
||||
if self.doneFunc:
|
||||
self.doneFunc()
|
||||
self.destroy()
|
|
@ -1,7 +0,0 @@
|
|||
NonErrorExitStateStart = 100
|
||||
ExitPurchase = 100
|
||||
ExitSetParentPassword = 101
|
||||
ExitEnableChat = 102
|
||||
ExitTimeExpired = 103
|
||||
ExitUpsell = 104
|
||||
NonErrorExitStateEnd = 199
|
|
@ -137,9 +137,6 @@ SecretFriendsInfoPanelText = ['\nThe Open Chat with True Friends Feature\n\nThe
|
|||
'\nbecome True Friends, one of them must request a new True Friend Code from the Service and communicate it to the other.\n\nTrue Friends communicate with one another in a free-form interactive open chat. The content of this chat is directly entered by the participating member and is processed through the Service, which is monitored by the Toontown Unlimited team. While we advise members not to exchange personal information such as first and last names, e-mail addresses, postal addresses, or phone numbers while using Open Chat with True Friends, we cannot guarantee that such exchanges of personal information will not happen. Although the True Friends chat is automatically filtered for most bad words, Open Chat with True Friends may be moderated, and we reserve the right to moderate any part of the Service that we,\n',
|
||||
"\nin our sole and absolute discretion, deems necessary. However, because Open Chat with True Friends will not always be moderated, if the Parent Account allows a child to use his or her account with the Open Chat with True Friends feature enabled, we strongly encourage parents to supervise their child or children while they play in the Service. By enabling the Open Chat with True Friends feature, the Parent Account acknowledges that there are some risks inherent in the Open Chat with True Friends feature and that the Parent Account has been informed of, and agrees to accept, any such risks, whether foreseeable or otherwise. \n\nWDIG does not use the content of True Friends chat for any purpose other than communicating that content to the member's true friend, and does not disclose that content to any third party except: (1) if required by law, for example, to comply with a court order or subpoena; (2) to enforce the Terms of Use\n",
|
||||
"\napplicable to the Service (which may be accessed on the home page of the Service); or, (3) to protect the safety and security of Members of the Service and the Service itself. In accordance with the Children's Online Privacy Protection Act, we are prohibited from conditioning, and do not condition, a child's participation in any activity (including Open Chat with True Friends) on the child's disclosing more personal information than is reasonably necessary to participate in such activity.\n\nIn addition, as noted above, we recognize the right of a parent to refuse to permit us to continue to allow a child to use the True Friends feature. By enabling the Open Chat with True Friends feature, you acknowledge that there are some risks inherent in the ability of members to open chat with one another through the Open Chat with True Friends feature, and that you have been informed of, and agree to accept, any such risks, whether foreseeable or otherwise.\n"]
|
||||
LeaveToPay = 'Click Purchase to exit the game and buy a Membership at toontown.com'
|
||||
LeaveToPayYes = 'Purchase'
|
||||
LeaveToPayNo = lCancel
|
||||
LeaveToSetParentPassword = 'In order to set parent account password, the game will exit to the Toontown website.'
|
||||
LeaveToSetParentPasswordYes = 'Set Password'
|
||||
LeaveToSetParentPasswordNo = lCancel
|
||||
|
|
|
@ -493,10 +493,7 @@ class ToontownChatManager(ChatManager.ChatManager):
|
|||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleUnpaidChatWarningPay(self):
|
||||
if base.cr.isWebPlayToken():
|
||||
self.fsm.request('leaveToPayDialog')
|
||||
else:
|
||||
self.fsm.request('mainMenu')
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleNoSecretChatAtAllOK(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
|
|
@ -25,7 +25,6 @@ from otp.distributed.OtpDoGlobals import *
|
|||
from otp.distributed import OtpDoGlobals
|
||||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLocalizer
|
||||
from otp.otpbase import OTPLauncherGlobals
|
||||
from otp.avatar.Avatar import teleportNotify
|
||||
from toontown.toonbase.ToonBaseGlobal import *
|
||||
from toontown.toonbase.ToontownGlobals import *
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from otp.launcher.DummyLauncherBase import DummyLauncherBase
|
||||
from toontown.launcher.ToontownLauncher import ToontownLauncher
|
||||
|
||||
class ToontownDummyLauncher(DummyLauncherBase, ToontownLauncher):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ToontownDummyLauncher')
|
||||
|
||||
def __init__(self):
|
||||
DummyLauncherBase.__init__(self)
|
||||
self.setPhaseComplete(1, 100)
|
||||
self.setPhaseComplete(2, 100)
|
||||
self.setPhaseComplete(3, 100)
|
||||
self.tutorialComplete = 1
|
||||
self.frequency = 0.0
|
||||
self.windowOpen = 0
|
||||
self.firstPhase = 3.5
|
||||
self.pandaErrorCodeKey = 'PANDA_ERROR_CODE'
|
||||
self.goUserName = ''
|
||||
self.periodTimeRemainingKey = 'PERIOD_TIME_REMAINING'
|
||||
self.periodNameKey = 'PERIOD_NAME'
|
||||
self.swidKey = 'SWID'
|
||||
self.reg = {}
|
||||
self.startFakeDownload()
|
||||
|
||||
def setTutorialComplete(self, complete):
|
||||
self.tutorialComplete = complete
|
||||
|
||||
def getTutorialComplete(self):
|
||||
return self.tutorialComplete
|
||||
|
||||
def setFrequency(self, freq):
|
||||
self.frequency = freq
|
||||
|
||||
def getFrequency(self):
|
||||
return self.frequency
|
||||
|
||||
def getInstallDir(self):
|
||||
return 'C:\\Program Files\\Disney\\Disney Online\\Toontown'
|
||||
|
||||
def getUserName(self):
|
||||
return 'dummy'
|
||||
|
||||
def getReferrerCode(self):
|
||||
return None
|
||||
|
||||
def setRegistry(self, name, value):
|
||||
print 'setRegistry[%s] = %s' % (name, value)
|
||||
self.reg[name] = value
|
||||
|
||||
def getRegistry(self, name, defaultValue = None):
|
||||
if name in self.reg:
|
||||
value = self.reg[name]
|
||||
else:
|
||||
value = defaultValue
|
||||
print 'getRegistry[%s] = %s' % (name, value)
|
||||
return value
|
||||
|
||||
def getGame2Done(self):
|
||||
return 1
|
||||
|
||||
def recordPeriodTimeRemaining(self, secondsRemaining):
|
||||
self.setRegistry(self.periodTimeRemainingKey, secondsRemaining)
|
||||
|
||||
def recordPeriodName(self, periodName):
|
||||
self.setRegistry(self.periodNameKey, periodName)
|
||||
|
||||
def recordSwid(self, swid):
|
||||
self.setRegistry(self.swidKey, swid)
|
||||
|
||||
def getGoUserName(self):
|
||||
return self.goUserName
|
||||
|
||||
def setGoUserName(self, userName):
|
||||
self.goUserName = userName
|
||||
|
||||
def getParentPasswordSet(self):
|
||||
return 0
|
||||
|
||||
def getNeedPwForSecretKey(self):
|
||||
return 0
|
|
@ -1,255 +0,0 @@
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
import types
|
||||
|
||||
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])
|
||||
|
||||
logfile = 'toontownD-' + logSuffix + '.log'
|
||||
|
||||
class LogAndOutput:
|
||||
def __init__(self, orig, log):
|
||||
self.orig = orig
|
||||
self.log = log
|
||||
|
||||
def write(self, str):
|
||||
self.log.write(str)
|
||||
self.log.flush()
|
||||
self.orig.write(str)
|
||||
self.orig.flush()
|
||||
|
||||
def flush(self):
|
||||
self.log.flush()
|
||||
self.orig.flush()
|
||||
|
||||
log = open(logfile, 'a')
|
||||
logOut = LogAndOutput(sys.__stdout__, log)
|
||||
logErr = LogAndOutput(sys.__stderr__, log)
|
||||
sys.stdout = logOut
|
||||
sys.stderr = logErr
|
||||
|
||||
print('\n\nStarting Toontown...')
|
||||
|
||||
if 1:
|
||||
print 'Current time: ' + time.asctime(time.localtime(time.time())) + ' ' + time.tzname[0]
|
||||
print 'sys.path = ', sys.path
|
||||
print 'sys.argv = ', sys.argv
|
||||
|
||||
from otp.launcher.LauncherBase import LauncherBase
|
||||
from otp.otpbase import OTPLauncherGlobals
|
||||
from panda3d.core import *
|
||||
from toontown.toonbase import TTLocalizer
|
||||
|
||||
class ToontownLauncher(LauncherBase):
|
||||
GameName = 'Toontown'
|
||||
LauncherPhases = [3, 3.5, 4, 5, 5.5, 6, 7, 8, 9, 10, 11, 12, 13]
|
||||
TmpOverallMap = [0.25, 0.15, 0.12, 0.17, 0.08, 0.07, 0.05, 0.05, 0.017,
|
||||
0.011, 0.01, 0.012, 0.01]
|
||||
RegistryKey = 'Software\\Disney\\Disney Online\\Toontown'
|
||||
ForegroundSleepTime = 0.01
|
||||
Localizer = TTLocalizer
|
||||
VerifyFiles = 1
|
||||
DecompressMultifiles = True
|
||||
|
||||
def __init__(self):
|
||||
if sys.argv[2] == 'Phase2.py':
|
||||
sys.argv = sys.argv[:1] + sys.argv[3:]
|
||||
if len(sys.argv) == 5 or len(sys.argv) == 6:
|
||||
self.gameServer = sys.argv[2]
|
||||
self.accountServer = sys.argv[3]
|
||||
self.testServerFlag = int(sys.argv[4])
|
||||
else:
|
||||
print 'Error: Launcher: incorrect number of parameters'
|
||||
sys.exit()
|
||||
|
||||
self.toontownBlueKey = 'TOONTOWN_BLUE'
|
||||
self.toontownPlayTokenKey = 'TTU_PLAYCOOKIE'
|
||||
self.launcherMessageKey = 'LAUNCHER_MESSAGE'
|
||||
self.game1DoneKey = 'GAME1_DONE'
|
||||
self.game2DoneKey = 'GAME2_DONE'
|
||||
self.tutorialCompleteKey = 'TUTORIAL_DONE'
|
||||
self.toontownRegistryKey = 'Software\\Disney\\Disney Online\\Toontown'
|
||||
if self.testServerFlag:
|
||||
self.toontownRegistryKey = '%s%s' % (self.toontownRegistryKey, 'Test')
|
||||
self.toontownRegistryKey = '%s%s' % (self.toontownRegistryKey, self.getProductName())
|
||||
LauncherBase.__init__(self)
|
||||
self.webAcctParams = 'WEB_ACCT_PARAMS'
|
||||
self.parseWebAcctParams()
|
||||
self.mainLoop()
|
||||
|
||||
def getValue(self, key, default=None):
|
||||
try:
|
||||
return self.getRegistry(key, default)
|
||||
except:
|
||||
return self.getRegistry(key)
|
||||
|
||||
def setValue(self, key, value):
|
||||
self.setRegistry(key, value)
|
||||
|
||||
def getVerifyFiles(self):
|
||||
return 1
|
||||
|
||||
def getTestServerFlag(self):
|
||||
return self.testServerFlag
|
||||
|
||||
def getGameServer(self):
|
||||
return self.gameServer
|
||||
|
||||
def getLogFileName(self):
|
||||
return 'toontown'
|
||||
|
||||
def parseWebAcctParams(self):
|
||||
s = config.GetString('fake-web-acct-params', '')
|
||||
if not s:
|
||||
s = self.getRegistry(self.webAcctParams)
|
||||
self.setRegistry(self.webAcctParams, '')
|
||||
l = s.split('&')
|
||||
length = len(l)
|
||||
dict = {}
|
||||
for index in xrange(0, len(l)):
|
||||
args = l[index].split('=')
|
||||
if len(args) == 3:
|
||||
[name, value] = args[-2:]
|
||||
dict[name] = int(value)
|
||||
elif len(args) == 2:
|
||||
[name, value] = args
|
||||
dict[name] = int(value)
|
||||
|
||||
self.secretNeedsParentPasswordKey = 1
|
||||
if 'secretsNeedsParentPassword' in dict:
|
||||
self.secretNeedsParentPasswordKey = dict['secretsNeedsParentPassword']
|
||||
else:
|
||||
self.notify.warning('no secretNeedsParentPassword token in webAcctParams')
|
||||
self.notify.info('secretNeedsParentPassword = %d' % self.secretNeedsParentPasswordKey)
|
||||
|
||||
self.chatEligibleKey = 0
|
||||
if 'chatEligible' in dict:
|
||||
self.chatEligibleKey = dict['chatEligible']
|
||||
else:
|
||||
self.notify.warning('no chatEligible token in webAcctParams')
|
||||
self.notify.info('chatEligibleKey = %d' % self.chatEligibleKey)
|
||||
|
||||
def getBlue(self):
|
||||
blue = self.getValue(self.toontownBlueKey)
|
||||
self.setValue(self.toontownBlueKey, '')
|
||||
if blue == 'NO BLUE':
|
||||
blue = None
|
||||
return blue
|
||||
|
||||
def getPlayToken(self):
|
||||
playToken = self.getValue(self.toontownPlayTokenKey)
|
||||
self.setValue(self.toontownPlayTokenKey, '')
|
||||
if playToken == 'NO PLAYTOKEN':
|
||||
playToken = None
|
||||
return playToken
|
||||
|
||||
def setRegistry(self, name, value):
|
||||
if not self.WIN32:
|
||||
return
|
||||
|
||||
t = type(value)
|
||||
if t == types.IntType:
|
||||
WindowsRegistry.setIntValue(self.toontownRegistryKey, name, value)
|
||||
elif t == types.StringType:
|
||||
WindowsRegistry.setStringValue(self.toontownRegistryKey, name, value)
|
||||
else:
|
||||
self.notify.warning('setRegistry: Invalid type for registry value: ' + `value`)
|
||||
|
||||
def getRegistry(self, name, missingValue=None):
|
||||
self.notify.info('getRegistry%s' % ((name, missingValue),))
|
||||
if not self.WIN32:
|
||||
if missingValue == None:
|
||||
missingValue = ''
|
||||
value = os.environ.get(name, missingValue)
|
||||
try:
|
||||
value = int(value)
|
||||
except: pass
|
||||
return value
|
||||
|
||||
t = WindowsRegistry.getKeyType(self.toontownRegistryKey, name)
|
||||
if t == WindowsRegistry.TInt:
|
||||
if missingValue == None:
|
||||
missingValue = 0
|
||||
return WindowsRegistry.getIntValue(self.toontownRegistryKey,
|
||||
name, missingValue)
|
||||
elif t == WindowsRegistry.TString:
|
||||
if missingValue == None:
|
||||
missingValue = ''
|
||||
return WindowsRegistry.getStringValue(self.toontownRegistryKey,
|
||||
name, missingValue)
|
||||
else:
|
||||
return missingValue
|
||||
|
||||
def getCDDownloadPath(self, origPath, serverFilePath):
|
||||
return '%s/%s%s/CD_%d/%s' % (origPath, self.ServerVersion, self.ServerVersionSuffix, self.fromCD, serverFilePath)
|
||||
|
||||
def getDownloadPath(self, origPath, serverFilePath):
|
||||
return '%s/%s%s/%s' % (origPath, self.ServerVersion, self.ServerVersionSuffix, serverFilePath)
|
||||
|
||||
def getPercentPatchComplete(self, bytesWritten):
|
||||
if self.totalPatchDownload:
|
||||
return LauncherBase.getPercentPatchComplete(self, bytesWritten)
|
||||
else:
|
||||
return 0
|
||||
|
||||
def hashIsValid(self, serverHash, hashStr):
|
||||
return serverHash.setFromDec(hashStr) or serverHash.setFromHex(hashStr)
|
||||
|
||||
def launcherMessage(self, msg):
|
||||
LauncherBase.launcherMessage(self, msg)
|
||||
self.setRegistry(self.launcherMessageKey, msg)
|
||||
|
||||
def getAccountServer(self):
|
||||
return self.accountServer
|
||||
|
||||
def setTutorialComplete(self):
|
||||
self.setRegistry(self.tutorialCompleteKey, 0)
|
||||
|
||||
def getTutorialComplete(self):
|
||||
return self.getRegistry(self.tutorialCompleteKey, 0)
|
||||
|
||||
def getGame2Done(self):
|
||||
return self.getRegistry(self.game2DoneKey, 0)
|
||||
|
||||
def setPandaErrorCode(self, code):
|
||||
self.pandaErrorCode = code
|
||||
if self.WIN32:
|
||||
self.notify.info('setting panda error code to %s' % code)
|
||||
exitCode2exitPage = {
|
||||
OTPLauncherGlobals.ExitEnableChat: 'chat',
|
||||
OTPLauncherGlobals.ExitSetParentPassword: 'setparentpassword',
|
||||
OTPLauncherGlobals.ExitPurchase: 'purchase'}
|
||||
if code in exitCode2exitPage:
|
||||
self.setRegistry('EXIT_PAGE', exitCode2exitPage[code])
|
||||
self.setRegistry(self.PandaErrorCodeKey, 0)
|
||||
else:
|
||||
self.setRegistry(self.PandaErrorCodeKey, code)
|
||||
else:
|
||||
LauncherBase.setPandaErrorCode(self, code)
|
||||
|
||||
def getNeedPwForSecretKey(self):
|
||||
return self.secretNeedsParentPasswordKey
|
||||
|
||||
def getParentPasswordSet(self):
|
||||
return self.chatEligibleKey
|
||||
|
||||
def MakeNTFSFilesGlobalWriteable(self, pathToSet=None):
|
||||
if not self.WIN32:
|
||||
return
|
||||
LauncherBase.MakeNTFSFilesGlobalWriteable(self, pathToSet)
|
||||
|
||||
def startGame(self):
|
||||
try:
|
||||
os.remove('Phase3.py')
|
||||
except: pass
|
||||
|
||||
import Phase3
|
||||
|
||||
self.newTaskManager()
|
||||
|
||||
from direct.showbase.EventManagerGlobal import eventMgr
|
||||
eventMgr.restart()
|
||||
|
||||
from toontown.toonbase import ToontownStart
|
|
@ -19,7 +19,6 @@ import Toon
|
|||
from otp.avatar import DistributedPlayer
|
||||
from otp.avatar import LocalAvatar
|
||||
from otp.avatar import PositionExaminer
|
||||
from otp.login import LeaveToPayDialog
|
||||
from otp.otpbase import OTPGlobals
|
||||
from toontown.achievements import AchievementGui
|
||||
from toontown.battle import Fanfare
|
||||
|
@ -438,8 +437,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
paidNoParentPassword = launcher and not launcher.getParentPasswordSet()
|
||||
else:
|
||||
paidNoParentPassword = 0
|
||||
self.leaveToPayDialog = LeaveToPayDialog.LeaveToPayDialog(paidNoParentPassword, self.purchaseButton.show)
|
||||
self.leaveToPayDialog.show()
|
||||
else:
|
||||
self.notify.error('You should not get here without a PlayToken')
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import ToontownGlobals
|
|||
import ToontownLoader
|
||||
from otp.otpbase import OTPBase
|
||||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLauncherGlobals
|
||||
from toontown.launcher import ToontownDownloadWatcher
|
||||
from toontown.margins import MarginGlobals
|
||||
from toontown.margins.MarginManager import MarginManager
|
||||
|
@ -473,12 +472,6 @@ class ToonBase(OTPBase.OTPBase):
|
|||
|
||||
def setExitErrorCode(self, code):
|
||||
self.exitErrorCode = code
|
||||
if os.name == 'nt':
|
||||
exitCode2exitPage = {OTPLauncherGlobals.ExitEnableChat: 'chat',
|
||||
OTPLauncherGlobals.ExitSetParentPassword: 'setparentpassword',
|
||||
OTPLauncherGlobals.ExitPurchase: 'purchase'}
|
||||
if code in exitCode2exitPage:
|
||||
launcher.setRegistry('EXIT_PAGE', exitCode2exitPage[code])
|
||||
|
||||
def getExitErrorCode(self):
|
||||
return self.exitErrorCode
|
||||
|
|
|
@ -7,7 +7,6 @@ import TTDialog
|
|||
from toontown.toonbase import TTLocalizer
|
||||
from direct.showbase import PythonUtil
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from otp.login import LeaveToPayDialog
|
||||
Pages = {'otherHoods': (TTLocalizer.TeaserOtherHoods,),
|
||||
'typeAName': (TTLocalizer.TeaserTypeAName,),
|
||||
'sixToons': (TTLocalizer.TeaserSixToons,),
|
||||
|
@ -87,15 +86,7 @@ class TeaserPanel(DirectObject):
|
|||
self.doneFunc()
|
||||
|
||||
def __handlePay(self):
|
||||
if base.cr.isWebPlayToken() or __dev__:
|
||||
if self.leaveDialog == None:
|
||||
self.notify.debug('making LTP')
|
||||
self.leaveDialog = LeaveToPayDialog.LeaveToPayDialog(0, doneFunc=self.doneFunc)
|
||||
self.notify.debug('showing LTP')
|
||||
self.leaveDialog.show()
|
||||
else:
|
||||
self.notify.error('You should not have a TeaserPanel without a PlayToken')
|
||||
return
|
||||
pass
|
||||
|
||||
def destroy(self):
|
||||
self.cleanup()
|
||||
|
|
Loading…
Reference in a new issue