Python Quake 3 server rcon and query class
Programming, pythonOnce again, I couldn’t find a Quake 3 server query/rcon class for Python so I made one. This one is substantially better then the PHP Quake 3 rcon class that I made a few days ago. It’s called pyquake3. The features are:
* Simple interface
* Automatic retries
* Can access server variables
* Can send rcon commands
* Can collect player names, ping and frags.
* With an rcon password, can collect player ip addresses.
The Python Quake 3 project page is here and you can directly download the Python Quake 3 class here.








July 17th, 2007 at 2:48 pm
this will fail to work if a player has negative frags
I think the simplest way to fix it would be to change line 38 to read:
player_reo = re.compile(r’^(-\d+|\d+) (\d+) “(.*)”‘)
otherwise the test on line 105 will fail
my knowledge of regular expressions is limited there may be a more elegant way.
I just realized that will record incorrect data is it will convert a players negative frag count to positive. Maybe you would know of a good way to fix this.
July 28th, 2007 at 11:45 pm
To get this to work, I had to add
# -*- coding: UTF-8 -*-
as the first line (or second line will do if you have #!/bin/python or whatnot)
see
http://www.python.org/dev/peps/pep-0263/
for details.
I’m using python 2.5
October 1st, 2007 at 9:42 am
This is a nice little class. I’ve found it to very useful.
Thanks for the effort you put into it!
March 13th, 2008 at 8:52 am
very nice class!!!!!!
i am not familiar with regular expression, i wanted to extend the class to get the time(played time) for each player. i gave many try but i didn’t succeed……
any idea?
thx