Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
403 stars 136 forks source link

Teamspeak not working #442

Closed Lapotor closed 6 years ago

Lapotor commented 6 years ago

Hello, I tried a few ways I used the standalone and the composer version. But both times the server is shown as offline, but I am at the same time online on that TeamSpeak. My test Code for Teamspeak:

echo "<pre>";
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once(__DIR__."/vendor/autoload.php");
$GameQ = new \GameQ\GameQ();
$GameQ->setOption('debug', true);
$GameQ->addServer([
    'type' => 'teamspeak3',
    'host' => 'ts.simliveradio.net:9987',
    'options' => [
        'query_port' => 10011,
    ],
]);
$results = $GameQ->process();
var_dump($results);
echo "</pre>";

And here the Output

  ["ts.simliveradio.net:9987"]=>
  array(16) {
    ["gq_address"]=>
    string(19) "ts.simliveradio.net"
    ["gq_dedicated"]=>
    NULL
    ["gq_hostname"]=>
    NULL
    ["gq_joinlink"]=>
    string(41) "ts3server://ts.simliveradio.net?port=9987"
    ["gq_maxplayers"]=>
    NULL
    ["gq_name"]=>
    string(11) "Teamspeak 3"
    ["gq_numplayers"]=>
    NULL
    ["gq_online"]=>
    bool(false)
    ["gq_password"]=>
    NULL
    ["gq_port_client"]=>
    int(9987)
    ["gq_port_query"]=>
    int(10011)
    ["gq_protocol"]=>
    string(10) "teamspeak3"
    ["gq_transport"]=>
    string(3) "tcp"
    ["gq_type"]=>
    string(10) "teamspeak3"
    ["players"]=>
    array(0) {
    }
    ["teams"]=>
    array(0) {
    }
  }
}

I use PHP 7.0.32 on Ubuntu 16.04.5.

I hope someone can help me.

Lapotor commented 6 years ago

If there is anything that is needed to help ask right away.

Austinb commented 6 years ago

You will need to check the value of query_port to make sure that is correct. I have checked against some publicly listed servers and it connects fine. Also make sure the port is open to be queried. It is possible the host of the server has closed it.

$GameQ->addServer([
    'type' => 'teamspeak3',
    'host' => '192.223.30.157:9987',
    'options' => [
        'query_port' => 10011,
    ],
]);

Please open this issue back up if you have any other issues querying your server.