Merge branch 'master' of gitlab.com:ToontownUnited/src

This commit is contained in:
Zach 2015-05-10 08:06:51 -05:00
commit 278294a454
14 changed files with 29 additions and 211 deletions

View file

@ -62,7 +62,7 @@ want-toontown-central #t
want-donalds-dock #t
want-daisys-garden #t
want-minnies-melodyland #t
want-the-burrrgh #t
want-the-brrrgh #t
want-donalds-dreamland #t
want-goofy-speedway #t
want-outdoor-zone #t
@ -75,11 +75,10 @@ want-butterflies #f
# Trolley minigames:
want-minigames #t
want-photo-game #f
want-travel-game #f
want-photo-game #t
# Picnic table board games:
want-game-tables #f
want-game-tables #t
# Cog headquarters:
want-cog-headquarters #t
@ -88,11 +87,6 @@ want-cashbot-headquarters #t
want-lawbot-headquarters #t
want-bossbot-headquarters #t
# Cashbot boss:
want-resistance-toonup #t
want-resistance-restock #t
want-resistance-dance #f
# Cog battles:
base-xp-multiplier 1.0
@ -110,7 +104,6 @@ want-cogbuildings #t
# Optional:
show-total-population #t
want-mat-all-tailors #t
want-long-pattern-game #f
want-talkative-tyler #f
# Developer options:
@ -122,4 +115,4 @@ smooth-lag 0.4
want-old-fireworks #t
# Live updates:
want-live-updates #t
estate-day-night #t

View file

@ -779,11 +779,7 @@ class OTPClientRepository(ClientRepositoryBase):
def _removeLocalAvFromStateServer(self):
self.sendSetAvatarIdMsg(0)
self._removeAllOV()
callback = Functor(self.loginFSM.request, self._closeShardLoginState)
if base.slowCloseShard:
taskMgr.doMethodLater(base.slowCloseShardDelay * 0.5, Functor(self.removeShardInterest, callback), 'slowCloseShard')
else:
self.removeShardInterest(callback)
self.removeShardInterest(Functor(self.loginFSM.request, self._closeShardLoginState))
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def _removeAllOV(self):
@ -804,16 +800,7 @@ class OTPClientRepository(ClientRepositoryBase):
self.cleanGameExit = True
self.cache.flush()
self.doDataCache.flush()
if base.slowCloseShard:
taskMgr.doMethodLater(base.slowCloseShardDelay * 0.5, Functor(self._callRemoveShardInterestCallback, callback), 'slowCloseShardCallback')
else:
self._callRemoveShardInterestCallback(callback, None)
return
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def _callRemoveShardInterestCallback(self, callback, task):
callback()
return Task.done
@report(types=['args', 'deltaStamp'], dConfigParam='teleport')
def _removeCurrentShardInterest(self, callback):

View file

