*** fuq.inc.php Mon Sep 27 11:32:02 2004 --- fuq2.inc.php Mon Oct 4 10:05:18 2004 *************** *** 1,7 **** _tryServQuery = $switch; } + /** + * Enables ServQuery's map list feature + * + * ServQuery can return the server's map rotation list. This is an expensive + * function so it is disabled in FUQ by default. If you don't mind the + * performance hit you can enable it by calling this function. + * + * @access public + * @param bool $switch a bool tell whether to activate (true) or + * deactivate the map list extension + * @return void + */ + function SetServQueryMapList($switch = true) { $this->_getMapList = $switch; } + /** * Returns the ServQuery mode * *************** *** 346,351 **** --- 359,365 ---- */ function GetTraceCols() { return $this->_traceCols; } + // }}} // {{{ accessing the results *************** *** 460,465 **** --- 474,491 ---- */ function GetSpectators() { return $this->_spectators; } + /** + * Returns an array of the current map rotation + * + * This function only returns the map list if the gameserver has + * El Muerte's ServQuery installed. If not, you will get an emtpy array. + * + * @access public + * @return array a single dimension array contaning a list of the + * map names in the server's map rotation + */ + function GetMapList() { return $this->_mapList; } + // }}} /**************************************************************************\ *************** *** 526,538 **** // ServQuery detected? if ($this->_tryServQuery && $this->_servQueryInstalled) { ! // we don't ask for the \maplist\, because that takes way too long ! // and most Servers have enabled Mapvoting anyways... ! $this->_gamespyAnswer = $this->_QueryServer( ! '\\teams\\\\spectators\\\\gamestatus\\\\echo\\fuq', ! $this->_port + $this->_gamespyOffset, ! true ! ); // now let's have a look at what we've got $this->_Trace("Fuq::Refresh(): analysing ServQuery Answer"); --- 552,573 ---- // ServQuery detected? if ($this->_tryServQuery && $this->_servQueryInstalled) { ! if (!$this->_getMapList) { ! // we don't ask for the \maplist\, because that takes way too long ! // and most Servers have enabled Mapvoting anyways... ! $this->_gamespyAnswer = $this->_QueryServer( ! '\\teams\\\\spectators\\\\gamestatus\\\\echo\\fuq', ! $this->_port + $this->_gamespyOffset, ! true ! ); ! } else { ! // the user wants it so give it to him/her ! $this->_gamespyAnswer = $this->_QueryServer( ! '\\teams\\\\spectators\\\\gamestatus\\\\maplist\\\\echo\\fuq', ! $this->_port + $this->_gamespyOffset, ! true ! ); ! } // now let's have a look at what we've got $this->_Trace("Fuq::Refresh(): analysing ServQuery Answer"); *************** *** 826,831 **** --- 861,874 ---- */ var $_tryServQuery = false; + /** + * Switching ServQueryMapList on/off + * + * @var bool + * @access private + */ + var $_getMapList = false; + /** * Gameserver has ServQuery (not) installed * *************** *** 875,880 **** --- 918,931 ---- var $_spectators; /** + * Current default map list + * + * @var array + * @access private + */ + var $_mapList; + + /** * Trace-console turned on/off * * @var bool *************** *** 1188,1194 **** } elseif (!strncmp($key,'spectator_',10)) { $this->_spectators[intval(substr($key,10))]['name']=$val; } elseif (!strncmp($key,'specping_',9)) { ! $this->_spectators[intval(substr($key,9))]['ping']=$val; } else { $this->_serverProps[strtolower($key)]=$val; } --- 1239,1247 ---- } elseif (!strncmp($key,'spectator_',10)) { $this->_spectators[intval(substr($key,10))]['name']=$val; } elseif (!strncmp($key,'specping_',9)) { ! $this->_spectators[intval(substr($key,9))]['ping']=$val; ! } elseif (!strncmp($key,'maplist_',8)) { ! $this->_mapList[intval(substr($key,8))]=$val; } else { $this->_serverProps[strtolower($key)]=$val; }