Remove Welcome Valley

This commit is contained in:
John 2015-05-24 17:21:40 +03:00
parent a03c70c0e6
commit 9a4af9c686
31 changed files with 28 additions and 192 deletions

View file

@ -245,7 +245,6 @@ dclass CallbackObject {
};
from direct.distributed import DistributedObjectGlobal
from toontown.ai import WelcomeValleyManager/AI
from toontown.building import DistributedAnimatedProp/AI
from toontown.toon import DistributedToon/AI/UD
from toontown.safezone import DistributedTrolley/AI
@ -626,12 +625,6 @@ dclass ToontownDistrictStats : DistributedObject {
setStats : setAvatarCount, setNewAvatarCount;
};
dclass WelcomeValleyManager : DistributedObject {
clientSetZone(uint32) airecv clsend;
requestZoneIdMessage(uint32, uint16) airecv clsend;
requestZoneIdResponse(uint32, uint16);
};
dclass DistributedAnimatedProp : DistributedObject {
setPropId(uint16) required broadcast ram;
setAvatarInteract(uint32) required broadcast ram;

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import *
hashVal = 3860069384L
hashVal = 4171615815L
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
@ -14,7 +14,7 @@ from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiv
from toontown.shtiker import PurchaseManager, NewbiePurchaseManager
from toontown.groups import GroupManager
from toontown.uberdog.ClientServicesManager import ClientServicesManager
from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedReportMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedJorElCam
from toontown.ai import NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedReportMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedJorElCam
from otp.chat import ChatAgent
from toontown.parties.GlobalPartyManager import GlobalPartyManager
from toontown.racing.DistributedStartingBlock import DistributedViewingBlock

View file

@ -1,12 +1,8 @@
class PotentialShard:
def __init__(self, id):
self.id = id
self.name = None
self.population = 0
self.welcomeValleyPopulation = 0
self.active = 1
self.available = 1
return
self.available = 1

View file

@ -1,34 +0,0 @@
from pandac.PandaModules import *
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
class WelcomeValleyManager(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('WelcomeValleyManager')
neverDisable = 1
def __init__(self, cr):
DistributedObject.DistributedObject.__init__(self, cr)
def generate(self):
if base.cr.welcomeValleyManager != None:
base.cr.welcomeValleyManager.delete()
base.cr.welcomeValleyManager = self
DistributedObject.DistributedObject.generate(self)
return
def disable(self):
base.cr.welcomeValleyManager = None
DistributedObject.DistributedObject.disable(self)
return
def delete(self):
base.cr.welcomeValleyManager = None
DistributedObject.DistributedObject.delete(self)
return
def requestZoneId(self, origZoneId, callback):
context = self.getCallbackContext(callback)
self.sendUpdate('requestZoneIdMessage', [origZoneId, context])
def requestZoneIdResponse(self, zoneId, context):
self.doCallbackContext(context, [zoneId])

View file

@ -1,17 +0,0 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class WelcomeValleyManagerAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory("WelcomeValleyManagerAI")
def clientSetZone(self, todo0):
pass
def toonSetZone(self, doId, newZoneId):
pass #TODO
def requestZoneIdMessage(self, todo0, todo1):
pass
def requestZoneIdResponse(self, todo0, todo1):
pass

View file

@ -17,7 +17,6 @@ from toontown.toonbase import TTLocalizer
from toontown.distributed import DelayDelete
from toontown.toon import TTEmote
from otp.avatar import Emote
from toontown.hood import ZoneUtil
import sys
FO_DICT = {'s': 'tt_m_ara_cbe_fieldOfficeMoverShaker',
'l': 'tt_m_ara_cbe_fieldOfficeLegalEagle',
@ -445,7 +444,6 @@ class DistributedBuilding(DistributedObject.DistributedObject):
level = int(self.difficulty / 2) + 1
suitNP = dnaStore.findNode('suit_landmark_' + chr(self.track) + str(level))
zoneId = dnaStore.getZoneFromBlockNumber(self.block)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
@ -548,7 +546,6 @@ class DistributedBuilding(DistributedObject.DistributedObject):
if not suitNP:
suitNP = loader.loadModel('phase_5/models/cogdominium/%s' % FO_DICT[chr(self.track)])
zoneId = dnaStore.getZoneFromBlockNumber(self.block)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.interiorZoneId)
newParentNP = base.cr.playGame.hood.loader.zoneDict[zoneId]
suitBuildingNP = suitNP.copyTo(newParentNP)
buildingTitle = dnaStore.getTitleFromBlockNumber(self.block)
@ -934,8 +931,7 @@ class DistributedBuilding(DistributedObject.DistributedObject):
pass
def getVisZoneId(self):
exteriorZoneId = base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block)
return ZoneUtil.getTrueZoneId(exteriorZoneId, self.zoneId)
return base.cr.playGame.hood.dnaStore.getZoneFromBlockNumber(self.block)
def getInteractiveProp(self):
if self.interactiveProp:

View file

@ -207,7 +207,6 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
blockNumber = self.block
dnaStore = self.air.dnaStoreMap[self.canonicalZoneId]
zoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
interiorZoneId = (zoneId - (zoneId%100)) + 500 + blockNumber
return (zoneId, interiorZoneId)
@ -274,13 +273,11 @@ class DistributedBuildingAI(DistributedObjectAI.DistributedObjectAI):
def updateSavedBy(self, savedBy):
if self.savedBy:
for (avId, name, dna) in self.savedBy:
if not ZoneUtil.isWelcomeValley(self.zoneId):
self.trophyMgr.removeTrophy(avId, self.numFloors)
self.trophyMgr.removeTrophy(avId, self.numFloors)
self.savedBy = savedBy
if self.savedBy:
for (avId, name, dna) in self.savedBy:
if not ZoneUtil.isWelcomeValley(self.zoneId):
self.trophyMgr.addTrophy(avId, name, self.numFloors)
self.trophyMgr.addTrophy(avId, name, self.numFloors)
def enterWaitForVictors(self, victorList, savedBy):
activeToons = []

View file

@ -147,7 +147,6 @@ class DistributedBuildingMgrAI:
def newHQBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = HQBuildingAI.HQBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -157,7 +156,6 @@ class DistributedBuildingMgrAI:
def newGagshopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = GagshopBuildingAI.GagshopBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -167,7 +165,6 @@ class DistributedBuildingMgrAI:
def newPetshopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = PetshopBuildingAI.PetshopBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber)
@ -177,7 +174,6 @@ class DistributedBuildingMgrAI:
def newKartShopBuilding(self, blockNumber):
dnaStore = self.air.dnaStoreMap[self.canonicalBranchId]
exteriorZoneId = dnaStore.getZoneFromBlockNumber(blockNumber)
exteriorZoneId = ZoneUtil.getTrueZoneId(exteriorZoneId, self.branchId)
interiorZoneId = (self.branchId - (self.branchId%100)) + 500 + blockNumber
building = KartShopBuildingAI.KartShopBuildingAI(
self.air, exteriorZoneId, interiorZoneId, blockNumber)

