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

Players not show #498

Closed boyfromhell closed 4 years ago

boyfromhell commented 5 years ago

ip 185.193.165.14 port 27015 type csgo

not see players.

on this site is good https://www.gametracker.rs/server_info/185.193.165.14:27015/ https://www.gametracker.com/server_info/185.193.165.14:27015/

$servers = [
            [
                // not show
                'type'    => 'csgo',
                'host'    => '185.193.165.14:27015',
            ],
            [
                // not show
                'type'    => 'csgo',
                'host'    => '46.174.54.231:27015',
            ],
            [
                // players show
                'type'    => 'csgo',
                'host'    => '74.91.113.113:27015',
            ],
        ];
        $GameQ = new \GameQ\GameQ();
        $GameQ->addServers($servers);
        $results = $GameQ->process();
        return $results;
"185.193.165.14:27015": {
"dedicated": "d",
"game_descr": "Counter-Strike: Global Offensive",
"game_dir": "csgo",
"game_id": 730,
"gq_address": "185.193.165.14",
"gq_dedicated": "d",
"gq_gametype": "Counter-Strike: Global Offensive",
"gq_hostname": "[TR] DUSTARENA.NET PRO PUBLIC [!ws !knife !glove !nt !tag]",
"gq_joinlink": "steam://connect/185.193.165.14:27015/",
"gq_mapname": "de_dust2",
"gq_maxplayers": 40,
"gq_mod": "csgo",
"gq_name": "Counter-Strike: Global Offensive",
"gq_numplayers": 30,
"gq_online": true,
"gq_password": 0,
"gq_port_client": 27015,
"gq_port_query": 27015,
"gq_protocol": "source",
"gq_transport": "udp",
"gq_type": "csgo",
"hostname": "[TR] DUSTARENA.NET PRO PUBLIC [!ws !knife !glove !nt !tag]",
"keywords": "128tick,arena,deathmatch,deathrun,dm,dust,dustarena,eldiven,glove,ja,jb,knife,market,prime,pro,prooyun,public,skin,tr,turkey,ws,secure",
"map": "de_dust2",
"max_players": 40,
"num_bots": 0,
"num_players": 30,
"os": "l",
"password": 0,
"players": [],
"port": 27015,
"protocol": 17,
"secure": 1,
"steamappid": 730,
"teams": [],
"version": "1.37.1.9"
},
"46.174.54.231:27015": {
"dedicated": "d",
"game_descr": "Counter-Strike: Global Offensive",
"game_dir": "csgo",
"game_id": 730,
"gq_address": "46.174.54.231",
"gq_dedicated": "d",
"gq_gametype": "Counter-Strike: Global Offensive",
"gq_hostname": "Zombie ::[Net4ALL.RU]:: 24/7|FastDL|SSD",
"gq_joinlink": "steam://connect/46.174.54.231:27015/",
"gq_mapname": "ze_copy_escape_v1_1",
"gq_maxplayers": 64,
"gq_mod": "csgo",
"gq_name": "Counter-Strike: Global Offensive",
"gq_numplayers": 4,
"gq_online": true,
"gq_password": 0,
"gq_port_client": 27015,
"gq_port_query": 27015,
"gq_protocol": "source",
"gq_transport": "udp",
"gq_type": "csgo",
"hostname": "Zombie ::[Net4ALL.RU]:: 24/7|FastDL|SSD",
"keywords": "fast,!lm,Fun,*,ekb,free,msk,n4a,ru,no-steam,rus,mos,moscow,knife,fun,russia,su,secure,skin,spb,skins,z,vip,zclass,ze,zm,zombies,secure",
"map": "ze_copy_escape_v1_1",
"max_players": 64,
"num_bots": 0,
"num_players": 4,
"os": "w",
"password": 0,
"players": [],
"port": 27015,
"protocol": 17,
"secure": 1,
"steamappid": 730,
"teams": [],
"version": "1.37.1.9"
},

