The online racing simulator
.NET - LFSlib.NET status
I'm currently doing some code clean-up and bug fixes to get 0.18b out (i know 017b never made it out publicly). That version is also going to be the first that lives on sourceforge.

Current version, docs, etc. are still at http://lfs.fullmotionracing.com/

0.18b and on will migrate to http://sourceforge.net/projects/lfslibnet/

If you want to become a contributor, drop me a message on sourceforge.
As mentioned earlier I will (try) to make the lib work with the CF (compact framework) so it can be used on Smart-Devices.

Currently v0.16 already runs on my iPaq with PPC2003.
:leb:

Waiting for the release on SF.

Cheers,
Michael
Attached images
TouchLFS-InSim-01.jpg
TouchLFS-OutGauge-01.jpg
Erm.. I think you're confusing LFSlib.NET and LFS_External bukhem :o These are 2 independant projects.. Or have I lost the plot?
Quote from the_angry_angel :Erm.. I think you're confusing LFSlib.NET and LFS_External bukhem :o These are 2 independant projects.. Or have I lost the plot?

Actually Micheal's been going through LFSLib to get it working under .NETCF and we hope to sprinkle the codebase with preprocessor instructions so a single source tree will be able to compile the lib for both .NET and .NETCF
Quote from the_angry_angel :Erm.. I think you're confusing LFSlib.NET and LFS_External bukhem :o These are 2 independant projects.. Or have I lost the plot?

Nope, I've been kind of waiting for LFS_External too as I didn't get LFSlib.NET working with .NETCF, until yesterday.

As LFSlib.NET is much further developed I'll use it for my project.

Cheers.
Sorry, I just saw cross posting and was getting confused myself
0.18b released
Quote from sdether :The newest version, along with SVN source access, bug and request systems and all the happiness that sourceforge brings, is now up at http://sourceforge.net/projects/lfslibnet/

I created a branch for the migration and added a new (pocketpc) project named LFSlib.CF into it.
VS defines a precompiler constant(?) named "PocketPC" by default for such projects, so I'm going with that in the source.
Currently I think about "tricking" the logging stuff with that:

#if !PocketPC
using log4net;
#endif
[...]
#if !PocketPC
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#else
private static readonly LogFaker log = new LogFaker();
#endif

Of course LogFaker implements everything from the ILog interface.
Any thoughts?

Cheers,
Michael
My changes are checked in. The project compiles now with CFNET 2.0.
I didn't check against my current working version but AFAIR there are a few things to workout so it will run as well.

Will do that tonight, I guess.

Cheers,
M.
Quote from bukhem :I created a branch for the migration and added a new (pocketpc) project named LFSlib.CF into it.
VS defines a precompiler constant(?) named "PocketPC" by default for such projects, so I'm going with that in the source.
Currently I think about "tricking" the logging stuff with that:

#if !PocketPC
using log4net;
#endif
[...]
#if !PocketPC
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#else
private static readonly LogFaker log = new LogFaker();
#endif

Of course LogFaker implements everything from the ILog interface.
Any thoughts?

Cheers,
Michael

You could make it even easier on yourself and create a Mock LogManager that returns a Mock ILog. Then you just need to do

#if !PocketPC
using log4net;
#else
using mockLog4net;
#endif

Inside of mockLog4net you have two classes, LogManager and MockLogger, and a copy of the ILog interface. LogManager which just has the static GetInstance method and always returns an instance of MockLogger which implements a stub ILog interface that does nothing.

Hrmm.. haven't checked .NETCF 2.0, but 1.0 didn't have System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.. so if that's still the case, then you're solution is the one to use.
Quote from sdether :
Hrmm.. haven't checked .NETCF 2.0, but 1.0 didn't have System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.. so if that's still the case, then you're solution is the one to use.

Yeah - that's still missing and I already changed the whole source like planned above. Let's see what other problems I run into tonight.
K, just a quick notice.
With the last revision I checked I watched 30 minutes of an online race. Displayed outgauge data, send messages, ... seems to work as expected.

No NullPointers, everything was fine.

Cheers,
Michael
Multiply propertynames in Visual Basic.NET
I can't use the version 0.18b in Visual Basic.NET
For example: RaceTrackPlayer event