@ -1,29 +1,17 @@
import math
import re
import time
import OTPGlobals
import OTPRender
from direct.showbase.ShowBase import ShowBase
from otp.ai.MagicWordGlobal import *
from pandac.PandaModules import Camera, TPLow, VBase4, ColorWriteAttrib, Filename, getModelPath, NodePath, Vec4
import OTPGlobals, OTPRender, math
class OTPBase(ShowBase):
def __init__(self, windowType = None):
self.wantEnviroDR = False
ShowBase.__init__(self, windowType=windowType)
if config.GetBool('want-phase-checker', 0):
from direct.showbase import Loader
Loader.phaseChecker = self.loaderPhaseChecker
self.errorAccumulatorBuffer = ''
taskMgr.add(self.delayedErrorCheck, 'delayedErrorCheck', priority=10000)
self.idTags = config.GetBool('want-id-tags', 0)
if not self.idTags:
del self.idTags
self.wantNametags = self.config.GetBool('want-nametags', 1)
self.slowCloseShard = self.config.GetBool('slow-close-shard', 0)
self.slowCloseShardDelay = self.config.GetFloat('slow-close-shard-delay', 10.0)
self.fillShardsToIdealPop = self.config.GetBool('fill-shards-to-ideal-pop', 1)
self.wantDynamicShadows = 1
self.stereoEnabled = False
@ -31,8 +19,6 @@ class OTPBase(ShowBase):
self.enviroCam = None
self.pixelZoomSetup = False
self.gameOptionsCode = ''
self.locationCode = ''
self.locationCodeChanged = time.time()
if base.cam:
if self.wantEnviroDR:
base.cam.node().setCameraMask(OTPRender.MainCameraBitmask)
@ -177,47 +163,6 @@ class OTPBase(ShowBase):
def getShardPopLimits(self):
return (100, 200, -1)
def setLocationCode(self, locationCode):
if locationCode != self.locationCode:
self.locationCode = locationCode
self.locationCodeChanged = time.time()
def delayedErrorCheck(self, task):
if self.errorAccumulatorBuffer:
buffer = self.errorAccumulatorBuffer
self.errorAccumulatorBuffer = ''
self.notify.error('\nAccumulated Phase Errors!:\n %s' % buffer)
return task.cont
def loaderPhaseChecker(self, path, loaderOptions):
if 'audio/' in path:
return 1
file = Filename(path)
if not file.getExtension():
file.setExtension('bam')
mp = getModelPath()
path = mp.findFile(file).cStr()
if not path:
return
match = re.match('.*phase_([^/]+)/', path)
if not match:
if 'dmodels' in path:
return
else:
self.errorAccumulatorBuffer += 'file not in phase (%s, %s)\n' % (file, path)
return
basePhase = float(match.groups()[0])
model = loader.loader.loadSync(Filename(path), loaderOptions)
if model:
model = NodePath(model)
for tex in model.findAllTextures():
texPath = tex.getFullpath().cStr()
match = re.match('.*phase_([^/]+)/', texPath)
if match:
texPhase = float(match.groups()[0])
if texPhase > basePhase:
self.errorAccumulatorBuffer += 'texture phase is higher than the models (%s, %s)\n' % (path, texPath)
def getRepository(self):
return self.cr
@ -331,4 +276,4 @@ def backgroundColor(r=None, g=1, b=1, a=1):
if r is None:
r, g, b, a = OTPGlobals.DefaultBackgroundColor
base.setBackgroundColor(Vec4(r, g, b, a))
return 'The background color has been changed.'
return 'The background color has been changed.'

View file

@ -10,8 +10,8 @@ import types
class SCMenu(SCObject, NodePath):
config = getConfigShowbase()
SpeedChatRolloverTolerance = config.GetFloat('speedchat-rollover-tolerance', 0.08)
WantFade = config.GetBool('want-speedchat-fade', 0)
FadeDuration = config.GetFloat('speedchat-fade-duration', 0.2)
WantFade = config.GetBool('want-speedchat-fade', 1)
FadeDuration = config.GetFloat('speedchat-fade-duration', 0.4)
SerialNum = 0
BackgroundModelName = None
GuiModelName = None
@ -163,7 +163,7 @@ class SCMenu(SCObject, NodePath):
else:
self.stopFade()
self.fadeIval = LerpFunctionInterval(self.fadeFunc, fromData=0.0, toData=1.0, duration=SCMenu.FadeDuration)
self.fadeIval.play()
self.fadeIval.start()
if parentMenu is not None:
parentMenu.childHasFaded = 1
return

View file