"74.91.113.113:27015": {
"dedicated": "d",
"game_descr": "Counter-Strike: Global Offensive",
"game_dir": "csgo",
"game_id": 730,
"gq_address": "74.91.113.113",
"gq_dedicated": "d",
"gq_gametype": "Counter-Strike: Global Offensive",
"gq_hostname": "    =(eGO)= | TTT | TROUBLE IN TERRORIST TOWN | Edge-Gamers.com",
"gq_joinlink": "steam://connect/74.91.113.113:27015/",
"gq_mapname": "ttt_subway",
"gq_maxplayers": 36,
"gq_mod": "csgo",
"gq_name": "Counter-Strike: Global Offensive",
"gq_numplayers": 27,
"gq_online": true,
"gq_password": 0,
"gq_port_client": 27015,
"gq_port_query": 27015,
"gq_protocol": "source",
"gq_transport": "udp",
"gq_type": "csgo",
"hostname": "    =(eGO)= | TTT | TROUBLE IN TERRORIST TOWN | Edge-Gamers.com",
"keywords": "!knife,!ws,bhop,course,deathrun,dr,ego,fun,jail,jb,mg,minigames,multi,pg,secure,surf,terrortown,ttt,secure",
"map": "ttt_subway",
"max_players": 36,
"num_bots": 0,
"num_players": 27,
"os": "l",
"password": 0,
"players": [
{
"id": 0,
"name": "Chaz",
"score": 0,
"time": 712.734130859375,
"gq_name": "Chaz",
"gq_score": 0,
"gq_time": 712.734130859375
},
],
"port": 27015,
"protocol": 17,
"secure": 1,
"steam_id": 85568392921213630,
"steamappid": 730,
"teams": [],
"version": "1.37.1.9"
}
uilson commented 5 years ago

I can confirm its not showing players, but its possible something related with the server mod, as I can get players from other CS:GO server like for example 216.52.148.47:27015.

But can you update the post with more information? like the response from the server, if the server is using any custom mod..

with such a poor info in post, it's hard for someone to help you.

Austinb commented 5 years ago

You can also enable debugging which will bubble up any exceptions due to invalid packets coming back from the server. $GameQ->setOption('debug', true); will throw any exceptions instead of ignoring them which is the default behavior.

If @uilson is correct and there is a mod messing with the response you will receive a non-matched response error from Source queries.

boyfromhell commented 5 years ago

add line

$GameQ->setOption('debug', true);

same results as above.

Austinb commented 5 years ago

The sever at 185.193.165.14:27015 is not returning a response for the players query request. Without a response there will be no player information available. You will need to contact the server admin to see if they are just not returning that information or if there is a plugin/mod they are running that is preventing/breaking the player response. It appears CS:GO does not return rule information via the normal rule query.

Raw response from server at 185.193.165.14:27015:

array(1) {
  [0] =>
  string(276) "<FF><FF><FF><FF>I^Q[TR] DUSTARENA.NET PRO PUBLIC [!ws !knife !glove !nt !tag]\000de_dust2\000csgo\000Counter-Strike: Global Offensive\000<DA>^B^D(\000dl\000^A1.37.1.9\000<A1><87>i128tick,arena,deathmatch,deathrun,dm,dust,dustarena,eldiven,glove,ja,jb,knife,market,prime,pro,prooyun,public,skin,tr,turkey,ws,secure\000<DA>^B\000\000\000\000\000\000"
}

The output above should have two or more arrays to have any player info. The response there is for the server info query \x49 or I. There should also be an array entry with \x44 or D which would be the player info response.

The server at 74.91.113.113:27015 returns the D response which is the player information which is why it shows the player info in the result.

From 185.193.165.14:27015:

