/** * Process all the data at once * @see GameQ_Protocols_Gamespy3::process_all() */ protected function process_all() { // Run the parent but we need to change some data $result = parent::process_all(); // Move some stuff around $this->move_result($result, 'hostname', 'OwningPlayerName'); $this->move_result($result, 'p1073741825', 'mapname'); $this->move_result($result, 'p1073741826', 'gametype'); $this->move_result($result, 'p1073741827', 'servername'); $this->move_result($result, 'p1073741828', 'custom_mutators'); $this->move_result($result, 'gamemode', 'open'); $this->move_result($result, 's32779', 'gamemode'); $this->move_result($result, 's0', 'bot_skill'); $this->move_result($result, 's6', 'pure_server'); $this->move_result($result, 's7', 'password'); $this->move_result($result, 's8', 'vs_bots'); $this->move_result($result, 's10', 'force_respawn'); $this->move_result($result, 'p268435704', 'frag_limit'); $this->move_result($result, 'p268435705', 'time_limit'); $this->move_result($result, 'p268435703', 'numbots'); $this->move_result($result, 'p268435717', 'stock_mutators'); // Put custom mutators into an array if (isset($result['custom_mutators'])) { $result['custom_mutators'] = explode("", $result['custom_mutators']); } // Delete some unknown stuff $this->delete_result($result, array('s1', 's9', 's11', 's12', 's13', 's14')); // Return the result return $result; }
protected function parsePlayerTeamInfoNew(GameQ_Buffer &$buf, GameQ_Result &$result) { // Read the buffer and replace the team_ sub-section under the players section becasue it is broke $buf_fixed = preg_replace('/team_(.*)score_/m', 'score_', $buf->getBuffer()); // Replace the buffer with the "fixed" buffer $buf = new GameQ_Buffer($buf_fixed); unset($buf_fixed); // Now we continue on with the parent return parent::parsePlayerTeamInfo($buf, $result); }