@ -86,7 +86,6 @@ class ToontownAIRepository(ToontownInternalRepository):
self.wantEmblems = self.config.GetBool('want-emblems', True)
self.wantCogbuildings = self.config.GetBool('want-cogbuildings', True)
self.wantCogdominiums = self.config.GetBool('want-cogdominiums', True)
self.doLiveUpdates = self.config.GetBool('want-live-updates', False)
self.wantTrackClsends = self.config.GetBool('want-track-clsends', False)
self.wantGloveNpc = self.config.GetBool('want-glove-npc', True)
self.baseXpMultiplier = self.config.GetFloat('base-xp-multiplier', 1.0)
@ -155,7 +154,7 @@ class ToontownAIRepository(ToontownInternalRepository):
self.hoods.append(DGHoodAI.DGHoodAI(self))
if self.config.GetBool('want-minnies-melodyland', True):
self.hoods.append(MMHoodAI.MMHoodAI(self))
if self.config.GetBool('want-the-burrrgh', True):
if self.config.GetBool('want-the-brrrgh', True):
self.hoods.append(BRHoodAI.BRHoodAI(self))
if self.config.GetBool('want-donalds-dreamland', True):
self.hoods.append(DLHoodAI.DLHoodAI(self))

View file

@ -19,20 +19,7 @@ EFFECT_RADIUS = 30
RESISTANCE_TOONUP = 0
RESISTANCE_RESTOCK = 1
RESISTANCE_MONEY = 2
RESISTANCE_DANCE = 3
allowedResistanceMessages = []
if config.GetBool('want-resistance-toonup', True):
allowedResistanceMessages.append(RESISTANCE_TOONUP)
if config.GetBool('want-resistance-restock', True):
allowedResistanceMessages.append(RESISTANCE_RESTOCK)
if config.GetBool('want-resistance-money', True):
allowedResistanceMessages.append(RESISTANCE_MONEY)
if config.GetBool('want-resistance-dance', True):
allowedResistanceMessages.append(RESISTANCE_DANCE)
resistanceMenu = [
RESISTANCE_TOONUP, RESISTANCE_RESTOCK, RESISTANCE_MONEY,
RESISTANCE_DANCE
]
resistanceMenu = [RESISTANCE_TOONUP, RESISTANCE_RESTOCK, RESISTANCE_MONEY]
resistanceDict = {
RESISTANCE_TOONUP: {
'menuName': TTLocalizer.ResistanceToonupMenu,
@ -73,13 +60,6 @@ resistanceDict = {
TTLocalizer.MovieNPCSOSAll
],
'items': [0, 1, 2, 3, 4, 5, 6, 7]
},
RESISTANCE_DANCE: {
'menuName': TTLocalizer.ResistanceDanceMenu,
'itemText': TTLocalizer.ResistanceDanceItem,
'chatText': TTLocalizer.ResistanceDanceChat,
'values': ['Dance'],
'items': [0]
}
}
@ -139,7 +119,7 @@ def getItemValue(textId):
def getRandomId():
menuIndex = random.choice(allowedResistanceMessages)
menuIndex = random.choice(resistanceMenu)
itemIndex = random.choice(getItems(menuIndex))
return encodeId(menuIndex, itemIndex)
@ -197,13 +177,6 @@ def doEffect(textId, speakingToon, nearbyToons):
p = effect.getParticlesNamed(name)
p.renderer.setFromNode(icon)
fadeColor = VBase4(0, 0, 1, 1)
elif menuIndex == RESISTANCE_DANCE:
effect = BattleParticles.loadParticleFile('resistanceEffectSparkle.ptf')
fadeColor = VBase4(1, 0.5, 1, 1)
for toonId in nearbyToons:
toon = base.cr.doId2do.get(toonId)
if toon and (not toon.ghostMode):
toon.setAnimState('victory')
else:
return
recolorToons = Parallel()

View file

@ -132,18 +132,6 @@ class FireworkShowMixin:
if self.fireworkShow and not self.fireworkShow.isEmpty():
self.fireworkShow.setColorScaleOff(0)
return
# Election Only
self.electionFloor = base.render.find('**/ShowFloor')
self.slappyBalloon = base.render.find('**/airballoon.egg')
if self.__checkHoodValidity() and hasattr(base.cr.playGame, 'hood') and base.cr.playGame.hood and hasattr(base.cr.playGame.hood, 'sky') and base.cr.playGame.hood.sky:
# Election Only
hood = self.getHood()
if hood.id == ToontownCentral:
preShow = Sequence(Func(base.localAvatar.setSystemMessage, 0, startMessage), Parallel(LerpColorScaleInterval(base.cr.playGame.hood.sky, 2.5, Vec4(0.0, 0.0, 0.0, 1.0)), LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 2.5, Vec4(0.25, 0.25, 0.35, 1)), LerpColorScaleInterval(self.electionFloor, 2.5, Vec4(0.25, 0.25, 0.35, 1)), LerpColorScaleInterval(self.slappyBalloon, 2.5, Vec4(0.55, 0.55, 0.65, 1)), LerpColorScaleInterval(base.localAvatar, 2.5, Vec4(0.85, 0.85, 0.85, 1)), Func(__lightDecorationOn__)), Func(base.setBackgroundColor, Vec4(0, 0, 0, 1)), Func(self.__checkDDFog), Func(base.camLens.setFar, 1000.0), Func(base.cr.playGame.hood.sky.hide), Func(base.localAvatar.setSystemMessage, 0, instructionMessage), Func(self.getLoader().music.stop), Wait(2.0), Func(base.playMusic, self.showMusic, 0, 1, 0.8, max(0, startT)))
else:
preShow = Sequence(Func(base.localAvatar.setSystemMessage, 0, startMessage), Parallel(LerpColorScaleInterval(base.cr.playGame.hood.sky, 2.5, Vec4(0.0, 0.0, 0.0, 1.0)), LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 2.5, Vec4(0.25, 0.25, 0.35, 1)), LerpColorScaleInterval(base.localAvatar, 2.5, Vec4(0.85, 0.85, 0.85, 1)), Func(__lightDecorationOn__)), Func(base.setBackgroundColor, Vec4(0, 0, 0, 1)), Func(self.__checkDDFog), Func(base.camLens.setFar, 1000.0), Func(base.cr.playGame.hood.sky.hide), Func(base.localAvatar.setSystemMessage, 0, instructionMessage), Func(self.getLoader().music.stop), Wait(2.0), Func(base.playMusic, self.showMusic, 0, 1, 0.8, max(0, startT)))
#preShow = Sequence(Func(base.localAvatar.setSystemMessage, 0, startMessage), Parallel(LerpColorScaleInterval(base.cr.playGame.hood.sky, 2.5, Vec4(0.0, 0.0, 0.0, 1.0)), LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 2.5, Vec4(0.25, 0.25, 0.35, 1)), LerpColorScaleInterval(base.localAvatar, 2.5, Vec4(0.85, 0.85, 0.85, 1)), Func(__lightDecorationOn__)), Func(base.setBackgroundColor, Vec4(0, 0, 0, 1)), Func(self.__checkDDFog), Func(base.camLens.setFar, 1000.0), Func(base.cr.playGame.hood.sky.hide), Func(base.localAvatar.setSystemMessage, 0, instructionMessage), Func(self.getLoader().music.stop), Wait(2.0), Func(base.playMusic, self.showMusic, 0, 1, 0.8, max(0, startT)))
return preShow
return None
def restoreCameraLens(self):

View file

@ -47,19 +47,6 @@ class EstateLoader(SafeZoneLoader.SafeZoneLoader):
self.submergeSound = base.loadSfx('phase_5.5/audio/sfx/AV_jump_in_water.ogg')
self.birdSound = map(base.loadSfx, ['phase_4/audio/sfx/SZ_TC_bird1.ogg', 'phase_4/audio/sfx/SZ_TC_bird2.ogg', 'phase_4/audio/sfx/SZ_TC_bird3.ogg'])
self.cricketSound = map(base.loadSfx, ['phase_4/audio/sfx/SZ_TC_bird1.ogg', 'phase_4/audio/sfx/SZ_TC_bird2.ogg', 'phase_4/audio/sfx/SZ_TC_bird3.ogg'])
if base.goonsEnabled:
invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons')
self.invModels = []
from toontown.toonbase import ToontownBattleGlobals
for track in xrange(len(ToontownBattleGlobals.AvPropsNew)):
itemList = []
for item in xrange(len(ToontownBattleGlobals.AvPropsNew[track])):
itemList.append(invModel.find('**/' + ToontownBattleGlobals.AvPropsNew[track][item]))
self.invModels.append(itemList)
invModel.removeNode()
del invModel
def unload(self):
self.ignoreAll()

