getPlayerCount() public method

public getPlayerCount ( )
Example #1
0
 public function fakeOnline(QueryRegenerateEvent $fakeon)
 {
     $r = mt_rand(1, 2);
     $fakeon->setMaxPlayerCount(50);
     # 50 - Number of slots
     if ($r == 1) {
         $fakeon->setPlayerCount($fakeon->getPlayerCount() + mt_rand(5, 30));
     } else {
         $fakeon->setPlayerCount($fakeon->getPlayerCount() + mt_rand(5, 30));
     }
     /*
      * If online is 1, the list of servers mcpe
      * number of players will be from 5 to 30 (randomly)
      */
 }
Example #2
0
 public function regenerateInfo()
 {
     $this->server->getPluginManager()->callEvent($ev = new QueryRegenerateEvent($this->server, 5));
     $this->server->mainInterface->setName($this->server->getNetwork()->getName());
     $this->server->mainInterface->setCount($ev->getPlayerCount(), $ev->getMaxPlayerCount());
     $this->longData = $ev->getLongQuery();
     $this->shortData = $ev->getShortQuery();
     $this->timeout = microtime(true) + $ev->getTimeout();
 }