_id = $id; $this->_ip = $ip; $this->_port = $port; } function isOnline() { startBenchmark(__FILE__, __CLASS__ . " -> " . __FUNCTION__); require_once(ABSOLUTEPATH . "plugins/shared/plugin_gs_query.inc"); $server_query = new plugin_gs_query($this->_ip, $this->_port + 8433); endBenchmark(__FILE__, __CLASS__ . " -> " . __FUNCTION__); if (!$this->info = $server_query->info()) return false; if (empty($this->info["hostname"])) return false; return true; } function getInfo() { startBenchmark(__FILE__, __CLASS__ . " -> " . __FUNCTION__); global $phpUA; require_once(ABSOLUTEPATH . "plugins/shared/plugin_gs_query.inc"); if ( $this->info["version"] == "v1.6" ) { endBenchmark(__FILE__, __CLASS__ . " -> " . __FUNCTION__); return array("name"=>$this->info["hostname"], "desc"=>$this->info["gameId"] . ": " . $this->info["numplayers"] . "/" . $this->info["maxplayers"] . " " . $phpUA["LANGUAGE"]["on"] . " " . $this->info["mapname"]); } else { endBenchmark(__FILE__, __CLASS__ . " -> " . __FUNCTION__); return array("name"=>$this->info["hostname"], "desc"=>$this->info["gametype"] . ": " . $this->info["numplayers"] . "/" . $this->info["maxplayers"] . " " . $phpUA["LANGUAGE"]["on"] . " " . $this->info["mapname"]); } } } ?>