View file

@ -73,7 +73,6 @@ class BossbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))

View file

@ -69,7 +69,6 @@ class CashbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))

View file

@ -70,7 +70,7 @@ class CogHQExterior(BattlePlace.BattlePlace):
self.accept('doorDoneEvent', self.handleDoorDoneEvent)
self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
NametagGlobals.setWant2dNametags(True)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList)
how = requestStatus['how']
self.fsm.request(how, [requestStatus])

View file

@ -75,7 +75,6 @@ class FactoryExterior(BattlePlace.BattlePlace):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))
@ -95,7 +94,7 @@ class FactoryExterior(BattlePlace.BattlePlace):
self.accept('doorDoneEvent', self.handleDoorDoneEvent)
self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
NametagGlobals.setWant2dNametags(True)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList)
how = requestStatus['how']
self.fsm.request(how, [requestStatus])

View file

@ -27,7 +27,6 @@ class LawbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))

View file

@ -23,7 +23,6 @@ class SellbotHQExterior(CogHQExterior.CogHQExterior):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visZoneId = ZoneUtil.getTrueZoneId(visZoneId, self.zoneId)
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))

View file

@ -249,7 +249,7 @@ class HoodMgr(DirectObject.DirectObject):
hoodId = ZoneUtil.getCanonicalZoneId(hoodId)
return ToontownGlobals.hoodNameMap[hoodId][-1]
def addLinkTunnelHooks(self, hoodPart, nodeList, currentZoneId):
def addLinkTunnelHooks(self, hoodPart, nodeList):
tunnelOriginList = []
for i in nodeList:
linkTunnelNPC = i.findAllMatches('**/linktunnel*')
@ -261,8 +261,6 @@ class HoodMgr(DirectObject.DirectObject):
zoneStr = nameParts[2]
hoodId = self.getIdFromName(hoodStr)
zoneId = int(zoneStr)
hoodId = ZoneUtil.getTrueZoneId(hoodId, currentZoneId)
zoneId = ZoneUtil.getTrueZoneId(zoneId, currentZoneId)
linkSphere = linkTunnel.find('**/tunnel_trigger')
if linkSphere.isEmpty():
linkSphere = linkTunnel.find('**/tunnel_sphere')

