HalfLife/Cstrike monitorring

Paul Clinch pclinch at internet-glue.co.uk
Sat Dec 13 00:08:23 CET 2003


"Guyon Morée" <gumuz*NOSP at M*looze.net> wrote in message news:<3fd8fa1c$0$154$3b62cedd at news.wanadoo.nl>...
> Thanx for the tip, but actually I wanted to make something, which shows the
> stats of a match a bit 'flashy arcade style'. perhaps i'll use pygame for
> that part.
> 
> In other words: it should look cool on a beamer :)
> 
> anyway, the decoding stuff I've managed, but I'm still stuck with the UDP (i
> think) because somehow no response is given. maybe someone can show me the
> light.
> 
> thanx,
> 
> Guyon
> 
> 
> "Erik Max Francis" <max at alcyone.com> schreef in bericht
> news:3FD8C79C.D7166008 at alcyone.com...
> > "Guyon Morée" wrote:
> >
> > > I want to write a HalfLife/CStrike monitor, to make some nice
> > > statistics for
> > > an upcoming LAN-party. I've found some pointers on how to use the
> > > protocol,
> > > but now I have to do the following:
> > >
> > > 1. make an UDP connection
> > > 2. send a string(?) like  '\xFF\xFF\xFF\xFFdetails\x00'
> > > 3. translate the response into bytes and strings :-s
> > >

UDP is connectionless, make a socket, send and recv.

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto('\xFF\xFF\xFF\xFFdetails\x00', ('127.0.0.1', portnumber ))
ret, addr = s.recvfrom(1024)

Note that the server is not guaranteed to receive your request, or you
receive the reply.
Look up select and poll in the doc.s. Python version 2.3 has socket
timeouts.

> > > for more details on this protocol see:
> > > http://dev.kquery.com/index.php?article=31
> > >
> > > I hope someone can help me with at least the first 2 steps.
> >
> > It sounds like you just want a server statistics package, of which there
> > are many available.  See Google; a good one is PsychoStats.  There's
> > really no need for you to reinvent the wheel here.
> >
> > -- 
> >  __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
> > /  \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
> > \__/ Dead men have no victory.
> >     -- Euripides


Regards, Paul Clinch




More information about the Python-list mailing list