
PiranMOTO CarLimiter 0.1: An InSim car specification checker
============================================================

CarLimiter will enforce car specifications when joining track. Definitions of the cars are loaded from an external file 'PiranMOTO_CarLimiter.data.csv', as described below. Every specification available to InSim on a car joining the track is covered by CarLimiter as of LFS version 0.6V. The supplied data file includes base values compiled from the LFS Forum.

A whitelist can be set from available car names, class names, or a combination, and players attempting to join the track in a car that doesn't match the whitelist will not be allowed to join. Players experiencing a rejection will be shown the current whitelist, and a full explanantion of any car's specifications can be requested by the player.

All but one options are checked upon the car joining the track, and failure results in the player not being allowed to join the track. The exception is the ontrack fuel check, which is checked on crossing the finish (or optionally also a split) and uses penalties in order to simulate fuel-tank size limitations.



Configuration Options:
======================

(loaded from 'PiranMOTO_CarLimiter.cfg', use '#' to comment lines)

  - host                  server IP address (default 127.0.0.1)
  - port                  server InSim port (default 29999)
  - adminpass             administrator password (default blank)
  - commandprefix         command used to trigger CarLimiter (default 'carlim')
  - sethostcars           autoset LFS car availability with whitelist changes (default 1/on)
  - whitelistrecheck      recheck cars already on track with whitelist changes (default 1/on)
  - fuelchecksplit        check ontrack fuel limits at split as well as finish line (default 0/off)
  - fuelcheckpenalty      penalty for ontrack fuel limit violations (default 2 (30 secs))
  - fuelcheckstack        repeat penalty with each split/lap that violates ontrack fuel limit (default 1/on)

  
  
Commands:
=========

Commands can be triggered by either '!' or ';', with the command prefix as set in the configuration file. The default is '!carlim <command>'. ('+' and ',' are replaced with spaces for flexibility in whitelist options)


Commands available to any player:
-----------------------------------

version                   reports current version
ver

explain X [Y]             reports cars in class X, or restrictions for car X
specs X [Y]               (optionally filter by intial letter Y)
spec X [Y]

whitelist                 reports current whitelist


Commands available to any server admin:
---------------------------------------

whitelist clear           set whitelist
whitelist [X] [Y] ...     set whitelist to X, Y etc. Whitelist can be car names, classnames, or a combination. (eg, '!carlim whitelist tbo lx4')

reload                    reloads car data from PiranMOTO_CarLimiter.data.csv without restarting CarLimiter

recheck                   recheck cars on track with current whitelist, spectate non-matches

cars                      list all known cars and classes by car

classes                   list all known cars and classes by class

lastjoin                  list specifications of last-joined car (includes denied join requests)

settings                  reports main settings

sethostcars [on|off]      set or check sethostcars option (default on)

whitelistrecheck [on|off] set or check whitelistrecheck option (default on)

fuelchecksplit [on|off]   set or check fuelchecksplit option (default off)

fuelcheckstack [on|off]   set or check fuelcheckstack option (default on)

fuelcheckpenalty [X]      set or check fuelcheckpenalty
                          0 = stop-go
                          1 = drive-through
                          2 = 30 seconds (default)
                          3 = 45 seconds
                          4 = spectate

kill                      shuts down CarLimiter, requires confirmation



Car/Class data file specification (PiranMOTO_CarLimiter.data.csv):
==================================================================

The specification file is in CSV format, it can be opened, edited and saved in any program that can handle CSV format, or any text editor.

Lines starting with '#' are ignored, the first lines in the supplied data file are commented column headings and default values for ease of reference.

Cars are listed one per line, classes are created by specifying the class name in each car definition.

The first 3 values on each line - basecar, carname and classname - are required values. Other values can be omitted, trailing commas can be omitted.

Car and class names are case-sensitive in terms of display, and *not* case-sensitive in terms of whitelist matching.

Car definitions can overlap, but should be listed in order of increasing specificity as CarLimiter will report the car furthest down the data file in the case of multiple matches.

Car definitions are checked for limits, but not checked for consistency - you could require impossible combinations with invalid data, eg, minimum passengers in an MRT.


Data file columns:

basecar             LFS internal name for *base car*
carname             your car name (letters, numbers, hyphen only)
classname           your class name (letters, numbers, hyphen only)
resmin              minimum air intake restriction required (default 0)
resmax              maximum air intake restriction allowed (default 50)
balmin              minimum ballast required (default 0)
balmax              maximum ballast allowed (default 200)
tyretypefmin        minimum tyre type required, front (default 0)
tyretypefmax        maximum tyre type allowed, front (default 7)
tyretypermin        minimum tyre type required, rear (default 0)
tyretypermax        maximum tyre type allowed, rear (default 7)
symwheels           symmetrical wheels (0=dissallowed, 1=compulsory, 2=not checked (default))
tractioncontrol     traction control (0=dissallowed, 1=compulsory, 2=not checked (default))
abs                 ABS (0=dissallowed, 1=compulsory, 2=not checked (default))
alternate           alternate configuration (0=dissallowed, 1=compulsory, 2=not checked (default))
passengermin        minimum number of passengers required (default 0)
passengermax        maximum number of passengers allowed (default 4)
tyrewidthredfmin    minimum tyre width reduction required, front (default 0)
tyrewidthredfmax    maximum tyre width reduction allowed, front (default 8)
tyrewidthredrmin    minimum tyre width reduction required, rear (default 0)
tyrewidthredrmax    maximum tyre width reduction allowed, rear (default 9)
fuelmin             minimum fuel on joining track (default 1)
fuelmax             maximum fuel on joining track (default 100)
ontrackfuelmin      minimum fuel on track (default 0)
ontrackfuelmax      maximum fuel on track (default 100)



Quick setup:
============

  - Place program file and configuration file in the same directory
  - Edit the config file to your server's ip address, port and admin password
  - Run the program
  - Join the server with admin password
  - Set the whitelist
  

