Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Receiving server info

  1. #1
    ... connecting
    Join Date
    May 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Receiving server info

    -
    Last edited by przemekh10; 18th August 2020 at 17:44.

  2. #2
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    You could try to send '\FF\FF\FF\FFgetstatus' or '\FF\FF\FF\FFgetinfo' with UDP and store the information that you get back.

  3. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    A little collection:

    Master server list:
    Code:
    $ echo -e "\xFF\xFF\xFF\xFFgetservers 117 full empty" | nc cod2master.activision.com -u 20710
    ÿÿÿÿgetserversResponse
    \Ù¬²q"\Ù¬²q#\°
                    ëq1\l=pq \U[Ì\Uc\Dè§Úq \°
                                                    ëq9\XÆvq9\EOF
    RCON:

    Code:
    $ echo -e '\xff\xff\xff\xffrcon thyPassword status' | netcat -u 127.0.0.1 28933
    ÿÿÿÿprint
    map: dr_beatwater
    num score ping guid   name            lastmsg address               qport rate
    --- ----- ---- ------ --------------- ------- --------------------- ----- -----
    getstatus

    Code:
    $ echo -e '\xff\xff\xff\xffgetstatus' | netcat -u 127.0.0.1 28933
    ÿÿÿÿstatusResponse
    \fs_game\dr_v4\g_antilag\1\g_gametype\zom\gamename\Call of Duty 2\mapname\dr_beatwater\protocol\117\shortversion\1.2\sv_allowAnonymous\0\sv_floodProtect\1\sv_hostname\^2K^3~^2DeathRun ^2Rounds ^3: ^23 ^3/ ^210 ^7killtube.org\sv_maxclients\15\sv_maxPing\0\sv_maxRate\0\sv_minPing\0\sv_privateClients\0\sv_punkbuster\0\sv_pure\1\sv_voice\0\pswrd\0\mod\1
    getinfo

    Code:
    $ echo -e '\xff\xff\xff\xffgetinfo' | netcat -u 127.0.0.1 28933
    ÿÿÿÿinfoResponse
    \protocol\117\hostname\^2K^3~^2DeathRun ^2Rounds ^3: ^23 ^3/ ^210 ^7killtube.org\mapname\dr_beatwater\sv_maxclients\15\gametype\zom\pure\1\game\dr_v4\kc\1\hw\1\mod\1\voice\0\pb\-4598016
    getchallenge

    Code:
    $ echo -e '\xff\xff\xff\xffgetchallenge' | netcat -u 127.0.0.1 28933
    ÿÿÿÿchallengeResponse -1508048936
    http://ftp.iinet.net.au/games/idstuf...ocs/server.txt
    "getstatus" responds with all the info that qplug or qspy can see about the server and all connected players. Used for getting detailed information after the simple info query. It is sent along with a challenge string. The server will respond with a "getstatusResponse" packet.

    "getinfo" responds with a short info message that should be enough to determine if a user is interested in a server to do a full status. It is also sent with a challenge string.

    "getchallenge" returns a challenge number that can be used in a subsequent connectResponse command. We do this to prevent denial of service attacks that flood the server with invalid connection IPs. With a challenge, they must give a valid IP address. The server will respond with a "challengeResponse" packet.

    "connect" is the first step in a client connecting to a server. You send the "connect" string followed by the infoString containing the protocol version of the client, the qport, the challenge string (obtained via getchallenge), and the userinfo.

    "rcon" is a remote command to the server. It's sent as "rcon" followed by the server password, followed by the command string to be executed.
    timescale 0.01

  4. The Following User Says Thank You to kung foo man For This Useful Post:

    php (3rd July 2017)

  5. #4
    ... connecting
    Join Date
    May 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    -
    Last edited by przemekh10; 18th August 2020 at 17:45.

  6. #5
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    In which language is it written? And how do you handle the response? Also a bit of code how sendRequest works would be nice too.

  7. #6
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    It also might be an iptables rule, which is blocking too fast requests (try to sleep() a second before next request to check).
    timescale 0.01

  8. #7
    ... connecting
    Join Date
    May 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    -
    Last edited by przemekh10; 18th August 2020 at 17:45.

  9. #8
    ... connecting
    Join Date
    May 2013
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    -
    Last edited by przemekh10; 18th August 2020 at 17:44.

  10. #9
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by przemekh10 View Post
    How to get number and names of all players playing on the server without having password?
    'getstatus' and 'getinfo' should contain the players list. But it doesn't mean player #0 is slot #0.

  11. #10
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    PHP Code:
    <?php

    {
    $server_ip '94.142.139.251';
    $server_port '28960';

    $server_info "udp://" $server_ip;
    @
    $connectpacket fsockopen($server_info$server_port$re$errstr2);
    if(!
    $connectpacket

    die(
    'Нету подключения к серверу/Или сервер несуществует!'); //server die, offline
    }
    global 
    $server_ip$server_port;
    $sendpacket '\xff\xff\xff\xffgetstatus';
    fwrite($connectpacket$sendpacket);
    socket_set_timeout($connectpacket2);
    $otvet fread($connectpacket15000);
    if(
    $otvet=='яяяяdisconnect') { die('не удалось подключение, или данные не получены!?'); } //dont results
    echo $otvet;
    sleep(1);
    }

    ?>
    It does not display the result.
    server exists.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •