Skip to content

Commit

Permalink
Fix Rust (Austinb#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikoDEV authored May 24, 2024
1 parent 0032515 commit 369d06b
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/GameQ/Protocols/Rust.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,12 @@ class Rust extends Source
* @type string
*/
protected $name_long = "Rust";

/**
* Overload so we can get max players from mp of keywords and num players from cp keyword
* query_port = client_port + 1
*
* @param Buffer $buffer
* @type int
*/
protected function processDetails(Buffer $buffer)
{
$results = parent::processDetails($buffer);

if ($results['keywords']) {
//get max players from mp of keywords and num players from cp keyword
preg_match_all('/(mp|cp)([\d]+)/', $results['keywords'], $matches);
$results['max_players'] = intval($matches[2][0]);
$results['num_players'] = intval($matches[2][1]);
}
protected $port_diff = 1;

return $results;
}
}

0 comments on commit 369d06b

Please sign in to comment.