mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Holocaust - prepare for chat update
This commit is contained in:
parent
54f50c811e
commit
11913788e9
33 changed files with 81 additions and 1406 deletions
|
@ -198,8 +198,6 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame):
|
|||
self.sendChatBySwitch(text)
|
||||
if self.wantHistory:
|
||||
self.addToHistory(text)
|
||||
else:
|
||||
localAvatar.chatMgr.deactivateChat()
|
||||
|
||||
if not overflow:
|
||||
self.hide()
|
||||
|
|
|
@ -43,15 +43,8 @@ class ChatManager(DirectObject.DirectObject):
|
|||
self.wantBackgroundFocus = 1
|
||||
self.__scObscured = 0
|
||||
self.__normalObscured = 0
|
||||
self.openChatWarning = None
|
||||
self.unpaidChatWarning = None
|
||||
self.paidNoParentPassword = None
|
||||
self.noSecretChatAtAll = None
|
||||
self.noSecretChatAtAllAndNoWhitelist = None
|
||||
self.noSecretChatWarning = None
|
||||
self.activateChatGui = None
|
||||
self.secretChatActivated = None
|
||||
self.problemActivatingChat = 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),
|
||||
|
@ -61,16 +54,9 @@ class ChatManager(DirectObject.DirectObject):
|
|||
State.State('whisperChatPlayer', self.enterWhisperChatPlayer, self.exitWhisperChatPlayer),
|
||||
State.State('whisperSpeedChat', self.enterWhisperSpeedChat, self.exitWhisperSpeedChat),
|
||||
State.State('whisperSpeedChatPlayer', self.enterWhisperSpeedChatPlayer, self.exitWhisperSpeedChatPlayer),
|
||||
State.State('openChatWarning', self.enterOpenChatWarning, self.exitOpenChatWarning),
|
||||
State.State('unpaidChatWarning', self.enterUnpaidChatWarning, self.exitUnpaidChatWarning),
|
||||
State.State('noSecretChatAtAll', self.enterNoSecretChatAtAll, self.exitNoSecretChatAtAll),
|
||||
State.State('noSecretChatAtAllAndNoWhitelist', self.enterNoSecretChatAtAllAndNoWhitelist, self.exitNoSecretChatAtAllAndNoWhitelist),
|
||||
State.State('noSecretChatWarning', self.enterNoSecretChatWarning, self.exitNoSecretChatWarning),
|
||||
State.State('noFriendsWarning', self.enterNoFriendsWarning, self.exitNoFriendsWarning),
|
||||
State.State('otherDialog', self.enterOtherDialog, self.exitOtherDialog),
|
||||
State.State('activateChat', self.enterActivateChat, self.exitActivateChat),
|
||||
State.State('secretChatActivated', self.enterSecretChatActivated, self.exitSecretChatActivated),
|
||||
State.State('problemActivatingChat', self.enterProblemActivatingChat, self.exitProblemActivatingChat),
|
||||
State.State('whiteListOpenChat', self.enterWhiteListOpenChat, self.exitWhiteListOpenChat),
|
||||
State.State('whiteListAvatarChat', self.enterWhiteListAvatarChat, self.exitWhiteListAvatarChat),
|
||||
State.State('whiteListPlayerChat', self.enterWhiteListPlayerChat, self.exitWhiteListPlayerChat)], 'off', 'off')
|
||||
|
@ -86,31 +72,12 @@ class ChatManager(DirectObject.DirectObject):
|
|||
del self.chatInputNormal
|
||||
self.chatInputSpeedChat.delete()
|
||||
del self.chatInputSpeedChat
|
||||
if self.openChatWarning:
|
||||
self.openChatWarning.destroy()
|
||||
self.openChatWarning = None
|
||||
if self.unpaidChatWarning:
|
||||
self.payButton = None
|
||||
self.unpaidChatWarning.destroy()
|
||||
self.unpaidChatWarning = None
|
||||
if self.noSecretChatAtAll:
|
||||
self.noSecretChatAtAll.destroy()
|
||||
self.noSecretChatAtAll = None
|
||||
if self.noSecretChatAtAllAndNoWhitelist:
|
||||
self.noSecretChatAtAllAndNoWhitelist.destroy()
|
||||
self.noSecretChatAtAllAndNoWhitelist = None
|
||||
if self.noSecretChatWarning:
|
||||
self.noSecretChatWarning.destroy()
|
||||
self.noSecretChatWarning = None
|
||||
if self.activateChatGui:
|
||||
self.activateChatGui.destroy()
|
||||
self.activateChatGui = None
|
||||
if self.secretChatActivated:
|
||||
self.secretChatActivated.destroy()
|
||||
self.secretChatActivated = None
|
||||
if self.problemActivatingChat:
|
||||
self.problemActivatingChat.destroy()
|
||||
self.problemActivatingChat = None
|
||||
del self.localAvatar
|
||||
del self.cr
|
||||
return
|
||||
|
@ -381,18 +348,6 @@ class ChatManager(DirectObject.DirectObject):
|
|||
def exitNormalChat(self):
|
||||
self.chatInputNormal.deactivate()
|
||||
|
||||
def enterOpenChatWarning(self):
|
||||
self.notify.error('called enterOpenChatWarning() on parent class')
|
||||
|
||||
def exitOpenChatWarning(self):
|
||||
self.notify.error('called exitOpenChatWarning() on parent class')
|
||||
|
||||
def enterUnpaidChatWarning(self):
|
||||
self.notify.error('called enterUnpaidChatWarning() on parent class')
|
||||
|
||||
def exitUnpaidChatWarning(self):
|
||||
self.notify.error('called exitUnpaidChatWarning() on parent class')
|
||||
|
||||
def enterNoSecretChatAtAll(self):
|
||||
self.notify.error('called enterNoSecretChatAtAll() on parent class')
|
||||
|
||||
|
@ -405,38 +360,8 @@ class ChatManager(DirectObject.DirectObject):
|
|||
def exitNoSecretChatAtAllAndNoWhitelist(self):
|
||||
self.notify.error('called exitNoSecretChatAtAllAndNoWhitelist() on parent class')
|
||||
|
||||
def enterNoSecretChatWarning(self):
|
||||
self.notify.error('called enterNoSecretChatWarning() on parent class')
|
||||
|
||||
def exitNoSecretChatWarning(self):
|
||||
self.notify.error('called exitNoSecretChatWarning() on parent class')
|
||||
|
||||
def enterNoFriendsWarning(self):
|
||||
self.notify.error('called enterNoFriendsWarning() on parent class')
|
||||
|
||||
def exitNoFriendsWarning(self):
|
||||
self.notify.error('called exitNoFriendsWarning() on parent class')
|
||||
|
||||
def enterActivateChat(self):
|
||||
self.notify.error('called enterActivateChat() on parent class')
|
||||
|
||||
def exitActivateChat(self):
|
||||
self.notify.error('called exitActivateChat() on parent class')
|
||||
|
||||
def enterOtherDialog(self):
|
||||
pass
|
||||
|
||||
def exitOtherDialog(self):
|
||||
pass
|
||||
|
||||
def enterSecretChatActivated(self):
|
||||
self.notify.error('called enterSecretChatActivated() on parent class')
|
||||
|
||||
def exitSecretChatActivated(self):
|
||||
self.notify.error('called exitSecretChatActivated() on parent class')
|
||||
|
||||
def enterProblemActivatingChat(self):
|
||||
self.notify.error('called enterProblemActivatingChat() on parent class')
|
||||
|
||||
def exitProblemActivatingChat(self):
|
||||
self.notify.error('called exitProblemActivatingChat() on parent class')
|
||||
pass
|
|
@ -54,163 +54,30 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
self.launcher = launcher
|
||||
base.launcher = launcher
|
||||
self.__currentAvId = 0
|
||||
self.productName = config.GetString('product-name', 'DisneyOnline-US')
|
||||
self.createAvatarClass = None
|
||||
self.systemMessageSfx = None
|
||||
reg_deployment = ''
|
||||
if self.productName == 'DisneyOnline-US':
|
||||
if self.launcher:
|
||||
if self.launcher.isDummy():
|
||||
reg_deployment = self.launcher.getDeployment()
|
||||
else:
|
||||
reg_deployment = self.launcher.getRegistry('DEPLOYMENT')
|
||||
if reg_deployment != 'UK' and reg_deployment != 'AP':
|
||||
|
||||
reg_deployment = self.launcher.getRegistry('GAME_DEPLOYMENT')
|
||||
self.notify.info('reg_deployment=%s' % reg_deployment)
|
||||
|
||||
if reg_deployment == 'UK':
|
||||
self.productName = 'DisneyOnline-UK'
|
||||
elif reg_deployment == 'AP':
|
||||
self.productName = 'DisneyOnline-AP'
|
||||
|
||||
|
||||
self.blue = None
|
||||
if self.launcher:
|
||||
self.blue = self.launcher.getBlue()
|
||||
|
||||
fakeBlue = config.GetString('fake-blue', '')
|
||||
if fakeBlue:
|
||||
self.blue = fakeBlue
|
||||
|
||||
|
||||
self.playToken = None
|
||||
|
||||
if self.launcher:
|
||||
self.playToken = self.launcher.getPlayToken()
|
||||
|
||||
fakePlayToken = config.GetString('fake-playtoken', '')
|
||||
if fakePlayToken:
|
||||
self.playToken = fakePlayToken
|
||||
|
||||
|
||||
self.DISLToken = None
|
||||
if self.launcher:
|
||||
self.DISLToken = self.launcher.getDISLToken()
|
||||
|
||||
fakeDISLToken = config.GetString('fake-DISLToken', '')
|
||||
fakeDISLPlayerName = config.GetString('fake-DISL-PlayerName', '')
|
||||
if fakeDISLToken:
|
||||
self.DISLToken = fakeDISLToken
|
||||
elif fakeDISLPlayerName:
|
||||
defaultId = 42
|
||||
defaultNumAvatars = 4
|
||||
defaultNumAvatarSlots = 4
|
||||
defaultNumConcur = 1
|
||||
subCount = config.GetInt('fake-DISL-NumSubscriptions', 1)
|
||||
playerAccountId = config.GetInt('fake-DISL-PlayerAccountId', defaultId)
|
||||
self.DISLToken = ('ACCOUNT_NAME=%s' % fakeDISLPlayerName +
|
||||
'&ACCOUNT_NUMBER=%s' % playerAccountId +
|
||||
'&ACCOUNT_NAME_APPROVAL=%s' % config.GetString('fake-DISL-PlayerNameApproved', 'YES') +
|
||||
'&SWID=%s' % config.GetString('fake-DISL-SWID', '{1763AC36-D73F-41C2-A54A-B579E58B69C8}') +
|
||||
'&FAMILY_NUMBER=%s' % config.GetString('fake-DISL-FamilyAccountId', '-1') +
|
||||
'&familyAdmin=%s' % config.GetString('fake-DISL-FamilyAdmin', '1') +
|
||||
'&PIRATES_ACCESS=%s' % config.GetString('fake-DISL-PiratesAccess', 'FULL') +
|
||||
'&PIRATES_MAX_NUM_AVATARS=%s' % config.GetInt('fake-DISL-MaxAvatars', defaultNumAvatars) +
|
||||
'&PIRATES_NUM_AVATAR_SLOTS=%s' % config.GetInt('fake-DISL-MaxAvatarSlots', defaultNumAvatarSlots) +
|
||||
'&expires=%s' % config.GetString('fake-DISL-expire', '1577898000') +
|
||||
'&OPEN_CHAT_ENABLED=%s' % config.GetString('fake-DISL-OpenChatEnabled', 'YES') +
|
||||
'&CREATE_FRIENDS_WITH_CHAT=%s' % config.GetString('fake-DISL-CreateFriendsWithChat', 'YES') +
|
||||
'&CHAT_CODE_CREATION_RULE=%s' % config.GetString('fake-DISL-ChatCodeCreation', 'YES') +
|
||||
'&FAMILY_MEMBERS=%s' % config.GetString('fake-DISL-FamilyMembers') + '&PIRATES_SUB_COUNT=%s' % subCount)
|
||||
|
||||
for i in xrange(subCount):
|
||||
self.DISLToken += ('&PIRATES_SUB_%s_ACCESS=%s' % (i, config.GetString('fake-DISL-Sub-%s-Access' % i, 'FULL')) +
|
||||
'&PIRATES_SUB_%s_ACTIVE=%s' % (i, config.GetString('fake-DISL-Sub-%s-Active' % i, 'YES')) +
|
||||
'&PIRATES_SUB_%s_ID=%s' % (i, config.GetInt('fake-DISL-Sub-%s-Id' % i, playerAccountId) + config.GetInt('fake-DISL-Sub-Id-Offset', 0)) +
|
||||
'&PIRATES_SUB_%s_LEVEL=%s' % (i, config.GetInt('fake-DISL-Sub-%s-Level' % i, 3)) +
|
||||
'&PIRATES_SUB_%s_NAME=%s' % (i, config.GetString('fake-DISL-Sub-%s-Name' % i, fakeDISLPlayerName)) +
|
||||
'&PIRATES_SUB_%s_NUM_AVATARS=%s' % (i, config.GetInt('fake-DISL-Sub-%s-NumAvatars' % i, defaultNumAvatars)) +
|
||||
'&PIRATES_SUB_%s_NUM_CONCUR=%s' % (i, config.GetInt('fake-DISL-Sub-%s-NumConcur' % i, defaultNumConcur)) +
|
||||
'&PIRATES_SUB_%s_OWNERID=%s' % (i, config.GetInt('fake-DISL-Sub-%s-OwnerId' % i, playerAccountId)) +
|
||||
'&PIRATES_SUB_%s_FOUNDER=%s' % (i, config.GetString('fake-DISL-Sub-%s-Founder' % i, 'YES')))
|
||||
|
||||
self.DISLToken += ('&WL_CHAT_ENABLED=%s' % config.GetString('fake-DISL-WLChatEnabled', 'YES') +
|
||||
'&valid=true')
|
||||
if base.logPrivateInfo:
|
||||
print self.DISLToken
|
||||
|
||||
|
||||
self.requiredLogin = config.GetString('required-login', 'auto')
|
||||
if self.requiredLogin == 'auto':
|
||||
|
||||
self.notify.info('required-login auto.')
|
||||
elif self.requiredLogin == 'green':
|
||||
self.notify.error('The green code is out of date')
|
||||
elif self.requiredLogin == 'blue':
|
||||
if not self.blue:
|
||||
self.notify.error('The tcr does not have the required blue login')
|
||||
elif self.requiredLogin == 'playToken':
|
||||
if not self.playToken:
|
||||
self.notify.error('The tcr does not have the required playToken login')
|
||||
elif self.requiredLogin == 'DISLToken':
|
||||
if not self.DISLToken:
|
||||
self.notify.error('The tcr does not have the required DISL token login')
|
||||
elif self.requiredLogin == 'gameServer':
|
||||
self.notify.info('Using game server name/password.')
|
||||
self.DISLToken = None
|
||||
else:
|
||||
self.notify.error('The required-login was not recognized.')
|
||||
|
||||
|
||||
self.playToken = None
|
||||
self.notify.error('The client repository does not have the required playToken login')
|
||||
|
||||
self.wantMagicWords = False
|
||||
|
||||
|
||||
|
||||
# TODO: HTTP
|
||||
if self.launcher and hasattr(self.launcher, 'http'):
|
||||
self.http = self.launcher.http
|
||||
else:
|
||||
self.http = HTTPClient()
|
||||
|
||||
|
||||
self.accountOldAuth = config.GetBool('account-old-auth', 0)
|
||||
|
||||
self.accountOldAuth = config.GetBool('%s-account-old-auth' % process,
|
||||
self.accountOldAuth)
|
||||
|
||||
self.loginInterface = LoginTTUAccount.LoginTTUAccount(self)
|
||||
|
||||
|
||||
self.secretChatAllowed = base.config.GetBool('allow-secret-chat', True)
|
||||
self.openChatAllowed = base.config.GetBool('allow-open-chat', True)
|
||||
|
||||
|
||||
self.secretChatNeedsParentPassword = base.config.GetBool('secret-chat-needs-parent-password', 0)
|
||||
|
||||
|
||||
|
||||
|
||||
self.parentPasswordSet = base.config.GetBool('parent-password-set', True)
|
||||
|
||||
|
||||
self.userSignature = base.config.GetString('signature', 'none')
|
||||
|
||||
|
||||
|
||||
self.freeTimeExpiresAt = -1
|
||||
self.__isPaid = 1
|
||||
|
||||
|
||||
|
||||
self.periodTimerExpired = 0
|
||||
self.periodTimerStarted = None
|
||||
self.periodTimerSecondsRemaining = None
|
||||
|
||||
|
||||
self.parentMgr.registerParent(OTPGlobals.SPRender, base.render)
|
||||
|
||||
|
||||
self.parentMgr.registerParent(OTPGlobals.SPHidden, NodePath())
|
||||
|
||||
self.timeManager = None
|
||||
|
||||
if config.GetBool('detect-leaks', 0) or config.GetBool('client-detect-leaks', 0):
|
||||
|
@ -218,7 +85,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
|
||||
if config.GetBool('detect-messenger-leaks', 0) or config.GetBool('ai-detect-messenger-leaks', 0):
|
||||
self.messengerLeakDetector = MessengerLeakDetector.MessengerLeakDetector('client messenger leak detector')
|
||||
|
||||
|
||||
if config.GetBool('leak-messages', 0):
|
||||
MessengerLeakDetector._leakMessengerObject()
|
||||
|
||||
|
@ -317,10 +184,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
self.exitAfkTimeout, [
|
||||
'waitForAvatarList',
|
||||
'shutdown']),
|
||||
State('periodTimeout',
|
||||
self.enterPeriodTimeout,
|
||||
self.exitPeriodTimeout, [
|
||||
'shutdown']),
|
||||
State('waitForAvatarList',
|
||||
self.enterWaitForAvatarList,
|
||||
self.exitWaitForAvatarList, [
|
||||
|
@ -370,7 +233,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
'login',
|
||||
'shutdown',
|
||||
'afkTimeout',
|
||||
'periodTimeout',
|
||||
'noShards'])],
|
||||
'loginOff', 'loginOff')
|
||||
self.gameFSM = ClassicFSM('gameFSM', [
|
||||
|
@ -424,19 +286,19 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
self.chatAgent = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_CHAT_MANAGER, 'ChatAgent')
|
||||
self.csm = None # To be set by subclass.
|
||||
|
||||
def hasPlayToken():
|
||||
return self.playToken != None
|
||||
|
||||
def readDCFile(self, dcFileNames=None):
|
||||
dcFile = self.getDcFile()
|
||||
dcFile.clear()
|
||||
self.dclassesByName = {}
|
||||
self.dclassesByNumber = {}
|
||||
self.hashVal = 0
|
||||
|
||||
try:
|
||||
dcStream
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
else:
|
||||
self.notify.info('Detected DC file stream, reading it...')
|
||||
dcFileNames = [dcStream]
|
||||
|
@ -480,6 +342,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def startLeakDetector(self):
|
||||
if hasattr(self, 'leakDetector'):
|
||||
return False
|
||||
|
||||
firstCheckDelay = config.GetFloat('leak-detector-first-check-delay', 2 * 60.0)
|
||||
self.leakDetector = ContainerLeakDetector('client container leak detector', firstCheckDelay=firstCheckDelay)
|
||||
self.objectTypesLeakDetector = LeakDetectors.ObjectTypesLeakDetector()
|
||||
|
@ -581,10 +444,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
dateString = time.strftime(self.toontownTimeManager.formatStr, timestamp)
|
||||
self.lastLoggedIn = self.toontownTimeManager.convertStrToToontownTime(dateString)
|
||||
self.loginFSM.request('waitForGameList')
|
||||
elif mode == 'getChatPassword':
|
||||
self.loginFSM.request('parentPassword')
|
||||
elif mode == 'freeTimeExpired':
|
||||
self.loginFSM.request('freeTimeInform')
|
||||
elif mode == 'reject':
|
||||
self.loginFSM.request('reject')
|
||||
elif mode == 'quit':
|
||||
|
@ -868,7 +727,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
message = message % {'name': self.bootedText}
|
||||
self.launcher.setDisconnectDetails(self.bootedIndex, message)
|
||||
style = OTPDialog.Acknowledge
|
||||
if reconnect and self.loginInterface.supportsRelogin():
|
||||
if reconnect:
|
||||
message += OTPLocalizer.CRTryConnectAgain
|
||||
style = OTPDialog.TwoChoice
|
||||
dialogClass = OTPGlobals.getGlobalDialogClass()
|
||||
|
@ -880,7 +739,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def __handleLostConnectionAck(self):
|
||||
if self.lostConnectionBox.doneStatus == 'ok' and self.loginInterface.supportsRelogin():
|
||||
if self.lostConnectionBox.doneStatus == 'ok':
|
||||
self.loginFSM.request('connect', [self.serverList])
|
||||
else:
|
||||
self.loginFSM.request('shutdown')
|
||||
|
@ -913,27 +772,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
self.handler = None
|
||||
return
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def enterPeriodTimeout(self):
|
||||
self.sendSetAvatarIdMsg(0)
|
||||
self.sendDisconnect()
|
||||
msg = OTPLocalizer.PeriodForceAcknowledgeMessage
|
||||
dialogClass = OTPGlobals.getDialogClass()
|
||||
self.periodDialog = dialogClass(text=msg, command=self.__handlePeriodOk, style=OTPDialog.Acknowledge)
|
||||
self.handler = self.handleMessageType
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def __handlePeriodOk(self, value):
|
||||
base.exitShow()
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def exitPeriodTimeout(self):
|
||||
if self.periodDialog:
|
||||
self.periodDialog.cleanup()
|
||||
self.periodDialog = None
|
||||
self.handler = None
|
||||
return
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def enterWaitForAvatarList(self):
|
||||
self._requestAvatarList()
|
||||
|
@ -1020,10 +858,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
if avId != self.__currentAvId:
|
||||
self.__currentAvId = avId
|
||||
self.csm.sendChooseAvatar(avId)
|
||||
if avId == 0:
|
||||
self.stopPeriodTimer()
|
||||
else:
|
||||
self.startPeriodTimer()
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
def handleAvatarResponseMsg(self, avatarId, di):
|
||||
|
@ -1506,36 +1340,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def exitSwitchShards(self):
|
||||
pass
|
||||
|
||||
def isFreeTimeExpired(self):
|
||||
if self.accountOldAuth:
|
||||
return 0
|
||||
if base.config.GetBool('free-time-expired', 0):
|
||||
return 1
|
||||
if base.config.GetBool('unlimited-free-time', 0):
|
||||
return 0
|
||||
if self.freeTimeExpiresAt == -1:
|
||||
return 0
|
||||
if self.freeTimeExpiresAt == 0:
|
||||
return 1
|
||||
if self.freeTimeExpiresAt < -1:
|
||||
self.notify.warning('freeTimeExpiresAt is less than -1 (%s)' % self.freeTimeExpiresAt)
|
||||
if self.freeTimeExpiresAt < time.time():
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def freeTimeLeft(self):
|
||||
if self.freeTimeExpiresAt == -1 or self.freeTimeExpiresAt == 0:
|
||||
return 0
|
||||
secsLeft = self.freeTimeExpiresAt - time.time()
|
||||
return max(0, secsLeft)
|
||||
|
||||
def isWebPlayToken(self):
|
||||
return self.playToken != None
|
||||
|
||||
def isBlue(self):
|
||||
return self.blue != None
|
||||
|
||||
def isPaid(self):
|
||||
paidStatus = base.config.GetString('force-paid-status', '')
|
||||
if not paidStatus:
|
||||
|
@ -1555,47 +1359,19 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def allowFreeNames(self):
|
||||
return base.config.GetInt('allow-free-names', 1)
|
||||
|
||||
# TODO: Login Server for all those
|
||||
def allowSecretChat(self):
|
||||
return self.secretChatAllowed or self.productName == 'Terra-DMC' and self.isBlue() and self.secretChatAllowed
|
||||
return self.secretChatAllowed
|
||||
|
||||
def allowWhiteListChat(self):
|
||||
if hasattr(self, 'whiteListChatEnabled') and self.whiteListChatEnabled:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return hasattr(self, 'whiteListChatEnabled') and self.whiteListChatEnabled
|
||||
|
||||
def allowAnyTypedChat(self):
|
||||
if self.allowSecretChat() or self.allowWhiteListChat() or self.allowOpenChat():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return self.allowSecretChat() or self.allowWhiteListChat() or self.allowOpenChat()
|
||||
|
||||
def allowOpenChat(self):
|
||||
return self.openChatAllowed
|
||||
|
||||
def isParentPasswordSet(self):
|
||||
return self.parentPasswordSet
|
||||
|
||||
def needParentPasswordForSecretChat(self):
|
||||
return self.isPaid() and self.secretChatNeedsParentPassword or self.productName == 'Terra-DMC' and self.isBlue() and self.secretChatNeedsParentPassword
|
||||
|
||||
def logAccountInfo(self):
|
||||
self.notify.info('*** ACCOUNT INFO ***')
|
||||
if base.logPrivateInfo:
|
||||
if self.blue:
|
||||
self.notify.info('paid: %s (blue)' % self.isPaid())
|
||||
else:
|
||||
self.notify.info('paid: %s' % self.isPaid())
|
||||
if not self.isPaid():
|
||||
if self.isFreeTimeExpired():
|
||||
self.notify.info('free time is expired')
|
||||
else:
|
||||
secs = self.freeTimeLeft()
|
||||
self.notify.info('free time left: %s' % PythonUtil.formatElapsedSeconds(secs))
|
||||
if self.periodTimerSecondsRemaining != None:
|
||||
self.notify.info('period time left: %s' % PythonUtil.formatElapsedSeconds(self.periodTimerSecondsRemaining))
|
||||
return
|
||||
|
||||
def getStartingDistrict(self):
|
||||
district = None
|
||||
if len(self.activeDistrictMap.keys()) == 0:
|
||||
|
@ -1698,53 +1474,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
render2d.prepareScene(gsg)
|
||||
base.graphicsEngine.renderFrame()
|
||||
|
||||
def resetPeriodTimer(self, secondsRemaining):
|
||||
self.periodTimerExpired = 0
|
||||
self.periodTimerSecondsRemaining = secondsRemaining
|
||||
|
||||
def recordPeriodTimer(self, task):
|
||||
freq = 60.0
|
||||
elapsed = globalClock.getRealTime() - self.periodTimerStarted
|
||||
self.runningPeriodTimeRemaining = self.periodTimerSecondsRemaining - elapsed
|
||||
self.notify.debug('periodTimeRemaining: %s' % self.runningPeriodTimeRemaining)
|
||||
launcher.recordPeriodTimeRemaining(self.runningPeriodTimeRemaining)
|
||||
taskMgr.doMethodLater(freq, self.recordPeriodTimer, 'periodTimerRecorder')
|
||||
return Task.done
|
||||
|
||||
def startPeriodTimer(self):
|
||||
if self.periodTimerStarted == None and self.periodTimerSecondsRemaining != None:
|
||||
self.periodTimerStarted = globalClock.getRealTime()
|
||||
taskMgr.doMethodLater(self.periodTimerSecondsRemaining, self.__periodTimerExpired, 'periodTimerCountdown')
|
||||
for warning in OTPGlobals.PeriodTimerWarningTime:
|
||||
if self.periodTimerSecondsRemaining > warning:
|
||||
taskMgr.doMethodLater(self.periodTimerSecondsRemaining - warning, self.__periodTimerWarning, 'periodTimerCountdown')
|
||||
|
||||
self.runningPeriodTimeRemaining = self.periodTimerSecondsRemaining
|
||||
self.recordPeriodTimer(None)
|
||||
return
|
||||
|
||||
def stopPeriodTimer(self):
|
||||
if self.periodTimerStarted != None:
|
||||
elapsed = globalClock.getRealTime() - self.periodTimerStarted
|
||||
self.periodTimerSecondsRemaining -= elapsed
|
||||
self.periodTimerStarted = None
|
||||
taskMgr.remove('periodTimerCountdown')
|
||||
taskMgr.remove('periodTimerRecorder')
|
||||
return
|
||||
|
||||
def __periodTimerWarning(self, task):
|
||||
base.localAvatar.setSystemMessage(0, OTPLocalizer.PeriodTimerWarning)
|
||||
return Task.done
|
||||
|
||||
def __periodTimerExpired(self, task):
|
||||
self.notify.info("User's period timer has just expired!")
|
||||
self.stopPeriodTimer()
|
||||
self.periodTimerExpired = 1
|
||||
self.periodTimerStarted = None
|
||||
self.periodTimerSecondsRemaining = None
|
||||
messenger.send('periodTimerExpired')
|
||||
return Task.done
|
||||
|
||||
def handleMessageType(self, msgType, di):
|
||||
if self.__recordObjectMessage(msgType, di):
|
||||
return
|
||||
|
|
|
@ -14,43 +14,9 @@ BothSecrets = 2
|
|||
|
||||
def showFriendSecret(secretType = AvatarSecret):
|
||||
global globalFriendSecret
|
||||
if not base.cr.isParentPasswordSet():
|
||||
if not base.cr.allowSecretChat():
|
||||
chatMgr = base.localAvatar.chatMgr
|
||||
if base.cr.productName in ['DisneyOnline-AP',
|
||||
'DisneyOnline-UK',
|
||||
'JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
chatMgr = base.localAvatar.chatMgr
|
||||
if not base.cr.isPaid():
|
||||
chatMgr.fsm.request('unpaidChatWarning')
|
||||
else:
|
||||
chatMgr.paidNoParentPassword = 1
|
||||
chatMgr.fsm.request('unpaidChatWarning')
|
||||
else:
|
||||
chatMgr.paidNoParentPassword = 1
|
||||
chatMgr.fsm.request('noSecretChatAtAll')
|
||||
elif not base.cr.allowSecretChat():
|
||||
chatMgr = base.localAvatar.chatMgr
|
||||
if base.cr.productName in ['DisneyOnline-AP',
|
||||
'DisneyOnline-UK',
|
||||
'JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
chatMgr = base.localAvatar.chatMgr
|
||||
if not base.cr.isPaid():
|
||||
chatMgr.fsm.request('unpaidChatWarning')
|
||||
else:
|
||||
chatMgr.paidNoParentPassword = 1
|
||||
chatMgr.fsm.request('unpaidChatWarning')
|
||||
else:
|
||||
chatMgr.fsm.request('noSecretChatAtAll')
|
||||
elif base.cr.needParentPasswordForSecretChat():
|
||||
unloadFriendSecret()
|
||||
globalFriendSecret = FriendSecretNeedsParentLogin(secretType)
|
||||
globalFriendSecret.enter()
|
||||
chatMgr.fsm.request('noSecretChatAtAll')
|
||||
else:
|
||||
openFriendSecret(secretType)
|
||||
|
||||
|
@ -77,155 +43,6 @@ def unloadFriendSecret():
|
|||
globalFriendSecret = None
|
||||
return
|
||||
|
||||
|
||||
class FriendSecretNeedsParentLogin(StateData.StateData):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('FriendSecretNeedsParentLogin')
|
||||
|
||||
def __init__(self, secretType):
|
||||
StateData.StateData.__init__(self, 'friend-secret-needs-parent-login-done')
|
||||
self.dialog = None
|
||||
self.secretType = secretType
|
||||
return
|
||||
|
||||
def enter(self):
|
||||
StateData.StateData.enter(self)
|
||||
base.localAvatar.chatMgr.fsm.request('otherDialog')
|
||||
if self.dialog == None:
|
||||
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
nameBalloon = loader.loadModel('phase_3/models/props/chatbox_input')
|
||||
optionsButtonImage = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR'))
|
||||
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'))
|
||||
withParentAccount = False
|
||||
try:
|
||||
withParentAccount = base.cr.withParentAccount
|
||||
except:
|
||||
self.notify.warning('withParentAccount not found in base.cr')
|
||||
|
||||
if withParentAccount:
|
||||
okPos = (-0.22, 0.0, -0.5)
|
||||
textPos = (0, 0.25)
|
||||
okCommand = self.__handleOKWithParentAccount
|
||||
elif base.cr.productName != 'Terra-DMC':
|
||||
okPos = (-0.22, 0.0, -0.5)
|
||||
textPos = (0, 0.25)
|
||||
okCommand = self.__oldHandleOK
|
||||
else:
|
||||
self.passwordEntry = None
|
||||
okPos = (0, 0, -0.35)
|
||||
textPos = (0, 0.125)
|
||||
okCommand = self.__handleCancel
|
||||
self.dialog = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.2), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.4, 1.0, 1.25), image_pos=(0, 0, -0.1), text=OTPLocalizer.FriendSecretNeedsParentLoginWarning, text_wordwrap=21.5, text_scale=0.055, text_pos=textPos, textMayChange=1)
|
||||
DirectButton(self.dialog, image=okButtonImage, relief=None, text=OTPLocalizer.FriendSecretNeedsPasswordWarningOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=okPos, command=okCommand)
|
||||
DirectLabel(parent=self.dialog, relief=None, pos=(0, 0, 0.35), text=OTPLocalizer.FriendSecretNeedsPasswordWarningTitle, textMayChange=0, text_scale=0.08)
|
||||
if base.cr.productName != 'Terra-DMC':
|
||||
self.usernameLabel = DirectLabel(parent=self.dialog, relief=None, pos=(-0.07, 0.0, -0.1), text=OTPLocalizer.ParentLogin, text_scale=0.06, text_align=TextNode.ARight, textMayChange=0)
|
||||
self.usernameEntry = DirectEntry(parent=self.dialog, relief=None, image=nameBalloon, image1_color=(0.8, 0.8, 0.8, 1.0), scale=0.064, pos=(0.0, 0.0, -0.1), width=OTPGlobals.maxLoginWidth, numLines=1, focus=1, cursorKeys=1, obscured=1, command=self.__handleUsername)
|
||||
self.passwordLabel = DirectLabel(parent=self.dialog, relief=None, pos=(-0.02, 0.0, -0.3), text=OTPLocalizer.ParentPassword, text_scale=0.06, text_align=TextNode.ARight, textMayChange=0)
|
||||
self.passwordEntry = DirectEntry(parent=self.dialog, relief=None, image=nameBalloon, image1_color=(0.8, 0.8, 0.8, 1.0), scale=0.064, pos=(0.04, 0.0, -0.3), width=OTPGlobals.maxLoginWidth, numLines=1, focus=1, cursorKeys=1, obscured=1, command=okCommand)
|
||||
DirectButton(self.dialog, image=cancelButtonImage, relief=None, text=OTPLocalizer.FriendSecretNeedsPasswordWarningCancel, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=1, pos=(0.2, 0.0, -0.5), command=self.__handleCancel)
|
||||
if withParentAccount:
|
||||
self.usernameEntry.enterText('')
|
||||
self.usernameEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
else:
|
||||
self.usernameEntry.hide()
|
||||
self.usernameLabel.hide()
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
guiButton.removeNode()
|
||||
buttons.removeNode()
|
||||
nameBalloon.removeNode()
|
||||
else:
|
||||
self.dialog['text'] = OTPLocalizer.FriendSecretNeedsParentLoginWarning
|
||||
if self.usernameEntry:
|
||||
self.usernameEntry['focus'] = 1
|
||||
self.usernameEntry.enterText('')
|
||||
elif self.passwordEntry:
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
self.dialog.show()
|
||||
return
|
||||
|
||||
def exit(self):
|
||||
self.ignoreAll()
|
||||
if self.dialog:
|
||||
self.dialog.destroy()
|
||||
self.dialog = None
|
||||
if self.isEntered:
|
||||
base.localAvatar.chatMgr.fsm.request('mainMenu')
|
||||
StateData.StateData.exit(self)
|
||||
return
|
||||
|
||||
def __handleUsername(self, *args):
|
||||
if self.passwordEntry:
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
|
||||
def __handleOKWithParentAccount(self, *args):
|
||||
username = self.usernameEntry.get()
|
||||
password = self.passwordEntry.get()
|
||||
base.cr.parentUsername = username
|
||||
base.cr.parentPassword = password
|
||||
tt = base.cr.loginInterface
|
||||
okflag, message = tt.authenticateParentUsernameAndPassword(localAvatar.DISLid, base.cr.password, username, password)
|
||||
if okflag:
|
||||
self.exit()
|
||||
openFriendSecret(self.secretType)
|
||||
elif message:
|
||||
base.localAvatar.chatMgr.fsm.request('problemActivatingChat')
|
||||
base.localAvatar.chatMgr.problemActivatingChat['text'] = OTPLocalizer.ProblemActivatingChat % message
|
||||
else:
|
||||
self.dialog['text'] = OTPLocalizer.FriendSecretNeedsPasswordWarningWrongPassword
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
|
||||
def __oldHandleOK(self, *args):
|
||||
username = self.usernameEntry.get()
|
||||
password = self.passwordEntry.get()
|
||||
base.cr.parentUsername = username
|
||||
base.cr.parentPassword = password
|
||||
tt = base.cr.loginInterface
|
||||
okflag, message = tt.authenticateParentPassword(base.cr.userName, base.cr.password, password)
|
||||
if okflag:
|
||||
self.exit()
|
||||
openFriendSecret(self.secretType)
|
||||
elif message:
|
||||
base.localAvatar.chatMgr.fsm.request('problemActivatingChat')
|
||||
base.localAvatar.chatMgr.problemActivatingChat['text'] = OTPLocalizer.ProblemActivatingChat % message
|
||||
else:
|
||||
self.dialog['text'] = OTPLocalizer.FriendSecretNeedsPasswordWarningWrongPassword
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
|
||||
def __handleOK(self, *args):
|
||||
base.cr.parentUsername = self.usernameEntry.get()
|
||||
base.cr.parentPassword = self.passwordEntry.get()
|
||||
base.cr.playerFriendsManager.sendRequestUseLimitedSecret('', base.cr.parentUsername, base.cr.parentPassword)
|
||||
self.accept(OTPGlobals.PlayerFriendRejectUseSecretEvent, self.__handleParentLogin)
|
||||
self.exit()
|
||||
|
||||
def __handleParentLogin(self, reason):
|
||||
if reason == 0:
|
||||
self.exit()
|
||||
openFriendSecret(self.secretType)
|
||||
elif reason == 1:
|
||||
self.dialog['text'] = OTPLocalizer.FriendSecretNeedsPasswordWarningWrongUsername
|
||||
self.usernameEntry['focus'] = 1
|
||||
self.usernameEntry.enterText('')
|
||||
elif reason == 2:
|
||||
self.dialog['text'] = OTPLocalizer.FriendSecretNeedsPasswordWarningWrongPassword
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
else:
|
||||
base.localAvatar.chatMgr.fsm.request('problemActivatingChat')
|
||||
base.localAvatar.chatMgr.problemActivatingChat['text'] = OTPLocalizer.ProblemActivatingChat % message
|
||||
|
||||
def __handleCancel(self):
|
||||
self.exit()
|
||||
|
||||
|
||||
class FriendSecret(DirectFrame, StateData.StateData):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('FriendSecret')
|
||||
|
||||
|
@ -278,20 +95,6 @@ class FriendSecret(DirectFrame, StateData.StateData):
|
|||
self.enterSecret.hide()
|
||||
self.ok1 = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=OTPLocalizer.FSok1, text=OTPLocalizer.FriendSecretEnter, text_scale=0.06, text_pos=(0, -0.02), pos=(0, 0, -0.5), command=self.__ok1)
|
||||
self.ok1.hide()
|
||||
if base.cr.productName in ['JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
|
||||
class ShowHide:
|
||||
|
||||
def show(self):
|
||||
pass
|
||||
|
||||
def hide(self):
|
||||
pass
|
||||
|
||||
self.changeOptions = ShowHide()
|
||||
self.ok2 = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=OTPLocalizer.FSok2, text=OTPLocalizer.FriendSecretOK, text_scale=0.06, text_pos=(0, -0.02), pos=(0, 0, -0.57), command=self.__ok2)
|
||||
self.ok2.hide()
|
||||
self.cancel = DirectButton(parent=self, relief=None, text=OTPLocalizer.FriendSecretCancel, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=OTPLocalizer.FScancel, text_scale=0.06, text_pos=(0, -0.02), pos=(0, 0, -0.57), command=self.__cancel)
|
||||
|
@ -395,12 +198,7 @@ class FriendSecret(DirectFrame, StateData.StateData):
|
|||
base.cr.ttuFriendsManager.d_requestSecret()
|
||||
self.accept('requestSecretResponse', self.__gotAvatarSecret)
|
||||
else:
|
||||
if base.cr.needParentPasswordForSecretChat():
|
||||
self.notify.info('### requestLimitedSecret')
|
||||
base.cr.playerFriendsManager.sendRequestLimitedSecret(base.cr.parentUsername, base.cr.parentPassword)
|
||||
else:
|
||||
base.cr.playerFriendsManager.sendRequestUnlimitedSecret()
|
||||
self.notify.info('### requestUnlimitedSecret')
|
||||
base.cr.playerFriendsManager.sendRequestUnlimitedSecret()
|
||||
self.accept(OTPGlobals.PlayerFriendNewSecretEvent, self.__gotAccountSecret)
|
||||
self.accept(OTPGlobals.PlayerFriendRejectNewSecretEvent, self.__rejectAccountSecret)
|
||||
|
||||
|
@ -464,12 +262,7 @@ class FriendSecret(DirectFrame, StateData.StateData):
|
|||
else:
|
||||
self.accept(OTPGlobals.PlayerFriendUpdateEvent, self.__useAccountSecret)
|
||||
self.accept(OTPGlobals.PlayerFriendRejectUseSecretEvent, self.__rejectUseAccountSecret)
|
||||
if base.cr.needParentPasswordForSecretChat():
|
||||
self.notify.info('### useLimitedSecret')
|
||||
base.cr.playerFriendsManager.sendRequestUseLimitedSecret(secret, base.cr.parentUsername, base.cr.parentPassword)
|
||||
else:
|
||||
self.notify.info('### useUnlimitedSecret')
|
||||
base.cr.playerFriendsManager.sendRequestUseUnlimitedSecret(secret)
|
||||
base.cr.playerFriendsManager.sendRequestUseUnlimitedSecret(secret)
|
||||
self.nextText['text'] = OTPLocalizer.FriendSecretTryingSecret
|
||||
self.nextText.setPos(0, 0, 0.3)
|
||||
self.nextText.show()
|
||||
|
|
|
@ -30,15 +30,9 @@ class PlayerFriendsManager(DistributedObjectGlobal):
|
|||
def sendRequestUnlimitedSecret(self):
|
||||
self.sendUpdate('requestUnlimitedSecret', [0])
|
||||
|
||||
def sendRequestLimitedSecret(self, username, password):
|
||||
self.sendUpdate('requestLimitedSecret', [0, username, password])
|
||||
|
||||
def sendRequestUseUnlimitedSecret(self, secret):
|
||||
pass
|
||||
|
||||
def sendRequestUseLimitedSecret(self, secret, username, password):
|
||||
pass
|
||||
|
||||
def sendSCWhisper(self, recipientId, msgId):
|
||||
self.sendUpdate('whisperSCTo', [0, recipientId, msgId])
|
||||
|
||||
|
|
|
@ -94,18 +94,9 @@ class DummyLauncherBase:
|
|||
def getAccountServer(self):
|
||||
return ''
|
||||
|
||||
def getDeployment(self):
|
||||
return 'US'
|
||||
|
||||
def getBlue(self):
|
||||
return None
|
||||
|
||||
def getPlayToken(self):
|
||||
return None
|
||||
|
||||
def getDISLToken(self):
|
||||
return None
|
||||
|
||||
def fakeDownloadPhaseTask(self, task):
|
||||
percentComplete = min(100, int(round(task.time / float(task.timePerPhase) * 100)))
|
||||
self.setPhaseComplete(task.phase, percentComplete)
|
||||
|
|
|
@ -89,11 +89,9 @@ class LauncherBase(DirectObject):
|
|||
UserLoggedInKey = 'USER_LOGGED_IN'
|
||||
PaidUserLoggedInKey = 'PAID_USER_LOGGED_IN'
|
||||
ReferrerKey = 'REFERRER_CODE'
|
||||
PeriodTimeRemainingKey = 'PERIOD_TIME_REMAINING'
|
||||
PeriodNameKey = 'PERIOD_NAME'
|
||||
SwidKey = 'SWID'
|
||||
PatchCDKey = 'FROM_CD'
|
||||
DISLTokenKey = 'DISLTOKEN'
|
||||
ProxyServerKey = 'PROXY_SERVER'
|
||||
ProxyDirectHostsKey = 'PROXY_DIRECT_HOSTS'
|
||||
launcherFileDbFilename = 'launcherFileDb'
|
||||
|
@ -198,7 +196,6 @@ class LauncherBase(DirectObject):
|
|||
self.extractPercentage = 4
|
||||
self.lastLauncherMsg = None
|
||||
self.topDir = Filename.fromOsSpecific(self.getValue(self.InstallDirKey, '.'))
|
||||
self.setRegistry(self.GameLogFilenameKey, logfile)
|
||||
tmpVal = self.getValue(self.PatchCDKey)
|
||||
if tmpVal == None:
|
||||
self.fromCD = 0
|
||||
|
@ -219,7 +216,6 @@ class LauncherBase(DirectObject):
|
|||
self.overallComplete = 0
|
||||
self.progressSoFar = 0
|
||||
self.patchExtension = 'pch'
|
||||
self.scanForHacks()
|
||||
self.firstPhase = self.LauncherPhases[0]
|
||||
self.finalPhase = self.LauncherPhases[-1]
|
||||
self.showPhase = 3.5
|
||||
|
@ -235,8 +231,6 @@ class LauncherBase(DirectObject):
|
|||
0.003]
|
||||
phaseIdx = 0
|
||||
for phase in self.LauncherPhases:
|
||||
percentPhaseCompleteKey = 'PERCENT_PHASE_COMPLETE_' + `phase`
|
||||
self.setRegistry(percentPhaseCompleteKey, 0)
|
||||
self.phaseComplete[phase] = 0
|
||||
self.phaseNewDownload[phase] = 0
|
||||
self.phaseOverallMap[phase] = tmpOverallMap[phaseIdx]
|
||||
|
@ -319,15 +313,6 @@ class LauncherBase(DirectObject):
|
|||
self.nextDownloadServerIndex += 1
|
||||
return 1
|
||||
|
||||
def getProductName(self):
|
||||
config = getConfigExpress()
|
||||
productName = config.GetString('product-name', '')
|
||||
if productName and productName != 'DisneyOnline-US':
|
||||
productName = '_%s' % productName
|
||||
else:
|
||||
productName = ''
|
||||
return productName
|
||||
|
||||
def background(self):
|
||||
self.notify.info('background: Launcher now operating in background')
|
||||
self.backgrounded = 1
|
||||
|
@ -336,13 +321,6 @@ class LauncherBase(DirectObject):
|
|||
self.notify.info('foreground: Launcher now operating in foreground')
|
||||
self.backgrounded = 0
|
||||
|
||||
def setRegistry(self, key, value):
|
||||
self.notify.info('DEPRECATED setRegistry: %s = %s' % (key, value))
|
||||
|
||||
def getRegistry(self, key):
|
||||
self.notify.info('DEPRECATED getRegistry: %s' % key)
|
||||
return None
|
||||
|
||||
def handleInitiateFatalError(self, errorCode):
|
||||
self.notify.warning('handleInitiateFatalError: ' + errorToText(errorCode))
|
||||
sys.exit()
|
||||
|
@ -1515,9 +1493,6 @@ class LauncherBase(DirectObject):
|
|||
self.lastLauncherMsg = msg
|
||||
self.notify.info(msg)
|
||||
|
||||
def recordPeriodTimeRemaining(self, secondsRemaining):
|
||||
self.setValue(self.PeriodTimeRemainingKey, int(secondsRemaining))
|
||||
|
||||
def recordPeriodName(self, periodName):
|
||||
self.setValue(self.PeriodNameKey, periodName)
|
||||
|
||||
|
@ -1599,10 +1574,7 @@ class LauncherBase(DirectObject):
|
|||
percent,
|
||||
self.getBandwidth(),
|
||||
self.byteRate])
|
||||
percentPhaseCompleteKey = 'PERCENT_PHASE_COMPLETE_' + `phase`
|
||||
self.setRegistry(percentPhaseCompleteKey, percent)
|
||||
self.overallComplete = int(round(percent * self.phaseOverallMap[phase])) + self.progressSoFar
|
||||
self.setRegistry('PERCENT_OVERALL_COMPLETE', self.overallComplete)
|
||||
|
||||
def getPercentPhaseComplete(self, phase):
|
||||
return self.phaseComplete[phase]
|
||||
|
@ -1776,89 +1748,5 @@ class LauncherBase(DirectObject):
|
|||
del self.httpChannel
|
||||
del self.http
|
||||
|
||||
def scanForHacks(self):
|
||||
if not self.WIN32:
|
||||
return
|
||||
import _winreg
|
||||
hacksInstalled = {}
|
||||
hacksRunning = {}
|
||||
hackName = ['!xSpeed.net', 'A Speeder', 'Speed Gear']
|
||||
knownHacksRegistryKeys = {
|
||||
hackName[0] : [
|
||||
[_winreg.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows\\CurrentVersion\\Run\\!xSpeed'],
|
||||
[_winreg.HKEY_CURRENT_USER, 'Software\\!xSpeednethy'],
|
||||
[_winreg.HKEY_CURRENT_USER, 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Start Menu\\Programs\\!xSpeednet'],
|
||||
[_winreg.HKEY_LOCAL_MACHINE, 'Software\\Gentee\\Paths\\!xSpeednet'],
|
||||
[_winreg.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\!xSpeed.net 2.0']],
|
||||
hackName[1] : [
|
||||
[_winreg.HKEY_CURRENT_USER, 'Software\\aspeeder'],
|
||||
[_winreg.HKEY_LOCAL_MACHINE, 'Software\\aspeeder'],
|
||||
[_winreg.HKEY_LOCAL_MACHINE, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\aspeeder']]
|
||||
}
|
||||
try:
|
||||
for prog in knownHacksRegistryKeys.keys():
|
||||
for key in knownHacksRegistryKeys[prog]:
|
||||
try:
|
||||
h = _winreg.OpenKey(key[0], key[1])
|
||||
hacksInstalled[prog] = 1
|
||||
_winreg.CloseKey(h)
|
||||
break
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
knownHacksMUI = {'!xspeednet': hackName[0], 'aspeeder': hackName[1], 'speed gear': hackName[2]}
|
||||
i = 0
|
||||
try:
|
||||
rh = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, 'Software\\Microsoft\\Windows\\ShellNoRoam\\MUICache')
|
||||
while 1:
|
||||
name, value, type = _winreg.EnumValue(rh, i)
|
||||
i += 1
|
||||
if type == 1:
|
||||
val = value.lower()
|
||||
for hackprog in knownHacksMUI:
|
||||
if val.find(hackprog) != -1:
|
||||
hacksInstalled[knownHacksMUI[hackprog]] = 1
|
||||
break
|
||||
_winreg.CloseKey(rh)
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
import otp.launcher.procapi
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
knownHacksExe = {'!xspeednet.exe': hackName[0], 'aspeeder.exe': hackName[1], 'speedgear.exe': hackName[2]}
|
||||
try:
|
||||
for p in procapi.getProcessList():
|
||||
pname = p.name
|
||||
if pname in knownHacksExe:
|
||||
hacksRunning[knownHacksExe[pname]] = 1
|
||||
except:
|
||||
pass
|
||||
|
||||
if len(hacksInstalled) > 0:
|
||||
self.notify.info("Third party programs installed:")
|
||||
for hack in hacksInstalled.keys():
|
||||
self.notify.info(hack)
|
||||
|
||||
if len(hacksRunning) > 0:
|
||||
self.notify.info("Third party programs running:")
|
||||
for hack in hacksRunning.keys():
|
||||
self.notify.info(hack)
|
||||
self.setPandaErrorCode(8)
|
||||
sys.exit()
|
||||
|
||||
def getBlue(self):
|
||||
return None
|
||||
|
||||
def getPlayToken(self):
|
||||
return None
|
||||
|
||||
def getDISLToken(self):
|
||||
DISLToken = self.getValue(self.DISLTokenKey)
|
||||
self.setValue(self.DISLTokenKey, '')
|
||||
if DISLToken == 'NO DISLTOKEN':
|
||||
DISLToken = None
|
||||
return DISLToken
|
||||
return None
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
|
||||
class LoginBase:
|
||||
freeTimeExpires = -1
|
||||
|
||||
def __init__(self, cr):
|
||||
self.cr = cr
|
||||
|
@ -10,7 +9,4 @@ class LoginBase:
|
|||
pass
|
||||
|
||||
def getErrorCode(self):
|
||||
return 0
|
||||
|
||||
def needToSetParentPassword(self):
|
||||
return 0
|
||||
return 0
|
|
@ -1,8 +1,5 @@
|
|||
from pandac.PandaModules import *
|
||||
from direct.distributed.MsgTypes import *
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
import LoginBase
|
||||
from direct.distributed.PyDatagram import PyDatagram
|
||||
|
||||
class LoginTTUAccount(LoginBase.LoginBase):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('LoginTTUAccount')
|
||||
|
@ -11,9 +8,7 @@ class LoginTTUAccount(LoginBase.LoginBase):
|
|||
LoginBase.LoginBase.__init__(self, cr)
|
||||
|
||||
def supportsRelogin(self):
|
||||
if __debug__:
|
||||
return 1
|
||||
return 0
|
||||
return 1
|
||||
|
||||
def authorize(self, username, password):
|
||||
return 0 # No error!
|
||||
|
@ -22,17 +17,8 @@ class LoginTTUAccount(LoginBase.LoginBase):
|
|||
cr = self.cr
|
||||
# TODO
|
||||
|
||||
def resendPlayToken(self):
|
||||
self.notify.error('Cannot resend playtoken!')
|
||||
|
||||
def getErrorCode(self):
|
||||
return 0
|
||||
|
||||
def needToSetParentPassword(self):
|
||||
return 0
|
||||
|
||||
def authenticateParentPassword(self, loginName, password, parentPassword):
|
||||
self.notify.error('authenticateParentPassword called')
|
||||
|
||||
def authenticateDelete(self, loginName, password):
|
||||
return 1
|
||||
|
|
|
@ -83,7 +83,6 @@ DisconnectReasons = {DisconnectUnknown: 'unknown',
|
|||
DisconnectGraphicsError: 'graphics error'}
|
||||
DatabaseDialogTimeout = 20.0
|
||||
DatabaseGiveupTimeout = 45.0
|
||||
PeriodTimerWarningTime = (600, 300, 60)
|
||||
WalkCutOff = 0.5
|
||||
RunCutOff = 8.0
|
||||
FloorOffset = 0.025
|
||||
|
|
|
@ -45,40 +45,19 @@ ChatInputNormalWhisper = 'Whisper'
|
|||
ChatInputWhisperLabel = 'To %s'
|
||||
SCEmoteNoAccessMsg = 'You do not have access\nto this emotion yet.'
|
||||
SCEmoteNoAccessOK = lOK
|
||||
ParentLogin = 'Parent Login'
|
||||
ParentPassword = 'Parent Account Password'
|
||||
ChatGarblerDefault = ['blah']
|
||||
ChatManagerChat = 'Chat'
|
||||
ChatManagerWhisperTo = 'Whisper to:'
|
||||
ChatManagerWhisperToName = 'Whisper To:\n%s'
|
||||
ChatManagerCancel = lCancel
|
||||
ChatManagerWhisperOffline = '%s is offline.'
|
||||
OpenChatWarning = 'To become True Friends with somebody, click on them, and select "True Friends" from the detail panel.\n\nSpeedChat Plus can also be enabled, which allow users to chat by typing words found in the SpeedChat Plus dictionary.\n\nTo activate these features or to learn more, exit Toontown and then click on Membership and select Manage Account. Log in to edit your "Community Settings."\n\nIf you are under 18, you need a Parent Account to manage these settings.'
|
||||
OpenChatWarningOK = lOK
|
||||
UnpaidChatWarning = 'Once you have subscribed, you can use this button to chat with your friends using the keyboard. Until then, you should chat with other Toons using SpeedChat.'
|
||||
UnpaidChatWarningPay = 'Subscribe'
|
||||
UnpaidChatWarningContinue = 'Continue Free Trial'
|
||||
PaidNoParentPasswordWarning = 'Use this button to chat with your friends by using the keyboard, enable it through your Account Manager on the Toontown Web site. Until then, you can chat by using SpeedChat.'
|
||||
UnpaidNoParentPasswordWarning = 'This is for SpeedChat Plus, which allows users to chat by typing words found in the SpeedChat Plus dictionary. To activate this feature, exit Toontown and click on Membership. Select Manage Account and log in to edit your "Community Settings." If you are under 18, you need a Parent Account to manage these settings.'
|
||||
PaidNoParentPasswordWarningSet = 'Update Chat Settings'
|
||||
PaidNoParentPasswordWarningContinue = 'Continue Playing Game'
|
||||
PaidParentPasswordUKWarning = 'Once you have Enabled Chat, you can enable this button to chat with your friends using the keyboard. Until then, you should chat with other Toons using SpeedChat.'
|
||||
PaidParentPasswordUKWarningSet = 'Enable Chat Now!'
|
||||
PaidParentPasswordUKWarningContinue = 'Continue Playing Game'
|
||||
NoSecretChatWarningTitle = 'Parental Controls'
|
||||
NoSecretChatWarning = 'To chat with a friend, the True Friends feature must first be enabled. Kids, have your parent visit the Toontown Web site to learn about True Friends.'
|
||||
RestrictedSecretChatWarning = 'To get or enter a True Friend Code, log in with the Parent Account. You can disable this prompt by changing your True Friends options.'
|
||||
NoSecretChatWarningOK = lOK
|
||||
NoSecretChatWarningCancel = lCancel
|
||||
NoSecretChatWarningWrongPassword = "That's not the correct Parent Account. Please log in with the Parent Account that is linked to this account."
|
||||
# True Friends
|
||||
NoSecretChatAtAllTitle = 'Open Chat With True Friends'
|
||||
NoSecretChatAtAll = 'Open Chat with True Friends allows real-life friends to chat openly with each other by means of a True Friend Code that must be shared outside of the game.\n\nTo activate these features or to learn more, exit Toontown and then click on Membership and select Manage Account. Log in to edit your "Community Settings." If you are under 18, you need a Parent Account to manage these settings.'
|
||||
NoSecretChatAtAllAndNoWhitelistTitle = 'Chat button'
|
||||
NoSecretChatAtAllAndNoWhitelist = 'You can use the blue Chat button to communicate with other Toons by using Speechat Plus or Open Chat with True Friends.\n\nSpeedchat Plus is a form of type chat that allows users to communicate by using the SpeedChat Plus dictionary.\n\nOpen Chat with True Friends allows real-life friends to chat openly with each other by means of a True Friend Code that must be shared outside of the game.\n\nTo activate these features or to learn more, exit Toontown and then click on Membership and select Manage Account. Log in to edit your "Community Settings." If you are under 18, you need a Parent Account to manage these settings.'
|
||||
NoSecretChatAtAll = 'Open Chat with True Friends allows real-life friends to chat openly with each other by means of a True Friend Code that must be shared outside of the game.\n\nTo activate these features or to learn more, exit Toontown and then click on Membership and select Manage Account. Log in to edit your "Community Settings."'
|
||||
# Speedchat Plus
|
||||
NoSecretChatAtAllAndNoWhitelistTitle = 'Chat Button'
|
||||
NoSecretChatAtAllAndNoWhitelist = 'You can use the blue Chat button to communicate with other Toons by using Speechat Plus or Open Chat with True Friends.\n\nSpeedchat Plus is a form of type chat that allows users to communicate by using the SpeedChat Plus dictionary.\n\nOpen Chat with True Friends allows real-life friends to chat openly with each other by means of a True Friend Code that must be shared outside of the game.\n\nTo activate these features or to learn more, exit Toontown and then click on Membership and select Manage Account. Log in to edit your "Community Settings."'
|
||||
NoSecretChatAtAllOK = lOK
|
||||
ChangeSecretFriendsOptions = 'Change True Friends Options'
|
||||
ChangeSecretFriendsOptionsWarning = '\nPlease enter the Parent Account Password to change your True Friends options.'
|
||||
ActivateChatTitle = 'True Friends Options'
|
||||
WhisperToFormat = 'To %s %s'
|
||||
WhisperToFormatName = 'To %s'
|
||||
WhisperFromFormatName = '%s whispers'
|
||||
|
@ -114,24 +93,6 @@ TextPropertiesManager.getGlobalPtr().setProperties('black', black)
|
|||
grey = TextProperties()
|
||||
grey.setTextColor(0.5, 0.5, 0.5, 1)
|
||||
TextPropertiesManager.getGlobalPtr().setProperties('grey', grey)
|
||||
ActivateChat = "True Friends allows one member to chat with another member only by means of a True Friend Code that must be communicated outside of the game. True Friends is not moderated or supervised.\n\nPlease choose one of Toontown's True Friends options:\n\n \x01shadow\x01No True Friends\x02 - Ability to make True Friends is disabled.\n This offers the highest level of control.\n\n \x01shadow\x01Restricted True Friends\x02 - Requires the Parent Account Password to make\n each new True Friend.\n\n \x01shadow\x01Unrestricted True Friends\x02 - Once enabled with the Parent Account Password,\n it is not required to supply the Parent Account Password to make each new\n True Friend. \x01red\x01This option is not recommended for children under 13.\x02\n\n\n\n\n\n\nBy enabling the True Friends feature, you acknowledge that there are some risks inherent in the True Friends feature and that you have been informed of, and agree to accept, any such risks."
|
||||
ActivateChatYes = 'Update'
|
||||
ActivateChatNo = lCancel
|
||||
ActivateChatMoreInfo = 'More Info'
|
||||
LeaveToSetParentPassword = 'In order to set parent account password, the game will exit to the Toontown website.'
|
||||
LeaveToSetParentPasswordYes = 'Set Password'
|
||||
LeaveToSetParentPasswordNo = lCancel
|
||||
LeaveToEnableChatUK = 'In order to enable chat, the game will exit to the Toontown website.'
|
||||
LeaveToEnableChatUKYes = 'Enable Chat'
|
||||
LeaveToEnableChatUKNo = lCancel
|
||||
ChatMoreInfoOK = lOK
|
||||
SecretChatDeactivated = 'The "True Friends" feature has been disabled.'
|
||||
RestrictedSecretChatActivated = 'The "Restricted True Friends" feature has been enabled!'
|
||||
SecretChatActivated = 'The "Unrestricted True Friends" feature has been enabled!'
|
||||
SecretChatActivatedOK = lOK
|
||||
SecretChatActivatedChange = 'Change Options'
|
||||
ProblemActivatingChat = 'Oops! We were unable to activate the "True Friends" chat feature.\n\n%s\n\nPlease try again later.'
|
||||
ProblemActivatingChatOK = lOK
|
||||
CRConnecting = 'Connecting...'
|
||||
CRNoConnectTryAgain = 'Could not connect to %s:%s. Try again?'
|
||||
CRNoConnectProxyNoPort = 'Could not connect to %s:%s.\n\nYou are communicating to the internet via a proxy, but your proxy does not permit connections on port %s.\n\nYou must open up this port, or disable your proxy, in order to play. If your proxy has been provided by your ISP, you must contact your ISP to request them to open up this port.'
|
||||
|
@ -166,8 +127,6 @@ CRServerDateTryAgain = 'Could not get server date from %s. Try again?'
|
|||
CRMaintenanceCountdownMessage = 'Attention Toons! Toontown United will be going down for maintenance in %d minutes.'
|
||||
CRMaintenanceMessage = 'Attention Toons! Toontown United is now going down for maintenance.'
|
||||
AfkForceAcknowledgeMessage = 'Your toon got sleepy and went to bed.'
|
||||
PeriodTimerWarning = 'Your available time is almost over!'
|
||||
PeriodForceAcknowledgeMessage = 'Sorry, you have used up all of your available time. Please exit to purchase more.'
|
||||
CREnteringToontown = 'Entering...'
|
||||
LoginScreenUserName = 'Account Name'
|
||||
LoginScreenPassword = 'Password'
|
||||
|
@ -177,7 +136,6 @@ LoginScreenLoginPrompt = 'Please enter a user name and password.'
|
|||
LoginScreenBadPassword = 'Bad password.\nPlease try again.'
|
||||
LoginScreenInvalidUserName = 'Invalid user name.\nPlease try again.'
|
||||
LoginScreenUserNameNotFound = 'User name not found.\nPlease try again or create a new account.'
|
||||
LoginScreenPeriodTimeExpired = 'Sorry, you have used up all of your available time.'
|
||||
LoginScreenNoNewAccounts = 'Sorry, we are not accepting new accounts at this time.'
|
||||
LoginScreenTryAgain = 'Try Again'
|
||||
DialogSpecial = 'ooo'
|
||||
|
@ -257,13 +215,6 @@ SCMenuSellbotInvasion = 'SELLBOT INVASION'
|
|||
SCMenuFieldOffice = 'FIELD OFFICES'
|
||||
SCMenuIdesOfMarch = 'GREEN'
|
||||
ScMenuBugs = 'Bugs'
|
||||
FriendSecretNeedsPasswordWarningTitle = 'Parental Controls'
|
||||
FriendSecretNeedsParentLoginWarning = 'To get or enter a True Friend Code, log in with the Parent Account. You can disable this prompt by changing your True Friend options.'
|
||||
FriendSecretNeedsPasswordWarning = 'To get or enter a True Friend Code, you must enter the Parent Account Password. You can disable this prompt by changing your True Friends options.'
|
||||
FriendSecretNeedsPasswordWarningOK = lOK
|
||||
FriendSecretNeedsPasswordWarningCancel = lCancel
|
||||
FriendSecretNeedsPasswordWarningWrongUsername = "That's not the correct username. Please enter the username of the parental account. This is not the same username used to play the game."
|
||||
FriendSecretNeedsPasswordWarningWrongPassword = "That's not the correct password. Please enter the password of the parental account. This is not the same password used to play the game."
|
||||
FriendSecretIntro = "If you are playing Toontown United with someone you know in the real world, you can become True Friends. You can chat using the keyboard with your True Friends. Other Toons won't understand what you're saying.\n\nYou do this by getting a True Friend Code. Tell the True Friend Code to your friend, but not to anyone else. When your friend types in your True Friend Code on his or her screen, you'll be True Friends in Toontown!"
|
||||
FriendSecretGetSecret = 'Get a True Friend Code'
|
||||
FriendSecretEnterSecret = 'If you have a True Friend Code from someone you know, type it here.'
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
from otp.otpbase import OTPGlobals
|
||||
|
||||
class SubDetailRecord:
|
||||
|
||||
def __init__(self):
|
||||
self.subId = 0
|
||||
self.subOwnerId = 0
|
||||
self.subName = ''
|
||||
self.subActive = ''
|
||||
self.subAccess = ''
|
||||
self.subLevel = 0
|
||||
self.subNumAvatars = 0
|
||||
self.subNumConcur = 0
|
||||
self.subFounder = 0
|
||||
|
||||
def __str__(self):
|
||||
s = ''
|
||||
s += '========== Sub %d ==========\n' % self.subId
|
||||
s += 'Sub Id: %d\n' % self.subId
|
||||
s += 'Sub Owner Id: %d\n' % self.subOwnerId
|
||||
s += 'Sub Name: %s\n' % self.subName
|
||||
s += 'Sub Active: %s\n' % self.subActive
|
||||
s += 'Sub Access: %s\n' % self.subAccess
|
||||
s += 'Sub Level: %d\n' % self.subLevel
|
||||
s += 'Sub MaxAvatars: %d\n' % self.subNumAvatars
|
||||
s += 'Sub Concurrent: %d\n' % self.subNumConcur
|
||||
s += 'Sub Founder: %d\n' % self.subFounder
|
||||
return s
|
||||
|
||||
|
||||
class AccountDetailRecord:
|
||||
|
||||
def __init__(self):
|
||||
self.openChatEnabled = False
|
||||
self.createFriendsWithChat = False
|
||||
self.chatCodeCreation = False
|
||||
self.piratesAccess = OTPGlobals.AccessUnknown
|
||||
self.familyAccountId = 0
|
||||
self.playerAccountId = 0
|
||||
self.playerName = ''
|
||||
self.playerNameApproved = False
|
||||
self.maxAvatars = 0
|
||||
self.numFamilyMembers = 0
|
||||
self.familyMembers = []
|
||||
self.numSubs = 0
|
||||
self.subDetails = {}
|
||||
self.maxAvatarSlots = 0
|
||||
self.WLChatEnabled = False
|
||||
|
||||
def getMaxNumAvatars(self, subId):
|
||||
subDetails = self.subDetails.get(subId)
|
||||
if subDetails:
|
||||
return subDetails.subNumAvatars
|
||||
else:
|
||||
return 0
|
||||
|
||||
def canOpenChatAndNotGetBooted(self):
|
||||
return self.openChatEnabled or self.createFriendsWithChat
|
||||
|
||||
def __str__(self):
|
||||
s = '========== Account %s ==========\n' % self.playerAccountId
|
||||
s += 'OpenChatEnabled: %s\n' % self.openChatEnabled
|
||||
s += 'WLChatEnabled: %s\n' % self.WLChatEnabled
|
||||
s += 'CreateFriendsWithChat: %s\n' % self.createFriendsWithChat
|
||||
s += 'ChatCodeCreation: %s\n' % self.chatCodeCreation
|
||||
s += 'PiratesAccess: %s\n' % self.piratesAccess
|
||||
s += 'FamilyAccountId: %d\n' % self.familyAccountId
|
||||
s += 'PlayerAccountId: %d\n' % self.playerAccountId
|
||||
s += 'PlayerName: %s\n' % self.playerName
|
||||
s += 'AccountNameApproved: %d\n' % self.playerNameApproved
|
||||
s += 'MaxAvatars: %d\n' % self.maxAvatars
|
||||
s += 'MaxAvatarSlots: %d\n' % self.maxAvatarSlots
|
||||
s += 'NumFamilyMembers: %d\n' % self.numFamilyMembers
|
||||
s += 'FamilyMembers: %s\n' % self.familyMembers
|
||||
s += 'NumSubs: %s\n' % self.numSubs
|
||||
for subDetails in self.subDetails.values():
|
||||
s += str(subDetails)
|
||||
|
||||
s += '================================\n'
|
||||
return s
|
|
@ -97,9 +97,6 @@ class SuitInterior(Place.Place):
|
|||
def enterZone(self, zoneId):
|
||||
pass
|
||||
|
||||
def isPeriodTimerEffective(self):
|
||||
return 0
|
||||
|
||||
def handleDSIDoneEvent(self, requestStatus):
|
||||
self.doneStatus = requestStatus
|
||||
messenger.send(self.doneEvent)
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import sys
|
||||
from direct.showbase import DirectObject
|
||||
from direct.showbase.PythonUtil import traceFunctionCall
|
||||
from otp.otpbase import OTPGlobals
|
||||
from otp.otpbase import OTPLocalizer
|
||||
from toontown.toonbase import TTLocalizer
|
||||
|
@ -12,20 +10,6 @@ from TTChatInputSpeedChat import TTChatInputSpeedChat
|
|||
from TTChatInputNormal import TTChatInputNormal
|
||||
from TTChatInputWhiteList import TTChatInputWhiteList
|
||||
|
||||
class HackedDirectRadioButton(DirectCheckButton):
|
||||
|
||||
def __init__(self, parent = None, **kw):
|
||||
optiondefs = ()
|
||||
self.defineoptions(kw, optiondefs)
|
||||
DirectCheckButton.__init__(self, parent)
|
||||
self.initialiseoptions(HackedDirectRadioButton)
|
||||
|
||||
def commandFunc(self, event):
|
||||
if self['indicatorValue']:
|
||||
self['indicatorValue'] = 0
|
||||
DirectCheckButton.commandFunc(self, event)
|
||||
|
||||
|
||||
class ToontownChatManager(ChatManager.ChatManager):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ToontownChatManager')
|
||||
|
||||
|
@ -115,21 +99,6 @@ class ToontownChatManager(ChatManager.ChatManager):
|
|||
msgIndex,
|
||||
whisperAvatarId])
|
||||
|
||||
def enterOpenChatWarning(self):
|
||||
if self.openChatWarning == None:
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
buttonImage = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
|
||||
self.openChatWarning = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.2), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.2, 1.0, 1.4), text=OTPLocalizer.OpenChatWarning, text_wordwrap=19, text_scale=TTLocalizer.TCMopenChatWarning, text_pos=(0.0, 0.575), textMayChange=0)
|
||||
DirectButton(self.openChatWarning, image=buttonImage, relief=None, text=OTPLocalizer.OpenChatWarningOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.0, 0.0, -0.55), command=self.__handleOpenChatWarningOK)
|
||||
buttons.removeNode()
|
||||
self.openChatWarning.show()
|
||||
normObs, scObs = self.isObscured()
|
||||
if not scObs:
|
||||
self.scButton.show()
|
||||
if not normObs:
|
||||
self.normalButton.show()
|
||||
return
|
||||
|
||||
def enterMainMenu(self):
|
||||
self.chatInputNormal.setPos(self.normalPos)
|
||||
self.chatInputNormal.reparentTo(base.a2dTopLeft)
|
||||
|
@ -139,47 +108,6 @@ class ToontownChatManager(ChatManager.ChatManager):
|
|||
else:
|
||||
ChatManager.ChatManager.enterMainMenu(self)
|
||||
|
||||
def exitOpenChatWarning(self):
|
||||
self.openChatWarning.hide()
|
||||
self.scButton.hide()
|
||||
|
||||
def enterUnpaidChatWarning(self):
|
||||
self.forceHidePayButton = False
|
||||
if base.cr.productName in ['DisneyOnline-UK',
|
||||
'JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
directFrameText = OTPLocalizer.PaidParentPasswordUKWarning
|
||||
payButtonText = OTPLocalizer.PaidParentPasswordUKWarningSet
|
||||
directButtonText = OTPLocalizer.PaidParentPasswordUKWarningContinue
|
||||
else:
|
||||
directFrameText = OTPLocalizer.PaidNoParentPasswordWarning
|
||||
payButtonText = OTPLocalizer.PaidNoParentPasswordWarningSet
|
||||
directButtonText = OTPLocalizer.PaidNoParentPasswordWarningContinue
|
||||
if self.unpaidChatWarning == None:
|
||||
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
|
||||
buttonImage = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR'))
|
||||
self.unpaidChatWarning = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.4), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.2, 1.0, 0.8), text=directFrameText, text_wordwrap=TTLocalizer.TCMunpaidChatWarningWordwrap, text_scale=TTLocalizer.TCMunpaidChatWarning, text_pos=TTLocalizer.TCMunpaidChatWarningPos, textMayChange=0)
|
||||
self.payButton = DirectButton(self.unpaidChatWarning, image=buttonImage, relief=None, text=payButtonText, image_scale=(1.75, 1, 1.15), text_scale=TTLocalizer.TCMpayButton, text_pos=(0, -0.02), textMayChange=0, pos=TTLocalizer.TCMpayButtonPos, command=self.__handleUnpaidChatWarningPay)
|
||||
DirectButton(self.unpaidChatWarning, image=buttonImage, relief=None, text=directButtonText, textMayChange=0, image_scale=(1.75, 1, 1.15), text_scale=0.06, text_pos=(0, -0.02), pos=TTLocalizer.TCMdirectButtonTextPos, command=self.__handleUnpaidChatWarningContinue)
|
||||
guiButton.removeNode()
|
||||
if base.localAvatar.cantLeaveGame or self.forceHidePayButton:
|
||||
self.payButton.hide()
|
||||
else:
|
||||
self.payButton.show()
|
||||
normObs, scObs = self.isObscured()
|
||||
if not scObs:
|
||||
self.scButton.show()
|
||||
if not normObs:
|
||||
self.normalButton.show()
|
||||
return
|
||||
|
||||
def exitUnpaidChatWarning(self):
|
||||
if self.unpaidChatWarning:
|
||||
self.unpaidChatWarning.hide()
|
||||
self.scButton.hide()
|
||||
|
||||
def enterNoSecretChatAtAll(self):
|
||||
if self.noSecretChatAtAll == None:
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
|
@ -194,161 +122,6 @@ class ToontownChatManager(ChatManager.ChatManager):
|
|||
def exitNoSecretChatAtAll(self):
|
||||
self.noSecretChatAtAll.hide()
|
||||
|
||||
def enterNoSecretChatWarning(self, passwordOnly = 0):
|
||||
if not passwordOnly:
|
||||
warningText = OTPLocalizer.NoSecretChatWarning
|
||||
else:
|
||||
warningText = OTPLocalizer.ChangeSecretFriendsOptionsWarning
|
||||
if self.noSecretChatWarning == None:
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
nameBalloon = loader.loadModel('phase_3/models/props/chatbox_input')
|
||||
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'))
|
||||
if base.cr.productName != 'Terra-DMC':
|
||||
okPos = (-0.22, 0.0, -0.35)
|
||||
textPos = (0, 0.25)
|
||||
okCommand = self.__handleNoSecretChatWarningOK
|
||||
else:
|
||||
self.passwordEntry = None
|
||||
okPos = (0, 0, -0.35)
|
||||
textPos = (0, 0.125)
|
||||
okCommand = self.__handleNoSecretChatWarningCancel
|
||||
self.noSecretChatWarning = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.2), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.4, 1.0, 1.0), text=warningText, text_wordwrap=20, text_scale=0.055, text_pos=textPos, textMayChange=1)
|
||||
DirectButton(self.noSecretChatWarning, image=okButtonImage, relief=None, text=OTPLocalizer.NoSecretChatWarningOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=okPos, command=okCommand)
|
||||
DirectLabel(parent=self.noSecretChatWarning, relief=None, pos=(0, 0, 0.35), text=OTPLocalizer.NoSecretChatWarningTitle, textMayChange=0, text_scale=0.08)
|
||||
if base.cr.productName != 'Terra-DMC':
|
||||
self.passwordLabel = DirectLabel(parent=self.noSecretChatWarning, relief=None, pos=(-0.07, 0.0, -0.2), text=OTPLocalizer.ParentPassword, text_scale=0.06, text_align=TextNode.ARight, textMayChange=0)
|
||||
self.passwordEntry = DirectEntry(parent=self.noSecretChatWarning, relief=None, image=nameBalloon, image1_color=(0.8, 0.8, 0.8, 1.0), scale=0.064, pos=(0.0, 0.0, -0.2), width=OTPGlobals.maxLoginWidth, numLines=1, focus=1, cursorKeys=1, obscured=1, command=self.__handleNoSecretChatWarningOK)
|
||||
DirectButton(self.noSecretChatWarning, image=cancelButtonImage, relief=None, text=OTPLocalizer.NoSecretChatWarningCancel, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=1, pos=(0.2, 0.0, -0.35), command=self.__handleNoSecretChatWarningCancel)
|
||||
buttons.removeNode()
|
||||
nameBalloon.removeNode()
|
||||
else:
|
||||
self.noSecretChatWarning['text'] = warningText
|
||||
if self.passwordEntry:
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
self.noSecretChatWarning.show()
|
||||
return
|
||||
|
||||
def exitNoSecretChatWarning(self):
|
||||
self.noSecretChatWarning.hide()
|
||||
|
||||
def enterActivateChat(self):
|
||||
if self.activateChatGui == None:
|
||||
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
|
||||
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'))
|
||||
moreButtonImage = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR'))
|
||||
nameShopGui = loader.loadModel('phase_3/models/gui/nameshop_gui')
|
||||
circle = nameShopGui.find('**/namePanelCircle')
|
||||
self.activateChatGui = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.2), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.8, 1.0, 1.6), text=OTPLocalizer.ActivateChat, text_align=TextNode.ALeft, text_wordwrap=33, text_scale=TTLocalizer.TCMactivateChatGui, text_pos=(-0.82, 0.58), textMayChange=0)
|
||||
innerCircle = circle.copyTo(hidden)
|
||||
innerCircle.setPos(0, 0, 0.2)
|
||||
self.c1b = circle.copyTo(self.activateChatGui, -1)
|
||||
self.c1b.setColor(0, 0, 0, 1)
|
||||
self.c1b.setPos(-0.8, 0, 0.29)
|
||||
self.c1b.setScale(0.4)
|
||||
c1f = circle.copyTo(self.c1b)
|
||||
c1f.setColor(1, 1, 1, 1)
|
||||
c1f.setScale(0.8)
|
||||
self.c2b = circle.copyTo(self.activateChatGui, -2)
|
||||
self.c2b.setColor(0, 0, 0, 1)
|
||||
self.c2b.setPos(-0.8, 0, 0.14)
|
||||
self.c2b.setScale(0.4)
|
||||
c2f = circle.copyTo(self.c2b)
|
||||
c2f.setColor(1, 1, 1, 1)
|
||||
c2f.setScale(0.8)
|
||||
self.c3b = circle.copyTo(self.activateChatGui, -2)
|
||||
self.c3b.setColor(0, 0, 0, 1)
|
||||
self.c3b.setPos(-0.8, 0, -0.01)
|
||||
self.c3b.setScale(0.4)
|
||||
c3f = circle.copyTo(self.c3b)
|
||||
c3f.setColor(1, 1, 1, 1)
|
||||
c3f.setScale(0.8)
|
||||
DirectLabel(self.activateChatGui, relief=None, text=OTPLocalizer.ActivateChatTitle, text_align=TextNode.ACenter, text_scale=0.07, text_pos=(0, 0.7), textMayChange=0)
|
||||
if base.cr.productName != 'JP':
|
||||
DirectButton(self.activateChatGui, image=moreButtonImage, image_scale=(1.25, 1.0, 1.0), relief=None, text=OTPLocalizer.ActivateChatMoreInfo, text_scale=0.06, text_pos=(0, -0.02), textMayChange=0, pos=(0.0, 0.0, -0.7), command=self.__handleActivateChatMoreInfo)
|
||||
self.dcb1 = HackedDirectRadioButton(parent=self.activateChatGui, relief=None, scale=0.1, boxImage=innerCircle, boxImageScale=2.5, boxImageColor=VBase4(0, 0.25, 0.5, 1), boxRelief=None, pos=(-0.745, 0, 0.297), command=self.__updateCheckBoxen, extraArgs=[1])
|
||||
self.dcb2 = HackedDirectRadioButton(parent=self.activateChatGui, relief=None, scale=0.1, boxImage=innerCircle, boxImageScale=2.5, boxImageColor=VBase4(0, 0.25, 0.5, 1), boxRelief=None, pos=(-0.745, 0, 0.147), command=self.__updateCheckBoxen, extraArgs=[2])
|
||||
self.dcb3 = HackedDirectRadioButton(parent=self.activateChatGui, relief=None, scale=0.1, boxImage=innerCircle, boxImageScale=2.5, boxImageColor=VBase4(0, 0.25, 0.5, 1), boxRelief=None, pos=(-0.745, 0, -0.003), command=self.__updateCheckBoxen, extraArgs=[3])
|
||||
DirectButton(self.activateChatGui, image=okButtonImage, relief=None, text=OTPLocalizer.ActivateChatYes, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(-0.35, 0.0, -0.27), command=self.__handleActivateChatYes)
|
||||
DirectButton(self.activateChatGui, image=cancelButtonImage, relief=None, text=OTPLocalizer.ActivateChatNo, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.35, 0.0, -0.27), command=self.__handleActivateChatNo)
|
||||
guiButton.removeNode()
|
||||
buttons.removeNode()
|
||||
nameShopGui.removeNode()
|
||||
innerCircle.removeNode()
|
||||
self.__initializeCheckBoxen()
|
||||
self.activateChatGui.show()
|
||||
return
|
||||
|
||||
def __initializeCheckBoxen(self):
|
||||
if base.cr.secretChatAllowed and not base.cr.secretChatNeedsParentPassword:
|
||||
self.dcb1['indicatorValue'] = 0
|
||||
self.dcb2['indicatorValue'] = 0
|
||||
self.dcb3['indicatorValue'] = 1
|
||||
elif base.cr.secretChatAllowed and base.cr.secretChatNeedsParentPassword:
|
||||
self.dcb1['indicatorValue'] = 0
|
||||
self.dcb2['indicatorValue'] = 1
|
||||
self.dcb3['indicatorValue'] = 0
|
||||
else:
|
||||
self.dcb1['indicatorValue'] = 1
|
||||
self.dcb2['indicatorValue'] = 0
|
||||
self.dcb3['indicatorValue'] = 0
|
||||
|
||||
def __updateCheckBoxen(self, value, checkBox):
|
||||
if value == 0:
|
||||
return
|
||||
if checkBox == 1:
|
||||
self.dcb2['indicatorValue'] = 0
|
||||
self.dcb3['indicatorValue'] = 0
|
||||
elif checkBox == 2:
|
||||
self.dcb1['indicatorValue'] = 0
|
||||
self.dcb3['indicatorValue'] = 0
|
||||
else:
|
||||
self.dcb1['indicatorValue'] = 0
|
||||
self.dcb2['indicatorValue'] = 0
|
||||
|
||||
def exitActivateChat(self):
|
||||
self.activateChatGui.hide()
|
||||
|
||||
def enterSecretChatActivated(self, mode = 2):
|
||||
if mode == 0:
|
||||
modeText = OTPLocalizer.SecretChatDeactivated
|
||||
elif mode == 1:
|
||||
modeText = OTPLocalizer.RestrictedSecretChatActivated
|
||||
else:
|
||||
modeText = OTPLocalizer.SecretChatActivated
|
||||
if self.secretChatActivated == None:
|
||||
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
|
||||
optionsButtonImage = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR'))
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
buttonImage = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
|
||||
self.secretChatActivated = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.4), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.0, 1.0, 0.8), text=modeText, text_align=TextNode.ACenter, text_wordwrap=14, text_scale=TTLocalizer.TCMsecretChatActivated, text_pos=(0, 0.25))
|
||||
DirectButton(self.secretChatActivated, image=buttonImage, relief=None, text=OTPLocalizer.SecretChatActivatedOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.0, 0.0, -0.1), command=self.__handleSecretChatActivatedOK)
|
||||
buttons.removeNode()
|
||||
guiButton.removeNode()
|
||||
else:
|
||||
self.secretChatActivated['text'] = modeText
|
||||
self.secretChatActivated.show()
|
||||
return
|
||||
|
||||
def exitSecretChatActivated(self):
|
||||
self.secretChatActivated.hide()
|
||||
|
||||
def enterProblemActivatingChat(self):
|
||||
if self.problemActivatingChat == None:
|
||||
buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
|
||||
buttonImage = (buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr'))
|
||||
self.problemActivatingChat = DirectFrame(parent=aspect2dp, pos=(0.0, 0.1, 0.4), relief=None, image=DGG.getDefaultDialogGeom(), image_color=OTPGlobals.GlobalDialogColor, image_scale=(1.2, 1.0, 0.9), text='', text_align=TextNode.ALeft, text_wordwrap=18, text_scale=0.06, text_pos=(-0.5, 0.28), textMayChange=1)
|
||||
DirectButton(self.problemActivatingChat, image=buttonImage, relief=None, text=OTPLocalizer.ProblemActivatingChatOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(0.0, 0.0, -0.28), command=self.__handleProblemActivatingChatOK)
|
||||
buttons.removeNode()
|
||||
self.problemActivatingChat.show()
|
||||
return
|
||||
|
||||
def exitProblemActivatingChat(self):
|
||||
self.problemActivatingChat.hide()
|
||||
|
||||
def __normalButtonPressed(self):
|
||||
if base.config.GetBool('want-qa-regression', 0):
|
||||
self.notify.info('QA-REGRESSION: CHAT: Speedchat Plus')
|
||||
|
@ -436,83 +209,8 @@ class ToontownChatManager(ChatManager.ChatManager):
|
|||
def __whisperCancelPressed(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleOpenChatWarningOK(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleUnpaidChatWarningDone(self):
|
||||
place = base.cr.playGame.getPlace()
|
||||
if place:
|
||||
place.handleBookClose()
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleUnpaidChatWarningContinue(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleUnpaidChatWarningPay(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleNoSecretChatAtAllOK(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleNoSecretChatWarningOK(self, *args):
|
||||
password = self.passwordEntry.get()
|
||||
tt = base.cr.loginInterface
|
||||
okflag, message = tt.authenticateParentPassword(base.cr.userName, base.cr.password, password)
|
||||
if okflag:
|
||||
self.fsm.request('activateChat')
|
||||
elif message:
|
||||
self.fsm.request('problemActivatingChat')
|
||||
self.problemActivatingChat['text'] = OTPLocalizer.ProblemActivatingChat % message
|
||||
else:
|
||||
self.noSecretChatWarning['text'] = OTPLocalizer.NoSecretChatWarningWrongPassword
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
|
||||
def __handleNoSecretChatWarningCancel(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleActivateChatYes(self):
|
||||
password = self.passwordEntry.get()
|
||||
tt = base.cr.loginInterface
|
||||
if self.dcb1['indicatorValue']:
|
||||
base.cr.secretChatAllowed = 0
|
||||
mode = 0
|
||||
elif self.dcb2['indicatorValue']:
|
||||
base.cr.secretChatAllowed = 1
|
||||
base.cr.secretChatNeedsParentPassword = 1
|
||||
mode = 1
|
||||
else:
|
||||
base.cr.secretChatAllowed = 1
|
||||
base.cr.secretChatNeedsParentPassword = 0
|
||||
mode = 2
|
||||
okflag, message = tt.enableSecretFriends(base.cr.userName, base.cr.password, password)
|
||||
if okflag:
|
||||
tt.resendPlayToken()
|
||||
self.fsm.request('secretChatActivated', [mode])
|
||||
else:
|
||||
if message == None:
|
||||
message = 'Parent Password was invalid.'
|
||||
self.fsm.request('problemActivatingChat')
|
||||
self.problemActivatingChat['text'] = OTPLocalizer.ProblemActivatingChat % message
|
||||
return
|
||||
|
||||
def __handleActivateChatMoreInfo(self):
|
||||
self.fsm.request('chatMoreInfo')
|
||||
|
||||
def __handleActivateChatNo(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleSecretChatActivatedOK(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def __handleSecretChatActivatedChangeOptions(self):
|
||||
self.fsm.request('activateChat')
|
||||
|
||||
def __handleProblemActivatingChatOK(self):
|
||||
self.fsm.request('mainMenu')
|
||||
|
||||
def messageSent(self):
|
||||
pass
|
||||
|
||||
def deactivateChat(self):
|
||||
pass
|
||||
pass
|
|
@ -105,9 +105,6 @@ class CogdoInterior(Place.Place):
|
|||
def enterZone(self, zoneId):
|
||||
pass
|
||||
|
||||
def isPeriodTimerEffective(self):
|
||||
return 0
|
||||
|
||||
def handleDSIDoneEvent(self, requestStatus):
|
||||
self.doneStatus = requestStatus
|
||||
messenger.send(self.doneEvent)
|
||||
|
|
|
@ -211,7 +211,6 @@ class Estate(Place.Place):
|
|||
def enterMailbox(self):
|
||||
Place.Place.enterPurchase(self)
|
||||
base.localAvatar.startSleepWatch(self.__handleFallingAsleepMailbox)
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def __handleFallingAsleepMailbox(self, arg):
|
||||
if hasattr(self, 'fsm'):
|
||||
|
@ -222,7 +221,6 @@ class Estate(Place.Place):
|
|||
def exitMailbox(self):
|
||||
Place.Place.exitPurchase(self)
|
||||
base.localAvatar.stopSleepWatch()
|
||||
self.disablePeriodTimer()
|
||||
|
||||
def enterTeleportIn(self, requestStatus):
|
||||
self._etiToken = self.addSetZoneCompleteCallback(Functor(self._teleportToHouse, requestStatus))
|
||||
|
|
|
@ -158,7 +158,6 @@ class House(Place.Place):
|
|||
base.localAvatar.laffMeter.start()
|
||||
base.localAvatar.obscureMoveFurnitureButton(1)
|
||||
base.localAvatar.startSleepWatch(self.__handleFallingAsleepCloset)
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def __handleFallingAsleepCloset(self, arg):
|
||||
if hasattr(self, 'fsm'):
|
||||
|
@ -172,7 +171,6 @@ class House(Place.Place):
|
|||
base.localAvatar.laffMeter.stop()
|
||||
base.localAvatar.obscureMoveFurnitureButton(-1)
|
||||
base.localAvatar.stopSleepWatch()
|
||||
self.disablePeriodTimer()
|
||||
|
||||
def enterBanking(self):
|
||||
Place.Place.enterBanking(self)
|
||||
|
|
|
@ -138,13 +138,7 @@ class FriendInviter(DirectFrame):
|
|||
|
||||
def enterGetNewFriend(self):
|
||||
self['text'] = TTLocalizer.FriendInviterClickToon % len(base.localAvatar.friendsList)
|
||||
if base.cr.productName in ['JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
self.bOk.show()
|
||||
else:
|
||||
self.bCancel.show()
|
||||
self.bCancel.show()
|
||||
self.accept('clickedNametag', self.__handleClickedNametag)
|
||||
|
||||
def exitGetNewFriend(self):
|
||||
|
@ -166,7 +160,7 @@ class FriendInviter(DirectFrame):
|
|||
self.bCancel.setPos(0.35, 0.0, -0.05)
|
||||
self.bCancel.show()
|
||||
self.bToon.show()
|
||||
if self.wantPlayerFriends and base.cr.productName != 'DisneyOnline-UK' and base.cr.productName != 'DisneyOnline-AP':
|
||||
if self.wantPlayerFriends:
|
||||
self.bPlayer.show()
|
||||
else:
|
||||
self.__handleToon()
|
||||
|
@ -175,7 +169,7 @@ class FriendInviter(DirectFrame):
|
|||
def exitBegin(self):
|
||||
self.ignore(self.avDisableName)
|
||||
self.bToon.hide()
|
||||
if self.wantPlayerFriends and base.cr.productName != 'DisneyOnline-UK' and base.cr.productName != 'DisneyOnline-AP':
|
||||
if self.wantPlayerFriends:
|
||||
self.bPlayer.hide()
|
||||
self.bCancel.setPos(0.0, 0.0, -0.1)
|
||||
self.bCancel.hide()
|
||||
|
@ -296,12 +290,6 @@ class FriendInviter(DirectFrame):
|
|||
self['text'] = TTLocalizer.FriendInviterToonAlready % self.getName()
|
||||
self.bStop['text'] = TTLocalizer.FriendInviterStopBeingToonFriends
|
||||
self.context = None
|
||||
if base.cr.productName in ['JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
self.bStop.setPos(-0.2, 0.0, -0.1)
|
||||
self.bCancel.setPos(0.2, 0.0, -0.1)
|
||||
self.bStop.show()
|
||||
self.bCancel.show()
|
||||
return
|
||||
|
|
|
@ -105,12 +105,6 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
|
|||
def __init__(self):
|
||||
self.leftmostPanel = FLPPets
|
||||
self.rightmostPanel = FLPPlayers
|
||||
if base.cr.productName in ['DisneyOnline-UK',
|
||||
'DisneyOnline-AP',
|
||||
'JP',
|
||||
'FR',
|
||||
'BR']:
|
||||
self.rightmostPanel = FLPAll
|
||||
DirectFrame.__init__(self, relief=None)
|
||||
self.listScrollIndex = [0,
|
||||
0,
|
||||
|
|
|
@ -143,9 +143,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
def getTaskZoneId(self):
|
||||
return self.getZoneId()
|
||||
|
||||
def isPeriodTimerEffective(self):
|
||||
return 1
|
||||
|
||||
def handleTeleportQuery(self, fromAvatar, toAvatar):
|
||||
if base.config.GetBool('want-tptrack', False):
|
||||
if toAvatar == localAvatar:
|
||||
|
@ -155,37 +152,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
else:
|
||||
fromAvatar.d_teleportResponse(toAvatar.doId, 1, toAvatar.defaultShard, base.cr.playGame.getPlaceId(), self.getZoneId())
|
||||
|
||||
def enablePeriodTimer(self):
|
||||
if self.isPeriodTimerEffective():
|
||||
if base.cr.periodTimerExpired:
|
||||
taskMgr.doMethodLater(5, self.redoPeriodTimer, 'redoPeriodTimer')
|
||||
self.accept('periodTimerExpired', self.periodTimerExpired)
|
||||
|
||||
def disablePeriodTimer(self):
|
||||
taskMgr.remove('redoPeriodTimer')
|
||||
self.ignore('periodTimerExpired')
|
||||
|
||||
def redoPeriodTimer(self, task):
|
||||
messenger.send('periodTimerExpired')
|
||||
return Task.done
|
||||
|
||||
def periodTimerExpired(self):
|
||||
self.fsm.request('final')
|
||||
if base.localAvatar.book.isEntered:
|
||||
base.localAvatar.book.exit()
|
||||
base.localAvatar.b_setAnimState('CloseBook', 1, callback=self.__handlePeriodTimerBookClose)
|
||||
else:
|
||||
base.localAvatar.b_setAnimState('TeleportOut', 1, self.__handlePeriodTimerExitTeleport)
|
||||
|
||||
def exitPeriodTimerExpired(self):
|
||||
pass
|
||||
|
||||
def __handlePeriodTimerBookClose(self):
|
||||
base.localAvatar.b_setAnimState('TeleportOut', 1, self.__handlePeriodTimerExitTeleport)
|
||||
|
||||
def __handlePeriodTimerExitTeleport(self):
|
||||
base.cr.loginFSM.request('periodTimeout')
|
||||
|
||||
def detectedPhoneCollision(self):
|
||||
self.fsm.request('phone')
|
||||
|
||||
|
@ -210,7 +176,7 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
if teleportIn == 0:
|
||||
self.walkStateData.fsm.request('walking')
|
||||
self.acceptOnce(self.walkDoneEvent, self.handleWalkDone)
|
||||
if base.cr.productName in ['DisneyOnline-US', 'ES'] and not base.cr.isPaid() and base.localAvatar.tutorialAck:
|
||||
if not base.cr.isPaid() and base.localAvatar.tutorialAck:
|
||||
base.localAvatar.chatMgr.obscure(0, 0)
|
||||
base.localAvatar.chatMgr.normalButton.show()
|
||||
self.accept('teleportQuery', self.handleTeleportQuery)
|
||||
|
@ -219,13 +185,11 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.invPage.acceptOnscreenHooks()
|
||||
base.localAvatar.questMap.acceptOnscreenHooks()
|
||||
self.walkStateData.fsm.request('walking')
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def exitWalk(self):
|
||||
self.exitFLM()
|
||||
if base.cr.productName in ['DisneyOnline-US', 'ES'] and not base.cr.isPaid() and base.localAvatar.tutorialAck and not base.cr.whiteListChatEnabled:
|
||||
if not base.cr.isPaid() and base.localAvatar.tutorialAck and not base.cr.whiteListChatEnabled:
|
||||
base.localAvatar.chatMgr.obscure(1, 0)
|
||||
self.disablePeriodTimer()
|
||||
messenger.send('wakeup')
|
||||
self.walkStateData.exit()
|
||||
self.ignore(self.walkDoneEvent)
|
||||
|
@ -323,7 +287,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.startSleepWatch(self.__handleFallingAsleep)
|
||||
self.accept('bookDone', self.__handleBook)
|
||||
base.localAvatar.b_setAnimState('ReadBook', 1)
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def __handleFallingAsleep(self, task):
|
||||
base.localAvatar.book.exit()
|
||||
|
@ -337,7 +300,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
|
||||
def exitStickerBook(self):
|
||||
base.localAvatar.stopSleepWatch()
|
||||
self.disablePeriodTimer()
|
||||
self.exitFLM()
|
||||
base.localAvatar.laffMeter.stop()
|
||||
base.localAvatar.setGuiConflict(0)
|
||||
|
@ -830,7 +792,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.laffMeter.start()
|
||||
base.localAvatar.obscureMoveFurnitureButton(1)
|
||||
base.localAvatar.startSleepWatch(self.__handleFallingAsleepBanking)
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def __handleFallingAsleepBanking(self, arg):
|
||||
if hasattr(self, 'fsm'):
|
||||
|
@ -844,7 +805,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.laffMeter.stop()
|
||||
base.localAvatar.obscureMoveFurnitureButton(-1)
|
||||
base.localAvatar.stopSleepWatch()
|
||||
self.disablePeriodTimer()
|
||||
|
||||
def enterPhone(self):
|
||||
base.localAvatar.b_setAnimState('neutral', 1)
|
||||
|
@ -853,7 +813,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.laffMeter.start()
|
||||
base.localAvatar.obscureMoveFurnitureButton(1)
|
||||
base.localAvatar.startSleepWatch(self.__handleFallingAsleepPhone)
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def __handleFallingAsleepPhone(self, arg):
|
||||
if hasattr(self, 'fsm'):
|
||||
|
@ -867,7 +826,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.laffMeter.stop()
|
||||
base.localAvatar.obscureMoveFurnitureButton(-1)
|
||||
base.localAvatar.stopSleepWatch()
|
||||
self.disablePeriodTimer()
|
||||
|
||||
def enterStopped(self):
|
||||
base.localAvatar.b_setAnimState('neutral', 1)
|
||||
|
@ -880,7 +838,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.laffMeter.start()
|
||||
base.localAvatar.obscureMoveFurnitureButton(1)
|
||||
base.localAvatar.startSleepWatch(self.__handleFallingAsleepStopped)
|
||||
self.enablePeriodTimer()
|
||||
|
||||
def __handleFallingAsleepStopped(self, arg):
|
||||
if hasattr(self, 'fsm'):
|
||||
|
@ -895,7 +852,6 @@ class Place(StateData.StateData, FriendsListManager.FriendsListManager):
|
|||
base.localAvatar.laffMeter.stop()
|
||||
base.localAvatar.obscureMoveFurnitureButton(-1)
|
||||
base.localAvatar.stopSleepWatch()
|
||||
self.disablePeriodTimer()
|
||||
messenger.send('exitingStoppedState')
|
||||
|
||||
def enterPet(self):
|
||||
|
|
|
@ -168,7 +168,6 @@ class AvatarChoice(DirectButton):
|
|||
self.verifyDeleteWithPassword()
|
||||
|
||||
def verifyDeleteWithPassword(self):
|
||||
self.deleteWithPassword = 0
|
||||
deleteText = TTLocalizer.AvatarChoiceDeleteConfirmText % {
|
||||
'name': self.name,
|
||||
'confirm': TTLocalizer.AvatarChoiceDeleteConfirmUserTypes}
|
||||
|
@ -179,13 +178,8 @@ class AvatarChoice(DirectButton):
|
|||
cancelButtonImage = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr'))
|
||||
self.deleteWithPasswordFrame = DirectFrame(pos=(0.0, 0.1, 0.2), parent=aspect2dp, relief=None, image=DGG.getDefaultDialogGeom(), image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.4, 1.0, 1.0), text=deleteText, text_wordwrap=19, text_scale=TTLocalizer.ACdeleteWithPasswordFrame, text_pos=(0, 0.25), textMayChange=1, sortOrder=NO_FADE_SORT_INDEX)
|
||||
self.deleteWithPasswordFrame.hide()
|
||||
if self.deleteWithPassword:
|
||||
self.passwordLabel = DirectLabel(parent=self.deleteWithPasswordFrame, relief=None, pos=(-0.07, 0.0, -0.2), text=TTLocalizer.AvatarChoicePassword, text_scale=0.08, text_align=TextNode.ARight, textMayChange=0)
|
||||
self.passwordEntry = DirectEntry(parent=self.deleteWithPasswordFrame, relief=None, image=nameBalloon, image1_color=(0.8, 0.8, 0.8, 1.0), image_pos=(0.0, 0.0, -0.45), scale=0.064, pos=(0.0, 0.0, -0.2), width=ToontownGlobals.maxLoginWidth, numLines=2, focus=1, cursorKeys=1, obscured=1, command=self.__handleDeleteWithPasswordOK)
|
||||
DirectButton(parent=self.deleteWithPasswordFrame, image=okButtonImage, relief=None, text=TTLocalizer.AvatarChoiceDeletePasswordOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(-0.22, 0.0, -0.35), command=self.__handleDeleteWithPasswordOK)
|
||||
else:
|
||||
self.passwordEntry = DirectEntry(parent=self.deleteWithPasswordFrame, relief=None, image=nameBalloon, image1_color=(0.8, 0.8, 0.8, 1.0), scale=0.064, pos=(-0.3, 0.0, -0.2), width=10, numLines=1, focus=1, cursorKeys=1, command=self.__handleDeleteWithConfirmOK)
|
||||
DirectButton(parent=self.deleteWithPasswordFrame, image=okButtonImage, relief=None, text=TTLocalizer.AvatarChoiceDeletePasswordOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(-0.22, 0.0, -0.35), command=self.__handleDeleteWithConfirmOK)
|
||||
self.passwordEntry = DirectEntry(parent=self.deleteWithPasswordFrame, relief=None, image=nameBalloon, image1_color=(0.8, 0.8, 0.8, 1.0), scale=0.064, pos=(-0.3, 0.0, -0.2), width=10, numLines=1, focus=1, cursorKeys=1, command=self.__handleDeleteWithConfirmOK)
|
||||
DirectButton(parent=self.deleteWithPasswordFrame, image=okButtonImage, relief=None, text=TTLocalizer.AvatarChoiceDeletePasswordOK, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=0, pos=(-0.22, 0.0, -0.35), command=self.__handleDeleteWithConfirmOK)
|
||||
DirectLabel(parent=self.deleteWithPasswordFrame, relief=None, pos=(0, 0, 0.35), text=TTLocalizer.AvatarChoiceDeletePasswordTitle, textMayChange=0, text_scale=0.08)
|
||||
DirectButton(parent=self.deleteWithPasswordFrame, image=cancelButtonImage, relief=None, text=TTLocalizer.AvatarChoiceDeletePasswordCancel, text_scale=0.05, text_pos=(0.0, -0.1), textMayChange=1, pos=(0.2, 0.0, -0.35), command=self.__handleDeleteWithPasswordCancel)
|
||||
buttons.removeNode()
|
||||
|
@ -198,35 +192,11 @@ class AvatarChoice(DirectButton):
|
|||
self.deleteWithPasswordFrame.show()
|
||||
return
|
||||
|
||||
def __handleDeleteWithPasswordOK(self, *args):
|
||||
password = self.passwordEntry.get()
|
||||
tt = base.cr.loginInterface
|
||||
okFlag, errorMsg = tt.authenticateDelete(base.cr.userName, password)
|
||||
if okFlag:
|
||||
self.deleteWithPasswordFrame.hide()
|
||||
base.transitions.noTransitions()
|
||||
messenger.send(self.doneEvent, ['delete', self.position])
|
||||
if config.GetBool('want-qa-regression', 0):
|
||||
self.notify.info('QA-REGRESSION: DELETEATOON: Deleting A Toon')
|
||||
else:
|
||||
if errorMsg is not None:
|
||||
self.notify.warning('authenticateDelete returned unexpected error: %s' % errorMsg)
|
||||
self.deleteWithPasswordFrame['text'] = TTLocalizer.AvatarChoiceDeleteWrongPassword
|
||||
self.passwordEntry['focus'] = 1
|
||||
self.passwordEntry.enterText('')
|
||||
return
|
||||
|
||||
def __handleDeleteWithConfirmOK(self, *args):
|
||||
password = self.passwordEntry.get()
|
||||
passwordMatch = TTLocalizer.AvatarChoiceDeleteConfirmUserTypes
|
||||
password = TextEncoder.lower(password)
|
||||
passwordMatch = TextEncoder.lower(passwordMatch)
|
||||
if password == passwordMatch:
|
||||
if self.passwordEntry.get().lower() == TTLocalizer.AvatarChoiceDeleteConfirmUserTypes:
|
||||
self.deleteWithPasswordFrame.hide()
|
||||
base.transitions.noTransitions()
|
||||
messenger.send(self.doneEvent, ['delete', self.position])
|
||||
if config.GetBool('want-qa-regression', 0):
|
||||
self.notify.info('QA-REGRESSION: DELETEATOON: Deleting A Toon')
|
||||
else:
|
||||
self.deleteWithPasswordFrame['text'] = TTLocalizer.AvatarChoiceDeleteWrongConfirm % {'name': self.name,
|
||||
'confirm': TTLocalizer.AvatarChoiceDeleteConfirmUserTypes}
|
||||
|
|
|
@ -412,8 +412,6 @@ class NameShop(StateData.StateData):
|
|||
self.squareDown,
|
||||
self.squareHover,
|
||||
self.squareUp), image_scale=(1, 1.1, 0.9), pos=(0.0033, 0, -.38833), scale=(1.2, 1, 1.2), text=TTLocalizer.TypeANameButton, text_scale=TTLocalizer.NStypeANameButton, text_pos=TTLocalizer.NStypeANameButtonPos, command=self.__typeAName)
|
||||
if base.cr.productName in ['DE', 'BR']:
|
||||
self.typeANameButton.hide()
|
||||
self.pickANameGUIElements.append(self.typeANameButton)
|
||||
self.nameResult = DirectLabel(parent=aspect2d, relief=None, scale=TTLocalizer.NSnameResult, pos=(0.005, 0, 0.585), text=' \n ', text_scale=0.8, text_align=TextNode.ACenter, text_wordwrap=MAX_NAME_WIDTH)
|
||||
self.pickANameGUIElements.append(self.nameResult)
|
||||
|
@ -477,9 +475,6 @@ class NameShop(StateData.StateData):
|
|||
except:
|
||||
print 'NameShop: Tried to show already removed object'
|
||||
|
||||
if base.cr.productName in ['DE', 'BR']:
|
||||
self.typeANameButton.hide()
|
||||
|
||||
def hideAll(self):
|
||||
self.uberhide(self.pickANameGUIElements)
|
||||
self.uberhide(self.typeANameGUIElements)
|
||||
|
|
|
@ -635,10 +635,6 @@ class DistributedCatchGame(DistributedMinigame):
|
|||
self.notify.debug('num catches: %s' % self.fruitsCaught)
|
||||
self.timer.hide()
|
||||
|
||||
#For the Alpha Blueprint ARG
|
||||
if base.config.GetBool('want-blueprint4-ARG', False):
|
||||
MinigameGlobals.generateDebugARGPhrase()
|
||||
|
||||
if self.fruitsCaught >= self.numFruits:
|
||||
self.notify.debug('perfect game!')
|
||||
perfectTextSubnode = hidden.attachNewNode(self.__genText(TTLocalizer.CatchGamePerfect))
|
||||
|
|
|
@ -1094,10 +1094,6 @@ class DistributedMazeGame(DistributedMinigame):
|
|||
self.showScoreTrack = Parallel(lerpTrack, Sequence(Wait(MazeGameGlobals.SHOWSCORES_DURATION), Func(self.gameOver)))
|
||||
self.showScoreTrack.start()
|
||||
|
||||
#For the Alpha Blueprint ARG
|
||||
if base.config.GetBool('want-blueprint4-ARG', False):
|
||||
MinigameGlobals.generateDebugARGPhrase()
|
||||
|
||||
def exitShowScores(self):
|
||||
self.showScoreTrack.pause()
|
||||
del self.showScoreTrack
|
||||
|
|
|
@ -940,9 +940,6 @@ class DistributedTugOfWarGame(DistributedMinigame):
|
|||
if self.gameFSM.getCurrentState().getName() == 'cleanup' or not self.randomNumGen:
|
||||
return
|
||||
if self.suit:
|
||||
#For the Alpha Blueprint ARG
|
||||
if base.config.GetBool('want-blueprint4-ARG', False):
|
||||
MinigameGlobals.generateDebugARGPhrase()
|
||||
if self.suitId in winners:
|
||||
newPos = VBase3(2.65, 18, 0.1)
|
||||
randInt = self.randomNumGen.randrange(0, 10)
|
||||
|
|
|
@ -242,10 +242,6 @@ class DistributedTwoDGame(DistributedMinigame):
|
|||
self.showScoreTrack = Parallel(lerpTrack, self.getElevatorCloseTrack(), Sequence(Wait(ToonBlitzGlobals.ShowScoresDuration), Func(self.gameOver)))
|
||||
self.showScoreTrack.start()
|
||||
|
||||
#For the Alpha Blueprint ARG
|
||||
if base.config.GetBool('want-blueprint4-ARG', False):
|
||||
MinigameGlobals.generateDebugARGPhrase()
|
||||
|
||||
def exitShowScores(self):
|
||||
self.showScoreTrack.pause()
|
||||
del self.showScoreTrack
|
||||
|
|
|
@ -33,27 +33,4 @@ def getSafezoneId(trolleyZone):
|
|||
def getScoreMult(trolleyZone):
|
||||
szId = getSafezoneId(trolleyZone)
|
||||
multiplier = PythonUtil.lerp(1.0, 1.5, float(SafeZones.index(szId)) / (len(SafeZones) - 1))
|
||||
return multiplier
|
||||
|
||||
# For Blueprint ARG
|
||||
SuitSerialMessages = [
|
||||
'DS-DEBUG1: Suit Serial #0043 -- METHOD',
|
||||
'DS-DEBUG1: Suit Serial #0052 -- USED',
|
||||
'DS-DEBUG1: Suit Serial #0045 -- IS',
|
||||
'DS-DEBUG1: Suit Serial #0041 -- THE',
|
||||
'DS-DEBUG1: Suit Serial #0054 -- SAME',
|
||||
'DS-DEBUG1: Suit Serial #0049 -- AS',
|
||||
'DS-DEBUG1: Suit Serial #004E -- LAST',
|
||||
'DS-DEBUG1: Suit Serial #0047 -- TIME',
|
||||
'DS-DEBUG2: Suit Serial #0045 -- ALL',
|
||||
'DS-DEBUG2: Suit Serial #0051 -- RECORDS',
|
||||
'DS-DEBUG2: Suit Serial #0055 -- EXPUNGED',
|
||||
'DS-DEBUG2: Suit Serial #0049 -- FURTHER',
|
||||
'DS-DEBUG2: Suit Serial #004D -- INVESTIGATION',
|
||||
'DS-DEBUG2: Suit Serial #0045 -- WILL',
|
||||
'DS-DEBUG2: Suit Serial #004E -- BE',
|
||||
'DS-DEBUG2: Suit Serial #0054 -- NECESSARY'
|
||||
]
|
||||
def generateDebugARGPhrase():
|
||||
phrase = choice(SuitSerialMessages)
|
||||
base.localAvatar.setSystemMessage(0, phrase)
|
||||
return multiplier
|
|
@ -636,9 +636,6 @@ class Purchase(PurchaseBase):
|
|||
headFrame[1].show()
|
||||
headFrame[1].reparentTo(self.toon.inventory.purchaseFrame)
|
||||
|
||||
if base.cr.periodTimerExpired:
|
||||
base.cr.loginFSM.request('periodTimeout')
|
||||
return
|
||||
if not self.tutorialMode:
|
||||
if not config.GetBool('disable-purchase-timer', 0):
|
||||
self.timer.show()
|
||||
|
|
|
@ -263,9 +263,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
del self.laffMeter
|
||||
self.questMap.destroy()
|
||||
self.questMap = None
|
||||
if hasattr(self, 'purchaseButton'):
|
||||
self.purchaseButton.destroy()
|
||||
del self.purchaseButton
|
||||
self.book.unload()
|
||||
del self.optionsPage
|
||||
del self.shardPage
|
||||
|
@ -391,10 +388,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
self.laffMeter.stop()
|
||||
self.questMap = QuestMap.QuestMap(self)
|
||||
self.questMap.stop()
|
||||
if not base.cr.isPaid():
|
||||
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
|
||||
self.purchaseButton = DirectButton(parent=aspect2d, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=0.9, text=TTLocalizer.OptionsPagePurchase, text_scale=0.05, text_pos=(0, -0.01), textMayChange=0, pos=(0.885, 0, -0.94), sortOrder=100, command=self.__handlePurchase)
|
||||
base.setCellsActive([base.bottomCells[4]], 0)
|
||||
self.accept('time-insert', self.__beginTossPie)
|
||||
self.accept('time-insert-up', self.__endTossPie)
|
||||
self.accept('time-delete', self.__beginTossPie)
|
||||
|
@ -413,19 +406,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
|
|||
QuestParser.init()
|
||||
return
|
||||
|
||||
def __handlePurchase(self):
|
||||
self.purchaseButton.hide()
|
||||
if (base.cr.isWebPlayToken() or __dev__):
|
||||
if base.cr.isPaid():
|
||||
if base.cr.productName in ['DisneyOnline-UK', 'DisneyOnline-AP', 'JP', 'DE', 'BR', 'FR']:
|
||||
paidNoParentPassword = launcher and launcher.getParentPasswordSet()
|
||||
else:
|
||||
paidNoParentPassword = launcher and not launcher.getParentPasswordSet()
|
||||
else:
|
||||
paidNoParentPassword = 0
|
||||
else:
|
||||
self.notify.error('You should not get here without a PlayToken')
|
||||
|
||||
if base.wantKarts:
|
||||
|
||||
def addKartPage(self):
|
||||
|
|
|
@ -238,27 +238,26 @@ class PlayerInfoPanel(AvatarPanelBase.AvatarPanelBase):
|
|||
text_align=TextNode.ALeft,
|
||||
state=avButtonState,
|
||||
command=ignoreCmd)
|
||||
if base.cr.productName not in ['JP', 'DE', 'BR', 'FR']:
|
||||
self.reportButton = DirectButton(
|
||||
parent=self.frame,
|
||||
image=(
|
||||
gui.find('**/report_BtnUP'),
|
||||
gui.find('**/report_BtnDN'),
|
||||
gui.find('**/report_BtnRLVR'),
|
||||
gui.find('**/report_BtnUP')),
|
||||
image3_color=disabledImageColor,
|
||||
image_scale=0.65,
|
||||
relief=None,
|
||||
pos=(-0.103, 0, -0.29738),
|
||||
text=TTLocalizer.AvatarPanelReport,
|
||||
text0_fg=text0Color,
|
||||
text1_fg=text1Color,
|
||||
text2_fg=text2Color,
|
||||
text3_fg=text3Color,
|
||||
text_scale=0.06,
|
||||
text_pos=(0.06, -0.015),
|
||||
text_align=TextNode.ALeft,
|
||||
command=self.handleReport)
|
||||
self.reportButton = DirectButton(
|
||||
parent=self.frame,
|
||||
image=(
|
||||
gui.find('**/report_BtnUP'),
|
||||
gui.find('**/report_BtnDN'),
|
||||
gui.find('**/report_BtnRLVR'),
|
||||
gui.find('**/report_BtnUP')),
|
||||
image3_color=disabledImageColor,
|
||||
image_scale=0.65,
|
||||
relief=None,
|
||||
pos=(-0.103, 0, -0.29738),
|
||||
text=TTLocalizer.AvatarPanelReport,
|
||||
text0_fg=text0Color,
|
||||
text1_fg=text1Color,
|
||||
text2_fg=text2Color,
|
||||
text3_fg=text3Color,
|
||||
text_scale=0.06,
|
||||
text_pos=(0.06, -0.015),
|
||||
text_align=TextNode.ALeft,
|
||||
command=self.handleReport)
|
||||
self.detailButton = DirectButton(
|
||||
parent=self.frame,
|
||||
image=(
|
||||
|
@ -291,11 +290,7 @@ class PlayerInfoPanel(AvatarPanelBase.AvatarPanelBase):
|
|||
def disableAll(self):
|
||||
self.detailButton['state'] = DGG.DISABLED
|
||||
self.ignoreButton['state'] = DGG.DISABLED
|
||||
if base.cr.productName not in ['JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
self.reportButton['state'] = DGG.DISABLED
|
||||
self.reportButton['state'] = DGG.DISABLED
|
||||
self.goToButton['state'] = DGG.DISABLED
|
||||
self.secretsButton['state'] = DGG.DISABLED
|
||||
self.whisperButton['state'] = DGG.DISABLED
|
||||
|
|
|
@ -243,29 +243,26 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
|
|||
text_pos=(0.06, -0.015),
|
||||
text_align=TextNode.ALeft,
|
||||
command=ignoreCmd)
|
||||
|
||||
|
||||
if base.cr.productName not in ['JP', 'DE', 'BR', 'FR']:
|
||||
self.reportButton = DirectButton(
|
||||
parent=self.frame,
|
||||
image=(
|
||||
gui.find('**/report_BtnUP'),
|
||||
gui.find('**/report_BtnDN'),
|
||||
gui.find('**/report_BtnRLVR'),
|
||||
gui.find('**/report_BtnUP')),
|
||||
image3_color=self.disabledImageColor,
|
||||
image_scale=0.65,
|
||||
relief=None,
|
||||
pos=(-0.103, 0, -0.29738),
|
||||
text=TTLocalizer.AvatarPanelReport,
|
||||
text0_fg=self.text0Color,
|
||||
text1_fg=self.text1Color,
|
||||
text2_fg=self.text2Color,
|
||||
text3_fg=self.text3Color,
|
||||
text_scale=0.06,
|
||||
text_pos=(0.06, -0.015),
|
||||
text_align=TextNode.ALeft,
|
||||
command=self.handleReport)
|
||||
self.reportButton = DirectButton(
|
||||
parent=self.frame,
|
||||
image=(
|
||||
gui.find('**/report_BtnUP'),
|
||||
gui.find('**/report_BtnDN'),
|
||||
gui.find('**/report_BtnRLVR'),
|
||||
gui.find('**/report_BtnUP')),
|
||||
image3_color=self.disabledImageColor,
|
||||
image_scale=0.65,
|
||||
relief=None,
|
||||
pos=(-0.103, 0, -0.29738),
|
||||
text=TTLocalizer.AvatarPanelReport,
|
||||
text0_fg=self.text0Color,
|
||||
text1_fg=self.text1Color,
|
||||
text2_fg=self.text2Color,
|
||||
text3_fg=self.text3Color,
|
||||
text_scale=0.06,
|
||||
text_pos=(0.06, -0.015),
|
||||
text_align=TextNode.ALeft,
|
||||
command=self.handleReport)
|
||||
|
||||
|
||||
if not base.localAvatar.isTeleportAllowed():
|
||||
|
@ -320,12 +317,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
|
|||
|
||||
def disableAll(self):
|
||||
self.detailButton['state'] = DGG.DISABLED
|
||||
if base.cr.productName not in ['ES',
|
||||
'JP',
|
||||
'DE',
|
||||
'BR',
|
||||
'FR']:
|
||||
self.reportButton['state'] = DGG.DISABLED
|
||||
self.reportButton['state'] = DGG.DISABLED
|
||||
self.ignoreButton['state'] = DGG.DISABLED
|
||||
self.goToButton['state'] = DGG.DISABLED
|
||||
self.secretsButton['state'] = DGG.DISABLED
|
||||
|
|
|
@ -3381,14 +3381,11 @@ AvatarChoiceNameRejected = 'Name\nRejected'
|
|||
AvatarChoiceNameApproved = 'Name\nApproved!'
|
||||
AvatarChoiceNameReview = 'Under\nReview'
|
||||
AvatarChoiceNameYourToon = 'Name\nYour Toon!'
|
||||
AvatarChoiceDeletePasswordText = 'Careful! This will delete %s forever. To delete this Toon, enter your password.'
|
||||
AvatarChoiceDeleteConfirmText = 'Careful! This will delete %(name)s forever. If you are sure you want to do this, type "%(confirm)s" and click OK.'
|
||||
AvatarChoiceDeleteConfirmUserTypes = 'delete'
|
||||
AvatarChoiceDeletePasswordTitle = 'Delete Toon?'
|
||||
AvatarChoicePassword = 'Password'
|
||||
AvatarChoiceDeletePasswordOK = lOK
|
||||
AvatarChoiceDeletePasswordCancel = lCancel
|
||||
AvatarChoiceDeleteWrongPassword = 'That password does not seem to match. To delete this Toon, enter your password.'
|
||||
AvatarChoiceDeleteWrongConfirm = 'You didn\'t type the right thing. To delete %(name)s, type "%(confirm)s" and click OK. Do not type the quotation marks. Click Cancel if you have changed your mind.'
|
||||
AvatarChooserPickAToon = 'Pick A Toon To Play'
|
||||
AvatarChooserQuit = lQuit
|
||||
|
@ -3904,7 +3901,6 @@ MapPageGoTo = 'Go To\n%s'
|
|||
OptionsPageTitle = 'Options'
|
||||
MoreOptionsPageTitle = 'More Options'
|
||||
OptionsTabTitle = 'Options\n& Codes'
|
||||
OptionsPagePurchase = 'Subscribe'
|
||||
OptionsPageExitToontown = 'Exit Toontown'
|
||||
OptionsPageMusicOnLabel = 'Music is on.'
|
||||
OptionsPageMusicOffLabel = 'Music is off.'
|
||||
|
|
|
@ -30,14 +30,6 @@ TCMscButton = 0.06
|
|||
TCMwhisperFrame = 0.06
|
||||
TCMwhisperButton = 0.05
|
||||
TCMwhisperScButton = 0.05
|
||||
TCMunpaidChatWarningWordwrap = 18
|
||||
TCMunpaidChatWarning = 0.055
|
||||
TCMunpaidChatWarningPos = (0.0, 0.3)
|
||||
TCMpayButton = 0.06
|
||||
TCMpayButtonPos = (0.0, 0.0, -0.13)
|
||||
TCMopenChatWarning = 0.06
|
||||
TCMactivateChatGui = 0.05
|
||||
TCMsecretChatActivated = 0.06
|
||||
TCMdirectButtonTextPos = (0.0, 0.0, -0.28)
|
||||
LCHQLfdText = 0.1
|
||||
SCHQLfdTypeText = 0.075
|
||||
|
|
Loading…
Reference in a new issue