Exemple #1
0
 /**
  * Our buzzer status has changed.
  *
  * This event will be fired either when a new client subscribes to buzzer_status updates, or when the buzzer has
  * been enabled/disabled.
  *
  * @param BuzzerStatus $status
  * @param array $blacklist
  * @param array $whitelist
  */
 public function onBuzzerStatusChange(BuzzerStatus $status, $blacklist = [], $whitelist = [])
 {
     if (!array_key_exists(self::BUZZER_STATUS_TOPIC, $this->subscribedTopics)) {
         return;
     }
     $this->subscribedTopics[self::BUZZER_STATUS_TOPIC]->broadcast($status->toJson(), $blacklist, $whitelist);
 }
Exemple #2
0
 /**
  * Resolves the current buzzer competition and returns the resolution.
  * As a side-effect, this will also disable the buzzer.
  *
  * @return \Depotwarehouse\Jeopardy\Buzzer\BuzzerResolution
  */
 public function resolveBuzzes()
 {
     $resolution = $this->resolver->resolve();
     $this->buzzerStatus->disable();
     return $resolution;
 }