View file

@ -67,7 +67,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.trophyManager = None
self.catalogManager = None
self.tutorialManager = None
self.welcomeValleyManager = None
self.newsManager = None
self.distributedDistrict = None
self.partyManager = None

View file

@ -62,7 +62,7 @@ class GSHoodAI(HoodAI.HoodAI):
racingPads.append(racingPad)
elif isinstance(dnaGroup, DNAVisGroup):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()):
(foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaGroup.at(i), zoneId, area, padType=padType)
racingPads.extend(foundRacingPads)
@ -98,7 +98,6 @@ class GSHoodAI(HoodAI.HoodAI):
viewingPadGroups = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
(foundRacingPads, foundRacingPadGroups) = self.findRacingPads(dnaData, zoneId, area, padType='racing_pad')

View file

@ -37,7 +37,7 @@ class GZHoodAI(HoodAI.HoodAI):
golfKart.generateWithRequired(zoneId)
golfKarts.append(golfKart)
elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()):
foundGolfKarts = self.findGolfKarts(dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone)
golfKarts.extend(foundGolfKarts)
@ -47,7 +47,6 @@ class GZHoodAI(HoodAI.HoodAI):
self.golfKarts = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
foundGolfKarts = self.findGolfKarts(dnaData, zoneId, area, overrideDNAZone=True)

View file

@ -92,7 +92,7 @@ class HoodAI:
fishingPonds.append(fishingPond)
elif isinstance(dnaGroup, DNAVisGroup):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()):
(foundFishingPonds, foundFishingPondGroups) = self.findFishingPonds(dnaGroup.at(i), zoneId, area)
fishingPonds.extend(foundFishingPonds)
@ -120,7 +120,6 @@ class HoodAI:
fishingPondGroups = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
(foundFishingPonds, foundFishingPondGroups) = self.findFishingPonds(dnaData, zoneId, area)
@ -149,7 +148,6 @@ class HoodAI:
self.partyGates = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
foundPartyGates = self.findPartyGates(dnaData, zoneId)
self.partyGates.extend(foundPartyGates)
@ -167,7 +165,6 @@ class HoodAI:
def createBuildingManagers(self):
for zoneId in self.getZoneTable():
dnaStore = self.air.dnaStoreMap[zoneId]
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
buildingManager = DistributedBuildingMgrAI.DistributedBuildingMgrAI(
self.air, zoneId, dnaStore, self.air.trophyMgr)
self.buildingManagers.append(buildingManager)
@ -177,7 +174,6 @@ class HoodAI:
for zoneId in self.getZoneTable():
if zoneId == self.zoneId:
continue
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
suitPlanner = DistributedSuitPlannerAI.DistributedSuitPlannerAI(self.air, zoneId)
suitPlanner.generateWithRequired(zoneId)
suitPlanner.d_setZoneId(zoneId)

View file

