EVENT CONTROL v0.42
This is another application/tutorial I've written in basic C/C++ using my "CInsim" library. You can find the C++ CInsim library and my previous basic applications here: http://www.lfsforum.net/showthread.php?t=47717
All the source code is provided, of course, as well as a code::blocks project file
This application is an event manager (server oriented) developed for the Fun Racing League (http://www.funracingleague.com/). It was originally designed (as Qual Control) to enforce HARDCORE qualify sessions, in which the use of Shift+P and Shift+S is forbidden, so people can only do realistic pitstops by driving into the pitlane and stopping on the yellow spots.
The current version allows further control over race directing, and introduces the figure of the RACE DIRECTOR, which is a driver appointed as such who can execute all Event Control's commands except for the ones to quit the application, and turn it ON or OFF. These race directors don't need the admin password of the server and are just added by editing a simple text file. Race Directors can configure the server for a race (track, cars, laps, weather, restart, end, etc.), but can't kick or ban users, change slots, and use advanced host configuration commands.
It is an ideal tool if you manage a league and you want to have non-admin drivers handling things like race director chat messages, restarting/ending sessions, reversing top grid drivers for consecutive rounds of a race, sending drivers to spectators, etc.
QUICK START
You have to edit the config.cfg file with a text editor and fill the three required fields: IP, insim_port and admin_password. Then run the executable (The PThreads dll must be in the same directory).
Optionally, you can edit the config.cfg file to add up to 50 lfs license names who will have access to all race director's commands.
All players who join the server using the admin password have automatic access to all commands.
When the executable is launched the application will connect to the server and a welcome message should appear. There can be drivers in the server when the application starts, but be warned that the first thing it does is send everybody to spectators.
Start running!
USAGE AND FEATURES
Basic user commands:
- !ehelp or !erules : Shows the intro screen.
- !ecommands or !ecmd : Shows the available commands in the chat, depending on the level of the user.
- !em [message] : Sends a preformatted (auto-color, auto upper case) Race Director message through the host chat.
- !eopen or !eop : Opens the track for free driving. People can use shift+p and shift+s and rejoin again whenever they want.
- !eclose or !ecl : Closes the track. Everybody is sent to spectators and nobody can join the track (they are automatically sent to spectators again if they try).
- !ehardq or !ehq : Restarts a hardcore qualify session. In this no rejoin after shift+p or shift+s is allowed. Succesive restarts of /qualify are on hardcore mode until !eopen or !esoftq is used.
- !esoftq or !esq : Restarts a soft qualify session. In this spectating and telepitting are allowed at all times.
- !erace or !erc : Restarts the race.
- !eend : Ends race and goes to lobby screen.
- !erev [opt] : In lobby screen, reverses the grid order of the top [opt] number of drivers. If no number is used, by default it's 8.
- !ecars, !etrack, !eweather, !ewind, !equal, !elaps, !ehours, !emustpit, !ecanreset (all like original LFS host commands).
- !espec, !ecars, !etrack, !eweather, !ewind, !equal, !elaps, !ehours, !emustpit, !ecanreset, !efcv, !emidrace, !eclear, !ep_dt, !ep_sg, !ep_30, !ep_45, !ep_clear, !ercm, !ercm_ply, !ercm_all, !ercc_ply, !ercc_all (all these commands work exactly like the originals).
- !eon : Turns Event Control ON. This is efectively like restarting it.
- !eoff : Turns Event Control OFF. Event control stays completely hidden and silent until an admin uses !eexit to quit it, or !eon to turn it on again.
- !eexit or !eex : Closes Event Control (must be launched again externally).
I have posted it on the programmers forum (it's highly focused to be a tutorial on insim). The zip file is attached there, but I post this announcement here for non-programmers that might be interested in it:
Link to the thread: http://www.lfsforum.net/showthread.php?p=1403034