Austinb / GameQ

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

Teamspeak 3 result incomplete #332

Closed Parilar closed 8 years ago

Parilar commented 8 years ago

Array ( [gq_address] => xxxxx [gq_dedicated] => [gq_hostname] => [gq_joinlink] => ts3server://xxxxx?port=9987 [gq_maxplayers] => [gq_name] => Teamspeak 3 [gq_numplayers] => [gq_online] => [gq_password] => [gq_port_client] => 9987 [gq_port_query] => 10011 [gq_protocol] => teamspeak3 [gq_transport] => tcp [gq_type] => teamspeak3 [players] => Array ( ) [teams] => Array ( ) )

The most of the propertys are empty. Any reason why ? Minecraft is also incomplete

Austinb commented 8 years ago

Incomplete means you are not getting a response from the ip:port you are connecting to. You will have to check to make sure you can connect to the server's and that the host you are running the script on will let you make remote connections.

Parilar commented 8 years ago

But how can the Script get the Server Name?
The gameserver and Script are on the same machine

Lasim commented 8 years ago

What OS is your machine running ?

Paste your config please. Like this: $GameQ->addServer([ 'type' => 'css', 'host' => '127.0.0.1:27015', ]);

Parilar commented 8 years ago

When i use 127.0.0.1 and not the IP of the Server i get "Notice: fwrite(): send of 7 bytes failed with errno=111 Connection refused in /var/site/vendor/austinb/gameq/src/GameQ/Query/Native.php on line 65" ( I think it's caused by Froxlor)

When i use the IP it get some Informations about the CSS Server My Config (On Debian Wheezy machine):

$GameQ = new \GameQ\GameQ(); $GameQ->addServer([ 'type' => 'css', 'host' => 'IP:27015', ]); $GameQ->addServer([ 'type' => 'minecraft', 'host' => 'IP:25565', ]); $GameQ->addServer([ 'type' => 'teamspeak3', 'host' => 'IP:9987', 'options' => [ 'query_port' => 10011 ], ]);

Netstat output

sudo netstat -tnlp | grep :27015 tcp 0 0 SERVER_IP:27015 0.0.0.0:* LISTEN 12975/srcds_linux

sudo netstat -tnlp | grep :25565 tcp6 0 0 0.0.0.0:25565 :::* LISTEN 22043/java

sudo netstat -tnlp | grep :10011 tcp 0 0 0.0.0.0:10011 0.0.0.0:* LISTEN 10759/ts3server tcp6 0 0 :::10011 :::* LISTEN 10759/ts3server

Lasim commented 8 years ago

Connection refused = the port X on IP 127.0.0.1 is closed

ok run the command:

netstat -lntp (where your CSS Server is running and paste it here)

Check for FW systemctl status firewalld.service

Parilar commented 8 years ago

tcp 0 0 0.0.0.0:5222 0.0.0.0:* LISTEN 2900/beam tcp 0 0 Server IP:27015 0.0.0.0:* LISTEN 12975/srcds_linux tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 26623/mongod tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 27276/mysqld tcp 0 0 0.0.0.0:49770 0.0.0.0:* LISTEN 1660/rpc.statd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1629/rpcbind tcp 0 0 0.0.0.0:30033 0.0.0.0:* LISTEN 10759/ts3server tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 2864/epmd tcp 0 0 0.0.0.0:5269 0.0.0.0:* LISTEN 2900/beam tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 2270/named tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 26558/sshd tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 3210/master tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 2270/named tcp 0 0 0.0.0.0:55930 0.0.0.0:* LISTEN 2900/beam tcp 0 0 0.0.0.0:10011 0.0.0.0:* LISTEN 10759/ts3server tcp 0 0 Server IP:443 0.0.0.0:* LISTEN 27455/apache2 tcp 0 0 0.0.0.0:5280 0.0.0.0:* LISTEN 2900/beam tcp 0 0 Server IP:7777 0.0.0.0:* LISTEN 2900/beam tcp6 0 0 :::110 :::* LISTEN 2173/couriertcpd tcp6 0 0 :::143 :::* LISTEN 2105/couriertcpd tcp6 0 0 :::111 :::* LISTEN 1629/rpcbind tcp6 0 0 :::80 :::* LISTEN 27455/apache2 tcp6 0 0 :::30033 :::* LISTEN 10759/ts3server tcp6 0 0 :::1234 :::* LISTEN 17409/nodejs tcp6 0 0 :::21 :::* LISTEN 7826/proftpd: (acce tcp6 0 0 ::1:53 :::* LISTEN 2270/named tcp6 0 0 :::22 :::* LISTEN 26558/sshd tcp6 0 0 :::25 :::* LISTEN 3210/master tcp6 0 0 ::1:953 :::* LISTEN 2270/named tcp6 0 0 :::49273 :::* LISTEN 1660/rpc.statd tcp6 0 0 :::10011 :::* LISTEN 10759/ts3server tcp6 0 0 0.0.0.0:25565 :::* LISTEN 22043/java

-bash: systemctl: command not found

Lasim commented 8 years ago

what is the output of:

telnet SERVER_IP 27015

?

Parilar commented 8 years ago

telnet SERVER_IP 27015 Trying SERVER_IP... Connected to SERVER_IP.

or you mean SERVER_IP:27015 ?

Lasim commented 8 years ago

Ah sorry!

You wrote:

When i use 127.0.0.1 and not the IP of the Server i get "Notice: fwrite(): send of 7 bytes failed with errno=111 Connection refused in /var/site/vendor/austinb/gameq/src/GameQ/Query/Native.php on line 65" ( I think it's caused by Froxlor)

Well you can't use 127.0.0.1 because the Port is listen only on Server_IP

See: tcp 0 0 Server IP:27015 0.0.0.0:* LISTEN 12975/srcds_linux

Parilar commented 8 years ago

Yes, getting a part of Informations of the CSS Server works. But Minecraft and teamspeak didn't Here is the printf of the result

Array ( [SERVER_IP:27015] => Array ( [bot_quota] => 0 [coop] => 0 [deathmatch] => 1 [decalfrequency] => 10 [dedicated] => d [game_descr] => Counter-Strike: Source [game_dir] => cstrike [game_id] => 240 [gq_address] => SERVER_IP [gq_dedicated] => d [gq_gametype] => Counter-Strike: Source [gq_hostname] => CSS Server [gq_joinlink] => steam://connect/SERVER_IP:27015/ [gq_mapname] => de_dust2 [gq_maxplayers] => 16 [gq_mod] => cstrike [gq_name] => Counter-Strike: Source [gq_numplayers] => 0 [gq_online] => 1 [gq_password] => 0 [gq_port_client] => 27015 [gq_port_query] => 27015 [gq_protocol] => source [gq_transport] => udp [gq_type] => css [hostname] => CSS Server [map] => de_dust2 [max_players] => 16 [metamod_version] => 1.10.6V [mp_allowNPCs] => 1 [mp_autocrosshair] => 1 [mp_autoteambalance] => 1 [mp_c4timer] => 45 [mp_disable_respawn_times] => 0 [mp_fadetoblack] => 0 [mp_falldamage] => 0 [mp_flashlight] => 0 [mp_footsteps] => 1 [mp_forceautoteam] => 0 [mp_forcerespawn] => 1 [mp_fraglimit] => 0 [mp_freezetime] => 6 [mp_friendlyfire] => 0 [mp_holiday_nogifts] => 0 [mp_hostagepenalty] => 13 [mp_limitteams] => 2 [mp_match_end_at_timelimit] => 0 [mp_maxrounds] => 0 [mp_respawnwavetime] => 10.0 [mp_roundtime] => 2.5 [mp_scrambleteams_auto] => 1 [mp_scrambleteams_auto_windifference] => 2 [mp_stalemate_enable] => 0 [mp_stalemate_meleeonly] => 0 [mp_startmoney] => 800 [mp_teamlist] => hgrunt;scientist [mp_teamplay] => 0 [mp_timelimit] => 0 [mp_tournament] => 0 [mp_weaponstay] => 0 [mp_winlimit] => 0 [nextlevel] => [num_bots] => 0 [num_players] => 0 [num_rules] => 87 [os] => l [password] => 0 [players] => Array ( ) [port] => 27015 [protocol] => 17 [r_AirboatViewDampenDamp] => 1.0 [r_AirboatViewDampenFreq] => 7.0 [r_AirboatViewZHeight] => 0.0 [r_JeepViewDampenDamp] => 1.0 [r_JeepViewDampenFreq] => 7.0 [r_JeepViewZHeight] => 10.0 [r_VehicleViewDampen] => 1 [secure] => 1 [sm_nextmap] => de_piranesi [sourcemod_version] => 1.8.0.5928 [steam_id] => 90103395388263424 [steamappid] => 240 [sv_accelerate] => 5 [sv_airaccelerate] => 100 [sv_allowminmodels] => 1 [sv_alltalk] => 0 [sv_bounce] => 0 [sv_cheats] => 0 [sv_competitive_minspec] => 0 [sv_contact] => [sv_enableboost] => 0 [sv_enablebunnyhopping] => 0 [sv_footsteps] => 1 [sv_friction] => 4 [sv_gravity] => 800 [sv_maxspeed] => 320 [sv_maxusrcmdprocessticks] => 24 [sv_noclipaccelerate] => 5 [sv_noclipspeed] => 5 [sv_nostats] => 0 [sv_password] => 0 [sv_pausable] => 0 [sv_rollangle] => 0 [sv_rollspeed] => 200 [sv_specaccelerate] => 5 [sv_specnoclip] => 1 [sv_specspeed] => 3 [sv_steamgroup] => [sv_stepsize] => 18 [sv_stopspeed] => 75 [sv_tags] => [sv_voiceenable] => 1 [sv_vote_quorum_ratio] => 0.6 [sv_wateraccelerate] => 100 [sv_waterfriction] => 1 [teams] => Array ( ) [tf_arena_max_streak] => 3 [tf_arena_preround_time] => 10 [tf_arena_round_time] => 0 [tf_arena_use_queue] => 1 [tv_enable] => 0 [tv_password] => 0 [tv_relaypassword] => 0 [version] => 3398447 )

[SERVER_IP:25565] => Array ( [dedicated] => 1 [gq_address] => SERVER_IP [gq_dedicated] => 1 [gq_gametype] => [gq_hostname] => [gq_joinlink] => minecraft://SERVER_IP:25565/ [gq_mapname] => [gq_maxplayers] => [gq_name] => Minecraft [gq_numplayers] => [gq_online] => 1 [gq_password] => 0 [gq_port_client] => 25565 [gq_port_query] => 25565 [gq_protocol] => gamespy3 [gq_transport] => udp [gq_type] => minecraft [password] => 0 [players] => Array ( ) [teams] => Array ( ) )

[SERVER_IP:9987] => Array ( [gq_address] => SERVER_IP [gq_dedicated] => [gq_hostname] => [gq_joinlink] => ts3server://SERVER_IP?port=9987 [gq_maxplayers] => [gq_name] => Teamspeak 3 [gq_numplayers] => [gq_online] => [gq_password] => [gq_port_client] => 9987 [gq_port_query] => 10011 [gq_protocol] => teamspeak3 [gq_transport] => tcp [gq_type] => teamspeak3 [players] => Array ( ) [teams] => Array ( ) ) )

Parilar commented 8 years ago

@Austinb any idear whats wrong here ? Because all servers are reachable