The online racing simulator
lol
Just a question to see if I'm a numpty or if it is a genuine problem; is LFS External supposed to work with an InSim configured/initialised OutSim port?

What I try to do is:
1) Connect via InSim
2) Send a SMALL SSP packet to init OutSim
3) Read OutSim and use its data for various calculations
4) Send commands via InSim based on the calculated data

The problem is as far as I can tell, that the InSim class automatically creates an UDP listener as soon as you specify an UDP reply port in the IS_ISI packet (actually class constructor). However, in the case for the SMALL SSP packet, this setting is used for configuring OutSim. Now of course I cannot listen to the OutSim port, because the InSim class already has the listener bound to it. Adding to that it throws an exception as soon as LFS starts sending, as it can't handle the OutSim packets (they don't have the packet size/etc. header information, and after all it's expecting InSim packets to arrive).

I got it working right now, but it's very very hacky, and I'd rather use it the proper way. At the moment I'm using a custom written OutSim handler (the OutSim class somehow errors with a NullReferenceException if I try to use it in conjunction with the other hack), and hacked the LFSExternal.dll to not create the UDP listener for the InSim class.

I'm fearing it's something embarrassingly simple and I'm solving problems with a sledgehammer here, but I tried and tried and can't seem to get it working the proper way.
Got it working now - it's still a workaround but at least much less of a hack then previously. I wrote a primitive InSim handler to connect to LFS, initialise OutSim and disconnect again, then re-connect via LFS External to have proper InSim handling.

I'm much happier with this approach, so I guess I'll continue using it that way, unless someone can point out a glaringly obvious mistake I made
Hey T-Ronx,

Normally when you connect to the lfs server with a insim program and the lfs server shuts down it should keep on trying reconnecting right? I just tried it and I got this exception:

System.IO.IOException was unhandled
Message="Kan geen gegevens lezen uit de transportverbinding: De externe host heeft een verbinding verbroken."
Source="System"
StackTrace:
bij System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
bij LFS_External.InSim.InSimInterface.listen_tcp()
bij System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bij System.Threading.ThreadHelper.ThreadStart()

And it doesn't point to any line so could it be a "bug" in the class itself?
That's the same I was getting... do you by any chance have a secondary connection open to LFS in some way? Anyway, the exception is thrown in LFS External's TCP listener thread, so there's no way for you to catch it - it would have to be handled by LFS External itself.
nope only 1 connection
Ok it could be a bug. I just reinstalled my OS so I can't have a look right now. I'll investigate when I have time.
Im trying to do something in my PDA. I wonder if this .dll would work on a WM6 pda... (basically I need to communicate with LFS running on my pc, and the easiest way I can figure out to do it is via networking - outgauge to the PDA).
If it's actually networked, whether wireless or wired, it will have an IP to the PC. In LFS' cfg.txt file, change the IP to that of your PDA. Then run LFS_External on the PDA, and it will receive info from the PC
awesome, big thanxs.
BTW, other than networking, any other way to commumicate with the PDA (assuming its connected with the USB cable and has activesync on)?
I really have NO idea, and I tried and tried and could find anything remotly usefull on teh web.
I'm not sure about USB...my idea would only work with Ethernet/Wi-Fi...AFAIK USB doesn't have IP addresses, and would be a hell of a lot more complicated, unless you can find a pre-made lib for your specific PDA...
You used to beable to get a TCP/IP connection between a PDA and a Windows Mobile device, over ActiveSync - however the last time I had a WM device to play with was over a year ago, so things may have changed.

I believe in ActiveSync if you go to File > Connection Settings there is an option in there to communicate using TCP. However, I think that only recent versions of WM (WM5, I think) actually present a usable network interface, which is part of the problem of getting WM to talk directly to applications on the host PC.

First thing I'd check is what version of WM you're trying to use, what version of ActiveSync, and whether or not you get an extra network interface when you enable TCP over ActiveSync...
I found something pretty cool, though TAA - when I connect the PDA, a new (my 4th) network connection appears - this is the network connection via USB to my pda. I think I can set the TCP/IP protocol to always give it the same IP.

But Im having a lot of trouble of having the bloody program run in the PDA.

I can make a "hello world" style thing, that takes a textbox and outputs the string again, but the program using LFS External wont work (tells me it cant run System - or somethin like this)
More details when I get the time to pick this up again
Does the PDA have .NET 3.5 installed on it? If .NET can even be installed on a PDA, idk...It seems like a framework error anyways
Ah yes, in which case you'd need to compile the program specifically for the Compact Framework, right? Haven't dealt with PDAs before, I'm too poor to own one
Well I'd be very surprised if LFS_External would run on the CF at all without an awful lot of work. Also seeing that LFS_E still closed source, it's not likely anyone would be able to do anything like that soon. I do know that a CF compliant version of LFSLib is in the works, but I don't know what the current state of that project is. Still, if you wanted to write a CF InSim program, nothing is to stop you writing your own InSim code, it's really not that complicated.
You dont acutally need to own a PDA iirc. Visual studio has something built in called a "Device emulator". You can emulate a PDA, although Im not sure how to run programs on it.
I had .net compact fmwrk 2.0. I installed the .net CF 3.5 and the program STARTED to run, then crashed with the message.
Me thinks the program begins, then as it loads LFS external, boom. which isnt surprising, and is why I asked what I asked a couple posts above.

Guess Ill have to code the tcp/ip stuff myself... oh well... more stuff to learn, I guess
I'm currently having a look at making it CF compatible, but I can't promise anything yet.
Just a progress update. It seems to work so far. I might release a test version tomorrow so we can hunt for bugs.
Attached images
works.jpg
I want to have your babies.
I need a little help in using the InSim.Send_BTN_CreateButton Method.
I' using LfS_External_vbf11 and event NCN_ClientJoinsHost.

Here is what works fine:

InSim.Send_BTN_CreateButton("Team:", "Team:", Flags.ButtonStyles.ISB_DARK + Flags.ButtonStyles.ISB_LEFT, 5, 20, 65, 20, 0, 101, NCN.UCID, 101, True)
InSim.Send_BTN_CreateButton("OK", Flags.ButtonStyles.ISB_CLICK + Flags.ButtonStyles.ISB_DARK, 5, 40, 70, 40, 103, NCN.UCID, 103, False)

But I need to have an input-box for text also. I tried many conbinations and the one out of the documentation as well:

InSim.Send_BTN_CreateButton("Click me", "I'm a textbox", Flags.ButtonStyles.ISB_CLICK + Flags.ButtonStyles.ISB_DARK, 10, 20, 50, 100, 10, 24, NCN.UCID, 98, True)
InSim.Send_BTN_CreateButton("Type Name here", "Type Name here", Flags.ButtonStyles.ISB_LIGHT, 5, 40, 65, 40, 20, 102, NCN.UCID, 102, True)

but no luck. The Buttons won't appear. What's wrong? I know it shout be working, T-RonX is using it for his Mail-System, but how the hell?
For the using the fuction when you click button:



if (BTC.ClickID.Equals([B][U][COLOR="Red"]HERETHEID[/COLOR][/U][/B]))
{
//here your code for when you clicked, for example, when you click send /msg.

InSim.Send_MST_Message("/msg ");

}

For type in the button I don't know how to, some people can post a example?

PD: You are sure your code are true? I believe is wrong.
for example ISB_DARK+ISB_CLICK, the operator for "or" is " | "
I'm using Visual Basic not C, so the operator should be correct.

The simple Click-Button ist working fine, only the dialog-ones won't work.

FGED GREDG RDFGDR GSFDG