array(2) {
  [0] =>
  string(263) "<FF><FF><FF><FF>I^Q    =(eGO)= | TTT | TROUBLE IN TERRORIST TOWN | Edge-Gamers.com\000clue_pg_v1\000csgo\000Counter-Strike: Global Offensive\000<DA>^B^]$\000dl\000^A1.37.1.9\000<B1><87>i<BE><EA>^Q\000\000\0000^A!knife,!ws,bhop,course,deathrun,dr,ego,fun,jail,jb,mg,minigames,multi,pg,secure,surf,terrortown,ttt,secure\000<DA>^B\000\000\000\000\000\000"
  [1] =>
  string(640) "<FF><FF><FF><FF>D^]\000more bad frames please\000g\000\000\000<CF>?ED\000elitegaming\000a\000\000\000<B1>(ED\000Chaz\000l\000\000\000<8F>#ED\000merzalt\000k\000\000\000<EE>"ED\000Washer\000\000\000\000\000a^_ED\000=(e)= icecold960\000\000\000\000\000A^]ED\000Cure\000p\000\000\0007^]ED\000Mrkoolade24\000f\000\000\000/^]ED\000=(e)= Pitman\000\000\000\000\000^A^\ED\000Tommy Shelby\000k\000\000\000<BB>^ZED\000Dexstrum\000\000\000\000\000<E4>^WED\000Unity723\000H\000\000\000<D8>^WED\000=(e)= KILO\000p\000\000\000^Z^SED\000CyberRecon\000>\000\000\000<EB>^MED\00"...
}
boyfromhell commented 5 years ago
host_players_show 1
This causes your server to not return a player list. Your server will track on GT, but will show no activity whatsoever. In HLSW, this will appear as if the server has one player named "Max Players" in the player list section.

host_players_show 2
This causes your server to respond to the query in the standard manner with player count and player list.

from gametracker.com

Austinb commented 5 years ago

@boyfromhell is this for CS:GO only? Thanks for the information. Closing.

boyfromhell commented 5 years ago

@Austinb ip 185.193.165.14:27015 Source Query PHP Library xPaw result

