コード例 #1
0
 protected function onConstruct()
 {
     $ui = new Bgs1InRace(40, 5.5);
     $ui->setSubStyle(Bgs1InRace::BgCardList);
     $ui->setHalign('center');
     $this->addComponent($ui);
     $ui = new Label(38, 5);
     $ui->setStyle(Label::TrackerTextBig);
     $ui->setHalign('center');
     $ui->setPosition(0, -1);
     $ui->setText('Free spot. Have fun !');
     $this->addComponent($ui);
     $this->setPosition(Config::getInstance()->posX, Config::getInstance()->posY - 29.5);
 }
コード例 #2
0
 function onEndMap($rankings, $map, $wasWarmUp, $matchContinuesOnNextMap, $restartMap)
 {
     if ($wasWarmUp || $restartMap) {
         return;
     }
     $config = Config::getInstance();
     $freePlaces = $this->storage->server->nextMaxPlayers - count($this->mapsPlayed);
     $nbToKick = max(0, min($config->lastToKick, count($this->queue)) - $this->outThisMatch - $freePlaces);
     while ($nbToKick > 0 && !empty($rankings)) {
         $ranking = array_pop($rankings);
         $login = $ranking['Login'];
         if (isset($this->mapsPlayed[$login]) && $this->mapsPlayed[$login] > 0 && !($config->ignoreAdmins && AdminGroup::contains($login))) {
             if ($config->queueInsteadOfKick) {
                 $this->connection->forceSpectator($login, 1);
                 $this->lastWorst[] = $login;
             } else {
                 $this->connection->kick($login);
             }
             --$nbToKick;
         }
     }
 }
コード例 #3
0
 protected function onConstruct()
 {
     $this->queueButton = new ButtonResizable(20, 4);
     $this->queueButton->setHalign('center');
     $this->queueButton->setPosY(-30.5);
     $this->addComponent(self::$background);
     $this->addComponent(self::$title);
     $this->addComponent(self::$queuedPlayers);
     $this->addComponent($this->queueButton);
     $this->setPosition(Config::getInstance()->posX, Config::getInstance()->posY);
     $this->setIsUnqueued();
 }