@ -52,7 +52,7 @@ class OZHoodAI(HoodAI.HoodAI):
picnicTable.generateWithRequired(zoneId)
picnicTables.append(picnicTable)
elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()):
foundPicnicTables = self.findPicnicTables(
dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone)
@ -63,7 +63,6 @@ class OZHoodAI(HoodAI.HoodAI):
self.picnicTables = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
foundPicnicTables = self.findPicnicTables(
@ -86,7 +85,7 @@ class OZHoodAI(HoodAI.HoodAI):
gameTable.setTableIndex(tableIndex)
gameTable.generateOtpObject(simbase.air.districtId, zoneId, ['setX', 'setY', 'setZ', 'setH', 'setP', 'setR'])
elif isinstance(dnaGroup, DNAVisGroup) and (not overrideDNAZone):
zoneId = ZoneUtil.getTrueZoneId(int(dnaGroup.getName().split(':')[0]), zoneId)
zoneId = int(dnaGroup.getName().split(':')[0])
for i in xrange(dnaGroup.getNumChildren()):
foundGameTables = self.findGameTables(
dnaGroup.at(i), zoneId, area, overrideDNAZone=overrideDNAZone)
@ -97,7 +96,6 @@ class OZHoodAI(HoodAI.HoodAI):
self.gameTables = []
for zoneId in self.getZoneTable():
dnaData = self.air.dnaDataMap.get(zoneId, None)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
if dnaData.getName() == 'root':
area = ZoneUtil.getCanonicalZoneId(zoneId)
foundGameTables = self.findGameTables(

View file

@ -205,35 +205,14 @@ class QuietZoneState(StateData.StateData):
return
def enterWaitForZoneRedirect(self):
print 'entered wait for zone redirect'
self.notify.debug('enterWaitForZoneRedirect(requestStatus=' + str(self._requestStatus) + ')')
if not self.Disable:
base.cr.handler = self.handleWaitForZoneRedirect
base.cr.handlerArgs = self._requestStatus
base.cr.setInQuietZone(True)
self.waitForDatabase('WaitForZoneRedirect')
zoneId = self._requestStatus['zoneId']
avId = self._requestStatus.get('avId', -1)
allowRedirect = self._requestStatus.get('allowRedirect', 1)
if avId != -1:
allowRedirect = 0
if not base.cr.welcomeValleyManager:
newZoneId = ZoneUtil.getCanonicalZoneId(zoneId)
if newZoneId != zoneId:
self.gotZoneRedirect(newZoneId)
return
if allowRedirect and ZoneUtil.isWelcomeValley(zoneId):
self.notify.info('Requesting AI redirect from zone %s.' % zoneId)
if base.slowQuietZone:
def rZI(task, zoneId = zoneId, self = self):
base.cr.welcomeValleyManager.requestZoneId(zoneId, self.gotZoneRedirect)
return Task.done
taskMgr.doMethodLater(base.slowQuietZoneDelay, rZI, 'slowQuietZone-welcomeValleyRedirect')
else:
base.cr.welcomeValleyManager.requestZoneId(zoneId, self.gotZoneRedirect)
else:
self.fsm.request('waitForSetZoneResponse')
self.fsm.request('waitForSetZoneResponse')
def gotZoneRedirect(self, zoneId):
self.notify.info('Redirecting to zone %s.' % zoneId)
@ -250,6 +229,7 @@ class QuietZoneState(StateData.StateData):
return
def enterWaitForSetZoneResponse(self):
print 'entered wait for set zone response - 2'
self.notify.debug('enterWaitForSetZoneResponse(requestStatus=' + str(self._requestStatus) + ')')
if not self.Disable:
messenger.send(self.getEnterWaitForSetZoneResponseMsg(), [self._requestStatus])

View file

@ -87,7 +87,7 @@ def getWhereName(zoneId, isToon):
where = 'toonInterior'
elif zoneId in tutorialDict['exteriors']:
where = 'street'
elif zoneId == ToontownCentral or zoneId == WelcomeValleyToken:
elif zoneId == ToontownCentral:
where = 'playground'
else:
zoneUtilNotify.error('No known zone: ' + str(zoneId))
@ -144,32 +144,7 @@ def getCanonicalBranchZone(zoneId):
return getBranchZone(getCanonicalZoneId(zoneId))
def isWelcomeValley(zoneId):
return zoneId == WelcomeValleyToken or zoneId >= WelcomeValleyBegin and zoneId < WelcomeValleyEnd
def getCanonicalZoneId(zoneId):
if zoneId == WelcomeValleyToken:
zoneId = ToontownCentral
elif zoneId >= WelcomeValleyBegin and zoneId < WelcomeValleyEnd:
zoneId = zoneId % 2000
if zoneId < 1000:
zoneId = zoneId + ToontownCentral
else:
zoneId = zoneId - 1000 + GoofySpeedway
return zoneId
def getTrueZoneId(zoneId, currentZoneId):
if zoneId >= WelcomeValleyBegin and zoneId < WelcomeValleyEnd or zoneId == WelcomeValleyToken:
zoneId = getCanonicalZoneId(zoneId)
if currentZoneId >= WelcomeValleyBegin and currentZoneId < WelcomeValleyEnd:
hoodId = getHoodId(zoneId)
offset = currentZoneId - currentZoneId % 2000
if hoodId == ToontownCentral:
return zoneId - ToontownCentral + offset
elif hoodId == GoofySpeedway:
return zoneId - GoofySpeedway + offset + 1000
return zoneId

View file

@ -221,7 +221,7 @@ class Playground(Place.Place):
lightsOn.start()
NametagGlobals.setWant2dNametags(True)
self.zoneId = requestStatus['zoneId']
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList, self.zoneId)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
how = requestStatus['how']
if how == 'teleportIn':
how = 'deathAck'
@ -575,7 +575,7 @@ class Playground(Place.Place):
else:
self.geom = hidden.attachNewNode(node)
self.makeDictionaries(self.loader.dnaStore)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList, self.zoneId)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList)
self.geom.flattenMedium()
gsg = base.win.getGsg()
if gsg:

View file

@ -274,7 +274,7 @@ class ShardPage(ShtikerPage.ShtikerPage):
self.currentBTL['state'] = DGG.DISABLED
self.currentBTR['state'] = DGG.DISABLED
if shardId == self.getCurrentShardId():
if shardId == base.localAvatar.defaultShard:
self.shardTeleportButton['state'] = DGG.DISABLED
if self.shardGroups is not None:
@ -459,14 +459,6 @@ class ShardPage(ShtikerPage.ShtikerPage):
zoneId = None
return zoneId
def getCurrentShardId(self):
zoneId = self.getCurrentZoneId()
if zoneId != None and ZoneUtil.isWelcomeValley(zoneId):
return ToontownGlobals.WelcomeValleyToken
else:
return base.localAvatar.defaultShard
def createSuitHead(self, suitName):
suitDNA = SuitDNA.SuitDNA()
suitDNA.newSuit(suitName)
@ -487,7 +479,6 @@ class ShardPage(ShtikerPage.ShtikerPage):
curShardTuples = base.cr.listActiveShards()
curShardTuples.sort(compareShardTuples)
currentShardId = self.getCurrentShardId()
actualShardId = base.localAvatar.defaultShard
actualShardName = None
anyChanges = 0
@ -550,7 +541,7 @@ class ShardPage(ShtikerPage.ShtikerPage):
def enter(self):
self.askForShardInfoUpdate()
self.updateScrollList()
currentShardId = self.getCurrentShardId()
currentShardId = base.localAvatar.defaultShard
buttonTuple = self.shardButtonMap.get(currentShardId)
if buttonTuple:
i = self.shardButtons.index(buttonTuple[0])
@ -581,16 +572,13 @@ class ShardPage(ShtikerPage.ShtikerPage):
def choseShard(self, shardId):
zoneId = self.getCurrentZoneId()
canonicalHoodId = ZoneUtil.getCanonicalHoodId(base.localAvatar.lastHood)
currentShardId = self.getCurrentShardId()
currentShardId = base.localAvatar.defaultShard
if self.currentGroupJoined:
self.rejectGroup(5)
return
if shardId == currentShardId:
return
elif shardId == base.localAvatar.defaultShard:
self.doneStatus = {'mode': 'teleport', 'hood': canonicalHoodId}
messenger.send(self.doneEvent)
else:
try:
place = base.cr.playGame.getPlace()

View file