Array
(
    [Protocol] => 17
    [HostName] => [TR] DUSTARENA.NET PRO PUBLIC [!ws !knife !glove !nt !tag]
    [Map] => de_cache
    [ModDir] => csgo
    [ModDesc] => Counter-Strike: Global Offensive
    [AppID] => 730
    [Players] => 19
    [MaxPlayers] => 40
    [Bots] => 0
    [Dedicated] => d
    [Os] => l
    [Password] => 
    [Secure] => 1
    [Version] => 1.37.1.9
    [ExtraDataFlags] => 161
    [GamePort] => 27015
    [GameTags] => 128tick,arena,deathmatch,deathrun,dm,dust,dustarena,eldiven,glove,ja,jb,knife,market,prime,pro,prooyun,public,skin,tr,turkey,ws,secure
    [GameID] => 730
)
Array
(
    [0] => Array
        (
            [Id] => 0
            [Name] => M7 Nächstes
            [Frags] => 0
            [Time] => 8628
            [TimeF] => 02:23:48
        )

    [1] => Array
        (
            [Id] => 0
            [Name] => ☆ezglobal☆ (
            [Frags] => 0
            [Time] => 7319
            [TimeF] => 02:01:59
        )

    [2] => Array
        (
            [Id] => 0
            [Name] => IRON MAN (DEMİR ADAM)
            [Frags] => 85
            [Time] => 6016
            [TimeF] => 01:40:16
        )

    [3] => Array
        (
            [Id] => 0
            [Name] => Burjuva ☂ OKtay
            [Frags] => 3
            [Time] => 4106
            [TimeF] => 01:08:26
        )

    [4] => Array
        (
            [Id] => 0
            [Name] => Rivena
            [Frags] => 34
            [Time] => 3001
            [TimeF] => 50:01
        )

    [5] => Array
        (
            [Id] => 0
            [Name] => Dypzerr......
            [Frags] => 108
            [Time] => 2398
            [TimeF] => 39:58
        )

    [6] => Array
        (
            [Id] => 0
            [Name] => ✪кєηραcнι z!
            [Frags] => 16
            [Time] => 2268
            [TimeF] => 37:48
        )

    [7] => Array
        (
            [Id] => 0
            [Name] => 『 ReLaX 』
            [Frags] => 28
            [Time] => 1998
            [TimeF] => 33:18
        )

    [8] => Array
        (
            [Id] => 0
            [Name] => Pigeon CS.MONEY
            [Frags] => 41
            [Time] => 1926
            [TimeF] => 32:06
        )

    [9] => Array
        (
            [Id] => 0
            [Name] => Lord'gLeab
            [Frags] => 32
            [Time] => 1804
            [TimeF] => 30:04
        )

    [10] => Array
        (
            [Id] => 0
            [Name] => serhatparov
            [Frags] => 5
            [Time] => 1482
            [TimeF] => 24:42
        )

    [11] => Array
        (
            [Id] => 0
            [Name] => Berat
            [Frags] => 13
            [Time] => 1165
            [TimeF] => 19:25
        )

    [12] => Array
        (
            [Id] => 0
            [Name] => ( O B ) SaRıı ✔ ツ
            [Frags] => 6
            [Time] => 990
            [TimeF] => 16:30
        )

    [13] => Array
        (
            [Id] => 0
            [Name] => mini =DD
            [Frags] => 4
            [Time] => 633
            [TimeF] => 10:33
        )

    [14] => Array
        (
            [Id] => 0
            [Name] => EM1RH4NИИ ✔  
            [Frags] => 0
            [Time] => 575
            [TimeF] => 09:35
        )

    [15] => Array
        (
            [Id] => 0
            [Name] => ๛『TR』Umutツ
            [Frags] => 10
            [Time] => 465
            [TimeF] => 07:45
        )

    [16] => Array
        (
            [Id] => 0
            [Name] => Son AnA sikici
            [Frags] => 2
            [Time] => 335
            [TimeF] => 05:35
        )

    [17] => Array
        (
            [Id] => 0
            [Name] => MA NİGGZ
            [Frags] => 0
            [Time] => 85
            [TimeF] => 01:25
        )

    [18] => Array
        (
            [Id] => 0
            [Name] => 
            [Frags] => 0
            [Time] => 9
            [TimeF] => 00:09
        )

)
uilson commented 5 years ago

I have checked the data coming and going to the server when a request is made with Gameq, using wireshark. And noticed that the servers that does not respond to the _PACKETCHALLENGE, like some of the ones mentioned here, don't send the answer to the _PACKETPLAYERS, because since Gameq didn't received an answer from the server, it sends the request:

U%s

"%s" is supposed to be the answer to the challenge (when the server responds with an "A" it replaces the "%s" with what comes after the "A"), since no answer to the _PACKETCHALLENGE was received, Gameq sends "%s" as if it was the answer.

And the servers don't understand the text "%s" so it just ignores it, and don't send players back.

I also noticed that if we send the wrong request in the _PACKETCHALLENGE, like for example: self::PACKET_CHALLENGE => "\xFF\xFF\xFF\xFF\x55\x65\x5c\x5f\x0e" instead of self::PACKET_CHALLENGE => "\xFF\xFF\xFF\xFF\x56\x00\x00\x00\x00"

it always the returns the answer "A", and then, the _PACKETPLAYERS and _PACKETRULES return its supposed info.

I've tested in 2 servers that work "normally" and the 2 mentioned here that don't work "normally". IPs that I tested:

work 216.52.148.47:27015 74.91.113.113:27015

(usually) didn't work 185.193.165.14:27015 46.174.54.231:27015

and it worked fine for the 4, returning the players and server info without a problem.

Just don't know if it works with the _GOLDSOURCEENGINE, but don't see why it shouldn't also work.

Changes to my CSGO protocol, that made it work:

class Csgo extends Source
{
    /**
     * Array of packets we want to look up.
     * Each key should correspond to a defined method in this or a parent class
     *
     * @type array
     */
    protected $packets = [
        self::PACKET_CHALLENGE      => "\xFF\xFF\xFF\xFF\x55\x65\x5c\x5f\x0e",
        self::PACKET_DETAILS        => "\xFF\xFF\xFF\xFFTSource Engine Query\x00",
        self::PACKET_PLAYERS        => "\xFF\xFF\xFF\xFF\x55%s",
        self::PACKET_RULES          => "\xFF\xFF\xFF\xFF\x56%s",
    ];

    /**
     * String name of this protocol class
     *
     * @type string
     */
    protected $name = 'csgo';

    /**
     * Longer string name of this protocol class
     *
     * @type string
     */
    protected $name_long = "Counter-Strike: Global Offensive";
}
Austinb commented 5 years ago

@uilson Thanks for the information and it seems just changing the challenge to use the players packet instead of the rules packet for the challenge those servers seem to respond some of the time but those servers never respond with the rules either. The issue remains as to why those servers to do not respond properly when I can pull random servers from gametracker and all of them respond with player and rules information with the existing challenge packet.

Also those two servers "that dont usually work" do not return any rules information and some times the changed challange packet doesn't work and sometimes the current challenge packet works \xFF\xFF\xFF\xFF\x56\x00\x00\x00\x00 but still no rules. Best guess is there is something preventing the response either at the server level via a setting or perhaps a mod preventing or mangling the response.

Austinb commented 5 years ago

@boyfromhell using xPaw it still doesn't have a A2S_RULES response. There is something else going on with those servers at the server level.

Raw response from a server from gametracker - 216.52.148.47:27015

array(3) {
  [0] =>
  string(293) "<FF><FF><FF><FF>I^Q[GFLClan.com] Zombie Escape 24/7 | Rank | Recruiting | NoBlock \000ze_tesv_skyrim_v5_6\000csgo\000Counter-Strike: Global Offensive\000<DA>^B3@\000dw\000^A1.37.2.0\000<B1><87>i1<F1>^E\000\000\0000^A_,Games,!,life,escape,gflclan,GFL,for,games,bhopping,n,empty,fun,competitive,bhop,secure,unique,updated,ze,zombie,zombie escape\000<DA>^B\000\000\000\000\000\000"
  [1] =>
  string(1054) "<FF><FF><FF><FF>D3\000GA·Frent\000\000\000\000\000<DC>u^RF\000Sories\000\000\000\000\000<F6>^M<EB>E\000Peke 77\000\000\000\000\000<A7>ܷE\000CHICO REVOLVER_69_420\000\000\000\000\000^G^R<B5>E\000Greed\000\000\000\000\000'ԫE\000不看中路死全家\000\000\000\000\000Hz<A9>E\000♿♿Schmeiger flick♿♿\000^A\000\000\000X?<9C>E\000Solus\000\000\000\000\000<98>^_<8E>E\0002spooky4me\000\000\000\000\000<AA>6<89>E\000Androgynous\000\000\000\000\000<FD>s<84>E\000Syyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\000\000\000\000\000<FE>^G
<81>E\000nep nep\000\000\000\000\000<BB>.{E\000its ppl "...
  [2] =>
  string(4708) "<FF><FF><FF><FF>E<B6>\000adminlist_version\0001.3c\000aws_version\0002.2.2\000cash_player_bomb_defused\000200\000cash_player_bomb_planted\000200\000cash_player_damage_hostage\000-30\000cash_player_get_killed\0000\000cash_player_interact_with_hostage\000300\000cash_player_killed_enemy_default\000200\000cash_player_killed_enemy_factor\0000.5\000cash_player_killed_hostage\000-1000\000cash_player_killed_teammate\000-3300\000cash_player_rescued_hostage\0001000\000cash_player_respawn_amount\0000\000cash_team_elimination_bomb_ma"...
}

This has 3 response packets which includes the A2S_RULES response as well as the A2S_PLAYERS using the current v3 Source.php protocol settings.