Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 19:49

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: ArmA2 Player list Grabbing
PostPosted: 01 Jul 2009 07:59 

Joined: 01 Jul 2009 07:56
Posts: 3
The below code works but how woulld i get the player info \player_\team_\score_\deaths_ or a total dump of the packet
Code:
"C:\test\gslist.exe" -n arma2pc -t -1 -X \hostname\gamever\numplayers\maxplayers\mapname\gametype\gamemode\country\mission\sv_battleye\mod\password\numteams\timelimit\param1\param2\dedicated\difficulty\currentVersion\requiredVersion\equalModRequired\language\platform -q >> output2.txt


Top
 Profile  
 
 
 Post subject: Re: ArmA2 Player list Grabbing
PostPosted: 01 Jul 2009 09:31 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
gamespy doesn't collect the players informations but only the main info (the one you see doing "gslist -d 8 IP:port")


Top
 Profile  
 
 Post subject: Re: ArmA2 Player list Grabbing
PostPosted: 01 Jul 2009 11:38 

Joined: 01 Jul 2009 07:56
Posts: 3
Code:
                     gamever 1.02.58055
                    hostname GamingSA Large Coops
                     mapname Chernarus
                    gametype Coop
                  numplayers 42
                    numteams 0
                  maxplayers 50
                    gamemode openplaying
                   timelimit 15
                    password 0
                      param1 1
                      param2 1
              currentVersion 102
             requiredVersion 102
                         mod CA;@English
            equalModRequired 0
                   gameState 7
                   dedicated 1
                    platform win
                    language 65543
                  difficulty 1
                     mission co50 Air Cav A2 1.04
                    gamename arma2pc
                 sv_battleye 0


in PHP you can do this
Code:
$addr = "202.136.100.194";
$port = "2702";
$openwaiting= "";
$member= "";
$maxwait = 60;
$sock = fsockopen(("udp://" . $addr), $port, $errno, $errdesc, $maxwait);
$query = pack("c*", 0xFE, 0xFD, 0x00, 0x04, 0x05, 0x06, 0x07, 0xFF, 0xFF, 0xFF);
fwrite($sock, $query);
@socket_set_timeout($sock, 2);
$reply = "";
if (!$sock) {
    $reply = "";
} else {
    fwrite($sock, $query);
    @socket_set_timeout($sock, 2);
    $reply = @fread($sock, 2048);
    fclose($sock);
    if (strlen($reply) > 100) {
    } else {
       // echo "An Error has poped up please check your setting";
       // exit;
    }
}
if ($reply != '') {
$Infoarray = explode(chr(0), $reply);
$num = $Infoarray[10];
$i5 = 1;
$i1 = 56;
for ($i = 0; $i < $num; $i++) {
    $PlayerID = $i5;
    $Playername = $Infoarray[$i1];
    $i1 = $i1 + 1;
    $Playerclan = $Infoarray[$i1];
    $i1 = $i1 + 1;
    $Playerkills = $Infoarray[$i1];
    $i1 = $i1 + 1;
    $PlayerDeaths = $Infoarray[$i1];

echo "Player ID = ". $PlayerID . "<br>";
echo "Player Name = ". $Playername . "<br>";
echo "Player Clan = ". $Playerclan . "<br>";
echo "Player Kills = ". $Playerkills . "<br>";
echo "Player Deaths = ". $PlayerDeaths . "<br>";
    $i1 = $i1 + 1;
    $i5 = $i5 + 1;
};
};


Top
 Profile  
 
 Post subject: Re: ArmA2 Player list Grabbing
PostPosted: 01 Jul 2009 21:02 

Joined: 01 Jul 2009 07:56
Posts: 3
is there any other way to collect player info programmatically


Top
 Profile  
 
 Post subject: Re: ArmA2 Player list Grabbing
PostPosted: 01 Jul 2009 22:35 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
you should query each server specifying the "players" query type (like the "0xFF, 0xFF, 0xFF" you used in your example) but personally I have never tested the parsing of the players informations because I didn't need them.

while if you want to make the job "automatic" you should parse the list of servers returned by gslist and query each one storing the info in a file or in a database.
I don't know exactly what you mean with "programmatically"


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron