You can download the local tracker (without PHP, 26kB) from the LFS forum thread, or download the local tracker (with PHP 4.4.7, 5MB), my dropbox account. Created by WolleT and Frankmd.
The local tracker is fairly simple to set up - simply edit the server.txt file and import db.sql into the database.
# server number ~> SERVERNAME(Relay)|Host(IP)|Port|Admin_PW|Spec_PW|Use_Relay(0|1)
#
#
#
1 ~> servername|ip|insim port|admin pw|spec pw|0
2 ~> servername #2|ip|insim port|admin pw|spec pw|0
etc
Simply edit the server.txt file in notepad or another text editor, and add the IP, insim port and admin password of the server. You can add as many servers as you wish, but by default only the first 3 servers will be used to provide data to the web tracker.
By default, the web & local tracker both use database named moetracker, with user moesite and password moepassword. These need to be created, and then the file db.sql should be imported. Here is the SQL contained in db.sql.
--
-- Table structure for table `data`
--
CREATE TABLE `data` (
`id` int(11) NOT NULL auto_increment,
`lfsworld` varchar(40) NOT NULL default '',
`type` varchar(40) NOT NULL default '',
`value` varchar(250) NOT NULL default '',
`lap` int(11) NOT NULL default '0',
`race_id` int(11) NOT NULL default '0',
`created_on` int(11) NOT NULL default '0',
`time` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `lfsworld` (`lfsworld`),
KEY `type` (`type`),
KEY `race_id` (`race_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `race`--
CREATE TABLE `race` (
`id` int(11) NOT NULL auto_increment,
`server` int(2) unsigned NOT NULL default '0',
`track` varchar(6) NOT NULL default '',
`laps` int(11) NOT NULL default '0',
`weather` int(1) NOT NULL default '0',
`wind` int(1) NOT NULL default '0',
`created_on` int(11) NOT NULL default '0',
`type` varchar(4) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
By default, only tracking of race sessions (where a race is in progress and laps > 0) is enabled by default. To track qualifying or practice sessions, you need to edit the boolean (true/false) values on lines 6-8 of insim/vr.php to get the local tracker to process the insim data during those sessions.
These batch files are for Windows, in order to ensure the local tracker connection does not time out in PHP. By default the local tracker uses a PHP install in the /php-4.4.7-Win32/ directory. It may use more than an average amount of CPU, so it should be run on a good processor or a second computer.
Empties the data and race tables in the moetracker database.
Runs php.exe and vr.php from the command line - which connects to the servers and starts storing data in the database.
Connects to the IP address specified in the batch file to retrieve the contents of the database. Displays the highest race_id found in the database, then starts the tracker. You may need to put a filepath in front of the mysql commands mysqldump and mysql - e.g. C:\wamp\bin\mysql\mysql5.1.36\bin\
To ensure redundancy, more than one person should run the local tracker, preferably 3 people all of whom have good connections, especially for long endurance races.
If the tracker connection to the server times out, then the following should be done to ensure accuracy:
UPDATE 'data' SET 'race_id' = new_race_id WHERE 'race_id' = old_race_id;
- substituting the new and old race_ids into the query.This is also useful when there is a server problem requiring a race restart, meaning 2 different race_ids - set them both to the same race_id and delete the other one in the race table.
Once all of the cars have completed their final lap, the tracker dos box should be closed to stop any further recording. If this is not possible, then update.php should be closed, so that the web tracker does not continue updating if for example, a new race starts on the server. If you do not use $trimFinished in the web tracker or if for some reason it does not work properly, then the extra laps and splits should be deleted after everyone has finished their final lap.
Also, the moetracker database should be exported and stored along with the .html, config.php and teams.yaml/.csv files to allow archiving, and so that the tracker can be recreated at a later data if required.