Skip to content

Version 3

Austin Bischoff edited this page Jun 25, 2019 · 34 revisions

Build Status Code Coverage Scrutinizer Code Quality License paypal

Testing status

Requirements

  • PHP 5.6.40+ - Tested in PHP 5.6, 7.0, 7.1, 7.2 & 7.3
  • Bzip2 - Used for A2S Compressed responses

Installation

This method assumes you already have composer installed and working properly. Add austinb/gameq as a requirement to composer.json by using composer require austinb/gameq:~3.0 or by manually adding the following to the composer.json file in the require section:

"austinb/gameq": "~3.0"

Update your packages with composer update or install with composer install.

Standalone Library

Download the latest version of the library and unpack it into your project. Add the following to your bootstrap file:

require_once('/path/to/src/GameQ/Autoloader.php');

The Autoloader.php file provides the same auto loading functionality as the Composer install.

Example

$GameQ = new \GameQ\GameQ();
$GameQ->addServer([
    'type' => 'css',
    'host' => '127.0.0.1:27015',
]);
$results = $GameQ->process();

Need more? See Examples.

Character encoding

GameQ v3 returns all values encoded in UTF-8 to provide uniformity across all protocols. Keep this in mind when reading values from Gamespy for example.