The online racing simulator
#1 - Racon
PHP7/Win - PIE (PHP; InSim; Easy) - Windows EXE running a PHP InSim framework
PiranMOTO PIE (PHP; InSim; Easy) - Windows EXE running a PHP InSim framework

** Please consider this a beta release at this time! **

PIE is designed to be give easy access to InSim functionality with the PHP programming language (ver 7.2, CLI mode). It takes care of connection to InSim (and optionally OutSim and OutGauge) and maintaining the connection, and calls a user-defined function on receipt of any packet. It can be used to connect to an LFS client (local mode) or an LFS server (host mode) and comes with some basic commands and debugging.

PIE is a commandline executable that reads a PHP file (refered to as a PIE script) and optionally a text configuration file. PIE then uses the settings provided to initiate a connection to InSim. Once connected, PIE will wake from sleep at the specified frequency to run a 'tick'. During this tick, PIE will process any incoming packets, call any pending callback functions, and return to sleep. PIE runs at between 5 and 50 ticks per second, default 20.

PIE scripts consist of PHP functions that are called by PIE as appropriate, such as at startup, on receipt of a packet, at a pre-specified time, etc.

There are functions available to do common tasks such as sending packets, speaking to chat, etc., and a PIE object provides constantly-updated InSim information and a data store.

Functions that are called on receipt of an InSim packet are called with a parameter which consists of all the packet data, unpacked into an associative array. Some packets with combined values have additional indexes for the separated values, and all text fields have been made safe for windows (0 byte stripped, raw SkinID bytes converted to SkinID text string).


Requirements:
  • Windows or emulator
  • LFS v0.7+ (InSim v9+)
  • Visual C++Redistributable 2015 (often already installed) (https://www.microsoft.com/en-us/download/details.aspx?id=48145)
(You do NOT need to install PHP)


'Hello world' demo:
Attached images
image1.jpg
Attached files
PIEv0.1.1.zip - 9 MB - 345 views
tutorials.zip - 727.7 KB - 274 views
PIEv0.1.2.zip - 9.1 MB - 5 views
This is really cool, good work!
#3 - Racon
An update for PIE! (link in OP).

It's mostly new LFS packets (notably AI control!), but a few small tweaks and bugfixes too and an update to the quick-reference text.

It is fully compatible with previous versions.

Updates in version 0.1.2:

FIX: Added missing constants/defines
FIX: Added missing ServerStatus in STA packet
FIX: Added missing CPP packet
FIX: Auto-shutdown if 3 pings missed
FIX: Removed 'ghost data' from MCI tracking
LFS UPDATE: License byte added to NCI packet
LFS UPDATE: New PLH packet (PLayer Handicaps)
LFS UPDATE: New LCL (SMALL) packet (Local Car Lights)
UPDATE: Added PIE_PLH array, player handicap data indexed by PLID
UPDATE: Added 'Flags' to BTC packet (mirror of 'CFlags')
UPDATE: Multiple MCI packets in a set will be concatenated
UPDATE: Added script type (local/host) to ;PIE command report
UPDATE: Added PIE_buttonsafe boolean to PIE object, true when screen is safe for buttons
UPDATE: Added PIE_buttonsafe function, called when screen becomes safe for buttons
UPDATE: Added PIE_buttonunsafe function, called when screen becomes unsafe for buttons
LFS UPDATE: New IPB packet (get/set IPBans)
LFS UPDATE: New AIC packet (AI Control)
LFS UPDATE: New AII packet (AI Info)

FGED GREDG RDFGDR GSFDG