Race Manager for Live For Speed

Race Manager - A set of tools for Live For Speed hosts

Copyright (C) 2004 Yves Marcoz ( lfs@marcoz.org )

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

All versions:
- LFS (dedicated server in particular, but should work with standalone version as well) with InSim enabled.

If you are not using the Windows binary:
- Python environment (version 2.3 or later, available at http://www.python.org and already installed on most Linux systems).
- If you want to use the Graphical User Interface, you will also need wxPython 2.4 (Available here https://sourceforge.net/project/showfiles.php?group_id=10718 )

1. LFS-Marshal :
This tool will display Yellow and Blue flags, and Final Lap notifications to cars when appropriate, in order to warn about accidents during races. A user can type "flags off" and "flags on" to enable or disable it for his own car during races.
2. Gateway :
This tool provides a way to allow more than one Insim programs to connect to the LFS Server. Mostly this is useful when you want to enable LFS-Spectator through the Master Server Relay. To enable this, start the tool in the Race Manager, and enter the port 35000 (by default, it can be changed in the configuration file) into the Master Server host configuration page ( http://www.lfsworld.net ).
3. Qualification Manager :
This tool allows the record and logging of all the laps made on the server. Every time someone completes a lap, it will be added to the laps.log file. The best lap for each user is stored in an ordered list, with notification of current position made to users to the end of a lap, or when connecting to a server. This will not work properly in Demo servers, as you need to use a unique identifiers (usernames) for players which is only possible in S1. A user can type "check laps" in order to get the current list of best laps for all users.
4. Best Lap Notifier :
This tool will keep track of lap times during a race (it is reset at the start of each race), and will display a notification to all players when someone beats the current best time.
5. Rolling Start :
This tool allows for Rolling Starts (as opposed to Standing Starts). Positions are recorded at the beginning of the race, and have to stay the same for the warmup lap. Players will drive around the track until a "Get Into Formation" message is displayed, at which point players must stay at a set distance of each other, at a speed limit of 80km/h or 50mph. Players will keep their formation until the Green Flag message is displayed (near the starting line), which is when the race starts. Before the Green Flag, notifications will be sent to help drivers keep their formation such as "Too Slow", "Too Fast", "Too Far"...
If players are not into formation when the Green Flag should be displayed, they will get a Yellow Flag instead. The race will then need to be restarted (nothing stops you from continuing though). If a player is speeding when the Green Flag is displayed, he will receive a Black Flag. This tool does not enforce the Black Flag penalty, but league administrators might want to force a Stop and Go. Many settings can be changed in RaceManager.cfg.
6. TrackChanger :
This tool allows for automatic track changing. At the end of a number of races (set in cfg file), the tool will end the game, set a new track and new cars. You can set which tracks/cars combinations can be loaded in the RaceManager.cfg file, in the TrackChanger section
7. ChatLogger :
This tool logs chats and other server events to a log file. Also, an admin can cancel an ongoing vote by using the "!can" command. Use this command on the chat window. Players will see it as chat. "^0!can" also works. (other colors don't)
8. VoteChecker :
This tool allows or disallows restart/end/qualify votes according to certain conditions. There are 6 rules:
1. No voting (restart, end, qualify) after the first 30 seconds of the race
2. Voting allowed one minute after the first player finishes race
3. If nobody completed one lap after 3 minutes of race start, voting allowed
4. If 65% (rounded-up) of drivers has finished race (and there's more than just
one finished driver) voting allowed
5. If everybody finished race, voting allowed (obviously)
6. If no LAPs or SPLITs completed in the last minute, voting allowed
9. WelcomeMessage :
Displays a combination of messages to a person who is connecting
10.Remote Control :
Allows some control of Race Manager through a web browser. Once the module is started, you can access it through: http://ServerName:8080 . Commands such as: "start 3", "restart", "quit" can be sent to RaceManager. If you start this module, make sure you change the password for securiy reasons.

Commands available to players:
Players can type these commands as a text message inside the game:
1. "flags off" , "flags on"
3. "check laps" , "laps on" , "laps off"
5. "start off" , "start on"

To disable most messages: "messages off"
To enable most messages: "messages on"
Please note that some messages can not be disabled (messages sent to all players, such as in
the Best Lap Notifier, or some messages in the Rolling Start).

- Extract the files to any directory on the server
- Edit the file RaceManager.cfg (with any text editor)
- Modify the settings in the "LFSServer" section (top of the file)
to fit your needs (in particular the admin password)
- Modify the settings in the "InSim" section if you are not running the tool
on the same computer as the LFS Server.
- Start your server (dedicated or multiplayer)
- Enable Insim on port 29999 (typing /insim 29999 for example)
- Start the program (cf. below for more options)

Starting the program:
The Race Manager includes 3 interfaces which you can use:
- Graphical User Interface (GUI): This is the default on Windows machines, or if you have wxPython installed. A window will appear with one button per tool. Press the associated button to turn on a specific tool.
- Command line interface: This is a basic text based interface. You will see a list of the tools, each associated with a number. Enter this number when prompted, and press enter to stop (or start the tool). Press X to quit.
- Pseudo-daemon: This is not an interface per-se, it will run in the background with all inputs disabled. You will need to kill the process, or press Ctrl-C to stop it. This is useful when used on a dedicated server 24h/day (using nohup for example).

When you start the program, you will have the default interface for your system (GUI if
possible, Command line if the GUI can't be loaded). To force a specific interface,
you can use the options:
"-g" to try to force the GUI interface
"-c" to get the Command line interface
"-s" to start as standalone
"-o" to get the Command line interface with an actual server command line and chat log

The last option is not tested on Windows. May not work.

You can also specify which tools to start on the command line:
1. LFS-Marshal
2. Gateway
3. Qualification Manager
4. Best Lap Notifier
5. Rolling Start
6. Track Changer
7. Chat Logger
8. Vote Checker
9. WelcomeMessage
10. Remote Control

RaceManager.py -s 1 2 3 4 5 : This will start the program in standalone mode, with all tools enabled
RaceManager.py -c 1 4 5 : This will start the program with the command line interface
RaceManager.py 1 3 : This will start the program with the default interface for your system

- With the Windows binary, you need to replace RaceManager.py by RaceManager.exe
- On some system, you might need to specify where the Python executable is, such as:
/usr/local/python RaceManager.py


Python version

Big thanks to all the people who helped me test this program for their excellent feedback.
Mosquito25 for his French traduction and additions to LFS-Marshal (Stands)
disq for his modules and other contributions

Please post your comments, feedback and bugreports to the official LFS forum:
or send to lfs@marcoz.org

Want to help me pay for S2? Don't hesitate to make a donation (even if very small) :-)

RaceManager-Oct12.zip67.75 KB
RaceManager-Oct12.zip67.75 KB