Python Quake 3 server rcon and query class

Programming, python

Once 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.

  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • description
  • Reddit
  • StumbleUpon

4 Responses to “Python Quake 3 server rcon and query class”

  1. Poster Says:

    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.

  2. Tuple Says:

    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

  3. Tucker Says:

    This is a nice little class. I’ve found it to very useful.
    Thanks for the effort you put into it!

  4. gengis Says:

    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

Leave a Reply