ANTH 0 Posted June 21, 2004 Hi I would like some help on getting server scores transfer to update on to webpage, Kills, Deaths, thats sort of thing just wondering if any one knows how to do it. My goal is to track every single server for this. But need some help doing it. Can anyone help? Share this post Link to post Share on other sites
benu 1 Posted June 21, 2004 I tried to write a perl cgi to do that once, but didn't really finish it. I didn't link to it from the site as it is not yet finished, but you can see the how it looks like at our site. The core part looks like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#! /usr/bin/perl -w use strict; use IO::Socket; use CGI::Carp qw(fatalsToBrowser); #default values if no parameters are given my $ARGS_HOSTNAME = 'gdt.game-server.cc'; #queryport defaults to serverport+1 my $ARGS_PORT = '2303'; #holds the response packet and is later used as loop variable for output my $response="bla"; #will hold output data in key/value format my %ausgabe; #holder for stripping off leading slash in response ticket and used as loop my $holder=0; #open socket my $sock = new IO::Socket::INET ( PeerAddr => $ARGS_HOSTNAME, PeerPort => $ARGS_PORT, Proto => 'udp', Blocking => 1, ); die "Could not create socket: $!\n" unless $sock; $sock->autoflush(1); $sock->syswrite("\\status\\"); #data length of 8192 bytes should be enough for about 150 players if ($sock->sysread($response,8192)) { #split off first slash in answer packet ($holder,%ausgabe)= split /\\/,$response; } else { print "Server $ARGS_HOSTNAME:$ARGS_PORT is down"; } Share this post Link to post Share on other sites
ANTH 0 Posted June 22, 2004 looks complicated im not fimliar with pearl :S. But im a very good learner when it comes to computers. I will give it ago. Share this post Link to post Share on other sites
Placebo 29 Posted June 22, 2004 Moving to MP. And ANTH your sig image exceeds the rules, expect a PM Share this post Link to post Share on other sites