using System;
using LiveForSpeed.InSim;
namespace ConsoleTester
{
class Program
{
static void Main(string[] args)
{
// Create InSimHandler option. The first false tells it that we don't
// want Asynchronous event handling, the second false tells it
// that we don't want to use the App Config to set up configuration
InSimHandler handler = new InSimHandler(false, false);
// Gets the config object (this is just for easier access to it)
Configuration config = handler.Configuration;
// The IP address that LFS is on
config.LFSHost = "127.0.0.1";
// The port LFS listens for InSim on ( /insim= )
config.LFSHostPort = 30000;
// The port we want LFS to talk back to us on
config.ReplyPort = 30001;
// Should LFS send keep alive ACKs and should we automatically reply
config.UseKeepAlives = true;
// Use the split message package structure
config.UseSplitMessages = true;
// Turn on guaranteed Delivery
config.GuaranteedDelivery = true;
// Send ISI packet.. Also sends VER packet to make sure
// that we're talking to an instance of LFS that's compatible
handler.Initialize();
// Now we should be connected and know the LFS version, so
// we query it
Console.WriteLine("LFS info:");
Console.WriteLine(" Product: {0}", handler.Version.Product);
Console.WriteLine(" Version: {0}", handler.Version.Version);
Console.WriteLine(" Serial: {0}", handler.Version.Serial);
// Closes the connection to LFS.
handler.Close();
Console.WriteLine("Press RETURN to exit");
Console.ReadLine();
}
}
}
using System;
using LiveForSpeed.InSim;
namespace ConsoleTester
{
class Program
{
static void Main(string[] args)
{
InSimHandler handler = new InSimHandler(false, false);
Configuration config = handler.Configuration;
config.LFSHost = "127.0.0.1";
config.LFSHostPort = 30000;
config.ReplyPort = 30001;
config.UseKeepAlives = true;
config.UseSplitMessages = true;
config.GuaranteedDelivery = true;
handler.Initialize();
Console.WriteLine("LFS info:");
Console.WriteLine(" Product: {0}", handler.Version.Product);
Console.WriteLine(" Version: {0}", handler.Version.Version);
Console.WriteLine(" Serial: {0}", handler.Version.Serial);
handler.Close();
Console.WriteLine("Press RETURN to exit");
Console.ReadLine();
}
}
}
LFS info:
Product: S2
Version: 0.5Q
Serial: 2
Press RETURN to exit
offset type number description
------ ---- ------ -----------
0 char 6 LFSCFG
6 byte 1 0
7 byte 1 Version byte (0.5P is 250)
8 char 15 filename of the skin associated to
the .COL file (part between <CAR>_ and .JPG
23 byte 1 0
24 byte 1 First Body Red Component (10-160)
25 byte 1 First Body Green Component (10-160)
26 byte 1 First Body Blue Component (10-160)
27 byte 1 0
28 byte 1 Second Body Red Component (10-160)
29 byte 1 Second Body Green Component (10-160)
30 byte 1 Second Body Blue Component (10-160)
31 byte 1 0
32 byte 1 Third Body Red Component (10-160) (only UFR)
33 byte 1 Third Body Green Component (10-160) (only UFR)
34 byte 1 Third Body Blue Component (10-160) (only UFR)
35 byte 1 0
36 byte 1 Unused Body Red Component (10-160) (only UFR)
37 byte 1 Unused Body Green Component (10-160) (only UFR)
38 byte 1 Unused Body Blue Component (10-160) (only UFR)
39 byte 1 0
40 byte 1 First Wheel Red Component (10-160)
41 byte 1 First Wheel Green Component (10-160)
42 byte 1 First Wheel Blue Component (10-160)
43 byte 1 0
44 byte 1 First Wheel Red Component (10-160)
45 byte 1 First Wheel Green Component (10-160)
46 byte 1 First Wheel Blue Component (10-160)
47 byte 1 0
48 byte 1 Unused Wheel Red Component (10-160)
49 byte 1 Unused Wheel Green Component (10-160)
50 byte 1 Unused Wheel Blue Component (10-160)
51 byte 1 0
52 byte 1 Unused Wheel Red Component (10-160)
53 byte 1 Unused Wheel Green Component (10-160)
54 byte 1 Unused Wheel Blue Component (10-160)
55 byte 1 0
S2 .COL file specification.
---------------------------
TYPES :
=======
char: 1-byte ascii character
byte: 1-byte integer
int: 4-byte int
offset type number description
------ ---- ------ -----------
0 char 6 LFSCFG
6 byte 1 0
7 byte 1 Version byte (0.5P is 250)
8 char 15 filename (part between <CAR>_ and .JPG
23 byte 1 0
24 int 4 First Body ARGB color value
28 int 4 Second Body ARGB color value (only some cars)
32 int 4 Third Body ARGB color value (only UF GTR)
36 int 4 Fourth Body ARGB color value? (unused)
40 int 4 First Wheel ARGB color value
44 int 4 Second Wheel ARGB color value
48 int 4 Third Wheel ARGB color value? (unused)
52 int 4 Fourth Wheel ARGB color value? (unused)