Austinb / GameQ

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

CSGO hostname length limited to 63 characters? #530

Closed spyrek10 closed 4 years ago

spyrek10 commented 4 years ago

Are there any limitations for csgo? GameQ3 returns only first 63 characters instead of full hostname.

uilson commented 4 years ago

There is no limit as far as I'm aware, so far I have successfully returned more than 63 characters.

Like for example this server: [TR] DUSTARENA.NET PRO-PUB #STEAM CÜZDAN KOD HEDİYE [!ws !knife !glove !nt !tag]

IP: 185.193.165.14 Port: 27015

Update your post with the server data, and the result you get when querying the server (the array/json response).

spyrek10 commented 4 years ago

Server: password github;connect 145.239.237.103:27150 Current hostname: "hostname" = "this is the longest server hostname you have ever seen is csgo history or maybe not" ( def. "" ) - Hostname for server.

Response:

[145.239.237.103:27150] => Array (

        [dedicated] => d
        [game_descr] => Counter-Strike: Global Offensive
        [game_dir] => csgo
        [game_id] => 730
        [gq_address] => 145.239.237.103
        [gq_dedicated] => d
        [gq_gametype] => Counter-Strike: Global Offensive
        [gq_hostname] => this is the longest server hostname you have ever seen is csgo 
        [gq_joinlink] => steam://connect/145.239.237.103:27150/
        [gq_mapname] => de_mirage
        [gq_maxplayers] => 11
        [gq_mod] => csgo
        [gq_name] => Counter-Strike: Global Offensive
        [gq_numplayers] => 1
        [gq_online] => 1
        [gq_password] => 1
        [gq_port_client] => 27150
        [gq_port_query] => 27150
        [gq_protocol] => source
        [gq_transport] => udp
        [gq_type] => csgo
        [hostname] => this is the longest server hostname you have ever seen is csgo 
        [keywords] => empty,srcds.pro 4.0 stable secure unddosable,secure
        [map] => de_mirage
        [max_players] => 11
        [num_bots] => 1
        [num_players] => 1
        [os] => l
        [password] => 1
        [players] => Array
            (
                [0] => Array
                    (
                        [id] => 0
                        [name] => SRCDS.pro - GOTV
                        [score] => 0
                        [time] => 187.98713684082
                        [gq_name] => SRCDS.pro - GOTV
                        [gq_score] => 0
                        [gq_time] => 187.98713684082
                    )

            )

        [port] => 27150
        [protocol] => 17
        [secure] => 1
        [sourcetv_name] => SRCDS.pro - GOTV
        [sourcetv_port] => 27151
        [steam_id] => 85568392920876978
        [steamappid] => 730
        [teams] => Array
            (
            )

        [version] => 1.37.4.0
    )
Austinb commented 4 years ago

I ran a couple of tests and @uilson server is returning 80 chars and yours seems to be cut off after 63 characters. The issue is the raw response coming back from the server is truncated to 63 characters. The response parsing for strings is looking for that \x00 character (shows up as ^@ in here) and that's where the string ends.

Raw response from 145.239.237.103:27150:

Array
(
    [0] => <FF><FF><FF><FF>I^Qthis is the longest server hostname you have ever seen is csgo ^@de_mirage^@csgo^@Counter-Strike: Global Offensive^@<DA>^B^A^K^Adl^A^A1.37.4.2^@<F1>^Nj<B2><C7>^L^@^@^@0^A
^OjSRCDS.pro - GOTV^@empty,srcds.pro 4.0 stable secure unddosable,secure^@<DA>^B^@^@^@^@^@^@
    [1] => <FF><FF><FF><FF>D^A^@SRCDS.pro - GOTV^@^@^@^@^@<D2><C4><F4>E
)

You can see the response is truncated after 63 characters when it comes back from the query request. My guess right now is that there is an addon, plugin or setting somewhere that is affecting the response length and limiting it to 64 chars (the ^@ is the 64th char which denotes the end of the string). I would try disabling any addons/plugins you have running and see if that affects anything. If so turn them on one by one and see which one is causing the problem.