mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
So much Jizzney removing that Hitler toke his life
This commit is contained in:
parent
578ee39c60
commit
b2bab83cbb
174 changed files with 64 additions and 4163 deletions
|
@ -67,20 +67,6 @@ dclass TimeManager : DistributedObject {
|
|||
serverTime(uint8 context, int32 timestap, uint32 timeOfDay);
|
||||
setDisconnectReason(uint8) airecv clsend;
|
||||
setExceptionInfo(string(0-1024)) airecv clsend;
|
||||
setSignature(string(0-1024) signature, char prcHash[16],
|
||||
char pycHash[16]) airecv clsend;
|
||||
setFrameRate(uint16/10 fps, uint16/1000 deviation, uint16 numAvatars,
|
||||
string(0-256) locationCode, uint32/10 timeInLocation,
|
||||
uint32/10 timeInGame, string(0-256) gameOptionsCode,
|
||||
uint16 vendorId, uint16 deviceId, uint32/10 processMemory,
|
||||
uint32/10 pageFileUsage, uint32/10 physicalMemory,
|
||||
uint32 pageFaultCount, OSInfo, CPUSpeed, uint16 cpuCores,
|
||||
uint16 logicalCPUs, string(0-256) apiName) airecv clsend;
|
||||
checkForGarbageLeaks(bool) airecv clsend;
|
||||
setNumAIGarbageLeaks(uint32);
|
||||
setClientGarbageLeak(uint32, string(0-1024)) airecv clsend;
|
||||
checkAvOnDistrict(uint32 context, DoId avatar) clsend airecv;
|
||||
checkAvOnDistrictResult(uint32 context, DoId av, bool isOnDistrict);
|
||||
};
|
||||
|
||||
dclass DistributedDirectory : DistributedObject {
|
||||
|
@ -447,7 +433,6 @@ from toontown.coghq import DistributedStageRoom/AI
|
|||
from toontown.coghq import DistributedStageBattle/AI
|
||||
from toontown.pets.PetDCImports/AI import *
|
||||
from toontown.pets import DistributedPetProxy/AI
|
||||
from toontown.coghq.InGameEditorDCImports/AI import *
|
||||
from toontown.distributed import ToontownDistrict/AI
|
||||
from toontown.distributed import ToontownDistrictStats/AI
|
||||
from toontown.racing import DistributedVehicle/AI
|
||||
|
@ -1714,10 +1699,6 @@ dclass AccountDate : DistributedObject {
|
|||
requestDateResult(string);
|
||||
};
|
||||
|
||||
dclass DistributedMyTest : DistributedObject {
|
||||
setMyTest(uint16) broadcast;
|
||||
};
|
||||
|
||||
dclass DistributedTreasure : DistributedObject {
|
||||
setTreasureType(uint16) required broadcast ram;
|
||||
setPosition(int16/10, int16/10, int16/10) required broadcast ram;
|
||||
|
@ -1732,14 +1713,6 @@ dclass DistributedCashbotBossTreasure : DistributedTreasure {
|
|||
setStyle(uint16) required broadcast ram;
|
||||
};
|
||||
|
||||
dclass DistributedLargeBlobSender : DistributedObject {
|
||||
setMode(uint8) required broadcast ram;
|
||||
setTargetAvId(uint32) required broadcast ram;
|
||||
setChunk(blob);
|
||||
setFilename(string);
|
||||
setAck() airecv clsend;
|
||||
};
|
||||
|
||||
dclass DistributedLevel : DistributedObject {
|
||||
setLevelZoneId(uint32) required broadcast ram;
|
||||
setAvIds(uint32[]) required broadcast ram;
|
||||
|
@ -1747,10 +1720,6 @@ dclass DistributedLevel : DistributedObject {
|
|||
setZoneIds(uint32[]) broadcast ram;
|
||||
setStartTimestamp(int32) broadcast ram;
|
||||
setOuch(uint8) airecv clsend;
|
||||
requestCurrentLevelSpec(string, string) airecv clsend;
|
||||
setSpecDeny(blob);
|
||||
setSpecSenderDoId(uint32);
|
||||
setAttribChange(uint32, blob, blob, blob) broadcast;
|
||||
};
|
||||
|
||||
dclass DistributedEntity : DistributedObject {
|
||||
|
@ -2364,17 +2333,6 @@ dclass DistributedStageRoom : DistributedLevel {
|
|||
setDefeated() broadcast ram;
|
||||
};
|
||||
|
||||
dclass DistributedInGameEditor : DistributedObject {
|
||||
setEditorAvId(uint32) required broadcast ram;
|
||||
setEditUsername(blob) required broadcast ram;
|
||||
setLevelDoId(uint32) required broadcast ram;
|
||||
requestCurrentLevelSpec() airecv clsend;
|
||||
setSpecSenderDoId(uint32);
|
||||
setEdit(uint32, blob, blob, blob) airecv clsend;
|
||||
setAttribChange(uint32, blob, blob, blob);
|
||||
setFinished() airecv clsend;
|
||||
};
|
||||
|
||||
dclass DistributedLift : DistributedEntity {
|
||||
setStateTransition(uint8, uint8, uint32) required broadcast ram;
|
||||
setAvatarEnter() airecv clsend;
|
||||
|
|
|
@ -6,7 +6,6 @@ import time
|
|||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.interval.IntervalManager import ivalMgr
|
||||
from direct.showbase import EventManager
|
||||
from direct.showbase import ExceptionVarDump
|
||||
from direct.showbase import PythonUtil
|
||||
from direct.showbase.BulletinBoardGlobal import *
|
||||
from direct.showbase.EventManagerGlobal import *
|
||||
|
@ -25,10 +24,6 @@ class AIBase:
|
|||
def __init__(self):
|
||||
self.config = getConfigShowbase()
|
||||
__builtins__['__dev__'] = self.config.GetBool('want-dev', 0)
|
||||
logStackDump = (self.config.GetBool('log-stack-dump', (not __dev__)) or self.config.GetBool('ai-log-stack-dump', (not __dev__)))
|
||||
uploadStackDump = self.config.GetBool('upload-stack-dump', 0)
|
||||
if logStackDump or uploadStackDump:
|
||||
ExceptionVarDump.install(logStackDump, uploadStackDump)
|
||||
if self.config.GetBool('use-vfs', 1):
|
||||
vfs = VirtualFileSystem.getGlobalPtr()
|
||||
else:
|
||||
|
@ -58,15 +53,11 @@ class AIBase:
|
|||
__builtins__['globalClock'] = globalClock
|
||||
__builtins__['vfs'] = vfs
|
||||
__builtins__['hidden'] = self.hidden
|
||||
AIBase.notify.info('__dev__ == %s' % __dev__)
|
||||
PythonUtil.recordFunctorCreationStacks()
|
||||
self.wantStats = self.config.GetBool('want-pstats', 0)
|
||||
Task.TaskManager.pStatsTasks = self.config.GetBool('pstats-tasks', 0)
|
||||
taskMgr.resumeFunc = PStatClient.resumeAfterPause
|
||||
defaultValue = 1
|
||||
if __dev__:
|
||||
defaultValue = 0
|
||||
wantFakeTextures = self.config.GetBool('want-fake-textures-ai', defaultValue)
|
||||
wantFakeTextures = self.config.GetBool('want-fake-textures-ai', 1)
|
||||
if wantFakeTextures:
|
||||
loadPrcFileData('aibase', 'textures-header-only 1')
|
||||
self.wantPets = self.config.GetBool('want-pets', 1)
|
||||
|
|
|
@ -20,7 +20,4 @@ def inspect(anObject):
|
|||
|
||||
|
||||
__builtins__['inspect'] = inspect
|
||||
if not __debug__ and __dev__:
|
||||
notify = directNotify.newCategory('ShowBaseGlobal')
|
||||
notify.error("You must set 'want-dev' to false in non-debug mode.")
|
||||
taskMgr.finalInit()
|
||||
|
|
|
@ -93,8 +93,6 @@ class AIZoneDataObj:
|
|||
if not hasattr(self, '_nonCollidableParent'):
|
||||
render = self.getRender()
|
||||
self._nonCollidableParent = render.attachNewNode('nonCollidables')
|
||||
if __dev__:
|
||||
pass
|
||||
return self._nonCollidableParent
|
||||
|
||||
def getParentMgr(self):
|
||||
|
|
|
@ -37,7 +37,6 @@ class GarbageLeakServerEventAggregator(DirectObject):
|
|||
self._sentLeakDesc2num.setdefault(desc, 0)
|
||||
num = curNum - self._sentLeakDesc2num[desc]
|
||||
if num > 0:
|
||||
base.cr.timeManager.d_setClientGarbageLeak(num, desc)
|
||||
self._sentLeakDesc2num[desc] = curNum
|
||||
|
||||
if task:
|
||||
|
|
|
@ -29,15 +29,12 @@ class TimeManager(DistributedObject.DistributedObject):
|
|||
self.extraSkew = base.config.GetInt('time-manager-extra-skew', 0)
|
||||
if self.extraSkew != 0:
|
||||
self.notify.info('Simulating clock skew of %0.3f s' % self.extraSkew)
|
||||
self.reportFrameRateInterval = base.config.GetDouble('report-frame-rate-interval', 300.0)
|
||||
self.talkResult = 0
|
||||
self.thisContext = -1
|
||||
self.nextContext = 0
|
||||
self.attemptCount = 0
|
||||
self.start = 0
|
||||
self.lastAttempt = -self.minWait * 2
|
||||
self.setFrameRateInterval(self.reportFrameRateInterval)
|
||||
self._numClientGarbage = 0
|
||||
|
||||
def generate(self):
|
||||
self._gotFirstTimeSync = False
|
||||
|
@ -47,8 +44,6 @@ class TimeManager(DistributedObject.DistributedObject):
|
|||
DistributedObject.DistributedObject.generate(self)
|
||||
self.accept(OTPGlobals.SynchronizeHotkey, self.handleHotkey)
|
||||
self.accept('clock_error', self.handleClockError)
|
||||
if __dev__ and base.config.GetBool('enable-garbage-hotkey', 0):
|
||||
self.accept(OTPGlobals.DetectGarbageHotkey, self.handleDetectGarbageHotkey)
|
||||
if self.updateFreq > 0:
|
||||
self.startTask()
|
||||
return
|
||||
|
@ -62,11 +57,8 @@ class TimeManager(DistributedObject.DistributedObject):
|
|||
|
||||
def disable(self):
|
||||
self.ignore(OTPGlobals.SynchronizeHotkey)
|
||||
if __dev__:
|
||||
self.ignore(OTPGlobals.DetectGarbageHotkey)
|
||||
self.ignore('clock_error')
|
||||
self.stopTask()
|
||||
taskMgr.remove('frameRateMonitor')
|
||||
if self.cr.timeManager == self:
|
||||
self.cr.timeManager = None
|
||||
del self._gotFirstTimeSync
|
||||
|
@ -75,10 +67,8 @@ class TimeManager(DistributedObject.DistributedObject):
|
|||
|
||||
def delete(self):
|
||||
self.ignore(OTPGlobals.SynchronizeHotkey)
|
||||
self.ignore(OTPGlobals.DetectGarbageHotkey)
|
||||
self.ignore('clock_error')
|
||||
self.stopTask()
|
||||
taskMgr.remove('frameRateMonitor')
|
||||
if self.cr.timeManager == self:
|
||||
self.cr.timeManager = None
|
||||
DistributedObject.DistributedObject.delete(self)
|
||||
|
@ -159,168 +149,4 @@ class TimeManager(DistributedObject.DistributedObject):
|
|||
info = PythonUtil.describeException()
|
||||
self.notify.info('Client exception: %s' % info)
|
||||
self.sendUpdate('setExceptionInfo', [info])
|
||||
self.cr.flush()
|
||||
|
||||
def setStackDump(self, dump):
|
||||
self.notify.debug('Stack dump: %s' % fastRepr(dump))
|
||||
maxLen = 900
|
||||
dataLeft = base64.b64encode(dump)
|
||||
index = 0
|
||||
while dataLeft:
|
||||
if len(dataLeft) >= maxLen:
|
||||
data = dataLeft[:maxLen]
|
||||
dataLeft = dataLeft[maxLen:]
|
||||
else:
|
||||
data = dataLeft
|
||||
dataLeft = None
|
||||
self.sendUpdate('setStackDump', [index, data])
|
||||
index += 1
|
||||
self.cr.flush()
|
||||
|
||||
return
|
||||
|
||||
def d_setSignature(self, signature, hash, pyc):
|
||||
self.sendUpdate('setSignature', [signature, hash, pyc])
|
||||
|
||||
def setFrameRateInterval(self, frameRateInterval):
|
||||
if frameRateInterval == 0:
|
||||
return
|
||||
if not base.frameRateMeter:
|
||||
maxFrameRateInterval = base.config.GetDouble('max-frame-rate-interval', 30.0)
|
||||
globalClock.setAverageFrameRateInterval(min(frameRateInterval, maxFrameRateInterval))
|
||||
taskMgr.remove('frameRateMonitor')
|
||||
taskMgr.doMethodLater(frameRateInterval, self.frameRateMonitor, 'frameRateMonitor')
|
||||
|
||||
def frameRateMonitor(self, task):
|
||||
from otp.avatar.Avatar import Avatar
|
||||
vendorId = 0
|
||||
deviceId = 0
|
||||
processMemory = 0
|
||||
pageFileUsage = 0
|
||||
physicalMemory = 0
|
||||
pageFaultCount = 0
|
||||
osInfo = (os.name,
|
||||
0,
|
||||
0,
|
||||
0)
|
||||
cpuSpeed = (0, 0)
|
||||
numCpuCores = 0
|
||||
numLogicalCpus = 0
|
||||
apiName = 'None'
|
||||
if getattr(base, 'pipe', None):
|
||||
di = base.pipe.getDisplayInformation()
|
||||
if di.getDisplayState() == DisplayInformation.DSSuccess:
|
||||
vendorId = di.getVendorId()
|
||||
deviceId = di.getDeviceId()
|
||||
di.updateMemoryInformation()
|
||||
oomb = 1.0 / (1024.0 * 1024.0)
|
||||
processMemory = di.getProcessMemory() * oomb
|
||||
pageFileUsage = di.getPageFileUsage() * oomb
|
||||
physicalMemory = di.getPhysicalMemory() * oomb
|
||||
pageFaultCount = di.getPageFaultCount() / 1000.0
|
||||
osInfo = (os.name,
|
||||
di.getOsPlatformId(),
|
||||
di.getOsVersionMajor(),
|
||||
di.getOsVersionMinor())
|
||||
if sys.platform == 'darwin':
|
||||
osInfo = self.getMacOsInfo(osInfo)
|
||||
di.updateCpuFrequency(0)
|
||||
ooghz = 1e-09
|
||||
cpuSpeed = (di.getMaximumCpuFrequency() * ooghz, di.getCurrentCpuFrequency() * ooghz)
|
||||
numCpuCores = di.getNumCpuCores()
|
||||
numLogicalCpus = di.getNumLogicalCpus()
|
||||
apiName = base.pipe.getInterfaceName()
|
||||
self.d_setFrameRate(max(0, globalClock.getAverageFrameRate()), max(0, globalClock.calcFrameRateDeviation()), len(Avatar.ActiveAvatars), base.locationCode or '', max(0, time.time() - base.locationCodeChanged), max(0, globalClock.getRealTime()), base.gameOptionsCode, vendorId, deviceId, processMemory, pageFileUsage, physicalMemory, pageFaultCount, osInfo, cpuSpeed, numCpuCores, numLogicalCpus, apiName)
|
||||
return task.again
|
||||
|
||||
def d_setFrameRate(self, fps, deviation, numAvs, locationCode, timeInLocation, timeInGame, gameOptionsCode, vendorId, deviceId, processMemory, pageFileUsage, physicalMemory, pageFaultCount, osInfo, cpuSpeed, numCpuCores, numLogicalCpus, apiName):
|
||||
info = '%0.1f fps|%0.3fd|%s avs|%s|%d|%d|%s|0x%04x|0x%04x|%0.1fMB|%0.1fMB|%0.1fMB|%d|%s|%s|%s cpus|%s' % (fps,
|
||||
deviation,
|
||||
numAvs,
|
||||
locationCode,
|
||||
timeInLocation,
|
||||
timeInGame,
|
||||
gameOptionsCode,
|
||||
vendorId,
|
||||
deviceId,
|
||||
processMemory,
|
||||
pageFileUsage,
|
||||
physicalMemory,
|
||||
pageFaultCount,
|
||||
'%s.%d.%d.%d' % osInfo,
|
||||
'%0.03f,%0.03f' % cpuSpeed,
|
||||
'%d,%d' % (numCpuCores, numLogicalCpus),
|
||||
apiName)
|
||||
print 'frame rate: %s' % info
|
||||
self.sendUpdate('setFrameRate', [fps,
|
||||
deviation,
|
||||
numAvs,
|
||||
locationCode,
|
||||
timeInLocation,
|
||||
timeInGame,
|
||||
gameOptionsCode,
|
||||
vendorId,
|
||||
deviceId,
|
||||
processMemory,
|
||||
pageFileUsage,
|
||||
physicalMemory,
|
||||
pageFaultCount,
|
||||
osInfo,
|
||||
cpuSpeed,
|
||||
numCpuCores,
|
||||
numLogicalCpus,
|
||||
apiName])
|
||||
|
||||
if __dev__:
|
||||
|
||||
def handleDetectGarbageHotkey(self):
|
||||
self._numClientGarbage = GarbageReport.b_checkForGarbageLeaks(wantReply=True)
|
||||
if self._numClientGarbage:
|
||||
s = '%s client garbage cycles found, see log' % self._numClientGarbage
|
||||
else:
|
||||
s = '0 client garbage cycles found'
|
||||
localAvatar.setChatAbsolute(s, CFSpeech | CFTimeout)
|
||||
|
||||
def d_checkForGarbageLeaks(self, wantReply):
|
||||
self.sendUpdate('checkForGarbageLeaks', [wantReply])
|
||||
|
||||
def setNumAIGarbageLeaks(self, numLeaks):
|
||||
if self._numClientGarbage and numLeaks:
|
||||
s = '%s client and %s AI garbage cycles found, see logs' % (self._numClientGarbage, numLeaks)
|
||||
elif numLeaks:
|
||||
s = '0 client and %s AI garbage cycles found, see log' % numLeaks
|
||||
else:
|
||||
s = '0 client and 0 AI garbage cycles found'
|
||||
localAvatar.setChatAbsolute(s, CFSpeech | CFTimeout)
|
||||
|
||||
def d_setClientGarbageLeak(self, num, description):
|
||||
self.sendUpdate('setClientGarbageLeak', [num, description])
|
||||
|
||||
def getMacOsInfo(self, defaultOsInfo):
|
||||
result = defaultOsInfo
|
||||
try:
|
||||
theFile = open('/System/Library/CoreServices/SystemVersion.plist')
|
||||
except IOError:
|
||||
pass
|
||||
else:
|
||||
key = re.search('<key>ProductUserVisibleVersion</key>\\s*' + '<string>(.*?)</string>', theFile.read())
|
||||
theFile.close()
|
||||
if key is not None:
|
||||
try:
|
||||
verString = key.group(1)
|
||||
parts = verString.split('.')
|
||||
major = int(parts[0])
|
||||
minor = int(parts[1])
|
||||
bugfix = int(parts[2])
|
||||
result = (sys.platform,
|
||||
bugfix,
|
||||
major,
|
||||
minor)
|
||||
except Exception, e:
|
||||
self.notify.debug('getMacOsInfo %s' % str(e))
|
||||
|
||||
self.notify.debug('getMacOsInfo returning %s' % str(result))
|
||||
return result
|
||||
|
||||
def checkAvOnDistrict(self, av, context):
|
||||
self.sendUpdate('checkAvOnDistrict', [context, av.doId])
|
||||
self.cr.flush()
|
|
@ -18,22 +18,4 @@ class TimeManagerAI(DistributedObjectAI):
|
|||
|
||||
def setExceptionInfo(self, exception):
|
||||
avId = self.air.getAvatarIdFromSender()
|
||||
self.air.writeServerEvent('client-exception', avId, exception)
|
||||
|
||||
def setSignature(self, todo0, todo1, todo2):
|
||||
pass
|
||||
|
||||
def setFrameRate(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6, todo7, todo8, todo9, todo10, todo11, todo12, todo13, todo14, todo15, todo16, todo17):
|
||||
pass
|
||||
|
||||
def checkForGarbageLeaks(self, todo0):
|
||||
pass
|
||||
|
||||
def setNumAIGarbageLeaks(self, todo0):
|
||||
pass
|
||||
|
||||
def setClientGarbageLeak(self, todo0, todo1):
|
||||
pass
|
||||
|
||||
def checkAvOnDistrict(self, todo0, todo1):
|
||||
pass
|
||||
self.air.writeServerEvent('client-exception', avId, exception)
|
|
@ -1,24 +1,15 @@
|
|||
|
||||
|
||||
class AvatarHandle:
|
||||
dclassName = 'AvatarHandle'
|
||||
|
||||
def getName(self):
|
||||
if __dev__:
|
||||
pass
|
||||
return ''
|
||||
|
||||
def isOnline(self):
|
||||
if __dev__:
|
||||
pass
|
||||
return False
|
||||
|
||||
def isUnderstandable(self):
|
||||
if __dev__:
|
||||
pass
|
||||
return True
|
||||
|
||||
def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags):
|
||||
newText, scrubbed = localAvatar.scrubTalk(chat, mods)
|
||||
base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed)
|
||||
return
|
||||
base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed)
|
|
@ -21,12 +21,6 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
|
|||
self.DISLid = 0
|
||||
self.adminAccess = 0
|
||||
|
||||
if __dev__:
|
||||
|
||||
def generate(self):
|
||||
self._sentExitServerEvent = False
|
||||
DistributedAvatarAI.DistributedAvatarAI.generate(self)
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedAvatarAI.DistributedAvatarAI.announceGenerate(self)
|
||||
ClsendTracker.announceGenerate(self)
|
||||
|
@ -40,16 +34,10 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
|
|||
|
||||
def _sendExitServerEvent(self):
|
||||
self.air.writeServerEvent('avatarExit', self.doId, '')
|
||||
if __dev__:
|
||||
self._sentExitServerEvent = True
|
||||
|
||||
def delete(self):
|
||||
if __dev__:
|
||||
del self._sentExitServerEvent
|
||||
self._doPlayerExit()
|
||||
ClsendTracker.destroy(self)
|
||||
if __dev__:
|
||||
GarbageReport.checkForGarbageLeaks()
|
||||
DistributedAvatarAI.DistributedAvatarAI.delete(self)
|
||||
|
||||
def isPlayerControlled(self):
|
||||
|
|
|
@ -15,10 +15,7 @@ class ChatInputNormal(DirectObject.DirectObject):
|
|||
self.whisperPos = Vec3(0.0, 0, 0.71)
|
||||
self.whisperAvatarName = None
|
||||
self.whisperAvatarId = None
|
||||
wantHistory = 0
|
||||
if __dev__:
|
||||
wantHistory = 1
|
||||
self.wantHistory = base.config.GetBool('want-chat-history', wantHistory)
|
||||
self.wantHistory = base.config.GetBool('want-chat-history', 0)
|
||||
self.history = ['']
|
||||
self.historySize = base.config.GetInt('chat-history-size', 10)
|
||||
self.historyIndex = 0
|
||||
|
|
|
@ -13,10 +13,7 @@ class ChatInputTyped(DirectObject.DirectObject):
|
|||
self.whisperName = None
|
||||
self.whisperId = None
|
||||
self.mainEntry = mainEntry
|
||||
wantHistory = 0
|
||||
if __dev__:
|
||||
wantHistory = 1
|
||||
self.wantHistory = base.config.GetBool('want-chat-history', wantHistory)
|
||||
self.wantHistory = base.config.GetBool('want-chat-history', 0)
|
||||
self.history = ['']
|
||||
self.historySize = base.config.GetInt('chat-history-size', 10)
|
||||
self.historyIndex = 0
|
||||
|
|
|
@ -45,10 +45,7 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame):
|
|||
self.chatEntry = DirectEntry(**entryOptions)
|
||||
self.whisperId = None
|
||||
self.chatEntry.bind(DGG.OVERFLOW, self.chatOverflow)
|
||||
wantHistory = 0
|
||||
if __dev__:
|
||||
wantHistory = 1
|
||||
self.wantHistory = base.config.GetBool('want-chat-history', wantHistory)
|
||||
self.wantHistory = base.config.GetBool('want-chat-history', 0)
|
||||
self.history = ['']
|
||||
self.historySize = base.config.GetInt('chat-history-size', 10)
|
||||
self.historyIndex = 0
|
||||
|
|
|
@ -12,7 +12,7 @@ class ClsendTracker:
|
|||
if self.isPlayerControlled():
|
||||
if simbase.air.getTrackClsends():
|
||||
if ClsendTracker.NumTrackersLoggingOverflow < ClsendTracker.MaxTrackersLoggingOverflow:
|
||||
self._logClsendOverflow = random.random() < 1.0 / config.GetFloat('clsend-log-one-av-in-every', choice(__dev__, 4, 50))
|
||||
self._logClsendOverflow = random.random() < 1.0 / config.GetFloat('clsend-log-one-av-in-every', choice(0, 4, 50))
|
||||
if self._logClsendOverflow:
|
||||
ClsendTracker.NumTrackersLoggingOverflow += 1
|
||||
self._clsendMsgs = []
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from pandac.PandaModules import *
|
||||
|
||||
|
||||
hashVal = 3070829445L
|
||||
hashVal = 204403139
|
||||
|
||||
|
||||
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot
|
||||
|
@ -30,7 +30,6 @@ from toontown.catalog import CatalogManager, AccountDate
|
|||
from toontown.rpc.AwardManager import AwardManager
|
||||
from toontown.parties import DistributedParty, DistributedPartyActivity, DistributedPartyTeamActivity, DistributedPartyCannon, DistributedPartyCannonActivity, DistributedPartyCatchActivity, DistributedPartyWinterCatchActivity, DistributedPartyCogActivity, DistributedPartyWinterCogActivity, DistributedPartyFireworksActivity, DistributedPartyDanceActivityBase, DistributedPartyDanceActivity, DistributedPartyDance20Activity, DistributedPartyValentineDanceActivity, DistributedPartyValentineDance20Activity, DistributedPartyTrampolineActivity, DistributedPartyValentineTrampolineActivity, DistributedPartyVictoryTrampolineActivity, DistributedPartyWinterTrampolineActivity, DistributedPartyTugOfWarActivity, DistributedPartyJukeboxActivityBase, DistributedPartyJukeboxActivity, DistributedPartyJukebox40Activity, DistributedPartyValentineJukeboxActivity, DistributedPartyValentineJukebox40Activity
|
||||
from toontown.friends.TrueFriendsMgr import TrueFriendsMgr
|
||||
from toontown.coghq.InGameEditorDCImports import *
|
||||
from toontown.friends import TTUFriendsManager
|
||||
from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog
|
||||
from otp.distributed import Account, DistributedDistrict, DistributedDirectory
|
||||
|
|
|
@ -637,10 +637,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
def doneWait(task, self = self):
|
||||
self.loginFSM.request('waitForShardList')
|
||||
|
||||
if __dev__:
|
||||
delay = 0.0
|
||||
else:
|
||||
delay = 6.5 + random.random() * 2.0
|
||||
delay = 6.5 + random.random() * 2.0
|
||||
taskMgr.doMethodLater(delay, doneWait, self.noShardsWaitTaskName)
|
||||
|
||||
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
|
||||
|
@ -832,7 +829,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
|
||||
@report(types=['args'], dConfigParam='teleport')
|
||||
def detectLeaks(self, okTasks = None, okEvents = None):
|
||||
if not __dev__ or configIsToday('allow-unclean-exit'):
|
||||
if not True:
|
||||
return
|
||||
leakedTasks = self.detectLeakedTasks(okTasks)
|
||||
leakedEvents = self.detectLeakedEvents(okEvents)
|
||||
|
@ -1085,10 +1082,6 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
self.gotTimeSync()
|
||||
else:
|
||||
DistributedSmoothNode.globalActivateSmoothing(1, 0)
|
||||
h = HashVal()
|
||||
hashPrcVariables(h)
|
||||
pyc = HashVal()
|
||||
self.timeManager.d_setSignature(self.userSignature, h.asBin(), pyc.asBin())
|
||||
if self.timeManager.synchronize('startup'):
|
||||
self.accept('gotTimeSync', self.gotTimeSync)
|
||||
self.waitForDatabaseTimeout(requestName='uberZoneInterest-timeSync')
|
||||
|
@ -1353,7 +1346,7 @@ class OTPClientRepository(ClientRepositoryBase):
|
|||
OTPClientRepository.notify.debug('waiting for database timeout %s at %s' % (requestName, globalClock.getFrameTime()))
|
||||
self.cleanupWaitingForDatabase()
|
||||
globalClock.tick()
|
||||
taskMgr.doMethodLater((OTPGlobals.DatabaseDialogTimeout + extraTimeout) * choice(__dev__, 10, 1), self.__showWaitingForDatabase, 'waitingForDatabase', extraArgs=[requestName])
|
||||
taskMgr.doMethodLater((OTPGlobals.DatabaseDialogTimeout + extraTimeout) * choice(0, 10, 1), self.__showWaitingForDatabase, 'waitingForDatabase', extraArgs=[requestName])
|
||||
|
||||
def cleanupWaitingForDatabase(self):
|
||||
if self.waitingForDatabase:
|
||||
|
|
|
@ -30,10 +30,4 @@ class AmbientSound(BasicEntities.NodePathEntity):
|
|||
self.soundIval.pause()
|
||||
del self.soundIval
|
||||
if hasattr(self, 'sound'):
|
||||
del self.sound
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, *args):
|
||||
self.destroySound()
|
||||
self.initSound()
|
||||
del self.sound
|
|
@ -9,16 +9,13 @@ class NodePathEntityBase:
|
|||
if doReparent:
|
||||
self.callSetters('parentEntId')
|
||||
self.getNodePath().setName('%s-%s' % (self.__class__.__name__, self.entId))
|
||||
if __dev__:
|
||||
self.getNodePath().setTag('entity', '1')
|
||||
|
||||
def setParentEntId(self, parentEntId):
|
||||
self.parentEntId = parentEntId
|
||||
self.level.requestReparent(self, self.parentEntId)
|
||||
|
||||
def destroy(self):
|
||||
if __dev__:
|
||||
self.getNodePath().clearTag('entity')
|
||||
pass
|
||||
|
||||
|
||||
class NodePathAttribs(NodePathEntityBase):
|
||||
|
|
|
@ -26,20 +26,9 @@ class CollisionSolidEntity(BasicEntities.NodePathEntity):
|
|||
node.addSolid(solid)
|
||||
node.setCollideMask(OTPGlobals.WallBitmask)
|
||||
self.collNodePath = self.attachNewNode(node)
|
||||
if __dev__:
|
||||
if self.showSolid:
|
||||
self.showCS()
|
||||
else:
|
||||
self.hideCS()
|
||||
|
||||
def destroySolid(self):
|
||||
if self.collNodePath is not None:
|
||||
self.collNodePath.removeNode()
|
||||
self.collNodePath = None
|
||||
return
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, attrib, value):
|
||||
print 'attribChanged'
|
||||
self.initSolid()
|
||||
return
|
|
@ -34,12 +34,4 @@ class DistributedEntityAI(DistributedObjectAI.DistributedObjectAI, Entity.Entity
|
|||
return self.levelDoId
|
||||
|
||||
def getEntId(self):
|
||||
return self.entId
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setParentEntId(self, parentEntId):
|
||||
self.parentEntId = parentEntId
|
||||
newZoneId = self.getZoneEntity().getZoneId()
|
||||
if newZoneId != self.zoneId:
|
||||
self.sendSetZone(newZoneId)
|
||||
return self.entId
|
|
@ -17,7 +17,6 @@ import random
|
|||
|
||||
class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLevel')
|
||||
WantVisibility = config.GetBool('level-visibility', 1)
|
||||
ColorZonesAllDOs = 0
|
||||
FloorCollPrefix = 'zoneFloor'
|
||||
OuchTaskName = 'ouchTask'
|
||||
|
@ -78,47 +77,12 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
|||
pass
|
||||
|
||||
def initializeLevel(self, levelSpec):
|
||||
if __dev__:
|
||||
self.candidateSpec = levelSpec
|
||||
self.sendUpdate('requestCurrentLevelSpec', [levelSpec.stringHash(), levelSpec.entTypeReg.getHashStr()])
|
||||
else:
|
||||
self.privGotSpec(levelSpec)
|
||||
|
||||
if __dev__:
|
||||
|
||||
def reportModelSpecSyncError(self, msg):
|
||||
DistributedLevel.notify.error('%s\n\nyour spec does not match the level model\nuse SpecUtil.updateSpec, then restart your AI and client' % msg)
|
||||
|
||||
def setSpecDeny(self, reason):
|
||||
DistributedLevel.notify.error(reason)
|
||||
|
||||
def setSpecSenderDoId(self, doId):
|
||||
DistributedLevel.notify.debug('setSpecSenderDoId: %s' % doId)
|
||||
blobSender = base.cr.doId2do[doId]
|
||||
|
||||
def setSpecBlob(specBlob, blobSender = blobSender, self = self):
|
||||
blobSender.sendAck()
|
||||
from LevelSpec import LevelSpec
|
||||
spec = eval(specBlob)
|
||||
if spec is None:
|
||||
spec = self.candidateSpec
|
||||
del self.candidateSpec
|
||||
self.privGotSpec(spec)
|
||||
return
|
||||
|
||||
if blobSender.isComplete():
|
||||
setSpecBlob(blobSender.getBlob())
|
||||
else:
|
||||
evtName = self.uniqueName('specDone')
|
||||
blobSender.setDoneEvent(evtName)
|
||||
self.acceptOnce(evtName, setSpecBlob)
|
||||
self.privGotSpec(levelSpec)
|
||||
|
||||
def privGotSpec(self, levelSpec):
|
||||
Level.Level.initializeLevel(self, self.doId, levelSpec, self.scenarioIndex)
|
||||
modelZoneNums = self.zoneNums
|
||||
specZoneNums = self.zoneNum2zoneId.keys()
|
||||
if not sameElements(modelZoneNums, specZoneNums):
|
||||
self.reportModelSpecSyncError('model zone nums (%s) do not match spec zone nums (%s)' % (modelZoneNums, specZoneNums))
|
||||
self.initVisibility()
|
||||
self.placeLocalToon()
|
||||
|
||||
|
@ -329,13 +293,7 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
|||
self.camEnterZone(zoneNum)
|
||||
|
||||
self.accept('on-floor', handleCameraRayFloorCollision)
|
||||
if not DistributedLevel.WantVisibility:
|
||||
zoneNums = list(self.zoneNums)
|
||||
zoneNums.remove(LevelConstants.UberZoneEntId)
|
||||
self.forceSetZoneThisFrame()
|
||||
self.setVisibility(zoneNums)
|
||||
taskMgr.add(self.visChangeTask, self.uniqueName(DistributedLevel.VisChangeTaskName), priority=49)
|
||||
return
|
||||
|
||||
def shutdownVisibility(self):
|
||||
taskMgr.remove(self.uniqueName(DistributedLevel.VisChangeTaskName))
|
||||
|
@ -373,8 +331,6 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
|||
|
||||
def enterZone(self, zoneNum):
|
||||
DistributedLevel.notify.debug('entering zone %s' % zoneNum)
|
||||
if not DistributedLevel.WantVisibility:
|
||||
return
|
||||
if zoneNum == self.curZoneNum:
|
||||
return
|
||||
if zoneNum not in self.zoneNumDict:
|
||||
|
@ -468,12 +424,6 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level):
|
|||
self.visChangedThisFrame = 0
|
||||
return Task.cont
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setAttribChange(self, entId, attribName, valueStr, username):
|
||||
value = eval(valueStr)
|
||||
self.levelSpec.setAttribChange(entId, attribName, value, username)
|
||||
|
||||
def spawnTitleText(self):
|
||||
|
||||
def getDescription(zoneNum, self = self):
|
||||
|
|
|
@ -20,8 +20,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
|||
self.numPlayers = len(self.avIdList)
|
||||
self.presentAvIds = list(self.avIdList)
|
||||
self.notify.debug('expecting avatars: %s' % str(self.avIdList))
|
||||
if __dev__:
|
||||
self.modified = 0
|
||||
|
||||
def setLevelSpec(self, levelSpec):
|
||||
self.levelSpec = levelSpec
|
||||
|
@ -34,9 +32,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
|||
self.initializeLevel(levelSpec)
|
||||
self.sendUpdate('setZoneIds', [self.zoneIds])
|
||||
self.sendUpdate('setStartTimestamp', [self.startTimestamp])
|
||||
if __dev__:
|
||||
pass
|
||||
return
|
||||
|
||||
def getLevelZoneId(self):
|
||||
return self.zoneId
|
||||
|
@ -52,8 +47,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
|||
|
||||
def delete(self, deAllocZone = True):
|
||||
self.notify.debug('delete')
|
||||
if __dev__:
|
||||
self.removeAutosaveTask()
|
||||
self.destroyLevel()
|
||||
self.ignoreAll()
|
||||
if deAllocZone:
|
||||
|
@ -66,8 +59,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
|||
lol = zip([1] * levelSpec.getNumScenarios(), range(levelSpec.getNumScenarios()))
|
||||
scenarioIndex = weightedChoice(lol)
|
||||
Level.Level.initializeLevel(self, self.doId, levelSpec, scenarioIndex)
|
||||
if __dev__:
|
||||
self.accept(self.editMgrEntity.getSpecSaveEvent(), self.saveSpec)
|
||||
for avId in self.avIdList:
|
||||
self.acceptOnce(self.air.getAvatarExitEvent(avId), Functor(self.handleAvatarDisconnect, avId))
|
||||
|
||||
|
@ -104,75 +95,4 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level):
|
|||
av.takeDamage(penalty)
|
||||
if av.getHp() <= 0:
|
||||
av.inventory.zeroInv()
|
||||
av.d_setInventory(av.inventory.makeNetString())
|
||||
|
||||
def requestCurrentLevelSpec(self, specHash, entTypeRegHash):
|
||||
senderId = self.air.getAvatarIdFromSender()
|
||||
self.notify.info('av %s: specHash %s, entTypeRegHash %s' % (senderId, specHash, entTypeRegHash))
|
||||
if not __dev__:
|
||||
self.notify.info('client is in dev mode and we are not')
|
||||
self.sendUpdateToAvatarId(senderId, 'setSpecDeny', ['AI server is not running in dev mode. Set want-dev to false on your client or true on the AI.'])
|
||||
return
|
||||
srvHash = self.levelSpec.entTypeReg.getHashStr()
|
||||
self.notify.info('srv entTypeRegHash %s' % srvHash)
|
||||
if srvHash != entTypeRegHash:
|
||||
self.sendUpdateToAvatarId(senderId, 'setSpecDeny', ['EntityTypeRegistry hashes do not match! (server:%s, client:%s' % (srvHash, entTypeRegHash)])
|
||||
return
|
||||
if hash(self.levelSpec) != specHash:
|
||||
self.notify.info('spec hashes do not match, sending our spec')
|
||||
spec = self.levelSpec
|
||||
useDisk = simbase.config.GetBool('spec-by-disk', 1)
|
||||
else:
|
||||
self.notify.info('spec hashes match, sending null spec')
|
||||
spec = None
|
||||
useDisk = 0
|
||||
specStr = repr(spec)
|
||||
from direct.directutil import DistributedLargeBlobSenderAI
|
||||
largeBlob = DistributedLargeBlobSenderAI.DistributedLargeBlobSenderAI(self.air, self.zoneId, senderId, specStr, useDisk=useDisk)
|
||||
self.sendUpdateToAvatarId(senderId, 'setSpecSenderDoId', [largeBlob.doId])
|
||||
return
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setAttribChange(self, entId, attribName, value, username = 'SYSTEM'):
|
||||
DistributedLevelAI.notify.info('setAttribChange(%s): %s, %s = %s' % (username,
|
||||
entId,
|
||||
attribName,
|
||||
repr(value)))
|
||||
self.sendUpdate('setAttribChange', [entId,
|
||||
attribName,
|
||||
repr(value),
|
||||
username])
|
||||
self.levelSpec.setAttribChange(entId, attribName, value, username)
|
||||
self.modified = 1
|
||||
self.scheduleAutosave()
|
||||
|
||||
AutosavePeriod = simbase.config.GetFloat('level-autosave-period-minutes', 5)
|
||||
|
||||
def scheduleAutosave(self):
|
||||
if hasattr(self, 'autosaveTask'):
|
||||
return
|
||||
self.autosaveTaskName = self.uniqueName('autosaveSpec')
|
||||
self.autosaveTask = taskMgr.doMethodLater(DistributedLevelAI.AutosavePeriod * 60, self.autosaveSpec, self.autosaveTaskName)
|
||||
|
||||
def removeAutosaveTask(self):
|
||||
if hasattr(self, 'autosaveTask'):
|
||||
taskMgr.remove(self.autosaveTaskName)
|
||||
del self.autosaveTask
|
||||
|
||||
def autosaveSpec(self, task = None):
|
||||
self.removeAutosaveTask()
|
||||
if self.modified:
|
||||
DistributedLevelAI.notify.info('autosaving spec')
|
||||
filename = self.levelSpec.getFilename()
|
||||
filename = '%s.autosave' % filename
|
||||
self.levelSpec.saveToDisk(filename, makeBackup=0)
|
||||
|
||||
def saveSpec(self, task = None):
|
||||
DistributedLevelAI.notify.info('saving spec')
|
||||
self.removeAutosaveTask()
|
||||
if not self.modified:
|
||||
DistributedLevelAI.notify.info('no changes to save')
|
||||
return
|
||||
self.levelSpec.saveToDisk()
|
||||
self.modified = 0
|
||||
av.d_setInventory(av.inventory.makeNetString())
|
|
@ -1,4 +0,0 @@
|
|||
import EditMgrBase
|
||||
|
||||
class EditMgr(EditMgrBase.EditMgrBase):
|
||||
pass
|
|
@ -1,41 +0,0 @@
|
|||
import EditMgrBase
|
||||
if __dev__:
|
||||
from direct.showbase.PythonUtil import list2dict
|
||||
import EditorGlobals
|
||||
|
||||
class EditMgrAI(EditMgrBase.EditMgrBase):
|
||||
if __dev__:
|
||||
|
||||
def setRequestNewEntity(self, data):
|
||||
spec = self.level.levelSpec
|
||||
entIds = spec.getAllEntIds()
|
||||
entIdDict = list2dict(entIds)
|
||||
allocRange = EditorGlobals.getEntIdAllocRange()
|
||||
if not hasattr(self, 'lastAllocatedEntId'):
|
||||
self.lastAllocatedEntId = allocRange[0]
|
||||
idChosen = 0
|
||||
while not idChosen:
|
||||
for id in xrange(self.lastAllocatedEntId, allocRange[1]):
|
||||
print id
|
||||
if id not in entIdDict:
|
||||
idChosen = 1
|
||||
break
|
||||
else:
|
||||
if self.lastAllocatedEntId != allocRange[0]:
|
||||
self.lastAllocatedEntId = allocRange[0]
|
||||
else:
|
||||
self.notify.error('out of entIds')
|
||||
|
||||
data.update({'entId': id})
|
||||
self.lastAllocatedEntId = id
|
||||
self.level.setAttribChange(self.entId, 'insertEntity', data)
|
||||
self.level.levelSpec.doSetAttrib(self.entId, 'requestNewEntity', None)
|
||||
return
|
||||
|
||||
def getSpecSaveEvent(self):
|
||||
return 'requestSave-%s' % self.level.levelId
|
||||
|
||||
def setRequestSave(self, data):
|
||||
messenger.send(self.getSpecSaveEvent())
|
||||
self.level.levelSpec.doSetAttrib(self.entId, 'requestSave', None)
|
||||
return
|
|
@ -1,25 +0,0 @@
|
|||
import Entity
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
||||
class EditMgrBase(Entity.Entity):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('EditMgr')
|
||||
|
||||
def __init__(self, level, entId):
|
||||
Entity.Entity.__init__(self, level, entId)
|
||||
|
||||
def destroy(self):
|
||||
Entity.Entity.destroy(self)
|
||||
self.ignoreAll()
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setInsertEntity(self, data):
|
||||
self.level.setEntityCreatorUsername(data['entId'], data['username'])
|
||||
self.level.levelSpec.insertEntity(data['entId'], data['entType'], data['parentEntId'])
|
||||
self.level.levelSpec.doSetAttrib(self.entId, 'insertEntity', None)
|
||||
return
|
||||
|
||||
def setRemoveEntity(self, data):
|
||||
self.level.levelSpec.removeEntity(data['entId'])
|
||||
self.level.levelSpec.doSetAttrib(self.entId, 'removeEntity', None)
|
||||
return
|
|
@ -1,40 +0,0 @@
|
|||
from direct.showbase.PythonUtil import uniqueElements
|
||||
EditTargetPostName = 'inGameEditTarget'
|
||||
EntIdRange = 10000
|
||||
username2entIdBase = {'darren': 1 * EntIdRange,
|
||||
'samir': 2 * EntIdRange,
|
||||
'skyler': 3 * EntIdRange,
|
||||
'joe': 4 * EntIdRange,
|
||||
'DrEvil': 5 * EntIdRange,
|
||||
'asad': 6 * EntIdRange,
|
||||
'drose': 7 * EntIdRange,
|
||||
'pappy': 8 * EntIdRange,
|
||||
'patricia': 9 * EntIdRange,
|
||||
'jloehrle': 10 * EntIdRange,
|
||||
'rurbino': 11 * EntIdRange}
|
||||
usernameConfigVar = 'level-edit-username'
|
||||
undefinedUsername = 'UNDEFINED_USERNAME'
|
||||
editUsername = config.GetString(usernameConfigVar, undefinedUsername)
|
||||
|
||||
def checkNotReadyToEdit():
|
||||
if editUsername == undefinedUsername:
|
||||
return "you must config '%s'; see %s.py" % (usernameConfigVar, __name__)
|
||||
if editUsername not in username2entIdBase:
|
||||
return "unknown editor username '%s'; see %s.py" % (editUsername, __name__)
|
||||
return None
|
||||
|
||||
|
||||
def assertReadyToEdit():
|
||||
msg = checkNotReadyToEdit()
|
||||
if msg is not None:
|
||||
pass
|
||||
return
|
||||
|
||||
|
||||
def getEditUsername():
|
||||
return editUsername
|
||||
|
||||
|
||||
def getEntIdAllocRange():
|
||||
baseId = username2entIdBase[editUsername]
|
||||
return [baseId, baseId + EntIdRange]
|
|
@ -84,18 +84,4 @@ class Entity(DirectObject):
|
|||
return
|
||||
|
||||
def setAttribInit(self, attrib, value):
|
||||
self.__dict__[attrib] = value
|
||||
|
||||
if __dev__:
|
||||
|
||||
def handleAttribChange(self, attrib, value):
|
||||
setter = self.privGetSetter(attrib)
|
||||
if setter is not None:
|
||||
setter(value)
|
||||
else:
|
||||
self.__dict__[attrib] = value
|
||||
self.attribChanged(attrib, value)
|
||||
return
|
||||
|
||||
def attribChanged(self, attrib, value):
|
||||
pass
|
||||
self.__dict__[attrib] = value
|
|
@ -2,7 +2,6 @@ import CutScene
|
|||
import EntityCreatorBase
|
||||
import BasicEntities
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
import EditMgr
|
||||
import EntrancePoint
|
||||
import LevelMgr
|
||||
import LogicGate
|
||||
|
@ -32,7 +31,6 @@ class EntityCreator(EntityCreatorBase.EntityCreatorBase):
|
|||
'ambientSound': AmbientSound.AmbientSound,
|
||||
'collisionSolid': CollisionSolidEntity.CollisionSolidEntity,
|
||||
'cutScene': CutScene.CutScene,
|
||||
'editMgr': EditMgr.EditMgr,
|
||||
'entityGroup': nothing,
|
||||
'entrancePoint': EntrancePoint.EntrancePoint,
|
||||
'levelMgr': LevelMgr.LevelMgr,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import EntityCreatorBase
|
||||
import LogicGate
|
||||
import EditMgrAI
|
||||
import LevelMgrAI
|
||||
import ZoneEntityAI
|
||||
from direct.showbase.PythonUtil import Functor
|
||||
|
@ -29,7 +28,6 @@ class EntityCreatorAI(EntityCreatorBase.EntityCreatorBase):
|
|||
'ambientSound': nothing,
|
||||
'collisionSolid': nothing,
|
||||
'cutScene': nothing,
|
||||
'editMgr': Functor(cLE, EditMgrAI.EditMgrAI),
|
||||
'entityGroup': nothing,
|
||||
'entrancePoint': nothing,
|
||||
'levelMgr': Functor(cLE, LevelMgrAI.LevelMgrAI),
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
from pandac.PandaModules import *
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
import types
|
||||
import AttribDesc
|
||||
import EntityTypeDesc
|
||||
from direct.showbase.PythonUtil import mostDerivedLast
|
||||
import os
|
||||
import string
|
||||
|
||||
class EntityTypeRegistry:
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('EntityTypeRegistry')
|
||||
|
||||
def __init__(self, entityTypeModule):
|
||||
self.entTypeModule = entityTypeModule
|
||||
hv = HashVal()
|
||||
import EntityTypes
|
||||
reload(EntityTypes)
|
||||
reload(self.entTypeModule)
|
||||
|
||||
def getPyExtVersion(filename):
|
||||
base, ext = os.path.splitext(filename)
|
||||
if ext == '.pyc' or ext == '.pyo':
|
||||
filename = base + '.py'
|
||||
return filename
|
||||
|
||||
fileLines = file(getPyExtVersion(EntityTypes.__file__)).readlines()
|
||||
hv.hashString(string.join(fileLines, ''))
|
||||
s = str(hv.asHex())
|
||||
s += '.'
|
||||
fileLines = file(getPyExtVersion(self.entTypeModule.__file__)).readlines()
|
||||
hv.hashString(string.join(fileLines, ''))
|
||||
s += str(hv.asHex())
|
||||
self.hashStr = s
|
||||
getPyExtVersion = None
|
||||
classes = []
|
||||
for key, value in entityTypeModule.__dict__.items():
|
||||
if type(value) is types.ClassType:
|
||||
if issubclass(value, EntityTypeDesc.EntityTypeDesc):
|
||||
classes.append(value)
|
||||
|
||||
self.entTypeName2typeDesc = {}
|
||||
mostDerivedLast(classes)
|
||||
for c in classes:
|
||||
if 'type' in c.__dict__:
|
||||
if c.type in self.entTypeName2typeDesc:
|
||||
EntityTypeRegistry.notify.debug("replacing %s with %s for entity type '%s'" % (self.entTypeName2typeDesc[c.type].__class__, c, c.type))
|
||||
self.entTypeName2typeDesc[c.type] = c()
|
||||
|
||||
self.output2typeNames = {}
|
||||
for typename, typeDesc in self.entTypeName2typeDesc.items():
|
||||
if typeDesc.isConcrete():
|
||||
if hasattr(typeDesc, 'output'):
|
||||
outputType = typeDesc.output
|
||||
self.output2typeNames.setdefault(outputType, [])
|
||||
self.output2typeNames[outputType].append(typename)
|
||||
|
||||
self.permanentTypeNames = []
|
||||
for typename, typeDesc in self.entTypeName2typeDesc.items():
|
||||
if typeDesc.isPermanent():
|
||||
self.permanentTypeNames.append(typename)
|
||||
|
||||
self.typeName2derivedTypeNames = {}
|
||||
for typename, typeDesc in self.entTypeName2typeDesc.items():
|
||||
typenames = []
|
||||
for tn, td in self.entTypeName2typeDesc.items():
|
||||
if td.isConcrete():
|
||||
if issubclass(td.__class__, typeDesc.__class__):
|
||||
typenames.append(tn)
|
||||
|
||||
self.typeName2derivedTypeNames[typename] = typenames
|
||||
|
||||
return
|
||||
|
||||
def getAllTypeNames(self):
|
||||
return self.entTypeName2typeDesc.keys()
|
||||
|
||||
def getTypeDesc(self, entTypeName):
|
||||
return self.entTypeName2typeDesc[entTypeName]
|
||||
|
||||
def getTypeNamesFromOutputType(self, outputType):
|
||||
return self.output2typeNames.get(outputType, [])
|
||||
|
||||
def getDerivedTypeNames(self, entTypeName):
|
||||
return self.typeName2derivedTypeNames[entTypeName]
|
||||
|
||||
def isDerivedAndBase(self, entType, baseEntType):
|
||||
return entType in self.getDerivedTypeNames(baseEntType)
|
||||
|
||||
def getPermanentTypeNames(self):
|
||||
return self.permanentTypeNames
|
||||
|
||||
def getHashStr(self):
|
||||
return self.hashStr
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __repr__(self):
|
||||
return str(self.entTypeName2typeDesc)
|
|
@ -16,18 +16,6 @@ class LevelMgr(Entity):
|
|||
attribs = (('name', 'LevelMgr', 'const'), ('parentEntId', 0, 'const'), ('modelFilename', '', 'const'))
|
||||
|
||||
|
||||
class EditMgr(Entity):
|
||||
type = 'editMgr'
|
||||
permanent = 1
|
||||
blockAttribs = ('comment',)
|
||||
attribs = (('name', 'LevelMgr', 'const'),
|
||||
('parentEntId', 0, 'const'),
|
||||
('requestSave', None, 'const'),
|
||||
('requestNewEntity', None, 'const'),
|
||||
('insertEntity', None, 'const'),
|
||||
('removeEntity', None, 'const'))
|
||||
|
||||
|
||||
class AttribModifier(Entity):
|
||||
type = 'attribModifier'
|
||||
attribs = (('recursive', 0, 'bool'),
|
||||
|
|
|
@ -30,11 +30,4 @@ class EntrancePoint(BasicEntities.NodePathEntity):
|
|||
def destroyEntrancePoint(self):
|
||||
if self.entranceId >= 0:
|
||||
if self.entranceId in self.level.entranceId2entity:
|
||||
del self.level.entranceId2entity[self.entranceId]
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, *args):
|
||||
BasicEntities.NodePathEntity.attribChanged(self, *args)
|
||||
self.destroyEntrancePoint()
|
||||
self.initEntrancePoint()
|
||||
del self.level.entranceId2entity[self.entranceId]
|
|
@ -17,8 +17,6 @@ class Level:
|
|||
self.levelSpec = levelSpec
|
||||
self.scenarioIndex = scenarioIndex
|
||||
self.levelSpec.setScenario(self.scenarioIndex)
|
||||
if __dev__:
|
||||
self.levelSpec.setLevel(self)
|
||||
self.entranceId2entity = {}
|
||||
self.entId2createCallbacks = {}
|
||||
self.createdEntIds = []
|
||||
|
@ -218,44 +216,4 @@ class Level:
|
|||
self.createdEntIds.remove(entId)
|
||||
|
||||
def handleVisChange(self):
|
||||
pass
|
||||
|
||||
if __dev__:
|
||||
|
||||
def getAttribChangeEventName(self):
|
||||
return 'attribChange-%s' % self.levelId
|
||||
|
||||
def getInsertEntityEventName(self):
|
||||
return 'insertEntity-%s' % self.levelId
|
||||
|
||||
def getRemoveEntityEventName(self):
|
||||
return 'removeEntity-%s' % self.levelId
|
||||
|
||||
def handleAttribChange(self, entId, attrib, value, username = None):
|
||||
entity = self.getEntity(entId)
|
||||
if entity is not None:
|
||||
entity.handleAttribChange(attrib, value)
|
||||
messenger.send(self.getAttribChangeEventName(), [entId,
|
||||
attrib,
|
||||
value,
|
||||
username])
|
||||
return
|
||||
|
||||
def setEntityCreatorUsername(self, entId, editUsername):
|
||||
pass
|
||||
|
||||
def handleEntityInsert(self, entId):
|
||||
self.entType2ids[self.getEntityType(entId)].append(entId)
|
||||
self.createEntity(entId)
|
||||
messenger.send(self.getInsertEntityEventName(), [entId])
|
||||
|
||||
def handleEntityRemove(self, entId):
|
||||
messenger.send(self.getRemoveEntityEventName(), [entId])
|
||||
if entId in self.createdEntIds:
|
||||
entity = self.getEntity(entId)
|
||||
entity.destroy()
|
||||
elif entId in self.nothingEntIds:
|
||||
del self.nothingEntIds[entId]
|
||||
elif entId in self.nonlocalEntIds:
|
||||
del self.nonlocalEntIds[entId]
|
||||
self.entType2ids[self.getEntityType(entId)].remove(entId)
|
||||
pass
|
|
@ -1,5 +1,4 @@
|
|||
MinZoneNum = 0
|
||||
MaxZoneNum = 999
|
||||
UberZoneEntId = 0
|
||||
LevelMgrEntId = 1000
|
||||
EditMgrEntId = 1001
|
||||
LevelMgrEntId = 1000
|
|
@ -1,53 +1,24 @@
|
|||
from pandac import PandaModules as PM
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
from direct.showbase.PythonUtil import list2dict, uniqueElements
|
||||
import string
|
||||
import LevelConstants
|
||||
import types
|
||||
if __dev__:
|
||||
import os
|
||||
import LevelConstants, types
|
||||
|
||||
class LevelSpec:
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('LevelSpec')
|
||||
SystemEntIds = (LevelConstants.UberZoneEntId, LevelConstants.LevelMgrEntId, LevelConstants.EditMgrEntId)
|
||||
SystemEntIds = (LevelConstants.UberZoneEntId, LevelConstants.LevelMgrEntId)
|
||||
|
||||
def __init__(self, spec = None, scenario = 0):
|
||||
newSpec = 0
|
||||
if type(spec) is types.ModuleType:
|
||||
if __dev__:
|
||||
reload(spec)
|
||||
self.specDict = spec.levelSpec
|
||||
if __dev__:
|
||||
self.setFilename(spec.__file__)
|
||||
elif type(spec) is types.DictType:
|
||||
self.specDict = spec
|
||||
elif spec is None:
|
||||
if __dev__:
|
||||
newSpec = 1
|
||||
self.specDict = {'globalEntities': {},
|
||||
'scenarios': [{}]}
|
||||
self.entId2specDict = {}
|
||||
self.entId2specDict.update(list2dict(self.getGlobalEntIds(), value=self.privGetGlobalEntityDict()))
|
||||
for i in xrange(self.getNumScenarios()):
|
||||
self.entId2specDict.update(list2dict(self.getScenarioEntIds(i), value=self.privGetScenarioEntityDict(i)))
|
||||
|
||||
self.setScenario(scenario)
|
||||
if __dev__:
|
||||
if newSpec:
|
||||
import EntityTypes
|
||||
import EntityTypeRegistry
|
||||
etr = EntityTypeRegistry.EntityTypeRegistry(EntityTypes)
|
||||
self.setEntityTypeReg(etr)
|
||||
entId = LevelConstants.UberZoneEntId
|
||||
self.insertEntity(entId, 'zone')
|
||||
self.doSetAttrib(entId, 'name', 'UberZone')
|
||||
entId = LevelConstants.LevelMgrEntId
|
||||
self.insertEntity(entId, 'levelMgr')
|
||||
self.doSetAttrib(entId, 'name', 'LevelMgr')
|
||||
entId = LevelConstants.EditMgrEntId
|
||||
self.insertEntity(entId, 'editMgr')
|
||||
self.doSetAttrib(entId, 'name', 'EditMgr')
|
||||
return
|
||||
|
||||
def destroy(self):
|
||||
del self.specDict
|
||||
|
@ -55,8 +26,6 @@ class LevelSpec:
|
|||
del self.scenario
|
||||
if hasattr(self, 'level'):
|
||||
del self.level
|
||||
if hasattr(self, 'entTypeReg'):
|
||||
del self.entTypeReg
|
||||
|
||||
def getNumScenarios(self):
|
||||
return len(self.specDict['scenarios'])
|
||||
|
@ -89,13 +58,6 @@ class LevelSpec:
|
|||
specDict = self.entId2specDict[entId]
|
||||
return specDict[entId]
|
||||
|
||||
def getCopyOfSpec(self, spec):
|
||||
return __import__(self.getSpecImportsModuleName(), fromlist=['*']).__dict__
|
||||
|
||||
def getEntitySpecCopy(self, entId):
|
||||
specDict = self.entId2specDict[entId]
|
||||
return self.getCopyOfSpec(specDict[entId])
|
||||
|
||||
def getEntityType(self, entId):
|
||||
return self.getEntitySpec(entId)['type']
|
||||
|
||||
|
@ -130,277 +92,4 @@ class LevelSpec:
|
|||
zoneIds.sort()
|
||||
for zoneNum in zoneIds:
|
||||
spec = self.getEntitySpec(zoneNum)
|
||||
print 'zone %s: %s' % (zoneNum, spec['name'])
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setLevel(self, level):
|
||||
self.level = level
|
||||
|
||||
def hasLevel(self):
|
||||
return hasattr(self, 'level')
|
||||
|
||||
def setEntityTypeReg(self, entTypeReg):
|
||||
self.entTypeReg = entTypeReg
|
||||
for entId in self.getAllEntIds():
|
||||
spec = self.getEntitySpec(entId)
|
||||
type = self.getEntityType(entId)
|
||||
typeDesc = self.entTypeReg.getTypeDesc(type)
|
||||
attribDescDict = typeDesc.getAttribDescDict()
|
||||
for attribName, desc in attribDescDict.iteritems():
|
||||
if attribName not in spec:
|
||||
spec[attribName] = desc.getDefaultValue()
|
||||
|
||||
self.checkSpecIntegrity()
|
||||
|
||||
def hasEntityTypeReg(self):
|
||||
return hasattr(self, 'entTypeReg')
|
||||
|
||||
def setFilename(self, filename):
|
||||
self.filename = filename
|
||||
|
||||
def doSetAttrib(self, entId, attrib, value):
|
||||
specDict = self.entId2specDict[entId]
|
||||
specDict[entId][attrib] = value
|
||||
|
||||
def setAttribChange(self, entId, attrib, value, username):
|
||||
LevelSpec.notify.info('setAttribChange(%s): %s, %s = %s' % (username,
|
||||
entId,
|
||||
attrib,
|
||||
repr(value)))
|
||||
self.doSetAttrib(entId, attrib, value)
|
||||
if self.hasLevel():
|
||||
self.level.handleAttribChange(entId, attrib, value, username)
|
||||
|
||||
def insertEntity(self, entId, entType, parentEntId = 'unspecified'):
|
||||
LevelSpec.notify.info('inserting entity %s (%s)' % (entId, entType))
|
||||
globalEnts = self.privGetGlobalEntityDict()
|
||||
self.entId2specDict[entId] = globalEnts
|
||||
globalEnts[entId] = {}
|
||||
spec = globalEnts[entId]
|
||||
attribDescs = self.entTypeReg.getTypeDesc(entType).getAttribDescDict()
|
||||
for name, desc in attribDescs.items():
|
||||
spec[name] = desc.getDefaultValue()
|
||||
|
||||
spec['type'] = entType
|
||||
if parentEntId != 'unspecified':
|
||||
spec['parentEntId'] = parentEntId
|
||||
if self.hasLevel():
|
||||
self.level.handleEntityInsert(entId)
|
||||
else:
|
||||
LevelSpec.notify.warning('no level to be notified of insertion')
|
||||
|
||||
def removeEntity(self, entId):
|
||||
LevelSpec.notify.info('removing entity %s' % entId)
|
||||
if self.hasLevel():
|
||||
self.level.handleEntityRemove(entId)
|
||||
else:
|
||||
LevelSpec.notify.warning('no level to be notified of removal')
|
||||
dict = self.entId2specDict[entId]
|
||||
del dict[entId]
|
||||
del self.entId2specDict[entId]
|
||||
|
||||
def removeZoneReferences(self, removedZoneNums):
|
||||
type2ids = self.getEntType2ids(self.getAllEntIdsFromAllScenarios())
|
||||
for type in type2ids:
|
||||
typeDesc = self.entTypeReg.getTypeDesc(type)
|
||||
visZoneListAttribs = typeDesc.getAttribsOfType('visZoneList')
|
||||
if len(visZoneListAttribs) > 0:
|
||||
for entId in type2ids[type]:
|
||||
spec = self.getEntitySpec(entId)
|
||||
for attribName in visZoneListAttribs:
|
||||
for zoneNum in removedZoneNums:
|
||||
while zoneNum in spec[attribName]:
|
||||
spec[attribName].remove(zoneNum)
|
||||
|
||||
def getSpecImportsModuleName(self):
|
||||
return 'toontown.coghq.SpecImports'
|
||||
|
||||
def getFilename(self):
|
||||
return self.filename
|
||||
|
||||
def privGetBackupFilename(self, filename):
|
||||
return '%s.bak' % filename
|
||||
|
||||
def saveToDisk(self, filename = None, makeBackup = 1):
|
||||
if filename is None:
|
||||
filename = self.filename
|
||||
if filename.endswith('.pyc'):
|
||||
filename = filename.replace('.pyc', '.py')
|
||||
if makeBackup and self.privFileExists(filename):
|
||||
try:
|
||||
backupFilename = self.privGetBackupFilename(filename)
|
||||
self.privRemoveFile(backupFilename)
|
||||
os.rename(filename, backupFilename)
|
||||
except OSError, e:
|
||||
LevelSpec.notify.warning('error during backup: %s' % str(e))
|
||||
|
||||
LevelSpec.notify.info("writing to '%s'" % filename)
|
||||
self.privRemoveFile(filename)
|
||||
self.privSaveToDisk(filename)
|
||||
return
|
||||
|
||||
def privSaveToDisk(self, filename):
|
||||
retval = 1
|
||||
f = file(filename, 'wb')
|
||||
try:
|
||||
f.write(self.getPrettyString())
|
||||
except IOError:
|
||||
retval = 0
|
||||
|
||||
f.close()
|
||||
return retval
|
||||
|
||||
def privFileExists(self, filename):
|
||||
try:
|
||||
os.stat(filename)
|
||||
return 1
|
||||
except OSError:
|
||||
return 0
|
||||
|
||||
def privRemoveFile(self, filename):
|
||||
try:
|
||||
os.remove(filename)
|
||||
return 1
|
||||
except OSError:
|
||||
return 0
|
||||
|
||||
def getPrettyString(self):
|
||||
import pprint
|
||||
tabWidth = 4
|
||||
tab = ' ' * tabWidth
|
||||
globalEntitiesName = 'GlobalEntities'
|
||||
scenarioEntitiesName = 'Scenario%s'
|
||||
topLevelName = 'levelSpec'
|
||||
|
||||
def getPrettyEntityDictStr(name, dict, tabs = 0):
|
||||
|
||||
def t(n):
|
||||
return (tabs + n) * tab
|
||||
|
||||
def sortList(lst, firstElements = []):
|
||||
elements = list(lst)
|
||||
result = []
|
||||
for el in firstElements:
|
||||
if el in elements:
|
||||
result.append(el)
|
||||
elements.remove(el)
|
||||
|
||||
elements.sort()
|
||||
result.extend(elements)
|
||||
return result
|
||||
|
||||
firstTypes = ('levelMgr', 'editMgr', 'zone')
|
||||
firstAttribs = ('type', 'name', 'comment', 'parentEntId', 'pos', 'x', 'y', 'z', 'hpr', 'h', 'p', 'r', 'scale', 'sx', 'sy', 'sz', 'color', 'model')
|
||||
str = t(0) + '%s = {\n' % name
|
||||
entIds = dict.keys()
|
||||
entType2ids = self.getEntType2ids(entIds)
|
||||
types = sortList(entType2ids.keys(), firstTypes)
|
||||
for type in types:
|
||||
str += t(1) + '# %s\n' % type.upper()
|
||||
entIds = entType2ids[type]
|
||||
entIds.sort()
|
||||
for entId in entIds:
|
||||
str += t(1) + '%s: {\n' % entId
|
||||
spec = dict[entId]
|
||||
attribs = sortList(spec.keys(), firstAttribs)
|
||||
for attrib in attribs:
|
||||
str += t(2) + "'%s': %s,\n" % (attrib, repr(spec[attrib]))
|
||||
|
||||
str += t(2) + '}, # end entity %s\n' % entId
|
||||
|
||||
str += t(1) + '}\n'
|
||||
return str
|
||||
|
||||
def getPrettyTopLevelDictStr(tabs = 0):
|
||||
|
||||
def t(n):
|
||||
return (tabs + n) * tab
|
||||
|
||||
str = t(0) + '%s = {\n' % topLevelName
|
||||
str += t(1) + "'globalEntities': %s,\n" % globalEntitiesName
|
||||
str += t(1) + "'scenarios': [\n"
|
||||
for i in xrange(self.getNumScenarios()):
|
||||
str += t(2) + '%s,\n' % (scenarioEntitiesName % i)
|
||||
|
||||
str += t(2) + '],\n'
|
||||
str += t(1) + '}\n'
|
||||
return str
|
||||
|
||||
str = 'from %s import *\n' % self.getSpecImportsModuleName()
|
||||
str += '\n'
|
||||
str += getPrettyEntityDictStr('GlobalEntities', self.privGetGlobalEntityDict())
|
||||
str += '\n'
|
||||
numScenarios = self.getNumScenarios()
|
||||
for i in xrange(numScenarios):
|
||||
str += getPrettyEntityDictStr('Scenario%s' % i, self.privGetScenarioEntityDict(i))
|
||||
str += '\n'
|
||||
|
||||
str += getPrettyTopLevelDictStr()
|
||||
self.testPrettyString(prettyString=str)
|
||||
return str
|
||||
|
||||
def _recurKeyTest(self, dict1, dict2):
|
||||
s = ''
|
||||
errorCount = 0
|
||||
if set(dict1.keys()) != set(dict2.keys()):
|
||||
return 0
|
||||
for key in dict1:
|
||||
if type(dict1[key]) == type({}) and type(dict2[key]) == type({}):
|
||||
if not self._recurKeyTest(dict1[key], dict2[key]):
|
||||
return 0
|
||||
else:
|
||||
strd1 = repr(dict1[key])
|
||||
strd2 = repr(dict2[key])
|
||||
if strd1 != strd2:
|
||||
s += '\nBAD VALUE(%s): %s != %s\n' % (key, strd1, strd2)
|
||||
errorCount += 1
|
||||
|
||||
print s
|
||||
if errorCount == 0:
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def testPrettyString(self, prettyString=None):
|
||||
pass
|
||||
|
||||
def checkSpecIntegrity(self):
|
||||
entIds = self.getGlobalEntIds()
|
||||
entIds = list2dict(entIds)
|
||||
for i in xrange(self.getNumScenarios()):
|
||||
for id in self.getScenarioEntIds(i):
|
||||
entIds[id] = None
|
||||
|
||||
if self.entTypeReg is not None:
|
||||
allEntIds = entIds
|
||||
for entId in allEntIds:
|
||||
spec = self.getEntitySpec(entId)
|
||||
entType = spec['type']
|
||||
typeDesc = self.entTypeReg.getTypeDesc(entType)
|
||||
attribNames = typeDesc.getAttribNames()
|
||||
attribDescs = typeDesc.getAttribDescDict()
|
||||
for attrib in spec.keys():
|
||||
if attrib not in attribNames:
|
||||
LevelSpec.notify.warning("entId %s (%s): unknown attrib '%s', omitting" % (entId, spec['type'], attrib))
|
||||
del spec[attrib]
|
||||
|
||||
for attribName in attribNames:
|
||||
if attribName not in spec:
|
||||
LevelSpec.notify.warning("entId %s (%s): missing attrib '%s'" % (entId, spec['type'], attribName))
|
||||
|
||||
return
|
||||
|
||||
def stringHash(self):
|
||||
h = PM.HashVal()
|
||||
h.hashString(repr(self))
|
||||
return h.asHex()
|
||||
|
||||
def __hash__(self):
|
||||
return hash(repr(self))
|
||||
|
||||
def __str__(self):
|
||||
return 'LevelSpec'
|
||||
|
||||
def __repr__(self):
|
||||
return 'LevelSpec(%s, scenario=%s)' % (repeatableRepr(self.specDict), repeatableRepr(self.scenario))
|
||||
print 'zone %s: %s' % (zoneNum, spec['name'])
|
|
@ -25,9 +25,4 @@ class LocatorEntity(Entity.Entity, NodePath):
|
|||
LocatorEntity.notify.warning("could not find '%s'" % self.searchPath)
|
||||
self.reparentTo(hidden)
|
||||
else:
|
||||
self.reparentTo(parent)
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, attrib, value):
|
||||
self.doReparent()
|
||||
self.reparentTo(parent)
|
|
@ -35,11 +35,7 @@ class ModelEntity(BasicEntities.NodePathEntity):
|
|||
if self.model:
|
||||
self.model.reparentTo(self)
|
||||
if self.collisionsOnly:
|
||||
if __dev__:
|
||||
self.model.setTransparency(1)
|
||||
self.model.setColorScale(1, 1, 1, 0.1)
|
||||
else:
|
||||
self.model.hide()
|
||||
self.model.hide()
|
||||
else:
|
||||
self.model.show()
|
||||
if self.modelPath in ('phase_9/models/cogHQ/woodCrateB.bam', 'phase_9/models/cogHQ/metal_crateB.bam', 'phase_10/models/cashbotHQ/CBMetalCrate.bam', 'phase_10/models/cogHQ/CBMetalCrate2.bam', 'phase_10/models/cashbotHQ/CBWoodCrate.bam', 'phase_11/models/lawbotHQ/LB_metal_crate.bam', 'phase_11/models/lawbotHQ/LB_metal_crate2.bam'):
|
||||
|
|
|
@ -20,12 +20,9 @@ class PathEntity(BasicEntities.NodePathEntity):
|
|||
pathTableId = GoonPathData.taskZoneId2pathId[self.level.getTaskZoneId()]
|
||||
if self.pathIndex in GoonPathData.Paths[pathTableId]:
|
||||
self.path = GoonPathData.Paths[pathTableId][self.pathIndex]
|
||||
if __dev__:
|
||||
messenger.send(self.getChangeEvent())
|
||||
else:
|
||||
PathEntity.notify.warning('invalid pathIndex: %s' % pathIndex)
|
||||
self.path = None
|
||||
return
|
||||
|
||||
def makePathTrack(self, node, velocity, name, turnTime = 1, lookAroundNode = None):
|
||||
track = Sequence(name=name)
|
||||
|
@ -45,13 +42,4 @@ class PathEntity(BasicEntities.NodePathEntity):
|
|||
duration = distance / velocity
|
||||
track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint))
|
||||
|
||||
return track
|
||||
|
||||
if __dev__:
|
||||
|
||||
def getChangeEvent(self):
|
||||
return self.getUniqueName('pathChanged')
|
||||
|
||||
def setPathScale(self, pathScale):
|
||||
self.pathScale = pathScale
|
||||
self.setPathIndex(self.pathIndex)
|
||||
return track
|
|
@ -49,10 +49,4 @@ class PropSpinner(Entity):
|
|||
def destroyProps(self):
|
||||
if hasattr(self, 'spinTracks'):
|
||||
self.spinTracks.pause()
|
||||
del self.spinTracks
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, *args):
|
||||
self.destroyProps()
|
||||
self.initProps()
|
||||
del self.spinTracks
|
|
@ -13,14 +13,12 @@ class VisibilityExtender(Entity.Entity):
|
|||
if self.event is not None:
|
||||
self.eventName = self.getOutputEventName(self.event)
|
||||
self.accept(self.eventName, self.handleEvent)
|
||||
return
|
||||
|
||||
def destroyVisExt(self):
|
||||
if self.eventName is not None:
|
||||
self.ignore(self.eventName)
|
||||
if self.extended:
|
||||
self.retract()
|
||||
return
|
||||
|
||||
def handleEvent(self, doExtend):
|
||||
if doExtend:
|
||||
|
@ -43,21 +41,4 @@ class VisibilityExtender(Entity.Entity):
|
|||
|
||||
def destroy(self):
|
||||
self.destroyVisExt()
|
||||
Entity.Entity.destroy(self)
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setNewZones(self, newZones):
|
||||
extended = self.extended
|
||||
self.destroyVisExt()
|
||||
self.newZones = newZones
|
||||
self.initVisExt()
|
||||
if extended:
|
||||
self.extend()
|
||||
|
||||
def attribChanged(self, *args):
|
||||
extended = self.extended
|
||||
self.destroyVisExt()
|
||||
self.initVisExt()
|
||||
if extended:
|
||||
self.extend()
|
||||
Entity.Entity.destroy(self)
|
|
@ -7,14 +7,10 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs):
|
|||
ZoneEntityBase.ZoneEntityBase.__init__(self, level, entId)
|
||||
self.nodePath = self.level.getZoneNode(self.entId)
|
||||
if self.nodePath is None:
|
||||
if __dev__:
|
||||
self.level.reportModelSpecSyncError('unknown zoneNum %s; zone was removed from model?' % self.entId)
|
||||
else:
|
||||
self.notify.error('zone %s not found in level model' % self.entId)
|
||||
self.notify.error('zone %s not found in level model' % self.entId)
|
||||
BasicEntities.NodePathAttribs.initNodePathAttribs(self, doReparent=0)
|
||||
self.visibleZoneNums = {}
|
||||
self.incrementRefCounts(self.visibility)
|
||||
return
|
||||
|
||||
def destroy(self):
|
||||
BasicEntities.NodePathAttribs.destroy(self)
|
||||
|
@ -35,12 +31,4 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs):
|
|||
for zoneNum in zoneNumList:
|
||||
self.visibleZoneNums[zoneNum] -= 1
|
||||
if self.visibleZoneNums[zoneNum] == 0:
|
||||
del self.visibleZoneNums[zoneNum]
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setVisibility(self, visibility):
|
||||
self.decrementRefCounts(self.visibility)
|
||||
self.visibility = visibility
|
||||
self.incrementRefCounts(self.visibility)
|
||||
self.level.handleVisChange()
|
||||
del self.visibleZoneNums[zoneNum]
|
|
@ -208,7 +208,6 @@ InventoryHotkeyOn = 'home'
|
|||
InventoryHotkeyOff = 'home-up'
|
||||
MapHotkeyOn = 'delete'
|
||||
MapHotkeyOff = 'delete-up'
|
||||
DetectGarbageHotkey = 'shift-f11'
|
||||
PrintCamPosHotkey = 'f12'
|
||||
QuitGameHotKeyOSX = 'meta-q'
|
||||
QuitGameHotKeyRepeatOSX = 'meta-q-repeat'
|
||||
|
|
|
@ -18,15 +18,6 @@ REJECT_BLOCKED_ROOM = 5
|
|||
REJECT_NOT_YET_AVAILABLE = 6
|
||||
REJECT_BOARDINGPARTY = 7
|
||||
MAX_GROUP_BOARDING_TIME = 6.0
|
||||
if __dev__:
|
||||
try:
|
||||
config = simbase.config
|
||||
except:
|
||||
config = base.config
|
||||
|
||||
elevatorCountdown = config.GetFloat('elevator-countdown', -1)
|
||||
if elevatorCountdown != -1:
|
||||
bboard.post('elevatorCountdown', elevatorCountdown)
|
||||
ElevatorData = {ELEVATOR_NORMAL: {'openTime': 2.0,
|
||||
'closeTime': 2.0,
|
||||
'width': 3.5,
|
||||
|
|
|
@ -4,13 +4,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'comment': '',
|
||||
'parentEntId': 0,
|
||||
'modelFilename': 'phase_10/models/cogHQ/EndVault.bam'},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -4,13 +4,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'comment': '',
|
||||
'parentEntId': 0,
|
||||
'modelFilename': 'phase_10/models/cogHQ/EndVault.bam'},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
from direct.fsm.StatePush import FunctionCall
|
||||
from otp.level.EntityStateVarSet import EntityStateVarSet
|
||||
from otp.level.LevelSpec import LevelSpec
|
||||
|
||||
class CogdoLevelGameBase:
|
||||
|
||||
def getLevelSpec(self):
|
||||
return LevelSpec(self.getSpec())
|
||||
|
||||
if __dev__:
|
||||
|
||||
def startHandleEdits(self):
|
||||
fcs = []
|
||||
Consts = self.getConsts()
|
||||
for item in Consts.__dict__.itervalues():
|
||||
if isinstance(item, EntityStateVarSet):
|
||||
for attribName in item._getAttributeNames():
|
||||
handler = getattr(self, '_handle%sChanged' % attribName, None)
|
||||
if handler:
|
||||
stateVar = getattr(item, attribName)
|
||||
fcs.append(FunctionCall(handler, stateVar))
|
||||
|
||||
self._functionCalls = fcs
|
||||
return
|
||||
|
||||
def stopHandleEdits(self):
|
||||
if __dev__:
|
||||
for fc in self._functionCalls:
|
||||
fc.destroy()
|
||||
|
||||
self._functionCalls = None
|
||||
return
|
||||
|
||||
def getEntityTypeReg(self):
|
||||
import CogdoEntityTypes
|
||||
from otp.level import EntityTypeRegistry
|
||||
typeReg = EntityTypeRegistry.EntityTypeRegistry(CogdoEntityTypes)
|
||||
return typeReg
|
|
@ -44,10 +44,4 @@ class DistCogdoBoardroomGame(CogdoBoardroomGameBase, DistCogdoLevelGame):
|
|||
self.timer.unstash()
|
||||
|
||||
def timerExpired(self):
|
||||
pass
|
||||
|
||||
if __dev__:
|
||||
|
||||
def _handleTimerScaleChanged(self, timerScale):
|
||||
if hasattr(self, 'timer'):
|
||||
self.timer.setScale(timerScale)
|
||||
pass
|
|
@ -869,16 +869,4 @@ class DistCogdoCrane(DistributedObject.DistributedObject, FSM.FSM):
|
|||
|
||||
def exitMovie(self):
|
||||
self.__deactivatePhysics()
|
||||
self.__straightenCable()
|
||||
|
||||
if __dev__:
|
||||
|
||||
def _handleEmptyFrictionCoefChanged(self, coef):
|
||||
self.handler.setDynamicFrictionCoef(coef)
|
||||
|
||||
def _handleRopeLinkMassChanged(self, mass):
|
||||
for an, anp, cnp in self.activeLinks:
|
||||
an.getPhysicsObject().setMass(mass)
|
||||
|
||||
def _handleMagnetMassChanged(self, mass):
|
||||
pass
|
||||
self.__straightenCable()
|
|
@ -28,8 +28,6 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame):
|
|||
DistCogdoLevelGame.announceGenerate(self)
|
||||
self.timer = ToontownTimer.ToontownTimer()
|
||||
self.timer.stash()
|
||||
if __dev__:
|
||||
self._durationChangedEvent = self.uniqueName('durationChanged')
|
||||
|
||||
def disable(self):
|
||||
self.timer.destroy()
|
||||
|
@ -151,8 +149,6 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame):
|
|||
self._physicsTask = taskMgr.add(self._doPhysics, self.uniqueName('physics'), priority=25)
|
||||
self.evWalls.stash()
|
||||
self._startTimer()
|
||||
if __dev__:
|
||||
self.accept(self._durationChangedEvent, self._startTimer)
|
||||
|
||||
def _startTimer(self):
|
||||
timeLeft = GameConsts.Settings.GameDuration.get() - self.getCurrentGameTime()
|
||||
|
@ -167,8 +163,6 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame):
|
|||
return Task.cont
|
||||
|
||||
def exitGame(self):
|
||||
if __dev__:
|
||||
self.ignore(self._durationChangedEvent)
|
||||
DistCogdoLevelGame.exitGame(self)
|
||||
self._physicsTask.remove()
|
||||
|
||||
|
@ -180,32 +174,4 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame):
|
|||
self.timer.unstash()
|
||||
|
||||
def timerExpired(self):
|
||||
pass
|
||||
|
||||
if __dev__:
|
||||
|
||||
def _handleGameDurationChanged(self, gameDuration):
|
||||
messenger.send(self._durationChangedEvent)
|
||||
|
||||
def _handleGravityChanged(self, gravity):
|
||||
self.physicsMgr.removeLinearForce(self._gravityForce)
|
||||
self._gravityForceNode.removeForce(self._gravityForce)
|
||||
self._gravityForce = PM.LinearVectorForce(0, 0, gravity)
|
||||
self.physicsMgr.addLinearForce(self._gravityForce)
|
||||
self._gravityForceNode.addForce(self._gravityForce)
|
||||
|
||||
def _handleEmptyFrictionCoefChanged(self, coef):
|
||||
for crane in self.cranes.itervalues():
|
||||
crane._handleEmptyFrictionCoefChanged(coef)
|
||||
|
||||
def _handleRopeLinkMassChanged(self, mass):
|
||||
for crane in self.cranes.itervalues():
|
||||
crane._handleRopeLinkMassChanged(mass)
|
||||
|
||||
def _handleMagnetMassChanged(self, mass):
|
||||
for crane in self.cranes.itervalues():
|
||||
crane._handleMagnetMassChanged(mass)
|
||||
|
||||
def _handleMoneyBagGrabHeightChanged(self, height):
|
||||
for moneyBag in self.moneyBags.itervalues():
|
||||
moneyBag._handleMoneyBagGrabHeightChanged(height)
|
||||
pass
|
|
@ -60,11 +60,4 @@ class DistCogdoCraneGameAI(DistCogdoLevelGameAI, CogdoCraneGameBase):
|
|||
|
||||
def _finishDoneDL(self, task):
|
||||
self.announceGameDone()
|
||||
return task.done
|
||||
|
||||
if __dev__:
|
||||
|
||||
def _handleGameDurationChanged(self, gameDuration):
|
||||
if hasattr(self, '_gameDoneEvent') and self._gameDoneEvent != None:
|
||||
taskMgr.remove(self._gameDoneEvent)
|
||||
self._scheduleGameDone()
|
||||
return task.done
|
|
@ -80,10 +80,4 @@ class DistCogdoCraneMoneyBag(DistCogdoCraneObject):
|
|||
self.showShadows()
|
||||
|
||||
def exitInitial(self):
|
||||
pass
|
||||
|
||||
if __dev__:
|
||||
|
||||
def _handleMoneyBagGrabHeightChanged(self, height):
|
||||
grabPos = DistCogdoCraneMoneyBag.grabPos
|
||||
DistCogdoCraneMoneyBag.grabPos = (grabPos[0], grabPos[1], height)
|
||||
pass
|
|
@ -1,12 +1,11 @@
|
|||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from otp.level.DistributedLevel import DistributedLevel
|
||||
from otp.level import LevelConstants
|
||||
from otp.level import EditorGlobals
|
||||
from otp.level.LevelSpec import LevelSpec
|
||||
from toontown.cogdominium.DistCogdoGame import DistCogdoGame
|
||||
from toontown.cogdominium.CogdoLevelGameBase import CogdoLevelGameBase
|
||||
from toontown.cogdominium.CogdoEntityCreator import CogdoEntityCreator
|
||||
|
||||
class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel):
|
||||
class DistCogdoLevelGame(DistCogdoGame, DistributedLevel):
|
||||
notify = directNotify.newCategory('DistCogdoLevelGame')
|
||||
|
||||
def __init__(self, cr):
|
||||
|
@ -16,14 +15,10 @@ class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel):
|
|||
def generate(self):
|
||||
DistributedLevel.generate(self)
|
||||
DistCogdoGame.generate(self)
|
||||
if __dev__:
|
||||
bboard.post(EditorGlobals.EditTargetPostName, self)
|
||||
|
||||
def announceGenerate(self):
|
||||
DistributedLevel.announceGenerate(self)
|
||||
DistCogdoGame.announceGenerate(self)
|
||||
if __dev__:
|
||||
self.startHandleEdits()
|
||||
|
||||
def createEntityCreator(self):
|
||||
return CogdoEntityCreator(level=self)
|
||||
|
@ -31,18 +26,7 @@ class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel):
|
|||
def levelAnnounceGenerate(self):
|
||||
self.notify.debug('levelAnnounceGenerate')
|
||||
DistributedLevel.levelAnnounceGenerate(self)
|
||||
spec = self.getLevelSpec()
|
||||
if __dev__:
|
||||
typeReg = self.getEntityTypeReg()
|
||||
spec.setEntityTypeReg(typeReg)
|
||||
DistributedLevel.initializeLevel(self, spec)
|
||||
|
||||
def privGotSpec(self, levelSpec):
|
||||
if __dev__:
|
||||
if not levelSpec.hasEntityTypeReg():
|
||||
typeReg = self.getEntityTypeReg()
|
||||
levelSpec.setEntityTypeReg(typeReg)
|
||||
DistributedLevel.privGotSpec(self, levelSpec)
|
||||
DistributedLevel.initializeLevel(self, LevelSpec(self.getSpec()))
|
||||
|
||||
def initVisibility(self):
|
||||
levelMgr = self.getEntity(LevelConstants.LevelMgrEntId)
|
||||
|
@ -53,13 +37,9 @@ class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel):
|
|||
DistributedLevel.placeLocalToon(self, moveLocalAvatar=False)
|
||||
|
||||
def disable(self):
|
||||
if __dev__:
|
||||
self.stopHandleEdits()
|
||||
DistCogdoGame.disable(self)
|
||||
DistributedLevel.disable(self)
|
||||
|
||||
def delete(self):
|
||||
DistCogdoGame.delete(self)
|
||||
DistributedLevel.delete(self)
|
||||
if __dev__:
|
||||
bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self)
|
||||
DistributedLevel.delete(self)
|
|
@ -31,12 +31,4 @@ class ActiveCell(BasicEntities.DistributedNodePathEntity):
|
|||
|
||||
def setState(self, state, objId):
|
||||
self.state = state
|
||||
self.occupantId = objId
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, *args):
|
||||
model = self.find('*')
|
||||
if not model.isEmpty():
|
||||
model.removeNode()
|
||||
self.loadModel()
|
||||
self.occupantId = objId
|
|
@ -28,31 +28,4 @@ class BarrelBase:
|
|||
self._gagTrack = self.getRng().choice(tracks)
|
||||
else:
|
||||
self._gagTrack = self.gagTrack
|
||||
return self._gagTrack
|
||||
|
||||
if __dev__:
|
||||
|
||||
def setRewardPerGrab(self, rewardPerGrab):
|
||||
if hasattr(self, '_reward'):
|
||||
del self._reward
|
||||
self.rewardPerGrab = rewardPerGrab
|
||||
|
||||
def setRewardPerGrabMax(self, rewardPerGrabMax):
|
||||
if hasattr(self, '_reward'):
|
||||
del self._reward
|
||||
self.rewardPerGrabMax = rewardPerGrabMax
|
||||
|
||||
def setGagLevel(self, gagLevel):
|
||||
if hasattr(self, '_gagLevel'):
|
||||
del self._gagLevel
|
||||
self.gagLevel = gagLevel
|
||||
|
||||
def setGagLevelMax(self, gagLevelMax):
|
||||
if hasattr(self, '_gagLevel'):
|
||||
del self._gagLevel
|
||||
self.gagLevelMax = gagLevelMax
|
||||
|
||||
def setGagTrack(self, gagTrack):
|
||||
if hasattr(self, '_gagTrack'):
|
||||
del self._gagTrack
|
||||
self.gagTrack = gagTrack
|
||||
return self._gagTrack
|
|
@ -86,10 +86,4 @@ class BattleBlocker(BasicEntities.DistributedNodePathEntity):
|
|||
track = Sequence()
|
||||
if callback:
|
||||
track.append(Func(callback))
|
||||
track.start()
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, *args):
|
||||
self.unloadCollisionGeom()
|
||||
self.initCollisionGeom()
|
||||
track.start()
|
|
@ -63,18 +63,4 @@ class BattleBlockerAI(DistributedEntityAI.DistributedEntityAI):
|
|||
messenger.send(self.getOutputEventName(), [1])
|
||||
|
||||
def d_setBattleFinished(self):
|
||||
self.sendUpdate('setBattleFinished', [])
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, *args):
|
||||
self.suitIds = []
|
||||
suits = self.level.planner.battleCellId2suits.get(self.cellId)
|
||||
if suits:
|
||||
for suit in suits:
|
||||
self.suitIds.append(suit.doId)
|
||||
|
||||
else:
|
||||
self.notify.warning("Couldn't find battle cell id %d in battleCellId2suits" % self.cellId)
|
||||
self.d_setSuits()
|
||||
self.registerBlocker()
|
||||
self.sendUpdate('setBattleFinished', [])
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotEntranceRoom',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,16 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotFairwayRoom_A',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': {'entType': 'door',
|
||||
'username': 'rurbino',
|
||||
'parentEntId': 110001,
|
||||
'entId': 110002},
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotKartBoardingRm',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotMazex1_C',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotMazex2_straight_C',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotMazex4_C',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotPresidentsRm',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotTeeOffRoom',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotTeeOffRoom',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_12/models/bossbotHQ/BossbotTeeOffRoom',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE31a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE15a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE15a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE15a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE03a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE07a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE07a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE07a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE19a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE04a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE04a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE04a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE22a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE11a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE10a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr',
|
|||
'farPlaneDistance': 1500,
|
||||
'modelFilename': 'phase_10/models/cashbotHQ/ZONE17a',
|
||||
'wantDoors': 1},
|
||||
1001: {'type': 'editMgr',
|
||||
'name': 'EditMgr',
|
||||
'parentEntId': 0,
|
||||
'insertEntity': None,
|
||||
'removeEntity': None,
|
||||
'requestNewEntity': None,
|
||||
'requestSave': None},
|
||||
0: {'type': 'zone',
|
||||
'name': 'UberZone',
|
||||
'comment': '',
|
||||
|
|
|
@ -98,10 +98,4 @@ class ConveyorBelt(BasicEntities.NodePathEntity):
|
|||
del self.tailClipPath
|
||||
self.clearClipPlane()
|
||||
for tread in self.treads:
|
||||
tread.parentingNode.clearClipPlane()
|
||||
|
||||
if __dev__:
|
||||
|
||||
def attribChanged(self, attrib, value):
|
||||
self.destroyBelt()
|
||||
self.initBelt()
|
||||
tread.parentingNode.clearClipPlane()
|
|
@ -13,12 +13,4 @@ class CountryClubRoomBase:
|
|||
self.roomId = roomId
|
||||
|
||||
def getCogTrack(self):
|
||||
return self.cogTrack
|
||||
|
||||
if __dev__:
|
||||
|
||||
def getCountryClubEntityTypeReg(self):
|
||||
import FactoryEntityTypes
|
||||
from otp.level import EntityTypeRegistry
|
||||
typeReg = EntityTypeRegistry.EntityTypeRegistry(FactoryEntityTypes)
|
||||
return typeReg
|
||||
return self.cogTrack
|
|
@ -41,8 +41,6 @@ class DistributedCountryClubAI(DistributedObjectAI.DistributedObjectAI):
|
|||
self.sendUpdate('setRoomDoIds', [
|
||||
roomDoIds])
|
||||
self.placeElevatorsOnMarkers()
|
||||
if __dev__:
|
||||
simbase.countryClub = self
|
||||
description = '%s|%s|%s' % (self.countryClubId, self.floorNum, self.avIds)
|
||||
for avId in self.avIds:
|
||||
self.air.writeServerEvent('countryClubEntered', avId, description)
|
||||
|
@ -58,9 +56,6 @@ class DistributedCountryClubAI(DistributedObjectAI.DistributedObjectAI):
|
|||
|
||||
def delete(self):
|
||||
self.notify.info('delete: %s' % self.doId)
|
||||
if __dev__:
|
||||
if hasattr(simbase, 'countryClub') and simbase.countryClub is self:
|
||||
del simbase.countryClub
|
||||
del self.rooms
|
||||
del self.layout
|
||||
del self.battleExpAggreg
|
||||
|
|
|
@ -11,8 +11,6 @@ import CountryClubRoomSpecs
|
|||
from otp.level import LevelSpec, LevelConstants
|
||||
from toontown.toonbase import TTLocalizer
|
||||
from toontown.nametag.NametagGlobals import *
|
||||
if __dev__:
|
||||
from otp.level import EditorGlobals
|
||||
|
||||
def getCountryClubRoomReadyPostName(doId):
|
||||
return 'countryClubRoomReady-%s' % doId
|
||||
|
@ -65,19 +63,12 @@ class DistributedCountryClubRoom(DistributedLevel.DistributedLevel, CountryClubR
|
|||
DistributedLevel.DistributedLevel.levelAnnounceGenerate(self)
|
||||
specModule = CountryClubRoomSpecs.getCountryClubRoomSpecModule(self.roomId)
|
||||
roomSpec = LevelSpec.LevelSpec(specModule)
|
||||
if __dev__:
|
||||
typeReg = self.getCountryClubEntityTypeReg()
|
||||
roomSpec.setEntityTypeReg(typeReg)
|
||||
DistributedLevel.DistributedLevel.initializeLevel(self, roomSpec)
|
||||
|
||||
def getReadyPostName(self):
|
||||
return getCountryClubRoomReadyPostName(self.doId)
|
||||
|
||||
def privGotSpec(self, levelSpec):
|
||||
if __dev__:
|
||||
if not levelSpec.hasEntityTypeReg():
|
||||
typeReg = self.getCountryClubEntityTypeReg()
|
||||
levelSpec.setEntityTypeReg(typeReg)
|
||||
DistributedLevel.DistributedLevel.privGotSpec(self, levelSpec)
|
||||
base.localAvatar.setH(-90)
|
||||
CountryClubRoom.CountryClubRoom.enter(self)
|
||||
|
@ -130,20 +121,14 @@ class DistributedCountryClubRoom(DistributedLevel.DistributedLevel, CountryClubR
|
|||
pass
|
||||
|
||||
def getParentTokenForEntity(self, entId):
|
||||
if __dev__:
|
||||
pass
|
||||
return 1000000 * self.roomNum + entId
|
||||
|
||||
def enterLtNotPresent(self):
|
||||
CountryClubRoom.CountryClubRoom.enterLtNotPresent(self)
|
||||
if __dev__:
|
||||
bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self)
|
||||
self.ignore('f2')
|
||||
|
||||
def enterLtPresent(self):
|
||||
CountryClubRoom.CountryClubRoom.enterLtPresent(self)
|
||||
if __dev__:
|
||||
bboard.post(EditorGlobals.EditTargetPostName, self)
|
||||
if self.countryClub is not None:
|
||||
self.countryClub.currentRoomName = CountryClubRoomSpecs.BossbotCountryClubRoomId2RoomName[self.roomId]
|
||||
|
||||
|
|
|
@ -33,10 +33,6 @@ class DistributedCountryClubRoomAI(DistributedLevelAI.DistributedLevelAI, Countr
|
|||
self.notify.debug('loading spec')
|
||||
specModule = CountryClubRoomSpecs.getCountryClubRoomSpecModule(self.roomId)
|
||||
roomSpec = LevelSpec.LevelSpec(specModule)
|
||||
if __dev__:
|
||||
self.notify.debug('creating entity type registry')
|
||||
typeReg = self.getCountryClubEntityTypeReg()
|
||||
roomSpec.setEntityTypeReg(typeReg)
|
||||
self.notify.debug('creating entities')
|
||||
DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec)
|
||||
self.notify.debug('creating cogs')
|
||||
|
|
|
@ -126,12 +126,8 @@ class DistributedDoorEntity(DistributedDoorEntityBase.DistributedDoorEntityBase,
|
|||
|
||||
self.accept('exit%s' % (self.getName(),), self.exitTrigger)
|
||||
self.acceptAvatar()
|
||||
if __dev__:
|
||||
self.initWantDoors()
|
||||
|
||||
def takedown(self):
|
||||
if __dev__:
|
||||
self.shutdownWantDoors()
|
||||
self.ignoreAll()
|
||||
if self.track is not None:
|
||||
self.track.finish()
|
||||
|
@ -446,23 +442,4 @@ class DistributedDoorEntity(DistributedDoorEntityBase.DistributedDoorEntityBase,
|
|||
self.doorLeft.unstash()
|
||||
self.doorRight.unstash()
|
||||
self.doorLeft.setPos(Vec3(0.0))
|
||||
self.doorRight.setPos(Vec3(0.0))
|
||||
|
||||
|
||||
if __dev__:
|
||||
def initWantDoors(self):
|
||||
self.accept('wantDoorsChanged', self.onWantDoorsChanged)
|
||||
self.onWantDoorsChanged()
|
||||
|
||||
def shutdownWantDoors(self):
|
||||
self.ignore('wantDoorsChanged')
|
||||
|
||||
def onWantDoorsChanged(self):
|
||||
if self.level.levelMgrEntity.wantDoors:
|
||||
self.getNodePath().unstash()
|
||||
else:
|
||||
self.getNodePath().stash()
|
||||
|
||||
def attribChanged(self, attrib, value):
|
||||
self.takedown()
|
||||
self.setup()
|
||||
self.doorRight.setPos(Vec3(0.0))
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue