From 0da6a108e4baeefd1aad9f9436ed6da76a1f3d15 Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 10 Jun 2015 23:35:42 -0400 Subject: [PATCH] Some preparations for the Goofy Speedway leaderboard --- toontown/hood/GSHoodAI.py | 12 +++++++----- toontown/racing/DistributedLeaderBoard.py | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/toontown/hood/GSHoodAI.py b/toontown/hood/GSHoodAI.py index 737a7f6e..293c6b88 100755 --- a/toontown/hood/GSHoodAI.py +++ b/toontown/hood/GSHoodAI.py @@ -27,15 +27,17 @@ class GSHoodAI(HoodAI.HoodAI): HoodAI.HoodAI.startup(self) self.createStartingBlocks() + self.cycleDuration = 10 self.createLeaderBoards() - self.cycleLeaderBoards() + self.__cycleLeaderBoards() def shutdown(self): HoodAI.HoodAI.shutdown(self) - taskMgr.removeTasksMatching('leaderBoardSwitch') + taskMgr.removeTasksMatching(str(self) + '_leaderBoardSwitch') for board in self.leaderBoards: board.delete() + del self.leaderBoards def findRacingPads(self, dnaGroup, zoneId, area, padType='racing_pad'): @@ -140,6 +142,6 @@ class GSHoodAI(HoodAI.HoodAI): for subscription in RaceGlobals.LBSubscription[leaderBoardType]: leaderBoard.subscribeTo(subscription) - def cycleLeaderBoards(self, task=None): - messenger.send('leaderBoardSwap-' + str(self.zoneId)) - taskMgr.doMethodLater(10, self.cycleLeaderBoards, 'leaderBoardSwitch') + def __cycleLeaderBoards(self, task = None): + messenger.send('GS_LeaderBoardSwap' + str(self.zoneId)) + taskMgr.doMethodLater(self.cycleDuration, self.__cycleLeaderBoards, str(self) + '_leaderBoardSwitch') diff --git a/toontown/racing/DistributedLeaderBoard.py b/toontown/racing/DistributedLeaderBoard.py index 6c129d4f..535f6127 100755 --- a/toontown/racing/DistributedLeaderBoard.py +++ b/toontown/racing/DistributedLeaderBoard.py @@ -151,4 +151,4 @@ class DistributedLeaderBoard(DistributedObject.DistributedObject): self.notify.debug('delete: deleting local leaderboard') self.ignoreAll() self.board.removeNode() - DistributedObject.DistributedObject.delete(self) \ No newline at end of file + DistributedObject.DistributedObject.delete(self)