PHP code example of thunderbug / tracker-quake-connection

1. Go to this page and download the library: Download thunderbug/tracker-quake-connection library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thunderbug / tracker-quake-connection example snippets


$master = new \Thunderbug\QuakeConnection\Master\Master("master.game.com", 28910);
$servers = $master->getServerList();

$gameserver = new \Thunderbug\QuakeConnection\Server\Gameserver("192.168.1.100", 28960);
$gameserver->getStatus($cvars, $players);

$cvars = $gameserver->getCvars();
$players = $gameserver->getPlayers();

print(\Thunderbug\QuakeConnection\Server\Colors::colorize("^5Thun^6der", ColorType::DARK)); 
//Prints html <span> with color codes
//Depending on the color of the site the color type can be light or dark
print(\Thunderbug\QuakeConnection\Server\Colors::removeColors("^5Thun^6der")); 
//Removes all color codes