PDA

View Full Version : .NET - LFSlib.NET status


sdether
26th February 2008, 18:49
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.

bukhem
26th February 2008, 22:52
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. :nod:

Cheers,
Michael

the_angry_angel
27th February 2008, 00:34
Erm.. I think you're confusing LFSlib.NET and LFS_External bukhem :o These are 2 independant projects.. Or have I lost the plot?

sdether
27th February 2008, 02:43
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

bukhem
27th February 2008, 07:43
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. :D

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

Cheers.

the_angry_angel
27th February 2008, 09:19
Sorry, I just saw cross posting and was getting confused myself :x

sdether
28th February 2008, 23:40
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/

bukhem
29th February 2008, 13:00
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? :scratchch

Cheers,
Michael

bukhem
29th February 2008, 14:06
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. :nod:

Cheers,
M.

sdether
29th February 2008, 17:17
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? :scratchch

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().De claringType.. so if that's still the case, then you're solution is the one to use.

bukhem
29th February 2008, 19:27
Hrmm.. haven't checked .NETCF 2.0, but 1.0 didn't have System.Reflection.MethodBase.GetCurrentMethod().De claringType.. 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. :schwitz:

bukhem
1st March 2008, 06:29
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. :D

Cheers,
Michael

whiterat
24th May 2008, 08:51
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.RaceTrackPlay er) 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.RaceTrackPla yer'...]
['Carname' is ambiguous because multiple kinds of members with this name exist in class 'FullMotion.LiveForSpeed.InSim.Events.RaceTrackPla yer'..."]

Visual Basic isn't case-sensitiv, he don't see difference between 'e.Carname' and 'e.CarName'.

Töki (HUN)
24th May 2008, 12:56
Miben mesterkedsz? :D

BabyOnWheels
11th August 2008, 08:26
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

bluejudas
16th August 2008, 00:09
Is it compatible with the latest lfs patch ??

~b

bluejudas
18th August 2008, 08:06
Is it compatible with the latest lfs patch ??

~b
Yes it is :)

EQ Worry
30th August 2008, 09:04
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 (http://members.chello.cz/lfs/LFSLib.lib.zip) or source code (http://members.chello.cz/lfs/LFSLib.src.zip). Oh, I almost forgot: People who did it, you library is GREAT and works very nicely!

DarkTimes
7th July 2009, 17:59
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])
{
case '8':
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. :p

EQ Worry
8th July 2009, 08:00
I believe you're completely right. :)

bluejudas
22nd August 2009, 23:24
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

bluejudas
23rd August 2009, 08:22
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....

bluejudas
2nd October 2009, 17:01
Two questions...

Is there a message sent when we get green light ?

Is it possible to cancel messages sent by a user ?

~b

burnsy1882
2nd October 2009, 17:22
Both no.