Results 1 to 3 of 3

Thread: Get all Ip's

  1. #1
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts

    Get all Ip's

    PHP Code:
    <?
    $message = '';
    $masterserver = 'cod2master.activision.com';
    $port = 20710;
    $protocol = 115;//for 1.0
    $expectHeader = "\xFF\xFF\xFF\xFFgetserversResponse\x0A\x00";
    $expectFootA = "\\EOT";
    $expectFootB = "\\EOF";
    $packet = "\xFF\xFF\xFF\xFFgetservers $protocol full empty";
    if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0)))
    {
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
    die("Couldn't create socket: [$errorcode] $errormsg \n");
    }
    //Send the message to the server
    if( ! socket_sendto($sock, $packet , strlen($packet) , 0 , $masterserver , $port))
    {
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
    die("Could not send data: [$errorcode] $errormsg \n");
    }
    //Now receive reply from server and print it
    if(socket_recv ( $sock , $message , 16000 , MSG_WAITALL ) === FALSE)
    {
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
    die("Could not receive data: [$errorcode] $errormsg \n");
    }
    $start = strlen($expectHeader);
    $end = strlen($message) - strlen($expectFootA);
    for($i=$start; $i<$end; $i+=7) {
    $a = ord(substr($message, $i+1, 1));
    $b = ord(substr($message, $i+2, 1));
    $c = ord(substr($message, $i+3, 1));
    $d = ord(substr($message, $i+4, 1));
    $u = unpack("n", substr( $message, $i+5, 2));
    $port = $u[1];
    print ("$a.$b.$c.$d:$port<br>");
    }
    ?>
    Count player's by steam:
    https://api.steampowered.com/ISteamU...v1/?appid=2630

  2. #2
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i have 2 question
    1-)what is this for
    2-)how can use this
    /[kick them all/

  3. #3
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    oh ok for server's ip but without steam useless
    /[kick them all/

Posting Permissions

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