@ -216,7 +216,7 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI):
self.setPathPosition(0, self.pathStartTime)
self.pathState = 1
self.currentLeg = 0
self.zoneId = ZoneUtil.getTrueZoneId(self.legList.getZoneId(0), self.branchId)
self.zoneId = self.legList.getZoneId(0)
self.legType = self.legList.getType(0)
if self.notify.getDebug():
self.notify.debug('creating suit in zone %s' % self.zoneId)
@ -236,7 +236,6 @@ class DistributedSuitAI(DistributedSuitBaseAI.DistributedSuitBaseAI):
self.currentLeg = nextLeg
self.__beginLegType(self.legList.getType(nextLeg))
zoneId = self.legList.getZoneId(nextLeg)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.branchId)
if zoneId:
self.__enterZone(zoneId)
self.notify.debug('Suit %s reached leg %s of %s in zone %s.' % (self.getDoId(),

View file

@ -79,8 +79,6 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MIN] +
self.SuitHoodInfo[self.hoodInfoIdx][self.SUIT_HOOD_INFO_MAX]) / 2
self.targetNumSuitBuildings = SuitBuildingGlobals.buildingMinMax[self.zoneId][0]
if ZoneUtil.isWelcomeValley(self.zoneId):
self.targetNumSuitBuildings = 0
self.pendingBuildingTracks = []
self.pendingBuildingHeights = []
self.suitList = []
@ -357,13 +355,9 @@ class DistributedSuitPlannerAI(DistributedObjectAI.DistributedObjectAI, SuitPlan
return False
numSuitBuildings = len(self.buildingMgr.getSuitBlocks())
if (random.random() * 100) < SuitBuildingGlobals.buildingChance[self.zoneId]:
bmax = SuitBuildingGlobals.buildingMinMax[self.zoneId][1]
if ZoneUtil.isWelcomeValley(self.zoneId):
bmax = 0
numNeeded = bmax - numSuitBuildings
return SuitBuildingGlobals.buildingMinMax[self.zoneId][1] - numSuitBuildings
else:
numNeeded = self.targetNumSuitBuildings - numSuitBuildings
return numNeeded
return self.targetNumSuitBuildings - numSuitBuildings
def newSuitShouldAttemptTakeover(self):
if not self.SUITS_ENTER_BUILDINGS:

View file

@ -3061,9 +3061,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.air.writeServerEvent('suspicious', self.doId, 'bogus cog summons')
self.sendUpdate('cogSummonsResponse', ['fail', suitIndex, 0])
return
if ZoneUtil.isWelcomeValley(self.zoneId):
self.sendUpdate('cogSummonsResponse', ['fail', suitIndex, 0])
return
returnCode = None
if type == 'single':
returnCode = self.doSummonSingleCog(suitIndex)

View file

@ -131,7 +131,6 @@ CashbotHQ = ('to', 'in', 'Cashbot HQ')
LawbotHQ = ('to', 'in', 'Lawbot HQ')
Tutorial = ('to the', 'in the', 'Toon-torial')
MyEstate = ('to', 'in', 'your house')
WelcomeValley = ('to', 'in', 'Welcome Valley')
GolfZone = ('to', 'in', lGolfZone)
PartyHood = ('to the', 'in the', lPartyHood)
Factory = 'Factory'
@ -3860,7 +3859,6 @@ QuestPosterDialogNo = 'Cancel'
ShardPageTitle = 'Districts'
ShardPageHelpIntro = 'Each District is a copy of the Toontown world.'
ShardPageHelpWhere = ' You are currently in the "%s" District.'
ShardPageHelpWelcomeValley = ' You are currently in the "Welcome Valley" District, within "%s".'
ShardPageHelpMove = ' To move to a new District, click on its name.'
ShardPagePopulationTotal = 'Total Toontown Population:\n%d'
ShardPageScrollTitle = 'Name Population'

View file

@ -179,7 +179,6 @@ HoodHierarchy = {ToontownCentral: (SillyStreet, LoopyLane, PunchlinePlace),
DaisyGardens: (ElmStreet, MapleStreet, OakStreet),
DonaldsDreamland: (LullabyLane, PajamaPlace),
GoofySpeedway: ()}
WelcomeValleyToken = 0
BossbotHQ = 10000
BossbotLobby = 10100
BossbotCountryClubIntA = 10500
@ -208,9 +207,7 @@ MyEstate = 16000
GolfZone = 17000
PartyHood = 18000
HoodsAlwaysVisited = [17000, 18000]
WelcomeValleyBegin = 22000
WelcomeValleyEnd = 61000
DynamicZonesBegin = 61000
DynamicZonesBegin = 22000
DynamicZonesEnd = 1 << 20
cogDept2index = {'c': 0,
'l': 1,

View file

@ -132,7 +132,7 @@ class Street(BattlePlace.BattlePlace):
self.accept('doorDoneEvent', self.handleDoorDoneEvent)
self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
self.enterZone(requestStatus['zoneId'])
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList, self.zoneId)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
self.fsm.request(requestStatus['how'], [requestStatus])
return

View file

@ -237,7 +237,6 @@ class TownLoader(StateData.StateData):
visGroup = dnaStore.getDNAVisGroupAI(i)
groupName = base.cr.hoodMgr.extractGroupName(groupFullName)
zoneId = int(groupName)
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
groupNode = self.geom.find('**/' + groupFullName)
if groupNode.isEmpty():
self.notify.error('Could not find visgroup')
@ -263,12 +262,10 @@ class TownLoader(StateData.StateData):
for i in xrange(numVisGroups):
groupFullName = dnaStore.getDNAVisGroupName(i)
zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
zoneId = ZoneUtil.getTrueZoneId(zoneId, self.zoneId)
for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)):
visName = dnaStore.getVisibleName(i, j)
groupName = base.cr.hoodMgr.extractGroupName(visName)
nextZoneId = int(groupName)
nextZoneId = ZoneUtil.getTrueZoneId(nextZoneId, self.zoneId)
visNode = self.zoneDict[nextZoneId]
self.nodeDict[zoneId].append(visNode)