Sub handler_RaceTrackPlayer(sender As FullMotion.LiveForSpeed.InSim.InSimHandler, e As FullMotion.LiveForSpeed.InSim.Events.RaceTrackPlayer) handles handler.RaceTrackPlayer
...
players(e.PlayerId)= New PlayerInfo(e.PlayerName, e.PlayerId,handler)
players(e.PlayerId).Car = e.Carname
...
End Sub


The result is this error messages:
['Playername' is ambiguous because multiple kinds of members with this name exist in class 'FullMotion.LiveForSpeed.InSim.Events.RaceTrackPlayer'...]
['Carname' is ambiguous because multiple kinds of members with this name exist in class 'FullMotion.LiveForSpeed.InSim.Events.RaceTrackPlayer'..."]

Visual Basic isn't case-sensitiv, he don't see difference between 'e.Carname' and 'e.CarName'.
Miben mesterkedsz?
At first thanks for great lib. It is very usefully for me.

I want to ask you for fixing small bug.
(It isn’t problem to change it locally, but I think it will be better to fix it in original sources.)

.\LFSLib.NET\trunk\LFSLib\InSim\Events\CarInfo.cs

/// <summary>
/// The speed of the car in meters/second
/// </summary>
public float Speed
{
get { return (int)compCar.Speed*100/32768; }
}

Returns int instead float. I don’t know if it was purpose (it seems) or not, but for precision speed comparison the float is better.

public float Speed
{
get { return compCar.Speed * 100.0f/32768.0f; }
}

Thanks
Baby
Is it compatible with the latest lfs patch ??

~b
LFSlib.NET updates
Hi people!

In the past several months I was using this library extensively while developing the massive Airio tracker, exploiting just about every aspect of insim data. While doing this I discovered and corrected numerous small bugs in the library source code. Problem is I was doing it rather for myself, took no notes and I cannot remember all those now. Anyway, here is the list of changes I can remember:

1) Speed is now output as float (not int, as mentioned above).

2) Passengers are handled/reported correctly.

3) Correct Autocross request packet is sent.

4) New LAG bit of patch Z is implemented.

5) Fixed some troubles with ^ character handling.

I also did some major changes to the code to have a library in the style I would like:

1) Removed all references to Log4Net.

2) Completely rewritten LFS string conversion to Unicode and back (using conversion tables from LFSlapper, but new code) so that all mappings are correct now. Still missing is conversion of Korean (^K) and Chinese (^H and ^S) double byte sets.

I'm not sure the original developer(s) would be happy with all the updates, but anyone interested may download this version (called 0.18b6) either as compiled library or source code. Oh, I almost forgot: People who did it, you library is GREAT and works very nicely!
I've been going through the string encoding in CharHelper.cs, because I plan to shameless steal it (don't worry it's still GPL), and I think I found a small bug in CharHelper.GetBytes().

switch (str[i + 1])
{
[b]case '8':[/b]
case 'L':
codepage = 'L';
break;
case 'E':
codepage = 'E';
break;
case 'C':
codepage = 'C';
break;
case 'G':
codepage = 'G';
break;
case 'T':
codepage = 'T';
break;
case 'B':
codepage = 'B';
break;
case 'J':
codepage = 'J';
break;
}

That value I believe should be '9', as ^9 is used to reset the colour and codepage back to the default. Resetting the code page on a 8 might cause weird issues. I know it's small but I thought I'd point it out.
I believe you're completely right.
Hi,

I am trying to get Dialog buttons to work, but has had no luck so fare.
My code can make a dialog button and I can enter text in the dialog, but I can not change the text and there is no handler being called when I enter the text in the dialog.
Can someone provide me with an example or point me to one ??

tnx...

~b
Quote from bluejudas :Hi,

I am trying to get Dialog buttons to work, but has had no luck so fare.
My code can make a dialog button and I can enter text in the dialog, but I can not change the text and there is no handler being called when I enter the text in the dialog.
Can someone provide me with an example or point me to one ??

tnx...

~b

Ok I solved my problem. I need to listen to the FullMotion.LiveForSpeed.InSim.Events.ButtonType event....
Two questions...

Is there a message sent when we get green light ?

Is it possible to cancel messages sent by a user ?

~b
Both no.

FGED GREDG RDFGDR GSFDG