Hello programmers. This new version is in a good enough state now to make a special
thread. The changes are extensive - all old InSim programs will need to be updated as
they will not work at all with this new improved version of InSim.
CHANGES since W9
The guaranteed delivery system has been removed from the UDP version of InSim.
You may now connect using TCP, and this is recommended for guaranteed delivery.
Up to 8 InSim clients can connect, but only one of them can use the UDP method.
You no longer send an acknowledgment every time you receive a race tracking packet.
If you need guaranteed delivery (e.g. if you are race tracking remotely over the
internet) then you should use TCP. You can connect using TCP, or send a UDP packet
and LFS will communicate with your program using the chosen protocol.
The "regular" packets IS_NLP and IS_MCI are a special case - which may be sent
using UDP, if you wish, even if you connected via TCP. The idea is that those
particular packets represent car positions, so you do not need guaranteed
delivery - if you miss one packet, you just want the next packet that arrives.
This approach is similar to the use of UDP packets in LFS for car positions.
To enable this, supply a UDP port number in the IS_INI (InSimInit) packet.
To receive NLP and MCI packets using TCP, set the UDPPort field to zero.
To guarantee delivery over the internet, you must use the TCP method of connection.
UDP can be reliable on LAN and provides an easier upgrade path to the new system.
As TCP is a continuous stream rather than separate packets, every packet now starts
with a size byte, which you must compare with the read data stored in a buffer, to
know if you have a complete packet to process.
All packet headers have changed from the old 4 char header, to a new style of header
suitable for TCP. The first 4 bytes of all packets now follow a common pattern.
Size - total packet size
Type - packet identification byte from the ISP_ enumeration
ReqI - request id specified by an InSim program and returned in a requested packet
Xxxx - different in each case, often zero in the case of converted packets
All sizes are a multiple of 4 bytes. Two examples of smallest possible packets :
e.g. 1 : An IS_TINY packet equivalent to the old IS_REN (Race ENd) packet
Size : 4
Type : 3 from ISP_ enum : ISP_TINY (a general 4 byte packet)
ReqI : 0 not a requested packet
SubT : 11 from TINY_ enum : TINY_REN
e.g. 2 : The new IS_PLP packet
Size : 4
Type : 22 from ISP_ enum : ISP_PLP
ReqI : 0 not a requested packet (sent when a player pits, not on request)
PLID : 8 an example unique id (the unique id of the player who pitted)
NOTES on changes, to help convert existing InSim programs :
Most "InSimPack" packets now use the new IS_TINY, some use IS_SMALL
All packet headers have changed to the new style (Size, Type, ReqI, Xxxx)
Connections now have a unique identifier, called UCID, assigned in IS_NCN
Any mention of "Conn" or "ConnNum" is removed - use UCID from now on
Player's unique identifier "UniqueId" is renamed to PLID
Any mention of "PlyNum" is removed - use PLID in all cases
MSS (message out split) packet has been removed - use MSO instead
MSO (message out) has new info added to take the place of MSS
NPL (new player) has been reduced and rearranged a bit
LAP and SPX packets have been reduced and rearranged
You can get some info about insim's state by typing /insim
FIN (finished) and RES (result) are now two separate packets
You can specify a custom command prefix in the IS_ISI packet
The IS_REO packet can now be used to reorder a race before the start
CHANGES W to W9
changed packets (size not changed) :
IS_NPL : Handicap and passenger info added
IS_PEN : Penalty reason byte added
IS_FLG : Added unique id of obstructed player
Player flags : Added SHIFTER, AXIS_CLUTCH, CUSTOM_VIEW
new packets :
IS_CCH : sent when a player's selected camera changes
IS_III : info /i message sent by user to host's InSim
CHANGES V to W
VERSION : InSim version increased to 3
changed packets (size not changed) :
IS_RST - Added race flags (MUST_PIT, etc)
IS_NPL - CName now 4 chars + added skin name and tyre compounds
IS_LAP - CName now 4 chars + added number of laps / flags / penalty / stops
IS_RES - New FIN version of this is sent immediately on finishing race
new packets :
IS_PIT (pit stop)
IS_PSF (pit stop finished)
IS_PEN (penalty)
IS_TOC (take over car)
IS_FLG (yellow or blue flags)
IS_PFL (player help flags)
DOWNLOAD W14 TEST :
client and dedi exe only - requires W10 from test patch forum
no other changes - only get this if you are testing InSim
[ EDIT : link removed - new version available below : http://www.lfsforum.net/showthread.php?p=403965#post403965 ]
DOCUMENTATION :
Ful documentation is provided in the attached ISPackets.txt file, best read in a text editor with tab size
set to 4 spaces. In fact it's a C++ header file, used in LFS, renamed to .txt so I could attach it to the forum.
[ EDIT : attachment removed - new version available below : http://www.lfsforum.net/showthread.php?p=403965#post403965 ]
STILL TO BE DONE :
I still want to add a proposed button interface allowing InSim software to add buttons to your
screen for the purposes of displaying info or providing menu services.
thread. The changes are extensive - all old InSim programs will need to be updated as
they will not work at all with this new improved version of InSim.
CHANGES since W9
The guaranteed delivery system has been removed from the UDP version of InSim.
You may now connect using TCP, and this is recommended for guaranteed delivery.
Up to 8 InSim clients can connect, but only one of them can use the UDP method.
You no longer send an acknowledgment every time you receive a race tracking packet.
If you need guaranteed delivery (e.g. if you are race tracking remotely over the
internet) then you should use TCP. You can connect using TCP, or send a UDP packet
and LFS will communicate with your program using the chosen protocol.
The "regular" packets IS_NLP and IS_MCI are a special case - which may be sent
using UDP, if you wish, even if you connected via TCP. The idea is that those
particular packets represent car positions, so you do not need guaranteed
delivery - if you miss one packet, you just want the next packet that arrives.
This approach is similar to the use of UDP packets in LFS for car positions.
To enable this, supply a UDP port number in the IS_INI (InSimInit) packet.
To receive NLP and MCI packets using TCP, set the UDPPort field to zero.
To guarantee delivery over the internet, you must use the TCP method of connection.
UDP can be reliable on LAN and provides an easier upgrade path to the new system.
As TCP is a continuous stream rather than separate packets, every packet now starts
with a size byte, which you must compare with the read data stored in a buffer, to
know if you have a complete packet to process.
All packet headers have changed from the old 4 char header, to a new style of header
suitable for TCP. The first 4 bytes of all packets now follow a common pattern.
Size - total packet size
Type - packet identification byte from the ISP_ enumeration
ReqI - request id specified by an InSim program and returned in a requested packet
Xxxx - different in each case, often zero in the case of converted packets
All sizes are a multiple of 4 bytes. Two examples of smallest possible packets :
e.g. 1 : An IS_TINY packet equivalent to the old IS_REN (Race ENd) packet
Size : 4
Type : 3 from ISP_ enum : ISP_TINY (a general 4 byte packet)
ReqI : 0 not a requested packet
SubT : 11 from TINY_ enum : TINY_REN
e.g. 2 : The new IS_PLP packet
Size : 4
Type : 22 from ISP_ enum : ISP_PLP
ReqI : 0 not a requested packet (sent when a player pits, not on request)
PLID : 8 an example unique id (the unique id of the player who pitted)
NOTES on changes, to help convert existing InSim programs :
Most "InSimPack" packets now use the new IS_TINY, some use IS_SMALL
All packet headers have changed to the new style (Size, Type, ReqI, Xxxx)
Connections now have a unique identifier, called UCID, assigned in IS_NCN
Any mention of "Conn" or "ConnNum" is removed - use UCID from now on
Player's unique identifier "UniqueId" is renamed to PLID
Any mention of "PlyNum" is removed - use PLID in all cases
MSS (message out split) packet has been removed - use MSO instead
MSO (message out) has new info added to take the place of MSS
NPL (new player) has been reduced and rearranged a bit
LAP and SPX packets have been reduced and rearranged
You can get some info about insim's state by typing /insim
FIN (finished) and RES (result) are now two separate packets
You can specify a custom command prefix in the IS_ISI packet
The IS_REO packet can now be used to reorder a race before the start
CHANGES W to W9
changed packets (size not changed) :
IS_NPL : Handicap and passenger info added
IS_PEN : Penalty reason byte added
IS_FLG : Added unique id of obstructed player
Player flags : Added SHIFTER, AXIS_CLUTCH, CUSTOM_VIEW
new packets :
IS_CCH : sent when a player's selected camera changes
IS_III : info /i message sent by user to host's InSim
CHANGES V to W
VERSION : InSim version increased to 3
changed packets (size not changed) :
IS_RST - Added race flags (MUST_PIT, etc)
IS_NPL - CName now 4 chars + added skin name and tyre compounds
IS_LAP - CName now 4 chars + added number of laps / flags / penalty / stops
IS_RES - New FIN version of this is sent immediately on finishing race
new packets :
IS_PIT (pit stop)
IS_PSF (pit stop finished)
IS_PEN (penalty)
IS_TOC (take over car)
IS_FLG (yellow or blue flags)
IS_PFL (player help flags)
DOWNLOAD W14 TEST :
client and dedi exe only - requires W10 from test patch forum
no other changes - only get this if you are testing InSim
[ EDIT : link removed - new version available below : http://www.lfsforum.net/showthread.php?p=403965#post403965 ]
DOCUMENTATION :
Ful documentation is provided in the attached ISPackets.txt file, best read in a text editor with tab size
set to 4 spaces. In fact it's a C++ header file, used in LFS, renamed to .txt so I could attach it to the forum.
[ EDIT : attachment removed - new version available below : http://www.lfsforum.net/showthread.php?p=403965#post403965 ]
STILL TO BE DONE :
I still want to add a proposed button interface allowing InSim software to add buttons to your
screen for the purposes of displaying info or providing menu services.