View file

@ -103,11 +103,11 @@ PROP_SNOWFLAKE = 2
FURNITURE_MODE_OFF = 0
FURNITURE_MODE_STOP = 1
FURNITURE_MODE_START = 2
DAY_NIGHT_PERIOD = 2700
DAY_PERIOD = 2100
NIGHT_PERIOD = 600
HALF_DAY_PERIOD = 1050
HALF_NIGHT_PERIOD = 300
DAY_NIGHT_PERIOD = 270
DAY_PERIOD = 210
NIGHT_PERIOD = 60
HALF_DAY_PERIOD = 105
HALF_NIGHT_PERIOD = 30
FIREWORKS_MOVIE_CLEAR = 0
FIREWORKS_MOVIE_GUI = 1

View file

@ -1,17 +1,9 @@
import MinigameGlobals
if config.GetBool('want-long-pattern-game', False):
INITIAL_ROUND_LENGTH = 1
ROUND_LENGTH_INCREMENT = 1
NUM_ROUNDS = 100
InputTime = 120
else:
INITIAL_ROUND_LENGTH = 2
ROUND_LENGTH_INCREMENT = 2
NUM_ROUNDS = 4
InputTime = 10
INITIAL_ROUND_LENGTH = 2
ROUND_LENGTH_INCREMENT = 2
NUM_ROUNDS = 4
InputTime = 10
TOONTOWN_WORK = 1
ClientsReadyTimeout = 5 + MinigameGlobals.latencyTolerance
InputTimeout = InputTime + MinigameGlobals.latencyTolerance
InputTimeout = InputTime + MinigameGlobals.latencyTolerance

View file

@ -2166,11 +2166,10 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def setCatalogSchedule(self, currentWeek, nextTime):
self.catalogScheduleCurrentWeek = currentWeek
self.catalogScheduleNextTime = nextTime
if self.air.doLiveUpdates:
taskName = self.uniqueName('next-catalog')
taskMgr.remove(taskName)
duration = max(10.0, nextTime * 60 - time.time())
taskMgr.doMethodLater(duration, self.__deliverCatalog, taskName)
taskName = self.uniqueName('next-catalog')
taskMgr.remove(taskName)
duration = max(10.0, nextTime * 60 - time.time())
taskMgr.doMethodLater(duration, self.__deliverCatalog, taskName)
def getCatalogSchedule(self):
return (self.catalogScheduleCurrentWeek, self.catalogScheduleNextTime)
@ -2232,7 +2231,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
self.onGiftOrder = CatalogItemList.CatalogItemList(onGiftOrder, store=CatalogItem.Customization | CatalogItem.DeliveryDate)
if not hasattr(self, 'air') or self.air == None:
return
if doUpdateLater and self.air.doLiveUpdates and hasattr(self, 'name'):
if doUpdateLater and hasattr(self, 'name'):
taskName = 'next-bothDelivery-%s' % self.doId
now = int(time.time() / 60 + 0.5)
nextItem = None
@ -3945,7 +3944,7 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
def setAwardSchedule(self, onAwardOrder, doUpdateLater = True):
self.onAwardOrder = CatalogItemList.CatalogItemList(onAwardOrder, store=CatalogItem.Customization | CatalogItem.DeliveryDate)
if hasattr(self, 'name'):
if doUpdateLater and self.air.doLiveUpdates and hasattr(self, 'air'):
if doUpdateLater and hasattr(self, 'air'):
taskName = self.uniqueName('next-award-delivery')
taskMgr.remove(taskName)
now = int(time.time() / 60 + 0.5)
@ -4915,19 +4914,6 @@ def dna(part, value):
invoker.b_setDNAString(dna.makeNetString())
return 'Laughing Man set to: ' + str(dna.laughingMan)
if part == 'save':
backup = simbase.backups.load('toon', (invoker.doId,), default={})
backup.setdefault('dna', {})[value] = invoker.getDNAString()
simbase.backups.save('toon', (invoker.doId,), backup)
return 'Saved a DNA backup for %s under the name: %s' % (invoker.getName(), value)
if part == 'restore':
backup = simbase.backups.load('toon', (invoker.doId,), default={})
if value not in backup.get('dna', {}):
return "Couldn't find a DNA backup for %s under the name: %s" % (invoker.getName(), value)
invoker.b_setDNAString(backup['dna'][value])
return 'Restored a DNA backup for %s under the name: %s' % (invoker.getName(), value)
if part == 'show':
return dna.asTuple()
return 'Invalid part: ' + part

