Austinb / GameQ

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

TeamSpeak 3 query #34

Closed Feertti closed 12 years ago

Feertti commented 12 years ago

I'm wondering why GameQ query 'spams' server. It always send 3 connects at the same time to the server. And there is always multiply connection lost.

TS Server Log 14.6.2012 12:46:04 VirtualServer Info query client connected 'Unknown from xx.xxx.xxx.xx:40240'(id:265)
14.6.2012 12:46:04 VirtualServer Info query client connected 'Unknown from xx.xxx.xxx.xx:55633'(id:265)
14.6.2012 12:46:04 VirtualServer Info query client connected 'Unknown from xx.xxx.xxx.xx:42125'(id:265)
14.6.2012 12:46:05 VirtualServer Info query client disconnected 'Unknown from xx.xxx.xxx.xx:40240'(id:265) reason 'reasonmsg=connection lost' 14.6.2012 12:46:05 VirtualServer Info query client disconnected 'Unknown from xx.xxx.xxx.xx:55633'(id:265) reason 'reasonmsg=connection lost' 14.6.2012 12:46:05 VirtualServer Info query client disconnected 'Unknown from xx.xxx.xxx.xx:42125'(id:265) reason 'reasonmsg=connection lost'

xFlip commented 12 years ago

I think he needs 3 connections for:

  1. Server info
  2. Channels
  3. Players

I recive a lot of: Notice: Undefined offset: 1 in /var/www/web5/html/interface/system/gameq/protocols/teamspeak3.php on line 354

by the script because the channel_topic is null... how can i fix this?

Austinb commented 12 years ago

xFlip: Can you provide the ip:port in a private message? I want to take a look. Also what version is the server? It is possible they updated and changed something.

Austinb commented 12 years ago

xFlip is correct. There are 3 queries that are sent per teamspeak3 server in the list.

Server info Client list Channel list

Feertti commented 12 years ago

Hmm, 3 queries got a feeling that old GameQ version used one query but I could be wrong. I know its possible to do only with one because I have checked other services queries from server log.

The reason why I'm worry about these multiply queries is because of TeamSpeak flood protection.

xFlip commented 12 years ago

I wrote you the IP:Port by E-Mail. Thank you!

xFlip commented 12 years ago

@Feertti: tsviewer.com for example is making a lot more connections, so i like that GameQ makes only 3. You have only to insert the IP of the webserver here: query_ip_whitelist.txt

You can find this file in your Teamspeak3 directory.

Austinb commented 12 years ago

Version 1 is in a different branch. Looking at https://github.com/Austinb/GameQ/blob/v1/GameQ/packets.ini#L116 there are 3 packets that were defined. I do my best to do as few queries as possible (where possible) to limit the number of round-trips to the server and making the query that much faster. TS3 does not have a single query to get all the information.

As far as flood protection it is a best practice to limit your queries (calls) as much as possible meaning only query servers when you have to. If you are displaying this information on a web page it is better to cache the results for at least 1 minute to prevent flooding of a server by your setup.

If you have any other issues please let me know.

Austinb commented 12 years ago

xFlip: Moved the issue to another ticket see #36

Closing unless there is a specific issue with the multiple queries to TS3 servers.

renniex commented 10 years ago

İm gameq teamspeak3 hostname ? client ? online or ofline ? HELP ME ????

##########################################

error_reporting(E_ALL); require_once '../rennie/gameq//GameQ.php';

$servers = array( 'abc' => array('ts3', '185.50.69.222', 1255), );

$gq = new GameQ(); $gq->addServers($servers); $gq->setOption('timeout', 200); $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); $results = $gq->requestData();

########################################## Example.php ; <?php echo $results["abc"]["hostname"];?>