Skip to content

Commit

Permalink
Fixed game type for ETS2 & ATS
Browse files Browse the repository at this point in the history
  • Loading branch information
tltneon committed Feb 28, 2025
1 parent bf37db8 commit 101fd3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lgsl_protocol.php
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,13 @@ public function process() {
preg_match('/mp\d{1,3}/', $this->_data['e']['tags'], $e);
$this->_data['s']['playersmax'] = substr($e[0], 2);
}
if ((substr(rtrim($this->_data['s']['game']), -2) === 'c=')) { // EURO TRUCK SIMULATOR 2 & American Truck Simulator
$this->_data['s']['game'] = 'ets2';
$this->_data['s']['map'] = substr($server['s']['map'], 0, -4);
if ($this->_data['s']['map'] == '/map/usa') {
$this->_data['s']['game'] = 'ats';
}
}
}

$mode = explode('_', $this->_data['s']['map'])[0];
Expand Down

0 comments on commit 101fd3f

Please sign in to comment.