Results 1 to 2 of 2

Thread: server tracking

  1. #1
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts

    server tracking

    hello , how can i track my servers with javascript and make real-time chart ? (score,ping etc.)

  2. #2
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    with javascript, i think: no way
    make client interface with HTML+javascript (ajax etc.), but server info from PHP, PERL etc.

    PHP Example:
    PHP Code:
    <?php
    /* if static */
    $ip 'your ip';
    $port 'your port';
    /*            */

    /* from jQuery "s_status.php?ip=127.0.0.1&port=28960" */
    $ip $_GET['ip'];
    $port $_GET['port'];
    /*              */

    /* from cmd term "php /home/cod2/rsrc/scripts/s_status.php 127.0.0.1 28960" */
    //$argv[0] - filename: s_status.php
    $ip $argv[1];
    $port $argv[2];
    /*               */

    $udp_socket fsockopen "udp://" .$ip$port );
    $udp_string "\xFF\xFF\xFF\xFFgetstatus";

    fwrite $udp_socket$udp_string );
    stream_set_timeout $udp_socket);
    $response fread ($udp_socket5000);

    $tech stream_get_meta_data ($udp_socket);
    if (
    $tech['timed_out'] || $tech['eof'])
        
    $r_result 'null';
    else
        
    $r_result $response;

    fclose $udp_socket );    
    die(
    $r_result);
    ?>
    result (#PARSE ME PLSSSS#):
    Code:
    ����statusResponse \_Admin\^3Paho^7, DamaGe, ^2PACTYX\_URL\^7Soon/�����\fs_game\russia_test\g_antilag\1\g_gametype\zom\gamename\Call of Duty 2\mapname\mp_fonecta\protocol\115\scr_friendlyfire\0\scr_killcam\1\shortversion\1.0\sv_allowAnonymous\0\sv_floodProtect\1\sv_hostname\^7��^4��^1��\sv_maxclients\30\sv_maxPing\0\sv_maxRate\0\sv_minPing\0\sv_privateClients\0\sv_pure\1\sv_voice\1\pswrd\0\mod\1
    next: draw tables with players, scores, pings...
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  3. The Following User Says Thank You to maxdamage99 For This Useful Post:

    feanor (7th October 2018)

Posting Permissions

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