def enterPlaying(self, timeStamp):
     self.notify.debug('enterPlaying: Enter Playing State')
     self.lastCatch = None
     session = BingoGlobals.getGameTime(self.typeId)
     time = session - globalClockDelta.localElapsedTime(timeStamp[0])
     self.card.startGameCountdown(time)
     self.card.enableCard(self.checkForUpdate)
 def createGame(self):
     self.canCall = False
     self.tileSeed = None
     self.typeId = None
     self.cardId += 1
     for spot in self.pond.spots.itervalues():
         request = RequestCard.get(spot.avId)
         if request:
             self.typeId, self.tileSeed = request
             del RequestCard[spot.avId]
     if self.cardId > 65535:
         self.cardId = 0
     if not self.tileSeed:
         self.tileSeed = random.randrange(0, 65535)
     if self.typeId == None:
         self.typeId = random.randrange(0, 4)
     if self.typeId == BingoGlobals.NORMAL_CARD:
         self.bingoCard = NormalBingo()
     elif self.typeId == BingoGlobals.DIAGONAL_CARD:
         self.bingoCard = DiagonalBingo()
     elif self.typeId == BingoGlobals.THREEWAY_CARD:
         self.bingoCard = ThreewayBingo()
     elif self.typeId == BingoGlobals.FOURCORNER_CARD:
         self.bingoCard = FourCornerBingo()
     else:
         self.bingoCard = BlockoutBingo()
     self.bingoCard.generateCard(self.tileSeed, self.pond.getArea())
     self.sendCardStateUpdate()
     self.b_setJackpot(BingoGlobals.getJackpot(self.typeId))
     self.state = 'Playing'
     self.sendStateUpdate()
     taskMgr.doMethodLater(BingoGlobals.getGameTime(self.typeId),
                           DistributedPondBingoManagerAI.finishGame,
                           'finishGame%d' % self.getDoId(), [self])
 def createGame(self):
     self.canCall = False
     self.tileSeed = None
     self.typeId = None
     self.cardId += 1
     for spot in self.pond.spots:
         avId = self.pond.spots[spot].avId
         request = RequestCard.get(avId)
         if request:
             self.typeId, self.tileSeed = request
             del RequestCard[avId]
     if self.cardId > 65535:
         self.cardId = 0
     if not self.tileSeed:
         self.tileSeed = random.randrange(0, 65535)
     if self.typeId == None:
         self.typeId = random.randrange(0, 4)
     if self.typeId == BingoGlobals.NORMAL_CARD:
         self.bingoCard = NormalBingo()
     elif self.typeId == BingoGlobals.DIAGONAL_CARD:
         self.bingoCard = DiagonalBingo()
     elif self.typeId == BingoGlobals.THREEWAY_CARD:
         self.bingoCard = ThreewayBingo()
     elif self.typeId == BingoGlobals.FOURCORNER_CARD:
         self.bingoCard = FourCornerBingo()
     else:
         self.bingoCard = BlockoutBingo()
     self.bingoCard.generateCard(self.tileSeed, self.pond.getArea())
     self.sendCardStateUpdate()
     self.b_setJackpot(BingoGlobals.getJackpot(self.typeId))
     self.state = 'Playing'
     self.sendStateUpdate()
     taskMgr.doMethodLater(BingoGlobals.getGameTime(self.typeId), DistributedPondBingoManagerAI.finishGame, 'finishGame%d' % self.getDoId(), [self])
Beispiel #4
0
 def enterPlaying(self, timeStamp):
     self.notify.debug('enterPlaying: Enter Playing State')
     self.lastCatch = None
     session = BingoGlobals.getGameTime(self.typeId)
     time = session - globalClockDelta.localElapsedTime(timeStamp[0])
     self.card.startGameCountdown(time)
     self.card.enableCard(self.checkForUpdate)
Beispiel #5
0
 def enterPlaying(self):
     self.notify.debug("enterPlaying: Enter Playing State in zone %s" % (self.zoneId))
     self.timeStamp = globalClockDelta.getRealNetworkTime()
     
     self.__startTimeout(self.uniqueName('GameTimer-%s'%(self.doId)),
                         self.__handleDefaultTimeout, 
                         BingoGlobals.getGameTime(self.typeId),
                         ['GameOver'])
     # Change the client state for each player
     # participating in the game.
     for id in list(self.avId2Fish.keys()):
         # Reset Fish for each player in the game.
         self.avId2Fish[id] = (None, None)
         self.d_setState(id, 'Playing')