Yeah I'd be happy to contribute to LFS Record. The first thing I'd do is port the InSim code over to InSim.NET, which shouldn't be very difficult. It's not so much about testing every part of the code, most of it is fundamentally unchanged, but just taking care of those small things that only crop up when you're running in a real environment.
Once I'd done that I can take a look around and help with anything else that needs doing. I must admit that I've already had a peek at the disassembly, but it's hard to see exactly what's going on if you don't have the original source files.
I have decided that the best way to test the new version of the library is to write an application that uses it. So... if you have a good idea for a InSim program or tool, let me know and I might write it for you. And no, I'm not going to write a cruise server.
At the moment I'm thinking I might build a LFSRemote/LFSSpecator style tool with WPF, that lets you spectate races outside of LFS. I already have the track rendering code written, and I think drawing all the cars and stuff would be quite easy and fun.
Yeah, I've had that before. I called up the guy at TalkTalk to tell him I was only getting about 100 kbps, when he proudly informed me that my line was running at 8 mbps. OK - great, my phoneline gets better broadband that I do, but that doesn't help me when I'm trying to watch an episode of Doctor Who and the screen freezes every ten seconds.
Anyway, after getting more and more angry with this poor guy (I always try not to get pissed at them, it's not their fault), I eventually hung up. Within a few days my speed was miraculously back to normal all by itself. I guess those three inches of cable between my phoneline and the computer must have recovered.
I've uploaded the current codebase, although it still needs a few tweaks and fixes here and there. I'm going insane trying to get encoding stuff to work, so I've just included a modified version of the old LFSLib encoding code, which works great for single-byte character sets, but not double-byte characters such as Chinese. Also now included is full OutSim and OutGauge support, plus lots of other API improvements. I need to create some documentation for the changes, amongst other things.
I'm trying to get all this stuff finished to I can stop bloody working on LFS related things and program something more interesting.
I had added some stuff that generates a default filename for you when you click export, and while it works on this PC, that doesn't seem to be the case for you. I think it may be an internationalization issue, as the filename in that error report is slightly different from how I intended it to look. Anyway, I've simplified all that stuff now which should get rid of it.
I was't planning on releasing a new version until I had finished the new sniffer code, but I have uploaded BETA 3 which is just BETA 2 with a few bug fixes.
In addition to confirming the export now works (hopefully), I'd also appreciate it if you could report back on whether the Launch LFS code is any better.
Where in your code is the YellowFlag variable being set to false? You will need to set YellowFlag to false at some point, otherwise the code will enter an infinite loop, which would indeed stop the thread from ever exiting. I would double-check your code to make sure that variable is being correctly unset.
Additionally I would not suggest using a thread for this, a better idea would be to use a timer set to elapse every second. Check out the threading.Timer class.
OK, thanks for those reports. I just haven't checked the tab stop order for a while, so I guess it must have gotten mixed up.
I can try adding a call to Process.WaitForInputIdle() to the LFS launch code, which will cause InSimSniffer to wait until LFS has finished creating its main window and the message pump goes into an idle state. Hopefully by then the socket code should be ready for it to connect.
The exception thing was something I put in to allow me to test the unhandled exception code and I decided to leave it. It lets people see what happens when an error occurs. I don't remember where the Monty Python references came from.
LFS should reply with an error when you set the wrong admin password in the ISI packet. Even something as simple as adding a TINY_APR (Admin Password Refused) packet before closing the connection would work.
OK - I have fixed the password miss-match bug and the illegal path bug and uploaded a new version to the beta post. The illegal path bug was introduced by a change I made to make the LFS.exe browse dialog work better on Windows 7, the admin password bug was in code unchanged from the old version but had just never been reported before.
I can't say for certain what the problem is, but that message is ConnectionRefused, which means that either LFS is not running or the host/port information your provided is incorrect.
Do you get this error with the old/stable version of InSimSniffer?
Please fix the bugs in the Visual Studio forms designer.
KTHXBYE
I've uploaded a new version where the status bar actually works. Seriously every time I edit the application resources things mysteriously go missing from the form.
I set about to add some new features to this, but I was embarrassed by how poor the code was, so before I started working on it I decided to refactor the existing codebase to bring it up to a much higher standard.
There are no new features in this version, so to speak, but everything has been improved and brought up to date and many things run better. The code is also easier to follow and less-complex to understand (which is a benefit to me above all else). Other things such as security and compatibility have also been improved.
Anyway, it will have a few bugs here and there, and I still plan to refactor the actual packet sniffer quite a lot, but I decided to release it now in beta form so as to get feedback on any problems there are with the current code revision.
You can download 1.2 later in this thread. Please note that it will have bugs, but then every program has bugs, so meh.
Last edited by DarkTimes, .
Reason : Added link to 1.2 RC1
You could try using UDP for the position updates, although it seems that your program might require that the packets arrive in the correct order, which UDP does not guarantee.
It sounds like the culprit may be the Nagle algorithm, which improves network efficiency by sending packets in batches. You can learn more about Nagle on the WinSock FAQ.
Another option might be to to use OutSim or OutGauge packets, which do include a timestamp when they are sent.
I cannot reproduce this bug, so I would appreciate it if you could send a crash report, if one was generated. Otherwise I need step-by-step instructions on how to reproduce it. I have looked through the code and tried moving the LFS location but I can't see anything that would allow this bug to happen.