get rid of more DeprecationWarnings
This commit is contained in:
parent
b8d5827496
commit
e1c842d235
8 changed files with 78 additions and 109 deletions
|
@ -1,4 +1,4 @@
|
||||||
from pandac.PandaModules import *
|
from panda3d.core import *
|
||||||
from panda3d.otp import Nametag, NametagGroup
|
from panda3d.otp import Nametag, NametagGroup
|
||||||
from panda3d.otp import CFSpeech, CFThought, CFTimeout, CFPageButton, CFNoQuitButton, CFQuitButton
|
from panda3d.otp import CFSpeech, CFThought, CFTimeout, CFPageButton, CFNoQuitButton, CFQuitButton
|
||||||
from otp.otpbase import OTPGlobals
|
from otp.otpbase import OTPGlobals
|
||||||
|
@ -12,7 +12,7 @@ from otp.otpbase import OTPRender
|
||||||
from otp.otpbase.PythonUtil import recordCreationStack
|
from otp.otpbase.PythonUtil import recordCreationStack
|
||||||
teleportNotify = DirectNotifyGlobal.directNotify.newCategory('Teleport')
|
teleportNotify = DirectNotifyGlobal.directNotify.newCategory('Teleport')
|
||||||
teleportNotify.showTime = True
|
teleportNotify.showTime = True
|
||||||
if config.GetBool('want-teleport-debug', 1):
|
if ConfigVariableBool('want-teleport-debug', 1).value:
|
||||||
teleportNotify.setDebug(1)
|
teleportNotify.setDebug(1)
|
||||||
|
|
||||||
def reconsiderAllUnderstandable():
|
def reconsiderAllUnderstandable():
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import string
|
import string
|
||||||
import sys
|
|
||||||
from direct.showbase import DirectObject
|
from direct.showbase import DirectObject
|
||||||
from otp.otpbase import OTPGlobals
|
|
||||||
from direct.fsm import ClassicFSM
|
from direct.fsm import ClassicFSM
|
||||||
from direct.fsm import State
|
from direct.fsm import State
|
||||||
from otp.login import SecretFriendsInfoPanel
|
from otp.login import SecretFriendsInfoPanel
|
||||||
|
@ -10,7 +8,7 @@ from otp.otpbase import OTPLocalizer
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
from otp.login import LeaveToPayDialog
|
from otp.login import LeaveToPayDialog
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from pandac.PandaModules import *
|
from panda3d.core import *
|
||||||
ChatEvent = 'ChatEvent'
|
ChatEvent = 'ChatEvent'
|
||||||
NormalChatEvent = 'NormalChatEvent'
|
NormalChatEvent = 'NormalChatEvent'
|
||||||
SCChatEvent = 'SCChatEvent'
|
SCChatEvent = 'SCChatEvent'
|
||||||
|
@ -39,7 +37,7 @@ def removeThoughtPrefix(message):
|
||||||
|
|
||||||
class ChatManager(DirectObject.DirectObject):
|
class ChatManager(DirectObject.DirectObject):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('ChatManager')
|
notify = DirectNotifyGlobal.directNotify.newCategory('ChatManager')
|
||||||
execChat = base.config.GetBool('exec-chat', 0)
|
execChat = ConfigVariableBool('exec-chat', 0).value
|
||||||
|
|
||||||
def __init__(self, cr, localAvatar):
|
def __init__(self, cr, localAvatar):
|
||||||
self.cr = cr
|
self.cr = cr
|
||||||
|
@ -323,7 +321,7 @@ class ChatManager(DirectObject.DirectObject):
|
||||||
if self.wantBackgroundFocus:
|
if self.wantBackgroundFocus:
|
||||||
self.chatInputNormal.chatEntry['backgroundFocus'] = 1
|
self.chatInputNormal.chatEntry['backgroundFocus'] = 1
|
||||||
self.acceptOnce('enterNormalChat', self.fsm.request, ['whisperChat', [avatarName, avatarId]])
|
self.acceptOnce('enterNormalChat', self.fsm.request, ['whisperChat', [avatarName, avatarId]])
|
||||||
if base.cr.config.GetBool('force-typed-whisper-enabled', 0):
|
if ConfigVariableBool('force-typed-whisper-enabled', 0).value:
|
||||||
self.whisperButton['state'] = 'normal'
|
self.whisperButton['state'] = 'normal'
|
||||||
self.enablewhisperButton()
|
self.enablewhisperButton()
|
||||||
return
|
return
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import string
|
|
||||||
import types
|
|
||||||
import random
|
import random
|
||||||
import gc
|
import gc
|
||||||
import os
|
import os
|
||||||
from pandac.PandaModules import *
|
from panda3d.core import *
|
||||||
from pandac.PandaModules import *
|
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from otp.distributed.OtpDoGlobals import *
|
from otp.distributed.OtpDoGlobals import *
|
||||||
from direct.interval.IntervalGlobal import ivalMgr
|
from direct.interval.IntervalGlobal import ivalMgr
|
||||||
|
@ -16,20 +13,17 @@ from direct.fsm.ClassicFSM import ClassicFSM
|
||||||
from direct.fsm.State import State
|
from direct.fsm.State import State
|
||||||
from direct.task import Task
|
from direct.task import Task
|
||||||
from direct.distributed import DistributedSmoothNode
|
from direct.distributed import DistributedSmoothNode
|
||||||
from direct.showbase import PythonUtil, GarbageReport, BulletinBoardWatcher
|
from direct.showbase import PythonUtil, GarbageReport
|
||||||
from direct.showbase.ContainerLeakDetector import ContainerLeakDetector
|
from direct.showbase.ContainerLeakDetector import ContainerLeakDetector
|
||||||
from direct.showbase import MessengerLeakDetector
|
from direct.showbase import MessengerLeakDetector
|
||||||
from direct.showbase.GarbageReportScheduler import GarbageReportScheduler
|
from direct.showbase.GarbageReportScheduler import GarbageReportScheduler
|
||||||
from direct.showbase import LeakDetectors
|
from direct.showbase import LeakDetectors
|
||||||
from direct.distributed.PyDatagram import PyDatagram
|
from direct.distributed.PyDatagram import PyDatagram
|
||||||
from direct.distributed.PyDatagramIterator import PyDatagramIterator
|
|
||||||
from otp.avatar import Avatar
|
|
||||||
from otp.avatar.DistributedPlayer import DistributedPlayer
|
from otp.avatar.DistributedPlayer import DistributedPlayer
|
||||||
from otp.login import LoginTTSpecificDevAccount
|
from otp.login import LoginTTSpecificDevAccount
|
||||||
from otp.login.CreateAccountScreen import CreateAccountScreen
|
from otp.login.CreateAccountScreen import CreateAccountScreen
|
||||||
from otp.login import LoginScreen
|
from otp.login import LoginScreen
|
||||||
from otp.otpgui import OTPDialog
|
from otp.otpgui import OTPDialog
|
||||||
from otp.avatar import DistributedAvatar
|
|
||||||
from otp.otpbase import OTPLocalizer
|
from otp.otpbase import OTPLocalizer
|
||||||
from otp.login import LoginGSAccount
|
from otp.login import LoginGSAccount
|
||||||
from otp.login import LoginGoAccount
|
from otp.login import LoginGoAccount
|
||||||
|
@ -60,7 +54,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.launcher = launcher
|
self.launcher = launcher
|
||||||
base.launcher = launcher
|
base.launcher = launcher
|
||||||
self.__currentAvId = 0
|
self.__currentAvId = 0
|
||||||
self.productName = config.GetString('product-name', 'DisneyOnline-US')
|
self.productName = ConfigVariableString('product-name', 'DisneyOnline-US').value
|
||||||
self.createAvatarClass = None
|
self.createAvatarClass = None
|
||||||
self.systemMessageSfx = None
|
self.systemMessageSfx = None
|
||||||
reg_deployment = ''
|
reg_deployment = ''
|
||||||
|
@ -84,7 +78,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
if self.launcher:
|
if self.launcher:
|
||||||
self.blue = self.launcher.getBlue()
|
self.blue = self.launcher.getBlue()
|
||||||
|
|
||||||
fakeBlue = config.GetString('fake-blue', '')
|
fakeBlue = ConfigVariableString('fake-blue', '').value
|
||||||
if fakeBlue:
|
if fakeBlue:
|
||||||
self.blue = fakeBlue
|
self.blue = fakeBlue
|
||||||
|
|
||||||
|
@ -92,7 +86,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
if self.launcher:
|
if self.launcher:
|
||||||
self.playToken = self.launcher.getPlayToken()
|
self.playToken = self.launcher.getPlayToken()
|
||||||
|
|
||||||
fakePlayToken = config.GetString('fake-playtoken', '')
|
fakePlayToken = ConfigVariableString('fake-playtoken', '').value
|
||||||
if fakePlayToken:
|
if fakePlayToken:
|
||||||
self.playToken = fakePlayToken
|
self.playToken = fakePlayToken
|
||||||
|
|
||||||
|
@ -100,8 +94,8 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
if self.launcher:
|
if self.launcher:
|
||||||
self.DISLToken = self.launcher.getDISLToken()
|
self.DISLToken = self.launcher.getDISLToken()
|
||||||
|
|
||||||
fakeDISLToken = config.GetString('fake-DISLToken', '')
|
fakeDISLToken = ConfigVariableString('fake-DISLToken', '').value
|
||||||
fakeDISLPlayerName = config.GetString('fake-DISL-PlayerName', '')
|
fakeDISLPlayerName = ConfigVariableString('fake-DISL-PlayerName', '').value
|
||||||
if fakeDISLToken:
|
if fakeDISLToken:
|
||||||
self.DISLToken = fakeDISLToken
|
self.DISLToken = fakeDISLToken
|
||||||
elif fakeDISLPlayerName:
|
elif fakeDISLPlayerName:
|
||||||
|
@ -109,39 +103,39 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
defaultNumAvatars = 4
|
defaultNumAvatars = 4
|
||||||
defaultNumAvatarSlots = 4
|
defaultNumAvatarSlots = 4
|
||||||
defaultNumConcur = 1
|
defaultNumConcur = 1
|
||||||
subCount = config.GetInt('fake-DISL-NumSubscriptions', 1)
|
subCount = ConfigVariableInt('fake-DISL-NumSubscriptions', 1).value
|
||||||
playerAccountId = config.GetInt('fake-DISL-PlayerAccountId', defaultId)
|
playerAccountId = ConfigVariableInt('fake-DISL-PlayerAccountId', defaultId).value
|
||||||
self.DISLToken = ('ACCOUNT_NAME=%s' % fakeDISLPlayerName +
|
self.DISLToken = ('ACCOUNT_NAME=%s' % fakeDISLPlayerName +
|
||||||
'&ACCOUNT_NUMBER=%s' % playerAccountId +
|
'&ACCOUNT_NUMBER=%s' % playerAccountId +
|
||||||
'&ACCOUNT_NAME_APPROVAL=%s' % config.GetString('fake-DISL-PlayerNameApproved', 'YES') +
|
'&ACCOUNT_NAME_APPROVAL=%s' % ConfigVariableString('fake-DISL-PlayerNameApproved', 'YES').value +
|
||||||
'&SWID=%s' % config.GetString('fake-DISL-SWID', '{1763AC36-D73F-41C2-A54A-B579E58B69C8}') +
|
'&SWID=%s' % ConfigVariableString('fake-DISL-SWID', '{1763AC36-D73F-41C2-A54A-B579E58B69C8}').value +
|
||||||
'&FAMILY_NUMBER=%s' % config.GetString('fake-DISL-FamilyAccountId', '-1') +
|
'&FAMILY_NUMBER=%s' % ConfigVariableString('fake-DISL-FamilyAccountId', '-1').value +
|
||||||
'&familyAdmin=%s' % config.GetString('fake-DISL-FamilyAdmin', '1') +
|
'&familyAdmin=%s' % ConfigVariableString('fake-DISL-FamilyAdmin', '1').value +
|
||||||
'&PIRATES_ACCESS=%s' % config.GetString('fake-DISL-PiratesAccess', 'FULL') +
|
'&PIRATES_ACCESS=%s' % ConfigVariableString('fake-DISL-PiratesAccess', 'FULL').value +
|
||||||
'&PIRATES_MAX_NUM_AVATARS=%s' % config.GetInt('fake-DISL-MaxAvatars', defaultNumAvatars) +
|
'&PIRATES_MAX_NUM_AVATARS=%s' % ConfigVariableInt('fake-DISL-MaxAvatars', defaultNumAvatars).value +
|
||||||
'&PIRATES_NUM_AVATAR_SLOTS=%s' % config.GetInt('fake-DISL-MaxAvatarSlots', defaultNumAvatarSlots) +
|
'&PIRATES_NUM_AVATAR_SLOTS=%s' % ConfigVariableInt('fake-DISL-MaxAvatarSlots', defaultNumAvatarSlots).value +
|
||||||
'&expires=%s' % config.GetString('fake-DISL-expire', '1577898000') +
|
'&expires=%s' % ConfigVariableString('fake-DISL-expire', '1577898000').value +
|
||||||
'&OPEN_CHAT_ENABLED=%s' % config.GetString('fake-DISL-OpenChatEnabled', 'YES') +
|
'&OPEN_CHAT_ENABLED=%s' % ConfigVariableString('fake-DISL-OpenChatEnabled', 'YES').value +
|
||||||
'&CREATE_FRIENDS_WITH_CHAT=%s' % config.GetString('fake-DISL-CreateFriendsWithChat', 'YES') +
|
'&CREATE_FRIENDS_WITH_CHAT=%s' % ConfigVariableString('fake-DISL-CreateFriendsWithChat', 'YES').value +
|
||||||
'&CHAT_CODE_CREATION_RULE=%s' % config.GetString('fake-DISL-ChatCodeCreation', 'YES') +
|
'&CHAT_CODE_CREATION_RULE=%s' % ConfigVariableString('fake-DISL-ChatCodeCreation', 'YES').value +
|
||||||
'&FAMILY_MEMBERS=%s' % config.GetString('fake-DISL-FamilyMembers') + '&PIRATES_SUB_COUNT=%s' % subCount)
|
'&FAMILY_MEMBERS=%s' % ConfigVariableString('fake-DISL-FamilyMembers').value + '&PIRATES_SUB_COUNT=%s' % subCount)
|
||||||
for i in range(subCount):
|
for i in range(subCount):
|
||||||
self.DISLToken += ('&PIRATES_SUB_%s_ACCESS=%s' % (i, config.GetString('fake-DISL-Sub-%s-Access' % i, 'FULL')) +
|
self.DISLToken += ('&PIRATES_SUB_%s_ACCESS=%s' % (i, ConfigVariableString('fake-DISL-Sub-%s-Access' % i, 'FULL').value) +
|
||||||
'&PIRATES_SUB_%s_ACTIVE=%s' % (i, config.GetString('fake-DISL-Sub-%s-Active' % i, 'YES')) +
|
'&PIRATES_SUB_%s_ACTIVE=%s' % (i, ConfigVariableString('fake-DISL-Sub-%s-Active' % i, 'YES').value) +
|
||||||
'&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_ID=%s' % (i, ConfigVariableInt('fake-DISL-Sub-%s-Id' % i, playerAccountId).value + ConfigVariableInt('fake-DISL-Sub-Id-Offset', 0).value) +
|
||||||
'&PIRATES_SUB_%s_LEVEL=%s' % (i, config.GetInt('fake-DISL-Sub-%s-Level' % i, 3)) +
|
'&PIRATES_SUB_%s_LEVEL=%s' % (i, ConfigVariableInt('fake-DISL-Sub-%s-Level' % i, 3).value) +
|
||||||
'&PIRATES_SUB_%s_NAME=%s' % (i, config.GetString('fake-DISL-Sub-%s-Name' % i, fakeDISLPlayerName)) +
|
'&PIRATES_SUB_%s_NAME=%s' % (i, ConfigVariableString('fake-DISL-Sub-%s-Name' % i, fakeDISLPlayerName).value) +
|
||||||
'&PIRATES_SUB_%s_NUM_AVATARS=%s' % (i, config.GetInt('fake-DISL-Sub-%s-NumAvatars' % i, defaultNumAvatars)) +
|
'&PIRATES_SUB_%s_NUM_AVATARS=%s' % (i, ConfigVariableInt('fake-DISL-Sub-%s-NumAvatars' % i, defaultNumAvatars).value) +
|
||||||
'&PIRATES_SUB_%s_NUM_CONCUR=%s' % (i, config.GetInt('fake-DISL-Sub-%s-NumConcur' % i, defaultNumConcur)) +
|
'&PIRATES_SUB_%s_NUM_CONCUR=%s' % (i, ConfigVariableInt('fake-DISL-Sub-%s-NumConcur' % i, defaultNumConcur).value) +
|
||||||
'&PIRATES_SUB_%s_OWNERID=%s' % (i, config.GetInt('fake-DISL-Sub-%s-OwnerId' % i, playerAccountId)) +
|
'&PIRATES_SUB_%s_OWNERID=%s' % (i, ConfigVariableInt('fake-DISL-Sub-%s-OwnerId' % i, playerAccountId).value) +
|
||||||
'&PIRATES_SUB_%s_FOUNDER=%s' % (i, config.GetString('fake-DISL-Sub-%s-Founder' % i, 'YES')))
|
'&PIRATES_SUB_%s_FOUNDER=%s' % (i, ConfigVariableString('fake-DISL-Sub-%s-Founder' % i, 'YES').value))
|
||||||
|
|
||||||
self.DISLToken += ('&WL_CHAT_ENABLED=%s' % config.GetString('fake-DISL-WLChatEnabled', 'YES') +
|
self.DISLToken += ('&WL_CHAT_ENABLED=%s' % ConfigVariableString('fake-DISL-WLChatEnabled', 'YES').value +
|
||||||
'&valid=true')
|
'&valid=true')
|
||||||
if base.logPrivateInfo:
|
if base.logPrivateInfo:
|
||||||
print(self.DISLToken)
|
print(self.DISLToken)
|
||||||
|
|
||||||
self.requiredLogin = config.GetString('required-login', 'auto')
|
self.requiredLogin = ConfigVariableString('required-login', 'auto').value
|
||||||
if self.requiredLogin == 'auto':
|
if self.requiredLogin == 'auto':
|
||||||
self.notify.info('required-login auto.')
|
self.notify.info('required-login auto.')
|
||||||
elif self.requiredLogin == 'green':
|
elif self.requiredLogin == 'green':
|
||||||
|
@ -167,10 +161,10 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
else:
|
else:
|
||||||
self.http = HTTPClient()
|
self.http = HTTPClient()
|
||||||
|
|
||||||
self.accountOldAuth = config.GetBool('account-old-auth', 0)
|
self.accountOldAuth = ConfigVariableBool('account-old-auth', 0).value
|
||||||
self.accountOldAuth = config.GetBool('%s-account-old-auth' % game.name,
|
self.accountOldAuth = ConfigVariableBool('%s-account-old-auth' % game.name,
|
||||||
self.accountOldAuth)
|
self.accountOldAuth).value
|
||||||
self.useNewTTDevLogin = base.config.GetBool('use-tt-specific-dev-login', False)
|
self.useNewTTDevLogin = ConfigVariableBool('use-tt-specific-dev-login', False).value
|
||||||
if __astron__:
|
if __astron__:
|
||||||
self.loginInterface = LoginAstronAccount.LoginAstronAccount(self)
|
self.loginInterface = LoginAstronAccount.LoginAstronAccount(self)
|
||||||
self.notify.info('loginInterface: LoginAstronAccount')
|
self.notify.info('loginInterface: LoginAstronAccount')
|
||||||
|
@ -193,11 +187,11 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.loginInterface = LoginTTAccount.LoginTTAccount(self)
|
self.loginInterface = LoginTTAccount.LoginTTAccount(self)
|
||||||
self.notify.info('loginInterface: LoginTTAccount')
|
self.notify.info('loginInterface: LoginTTAccount')
|
||||||
|
|
||||||
self.secretChatAllowed = base.config.GetBool('allow-secret-chat', 0)
|
self.secretChatAllowed = ConfigVariableBool('allow-secret-chat', 0).value
|
||||||
self.openChatAllowed = base.config.GetBool('allow-open-chat', 0)
|
self.openChatAllowed = ConfigVariableBool('allow-open-chat', 0).value
|
||||||
self.secretChatNeedsParentPassword = base.config.GetBool('secret-chat-needs-parent-password', 0) or (self.launcher and self.launcher.getNeedPwForSecretKey())
|
self.secretChatNeedsParentPassword = ConfigVariableBool('secret-chat-needs-parent-password', 0).value or (self.launcher and self.launcher.getNeedPwForSecretKey())
|
||||||
self.parentPasswordSet = base.config.GetBool('parent-password-set', 0) or (self.launcher and self.launcher.getParentPasswordSet())
|
self.parentPasswordSet = ConfigVariableBool('parent-password-set', 0).value or (self.launcher and self.launcher.getParentPasswordSet())
|
||||||
self.userSignature = base.config.GetString('signature', 'none')
|
self.userSignature = ConfigVariableString('signature', 'none').value
|
||||||
self.freeTimeExpiresAt = -1
|
self.freeTimeExpiresAt = -1
|
||||||
self.__isPaid = 0
|
self.__isPaid = 0
|
||||||
self.periodTimerExpired = 0
|
self.periodTimerExpired = 0
|
||||||
|
@ -206,18 +200,18 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.parentMgr.registerParent(OTPGlobals.SPRender, base.render)
|
self.parentMgr.registerParent(OTPGlobals.SPRender, base.render)
|
||||||
self.parentMgr.registerParent(OTPGlobals.SPHidden, NodePath())
|
self.parentMgr.registerParent(OTPGlobals.SPHidden, NodePath())
|
||||||
self.timeManager = None
|
self.timeManager = None
|
||||||
if config.GetBool('detect-leaks', 0) or config.GetBool('client-detect-leaks', 0):
|
if ConfigVariableBool('detect-leaks', 0).value or ConfigVariableBool('client-detect-leaks', 0).value:
|
||||||
self.startLeakDetector()
|
self.startLeakDetector()
|
||||||
|
|
||||||
if config.GetBool('detect-messenger-leaks', 0) or config.GetBool('ai-detect-messenger-leaks', 0):
|
if ConfigVariableBool('detect-messenger-leaks', 0).value or ConfigVariableBool('ai-detect-messenger-leaks', 0).value:
|
||||||
self.messengerLeakDetector = MessengerLeakDetector.MessengerLeakDetector('client messenger leak detector')
|
self.messengerLeakDetector = MessengerLeakDetector.MessengerLeakDetector('client messenger leak detector')
|
||||||
if config.GetBool('leak-messages', 0):
|
if ConfigVariableBool('leak-messages', 0).value:
|
||||||
MessengerLeakDetector._leakMessengerObject()
|
MessengerLeakDetector._leakMessengerObject()
|
||||||
|
|
||||||
if config.GetBool('run-garbage-reports', 0) or config.GetBool('client-run-garbage-reports', 0):
|
if ConfigVariableBool('run-garbage-reports', 0).value or ConfigVariableBool('client-run-garbage-reports', 0).value:
|
||||||
noneValue = -1.0
|
noneValue = -1.0
|
||||||
reportWait = config.GetFloat('garbage-report-wait', noneValue)
|
reportWait = ConfigVariableDouble('garbage-report-wait', noneValue).value
|
||||||
reportWaitScale = config.GetFloat('garbage-report-wait-scale', noneValue)
|
reportWaitScale = ConfigVariableDouble('garbage-report-wait-scale', noneValue).value
|
||||||
if reportWait == noneValue:
|
if reportWait == noneValue:
|
||||||
reportWait = 60.0 * 2.0
|
reportWait = 60.0 * 2.0
|
||||||
if reportWaitScale == noneValue:
|
if reportWaitScale == noneValue:
|
||||||
|
@ -225,8 +219,8 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.garbageReportScheduler = GarbageReportScheduler(waitBetween=reportWait,
|
self.garbageReportScheduler = GarbageReportScheduler(waitBetween=reportWait,
|
||||||
waitScale=reportWaitScale)
|
waitScale=reportWaitScale)
|
||||||
|
|
||||||
self._proactiveLeakChecks = config.GetBool('proactive-leak-checks', 1) or config.GetBool('client-proactive-leak-checks', 1)
|
self._proactiveLeakChecks = ConfigVariableBool('proactive-leak-checks', 1).value or ConfigVariableBool('client-proactive-leak-checks', 1).value
|
||||||
self._crashOnProactiveLeakDetect = config.GetBool('crash-on-proactive-leak-detect', 1)
|
self._crashOnProactiveLeakDetect = ConfigVariableBool('crash-on-proactive-leak-detect', 1).value
|
||||||
self.activeDistrictMap = {}
|
self.activeDistrictMap = {}
|
||||||
self.telemetryLimiter = TelemetryLimiter()
|
self.telemetryLimiter = TelemetryLimiter()
|
||||||
self.serverVersion = serverVersion
|
self.serverVersion = serverVersion
|
||||||
|
@ -415,8 +409,8 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.playGame = playGame(self.gameFSM, self.gameDoneEvent)
|
self.playGame = playGame(self.gameFSM, self.gameDoneEvent)
|
||||||
self.shardListHandle = None
|
self.shardListHandle = None
|
||||||
self.uberZoneInterest = None
|
self.uberZoneInterest = None
|
||||||
self.wantSwitchboard = config.GetBool('want-switchboard', 0)
|
self.wantSwitchboard = ConfigVariableBool('want-switchboard', 0).value
|
||||||
self.wantSwitchboardHacks = base.config.GetBool('want-switchboard-hacks', 0)
|
self.wantSwitchboardHacks = ConfigVariableBool('want-switchboard-hacks', 0).value
|
||||||
self.__pendingGenerates = {}
|
self.__pendingGenerates = {}
|
||||||
self.__pendingMessages = {}
|
self.__pendingMessages = {}
|
||||||
self.__doId2pendingInterest = {}
|
self.__doId2pendingInterest = {}
|
||||||
|
@ -427,7 +421,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
def startLeakDetector(self):
|
def startLeakDetector(self):
|
||||||
if hasattr(self, 'leakDetector'):
|
if hasattr(self, 'leakDetector'):
|
||||||
return False
|
return False
|
||||||
firstCheckDelay = config.GetFloat('leak-detector-first-check-delay', 2 * 60.0)
|
firstCheckDelay = ConfigVariableDouble('leak-detector-first-check-delay', 2 * 60.0).value
|
||||||
self.leakDetector = ContainerLeakDetector('client container leak detector', firstCheckDelay=firstCheckDelay)
|
self.leakDetector = ContainerLeakDetector('client container leak detector', firstCheckDelay=firstCheckDelay)
|
||||||
self.objectTypesLeakDetector = LeakDetectors.ObjectTypesLeakDetector()
|
self.objectTypesLeakDetector = LeakDetectors.ObjectTypesLeakDetector()
|
||||||
self.garbageLeakDetector = LeakDetectors.GarbageLeakDetector()
|
self.garbageLeakDetector = LeakDetectors.GarbageLeakDetector()
|
||||||
|
@ -685,7 +679,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||||
def waitForGetGameListResponse(self):
|
def waitForGetGameListResponse(self):
|
||||||
if self.isGameListCorrect():
|
if self.isGameListCorrect():
|
||||||
if base.config.GetBool('game-server-tests', 0):
|
if ConfigVariableBool('game-server-tests', 0).value:
|
||||||
from otp.distributed import GameServerTestSuite
|
from otp.distributed import GameServerTestSuite
|
||||||
GameServerTestSuite.GameServerTestSuite(self)
|
GameServerTestSuite.GameServerTestSuite(self)
|
||||||
self.loginFSM.request('waitForShardList')
|
self.loginFSM.request('waitForShardList')
|
||||||
|
@ -1207,7 +1201,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
else:
|
else:
|
||||||
logFunc = self.notify.warning
|
logFunc = self.notify.warning
|
||||||
allowExit = False
|
allowExit = False
|
||||||
if base.config.GetBool('direct-gui-edit', 0):
|
if ConfigVariableBool('direct-gui-edit', 0).value:
|
||||||
logFunc('There are leaks: %s tasks, %s events, %s ivals, %s garbage cycles\nLeaked Events may be due to direct gui editing' % (leakedTasks,
|
logFunc('There are leaks: %s tasks, %s events, %s ivals, %s garbage cycles\nLeaked Events may be due to direct gui editing' % (leakedTasks,
|
||||||
leakedEvents,
|
leakedEvents,
|
||||||
leakedIvals,
|
leakedIvals,
|
||||||
|
@ -1624,7 +1618,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
avId = self.handlerArgs['avId']
|
avId = self.handlerArgs['avId']
|
||||||
if not self.SupportTutorial or base.localAvatar.tutorialAck:
|
if not self.SupportTutorial or base.localAvatar.tutorialAck:
|
||||||
self.gameFSM.request('playGame', [hoodId, zoneId, avId])
|
self.gameFSM.request('playGame', [hoodId, zoneId, avId])
|
||||||
elif base.config.GetBool('force-tutorial', 1):
|
elif ConfigVariableBool('force-tutorial', 1).value:
|
||||||
if hasattr(self, 'skipTutorialRequest') and self.skipTutorialRequest:
|
if hasattr(self, 'skipTutorialRequest') and self.skipTutorialRequest:
|
||||||
self.gameFSM.request('playGame', [hoodId, zoneId, avId])
|
self.gameFSM.request('playGame', [hoodId, zoneId, avId])
|
||||||
self.gameFSM.request('skipTutorialRequest', [hoodId, zoneId, avId])
|
self.gameFSM.request('skipTutorialRequest', [hoodId, zoneId, avId])
|
||||||
|
@ -1698,9 +1692,9 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
def isFreeTimeExpired(self):
|
def isFreeTimeExpired(self):
|
||||||
if self.accountOldAuth:
|
if self.accountOldAuth:
|
||||||
return 0
|
return 0
|
||||||
if base.config.GetBool('free-time-expired', 0):
|
if ConfigVariableBool('free-time-expired', 0).value:
|
||||||
return 1
|
return 1
|
||||||
if base.config.GetBool('unlimited-free-time', 0):
|
if ConfigVariableBool('unlimited-free-time', 0).value:
|
||||||
return 0
|
return 0
|
||||||
if self.freeTimeExpiresAt == -1:
|
if self.freeTimeExpiresAt == -1:
|
||||||
return 0
|
return 0
|
||||||
|
@ -1726,7 +1720,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
return self.blue != None
|
return self.blue != None
|
||||||
|
|
||||||
def isPaid(self):
|
def isPaid(self):
|
||||||
paidStatus = base.config.GetString('force-paid-status', '')
|
paidStatus = ConfigVariableString('force-paid-status', '').value
|
||||||
if not paidStatus:
|
if not paidStatus:
|
||||||
return self.__isPaid
|
return self.__isPaid
|
||||||
elif paidStatus == 'paid':
|
elif paidStatus == 'paid':
|
||||||
|
@ -1744,7 +1738,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
||||||
self.__isPaid = isPaid
|
self.__isPaid = isPaid
|
||||||
|
|
||||||
def allowFreeNames(self):
|
def allowFreeNames(self):
|
||||||
return base.config.GetInt('allow-free-names', 1)
|
return ConfigVariableInt('allow-free-names', 1).value
|
||||||
|
|
||||||
def allowSecretChat(self):
|
def allowSecretChat(self):
|
||||||
return self.secretChatAllowed or self.productName == 'Terra-DMC' and self.isBlue() and self.secretChatAllowed
|
return self.secretChatAllowed or self.productName == 'Terra-DMC' and self.isBlue() and self.secretChatAllowed
|
||||||
|
|
|
@ -65,15 +65,13 @@ class LauncherBase(DirectObject):
|
||||||
print('Current time: ' + time.asctime(time.localtime(time.time())) + ' ' + time.tzname[0])
|
print('Current time: ' + time.asctime(time.localtime(time.time())) + ' ' + time.tzname[0])
|
||||||
print('sys.path = ', sys.path)
|
print('sys.path = ', sys.path)
|
||||||
print('sys.argv = ', sys.argv)
|
print('sys.argv = ', sys.argv)
|
||||||
launcherConfig = DConfig
|
if ConfigVariableBool('log-private-info', 0).value:
|
||||||
builtins.config = launcherConfig
|
|
||||||
if config.GetBool('log-private-info', 0):
|
|
||||||
print('os.environ = ', os.environ)
|
print('os.environ = ', os.environ)
|
||||||
self.miniTaskMgr = MiniTaskManager()
|
self.miniTaskMgr = MiniTaskManager()
|
||||||
self.nout = MultiplexStream()
|
self.nout = MultiplexStream()
|
||||||
Notify.ptr().setOstreamPtr(self.nout, 0)
|
Notify.ptr().setOstreamPtr(self.nout, 0)
|
||||||
self.nout.addFile(Filename(logfile))
|
self.nout.addFile(Filename(logfile))
|
||||||
if launcherConfig.GetBool('console-output', 0):
|
if ConfigVariableBool('console-output', 0).value:
|
||||||
self.nout.addStandardOutput()
|
self.nout.addStandardOutput()
|
||||||
sys.stdout.console = True
|
sys.stdout.console = True
|
||||||
sys.stderr.console = True
|
sys.stderr.console = True
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
from pandac.PandaModules import *
|
from panda3d.core import *
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from direct.task import Task
|
from direct.task import Task
|
||||||
from .SCConstants import *
|
from .SCConstants import *
|
||||||
from direct.interval.IntervalGlobal import *
|
from direct.interval.IntervalGlobal import *
|
||||||
from .SCObject import SCObject
|
from .SCObject import SCObject
|
||||||
from direct.showbase.PythonUtil import makeTuple
|
from direct.showbase.PythonUtil import makeTuple
|
||||||
import types
|
|
||||||
|
|
||||||
class SCMenu(SCObject, NodePath):
|
class SCMenu(SCObject, NodePath):
|
||||||
config = getConfigShowbase()
|
SpeedChatRolloverTolerance = ConfigVariableDouble('speedchat-rollover-tolerance', 0.08).value
|
||||||
SpeedChatRolloverTolerance = config.GetFloat('speedchat-rollover-tolerance', 0.08)
|
WantFade = ConfigVariableBool('want-speedchat-fade', 0).value
|
||||||
WantFade = config.GetBool('want-speedchat-fade', 0)
|
FadeDuration = ConfigVariableDouble('speedchat-fade-duration', 0.2).value
|
||||||
FadeDuration = config.GetFloat('speedchat-fade-duration', 0.2)
|
|
||||||
SerialNum = 0
|
SerialNum = 0
|
||||||
BackgroundModelName = None
|
BackgroundModelName = None
|
||||||
GuiModelName = None
|
GuiModelName = None
|
||||||
|
|
|
@ -1,31 +1,14 @@
|
||||||
import time
|
from panda3d.core import *
|
||||||
from pandac.PandaModules import *
|
|
||||||
from direct.distributed.ClockDelta import *
|
from direct.distributed.ClockDelta import *
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
from pandac.PandaModules import *
|
|
||||||
from direct.interval.IntervalGlobal import ivalMgr
|
from direct.interval.IntervalGlobal import ivalMgr
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
|
||||||
from direct.distributed import DistributedSmoothNode
|
|
||||||
from direct.distributed.PyDatagram import PyDatagram
|
from direct.distributed.PyDatagram import PyDatagram
|
||||||
from direct.distributed.PyDatagramIterator import PyDatagramIterator
|
from direct.distributed.PyDatagramIterator import PyDatagramIterator
|
||||||
from direct.task import Task
|
|
||||||
from direct.fsm import ClassicFSM
|
|
||||||
from direct.fsm import State
|
from direct.fsm import State
|
||||||
from direct.showbase.PythonUtil import Functor, ScratchPad
|
from direct.showbase.PythonUtil import Functor, ScratchPad
|
||||||
from direct.showbase.InputStateGlobal import inputState
|
|
||||||
from otp.avatar import Avatar
|
from otp.avatar import Avatar
|
||||||
from otp.avatar import DistributedAvatar
|
|
||||||
from otp.friends import FriendManager
|
|
||||||
from otp.login import LoginScreen
|
|
||||||
from otp.login import LoginGSAccount
|
|
||||||
from otp.login import LoginGoAccount
|
|
||||||
from otp.login import LoginWebPlayTokenAccount
|
|
||||||
from otp.login import LoginTTAccount
|
|
||||||
from otp.login import HTTPUtil
|
|
||||||
from otp.distributed import OTPClientRepository
|
from otp.distributed import OTPClientRepository
|
||||||
from otp.distributed import PotentialAvatar
|
from otp.distributed import PotentialAvatar
|
||||||
from otp.distributed import PotentialShard
|
|
||||||
from otp.distributed import DistributedDistrict
|
|
||||||
from otp.distributed.OtpDoGlobals import *
|
from otp.distributed.OtpDoGlobals import *
|
||||||
from otp.distributed import OtpDoGlobals
|
from otp.distributed import OtpDoGlobals
|
||||||
from otp.otpbase import OTPGlobals
|
from otp.otpbase import OTPGlobals
|
||||||
|
@ -39,7 +22,6 @@ from toontown.distributed import DelayDelete
|
||||||
from toontown.friends import FriendHandle
|
from toontown.friends import FriendHandle
|
||||||
from toontown.friends import FriendsListPanel
|
from toontown.friends import FriendsListPanel
|
||||||
from toontown.friends import ToontownFriendSecret
|
from toontown.friends import ToontownFriendSecret
|
||||||
from toontown.uberdog import TTSpeedchatRelay
|
|
||||||
from toontown.login import DateObject
|
from toontown.login import DateObject
|
||||||
from toontown.login import AvatarChooser
|
from toontown.login import AvatarChooser
|
||||||
from toontown.makeatoon import MakeAToon
|
from toontown.makeatoon import MakeAToon
|
||||||
|
@ -49,7 +31,6 @@ from toontown.toontowngui import TTDialog
|
||||||
from toontown.toon import LocalToon
|
from toontown.toon import LocalToon
|
||||||
from toontown.toon import ToonDNA
|
from toontown.toon import ToonDNA
|
||||||
from toontown.distributed import ToontownDistrictStats
|
from toontown.distributed import ToontownDistrictStats
|
||||||
from toontown.makeatoon import TTPickANamePattern
|
|
||||||
from toontown.parties import ToontownTimeManager
|
from toontown.parties import ToontownTimeManager
|
||||||
from toontown.toon import Toon, DistributedToon
|
from toontown.toon import Toon, DistributedToon
|
||||||
from .ToontownMsgTypes import *
|
from .ToontownMsgTypes import *
|
||||||
|
@ -101,7 +82,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.playerFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_PLAYER_FRIENDS_MANAGER, 'TTPlayerFriendsManager')
|
self.playerFriendsManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_PLAYER_FRIENDS_MANAGER, 'TTPlayerFriendsManager')
|
||||||
self.speedchatRelay = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_SPEEDCHAT_RELAY, 'TTSpeedchatRelay')
|
self.speedchatRelay = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_SPEEDCHAT_RELAY, 'TTSpeedchatRelay')
|
||||||
self.deliveryManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')
|
self.deliveryManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_DELIVERY_MANAGER, 'DistributedDeliveryManager')
|
||||||
if config.GetBool('want-code-redemption', 1):
|
if ConfigVariableBool('want-code-redemption', 1).value:
|
||||||
self.codeRedemptionManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_CODE_REDEMPTION_MANAGER, 'TTCodeRedemptionMgr')
|
self.codeRedemptionManager = self.generateGlobalObject(OtpDoGlobals.OTP_DO_ID_TOONTOWN_CODE_REDEMPTION_MANAGER, 'TTCodeRedemptionMgr')
|
||||||
self.streetSign = None
|
self.streetSign = None
|
||||||
self.furnitureManager = None
|
self.furnitureManager = None
|
||||||
|
@ -127,9 +108,9 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
state.addTransition('skipTutorialRequest')
|
state.addTransition('skipTutorialRequest')
|
||||||
state = self.gameFSM.getStateNamed('playGame')
|
state = self.gameFSM.getStateNamed('playGame')
|
||||||
state.addTransition('skipTutorialRequest')
|
state.addTransition('skipTutorialRequest')
|
||||||
self.wantCogdominiums = base.config.GetBool('want-cogdominiums', 1)
|
self.wantCogdominiums = ConfigVariableBool('want-cogdominiums', 1).value
|
||||||
self.wantEmblems = base.config.GetBool('want-emblems', 0)
|
self.wantEmblems = ConfigVariableBool('want-emblems', 0).value
|
||||||
if base.config.GetBool('tt-node-check', 0):
|
if ConfigVariableBool('tt-node-check', 0).value:
|
||||||
for species in ToonDNA.toonSpeciesTypes:
|
for species in ToonDNA.toonSpeciesTypes:
|
||||||
for head in ToonDNA.getHeadList(species):
|
for head in ToonDNA.getHeadList(species):
|
||||||
for torso in ToonDNA.toonTorsoTypes:
|
for torso in ToonDNA.toonTorsoTypes:
|
||||||
|
@ -231,7 +212,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.avChoice.load(self.isPaid())
|
self.avChoice.load(self.isPaid())
|
||||||
self.avChoice.enter()
|
self.avChoice.enter()
|
||||||
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
|
self.accept(self.avChoiceDoneEvent, self.__handleAvatarChooserDone, [avList])
|
||||||
if config.GetBool('want-gib-loader', 1):
|
if ConfigVariableBool('want-gib-loader', 1).value:
|
||||||
self.loadingBlocker = ToontownLoadingBlocker.ToontownLoadingBlocker(avList)
|
self.loadingBlocker = ToontownLoadingBlocker.ToontownLoadingBlocker(avList)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from . import TTLocalizer
|
from . import TTLocalizer
|
||||||
from otp.otpbase.OTPGlobals import *
|
from otp.otpbase.OTPGlobals import *
|
||||||
from direct.showbase.PythonUtil import Enum, invertDict
|
from direct.showbase.PythonUtil import Enum, invertDict
|
||||||
from pandac.PandaModules import BitMask32, Vec4
|
from panda3d.core import BitMask32, Vec4
|
||||||
MapHotkeyOn = 'alt'
|
MapHotkeyOn = 'alt'
|
||||||
MapHotkeyOff = 'alt-up'
|
MapHotkeyOff = 'alt-up'
|
||||||
MapHotkey = 'alt'
|
MapHotkey = 'alt'
|
||||||
|
|
|
@ -71,7 +71,7 @@ if base.musicManagerIsValid:
|
||||||
else:
|
else:
|
||||||
music = None
|
music = None
|
||||||
from direct.gui.DirectGui import *
|
from direct.gui.DirectGui import *
|
||||||
serverVersion = base.config.GetString('server-version', 'no_version_set')
|
serverVersion = ConfigVariableString('server-version', 'no_version_set').value
|
||||||
print('ToontownStart: serverVersion: ', serverVersion)
|
print('ToontownStart: serverVersion: ', serverVersion)
|
||||||
version = OnscreenText(serverVersion, pos=(-1.3, -0.975), scale=0.06, fg=Vec4(0, 0, 1, 0.6), align=TextNode.ALeft)
|
version = OnscreenText(serverVersion, pos=(-1.3, -0.975), scale=0.06, fg=Vec4(0, 0, 1, 0.6), align=TextNode.ALeft)
|
||||||
loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NONE)
|
loader.beginBulkLoad('init', TTLocalizer.LoaderLabel, 138, 0, TTLocalizer.TIP_NONE)
|
||||||
|
|
Loading…
Reference in a new issue