Decorations should only be used on their correct holidays pls.

This commit is contained in:
Loudrob 2015-05-16 14:34:31 -04:00
parent a03c70c0e6
commit c1e1f5164a
9 changed files with 107 additions and 42 deletions

View file

@ -3214,6 +3214,8 @@ dclass DistributedPartyManager : DistributedObject {
updateToPublicPartyCountUdToAllAi(uint32 partyCount, uint64 partyId) airecv;
requestShardIdZoneIdForHostId(uint32) clsend airecv;
sendShardIdZoneIdToAvatar(uint32, uint32);
partyManagerUdStartingUp() airecv;
partyManagerUdLost() airecv;
updateAllPartyInfoToUd(uint32, uint64, uint32, uint32, uint8, uint8, string, uint8 [], uint64);
forceCheckStart();
requestMw(uint32, string, uint32, uint32);

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import *
hashVal = 3860069384L
hashVal = 4040865593L
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

View file

@ -1,13 +1,21 @@
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObjectAI import DistributedObjectAI
from PartyGlobals import *
import DistributedPartyCannonAI, DistributedPartyCannonActivityAI, DistributedPartyCatchActivityAI, DistributedPartyCogActivityAI, DistributedPartyDanceActivityAI
import DistributedPartyDance20ActivityAI, DistributedPartyFireworksActivityAI, DistributedPartyJukeboxActivityAI, DistributedPartyJukebox40ActivityAI
import DistributedPartyTrampolineActivityAI, DistributedPartyTugOfWarActivityAI, DistributedPartyValentineDanceActivityAI
import DistributedPartyValentineDance20ActivityAI, DistributedPartyValentineJukeboxActivityAI, DistributedPartyValentineJukebox40ActivityAI
import DistributedPartyValentineTrampolineActivityAI, DistributedPartyVictoryTrampolineActivityAI, DistributedPartyWinterCatchActivityAI
import DistributedPartyWinterCogActivityAI, DistributedPartyWinterTrampolineActivityAI
import PartyUtils, time
import PartyUtils
import time
# ugh all these activities
from toontown.parties.DistributedPartyJukeboxActivityAI import DistributedPartyJukeboxActivityAI
from toontown.parties.DistributedPartyDanceActivityAI import DistributedPartyDanceActivityAI
from toontown.parties.DistributedPartyJukebox40ActivityAI import DistributedPartyJukebox40ActivityAI
from toontown.parties.DistributedPartyDance20ActivityAI import DistributedPartyDance20ActivityAI
from toontown.parties.DistributedPartyCogActivityAI import DistributedPartyCogActivityAI
from toontown.parties.DistributedPartyTrampolineActivityAI import DistributedPartyTrampolineActivityAI
from toontown.parties.DistributedPartyVictoryTrampolineActivityAI import DistributedPartyVictoryTrampolineActivityAI
from toontown.parties.DistributedPartyCatchActivityAI import DistributedPartyCatchActivityAI
from toontown.parties.DistributedPartyTugOfWarActivityAI import DistributedPartyTugOfWarActivityAI
from toontown.parties.DistributedPartyCannonActivityAI import DistributedPartyCannonActivityAI
from toontown.parties.DistributedPartyCannonAI import DistributedPartyCannonAI
from toontown.parties.DistributedPartyFireworksActivityAI import DistributedPartyFireworksActivityAI
"""
dclass DistributedParty : DistributedObject {
@ -51,23 +59,16 @@ class DistributedPartyAI(DistributedObjectAI):
DistributedObjectAI.generate(self)
# make stuff
actId2Class = {
ActivityIds.PartyCatch: DistributedPartyCatchActivityAI.DistributedPartyCatchActivityAI,
ActivityIds.PartyCog: DistributedPartyCogActivityAI.DistributedPartyCogActivityAI,
ActivityIds.PartyDance: DistributedPartyDanceActivityAI.DistributedPartyDanceActivityAI,
ActivityIds.PartyDance20: DistributedPartyDance20ActivityAI.DistributedPartyDance20ActivityAI,
ActivityIds.PartyFireworks: DistributedPartyFireworksActivityAI.DistributedPartyFireworksActivityAI,
ActivityIds.PartyJukebox: DistributedPartyJukeboxActivityAI.DistributedPartyJukeboxActivityAI,
ActivityIds.PartyJukebox40: DistributedPartyJukebox40ActivityAI.DistributedPartyJukebox40ActivityAI,
ActivityIds.PartyTrampoline: DistributedPartyTrampolineActivityAI.DistributedPartyTrampolineActivityAI,
ActivityIds.PartyTugOfWar: DistributedPartyTugOfWarActivityAI.DistributedPartyTugOfWarActivityAI,
ActivityIds.PartyValentineDance: DistributedPartyValentineDanceActivityAI.DistributedPartyValentineDanceActivityAI,
ActivityIds.PartyValentineDance20: DistributedPartyValentineDance20ActivityAI.DistributedPartyValentineDance20ActivityAI,
ActivityIds.PartyValentineJukebox: DistributedPartyValentineJukeboxActivityAI.DistributedPartyValentineJukeboxActivityAI,
ActivityIds.PartyValentineJukebox40: DistributedPartyValentineJukebox40ActivityAI.DistributedPartyValentineJukebox40ActivityAI,
ActivityIds.PartyValentineTrampoline: DistributedPartyValentineTrampolineActivityAI.DistributedPartyValentineTrampolineActivityAI,
ActivityIds.PartyVictoryTrampoline: DistributedPartyVictoryTrampolineActivityAI.DistributedPartyVictoryTrampolineActivityAI,
ActivityIds.PartyWinterCatch: DistributedPartyWinterCatchActivityAI.DistributedPartyWinterCatchActivityAI,
ActivityIds.PartyWinterCog: DistributedPartyWinterCogActivityAI.DistributedPartyWinterCogActivityAI
ActivityIds.PartyJukebox: DistributedPartyJukeboxActivityAI,
ActivityIds.PartyTrampoline: DistributedPartyTrampolineActivityAI,
ActivityIds.PartyVictoryTrampoline: DistributedPartyVictoryTrampolineActivityAI,
ActivityIds.PartyCatch: DistributedPartyCatchActivityAI,
ActivityIds.PartyDance: DistributedPartyDanceActivityAI,
ActivityIds.PartyTugOfWar: DistributedPartyTugOfWarActivityAI,
ActivityIds.PartyFireworks: DistributedPartyFireworksActivityAI,
ActivityIds.PartyJukebox40: DistributedPartyJukebox40ActivityAI,
ActivityIds.PartyDance20: DistributedPartyDance20ActivityAI,
ActivityIds.PartyCog: DistributedPartyCogActivityAI,
}
for activity in self.info['activities']:
actId = activity[0]
@ -77,9 +78,9 @@ class DistributedPartyAI(DistributedObjectAI):
self.activities.append(act)
elif actId == ActivityIds.PartyCannon:
if not self.cannonActivity:
self.cannonActivity = DistributedPartyCannonActivityAI.DistributedPartyCannonActivityAI(self.air, self.doId, activity)
self.cannonActivity = DistributedPartyCannonActivityAI(self.air, self.doId, activity)
self.cannonActivity.generateWithRequired(self.zoneId)
act = DistributedPartyCannonAI.DistributedPartyCannonAI(self.air)
act = DistributedPartyCannonAI(self.air)
act.setActivityDoId(self.cannonActivity.doId)
x, y, h = activity[1:] # ignore activity ID
x = PartyUtils.convertDistanceFromPartyGrid(x, 0)

View file

@ -166,7 +166,14 @@ class GlobalPartyManagerUD(DistributedObjectGlobalUD):
self.__updatePartyCount(partyId)
def partyManagerAIHello(self, channel):
# Upon AI boot, DistributedPartyManagerAIs are supposed to say hello.
# They send along the DPMAI's doId as well, so that I can talk to them later.
print 'AI with base channel %s, will send replies to DPM %s' % (simbase.air.getAvatarIdFromSender(), channel)
self.senders2Mgrs[simbase.air.getAvatarIdFromSender()] = channel
self.sendToAI('partyManagerUdStartingUp', [])
# In addition, set up a postRemove where we inform this AI that the UD has died
self.air.addPostRemove(self._makeAIMsg('partyManagerUdLost', [], channel))
def addParty(self, avId, partyId, start, end, isPrivate, inviteTheme, activities, decorations, inviteeIds):
PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'

View file

@ -110,9 +110,24 @@ PartyEditorActivityOrder = [ ActivityIds.PartyClock,
ActivityIds.PartyCog,
ActivityIds.PartyWinterCog,
ActivityIds.PartyFireworks]
MutuallyExclusiveActivities = ((ActivityIds.PartyJukebox, ActivityIds.PartyJukebox40, ActivityIds.PartyValentineJukebox, ActivityIds.PartyValentineJukebox40),
MutuallyExclusiveActivities = ((ActivityIds.PartyJukebox, ActivityIds.PartyJukebox40),
(ActivityIds.PartyValentineJukebox, ActivityIds.PartyValentineJukebox40),
(ActivityIds.PartyDance, ActivityIds.PartyDance20),
(ActivityIds.PartyValentineDance, ActivityIds.PartyValentineDance20))
VictoryPartyActivityIds = frozenset([ActivityIds.PartyVictoryTrampoline])
VictoryPartyReplacementActivityIds = frozenset([ActivityIds.PartyTrampoline])
WinterPartyActivityIds = frozenset([ActivityIds.PartyWinterCatch, ActivityIds.PartyWinterTrampoline, ActivityIds.PartyWinterCog])
WinterPartyReplacementActivityIds = frozenset([ActivityIds.PartyCatch, ActivityIds.PartyTrampoline, ActivityIds.PartyCog])
ValentinePartyActivityIds = frozenset([ActivityIds.PartyValentineDance,
ActivityIds.PartyValentineDance20,
ActivityIds.PartyValentineJukebox,
ActivityIds.PartyValentineJukebox40,
ActivityIds.PartyValentineTrampoline])
ValentinePartyReplacementActivityIds = frozenset([ActivityIds.PartyDance,
ActivityIds.PartyDance20,
ActivityIds.PartyJukebox,
ActivityIds.PartyJukebox40,
ActivityIds.PartyTrampoline])
DecorationIds = PythonUtil.Enum(('BalloonAnvil',
'BalloonStage',
'Bow',
@ -141,6 +156,21 @@ DecorationIds = PythonUtil.Enum(('BalloonAnvil',
'BalloonAnvilValentine'))
DECORATION_VOLUME = 1.0
DECORATION_CUTOFF = 45
VictoryPartyDecorationIds = frozenset([DecorationIds.BannerVictory,
DecorationIds.CannonVictory,
DecorationIds.CogStatueVictory,
DecorationIds.TubeCogVictory])
WinterPartyDecorationIds = frozenset([DecorationIds.cogIceCreamWinter,
DecorationIds.StageWinter,
DecorationIds.CogStatueWinter,
DecorationIds.snowman,
DecorationIds.snowDoodle])
VictoryPartyReplacementDecorationIds = frozenset([DecorationIds.BannerJellyBean])
ValentinePartyDecorationIds = frozenset([DecorationIds.BalloonAnvilValentine,
DecorationIds.HeartBanner,
DecorationIds.HeartTarget,
DecorationIds.FlyingHeart])
ValentinePartyReplacementDecorationIds = frozenset([DecorationIds.BalloonAnvil, DecorationIds.BannerJellyBean])
GoToPartyStatus = PythonUtil.Enum(('AllowedToGo',
'PartyFull',
'PrivateParty',

View file

@ -3598,36 +3598,40 @@ PartyDecorationNameDict = {0: {'editor': 'Balloon Anvil',
9: {'editor': 'Pinwheel',
'description': 'Colorful twirling for everyone!'},
10: {'editor': 'Gag Globe',
'description': 'Gag and star globe'},
'description': 'Gag and star globe designed by Olivea'},
11: {'editor': 'Bean Banner',
'description': 'A Jellybean banner'},
'description': 'A Jellybean banner designed by Cassidy'},
12: {'editor': 'Gag Cake',
'description': 'A Topsy Turvy gag cake'},
'description': 'A Topsy Turvy gag cake designed by Felicia'},
13: {'editor': "Cupid's Heart",
'description': 'Ready...Aim...\nValenToons!'},
14: {'editor': 'Candy Hearts\n Banner',
'description': "Who doesn't love candy hearts?"},
15: {'editor': 'Flying Heart',
'description': 'This heart is getting carried away!'},
16: {'editor': 'Victory Banner',
16: {'editor': 'Victory Bandstand',
'description': 'All our new friends are ready to dance!'},
17: {'editor': 'Victory Banner',
'description': 'Not just a normal banner!'},
17: {'editor': 'Confetti Cannons',
18: {'editor': 'Confetti Cannons',
'description': 'BOOM! Confetti! Fun!'},
18: {'editor': 'Cog & Doodle',
19: {'editor': 'Cog & Doodle',
'description': "Ouch! That's gotta hurt."},
19: {'editor': 'Cog Flappy Man',
20: {'editor': 'Cog Flappy Man',
'description': 'A Cog full of hot air, what a shock!'},
20: {'editor': 'CogCicle',
21: {'editor': 'Cog Ice Cream',
'description': 'A Cog looking his best.'},
22: {'editor': 'CogCicle',
'description': 'A Cog looking his holiday best.'},
21: {'editor': 'Holiday Bandstand',
23: {'editor': 'Holiday Bandstand',
'description': 'Everyone loves a Holiday Party!'},
22: {'editor': 'Chilly Cog',
24: {'editor': 'Chilly Cog',
'description': "Ouch! That's gotta hurt."},
23: {'editor': 'Snowman',
25: {'editor': 'Snowman',
'description': "So cool, he's hot!"},
24: {'editor': 'SnowDoodle',
26: {'editor': 'SnowDoodle',
'description': 'His only trick is being cold!'},
25: {'editor': 'ValenToons Anvil',
27: {'editor': 'ValenToons Anvil',
'description': "We've got your heart on a string!"}}
ActivityLabel = 'Cost - Activity Name'
PartyDoYouWantToPlan = 'Would you like to plan a new party right now?'

View file

@ -21,10 +21,17 @@ class DistributedPartyManagerAI(DistributedObjectAI):
self.id2Party = {}
self.pubPartyInfo = {}
self.idPool = range(self.air.ourChannel, self.air.ourChannel + 100000)
# get 100 ids at the start and top up
#taskMgr.doMethodLater(0, self.__getIds, 'DistributedPartyManagerAI___getIds')
def receiveId(self, ids):
self.idPool += ids
# def __getIds(self, task):
# if len(self.idPool) < 50:
# self.air.globalPartyMgr.allocIds(100 - len(self.idPool))
# taskMgr.doMethodLater(180, self.__getIds, 'DistributedPartyManagerAI___getIds')
def _makePartyDict(self, struct):
PARTY_TIME_FORMAT = '%Y-%m-%d %H:%M:%S'
party = {}
@ -41,6 +48,15 @@ class DistributedPartyManagerAI(DistributedObjectAI):
# struct[16] = partystatus
return party
# Management stuff
def partyManagerUdStartingUp(self):
# This is sent in reply to the GPMAI's hello
self.notify.info("uberdog has said hello")
def partyManagerUdLost(self):
# well fuck. ud died.
self.notify.warning("uberdog lost!")
def addPartyRequest(self, hostId, startTime, endTime, isPrivate, inviteTheme, activities, decorations, inviteeIds):
if hostId != simbase.air.getAvatarIdFromSender():
self.air.writeServerEvent('suspicious',simbase.air.getAvatarIdFromSender(),'Toon tried to create a party as someone else!')

View file

@ -7,6 +7,8 @@ class DistributedPartyManagerUD(DistributedObjectUD):
def announceGenerate(self):
DistributedObjectUD.announceGenerate(self)
self.sendUpdate('partyManagerUdStartingUp') # Shouldn't have to send to anyone special, as the field is airecv
def addParty(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6, todo7, todo8, todo9):
pass
@ -112,6 +114,9 @@ class DistributedPartyManagerUD(DistributedObjectUD):
def sendShardIdZoneIdToAvatar(self, shardId, zoneId):
pass
def partyManagerUdStartingUp(self):
pass
def updateAllPartyInfoToUd(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6, todo7, todo8):
pass