コード例 #1
0
 public function onRun()
 {
     $query = new MinecraftQuery();
     foreach ($this->targets as $target) {
         $address = explode(":", $target);
         $query->connect($address[0], $address[1]);
         $this->data[] = $query->getInfo();
     }
 }
コード例 #2
0
 public function onRun()
 {
     $data = [];
     $query = new MinecraftQuery();
     foreach ($this->targets as $target) {
         $address = explode(":", $target);
         try {
             $query->connect($address[0], isset($address[1]) ? $address[1] : 19132);
             $data[] = ["info" => $query->getInfo()];
             //var_dump($query->getInfo());
             //var_dump($query->getPlayers());
         } catch (MinecraftQueryException $exception) {
             $data[] = $exception->getMessage();
         }
     }
     $this->result = $data;
 }