Some preparations for the Goofy Speedway leaderboard

This commit is contained in:
John Cote 2015-06-10 23:35:42 -04:00
parent 443233ad1d
commit 0da6a108e4
2 changed files with 8 additions and 6 deletions

View file

@ -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')

View file

@ -151,4 +151,4 @@ class DistributedLeaderBoard(DistributedObject.DistributedObject):
self.notify.debug('delete: deleting local leaderboard')
self.ignoreAll()
self.board.removeNode()
DistributedObject.DistributedObject.delete(self)
DistributedObject.DistributedObject.delete(self)