View file

@ -70,15 +70,12 @@ NPC_SMART = 13
NPC_GLOVE = 14
CLERK_COUNTDOWN_TIME = 120
TAILOR_COUNTDOWN_TIME = 300
RTDNAFile = '/RTDNAFile.txt'
saveDNA = False
def getRandomDNA(seed, gender):
randomDNA = ToonDNA.ToonDNA()
randomDNA.newToonRandom(seed, gender, 1)
return randomDNA.asTuple()
def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
import DistributedNPCToonAI
import DistributedNPCClerkAI
@ -130,31 +127,6 @@ def createNPC(air, npcId, desc, zoneId, posIndex = 0, questCallback = None):
dnaList = getRandomDNA(npcId, gender)
else:
dnaList = dnaType
if saveDNA:
strList = []
strList.append('\n\nNPC Id: ')
strList.append(str(npcId))
strList.append('\nDNA: ')
count = 0
strList.append('(')
for item in dnaList:
if count < 4:
strList.append('"' + str(item) + '"')
else:
strList.append(str(item))
count += 1
strList.append(' ,')
strList.append(')')
rtDNA = ''.join(strList)
if os.path.isfile(RTDNAFile):
rtDnaFile = open(RTDNAFile, 'r+')
rtDnaFile.seek(0, 2)
rtDnaFile.writelines(rtDNA)
else:
rtDnaFile = open(RTDNAFile, 'w')
rtDnaFile.writelines(rtDNA)
rtDnaFile.close()
dna.newToonFromProperties(*dnaList)
npc.setDNAString(dna.makeNetString())
npc.setHp(15)

View file

@ -7714,9 +7714,6 @@ ResistanceToonupMenu = 'Toon-up'
ResistanceToonupItem = '%s Toon-up'
ResistanceToonupItemMax = 'Max'
ResistanceToonupChat = 'Toons of the World, Toon-up!'
ResistanceDanceMenu = 'Dance'
ResistanceDanceItem = 'Make them %s'
ResistanceDanceChat = 'Toons of the World, Dance with me!'
ResistanceRestockMenu = 'Gag-up'
ResistanceRestockItem = 'Gag-up %s'
ResistanceRestockItemAll = 'All'

View file

@ -204,7 +204,6 @@ class ToonBase(OTPBase.OTPBase):
self.dayNightEnabled = self.config.GetBool('estate-day-night', 0)
self.cloudPlatformsEnabled = self.config.GetBool('estate-clouds', 0)
self.greySpacing = self.config.GetBool('allow-greyspacing', 0)
self.goonsEnabled = self.config.GetBool('estate-goon', 0)
self.slowQuietZone = self.config.GetBool('slow-quiet-zone', 0)
self.slowQuietZoneDelay = self.config.GetFloat('slow-quiet-zone-delay', 5)
self.killInterestResponse = self.config.GetBool('kill-interest-response', 0)