Jeez... First we get inundated with nearly every other "Programmer Forum" thread being yet another LTC clone request. Now we're also getting slap fights about people creating LTC clones.
My hat's off to Krammeh (i assume the attribution for LTC is correct). It's certainly sparked a phenomenon and the sincerest form of flattery is imitation.
Once someone puts their stuff out on a public server, it's there for everyone to draw inspiration from. If its popular and not being offered for others to use, someone will try to re-implement it. That's not theft. Until you take a Patent out of it (which you unfortunately can), ideas and processes are not intellectual properties.
Can we get back to talking about the actual coding of InSim apps (and no, InSim is not a special LFS term for Cash Server).
I'll try to package up 0.16b (with Relay support) of my lib today or tomorrow and release it. That way people can do some more testing against the test server before it goes live.
Am I smoking something or did IS_CPP always report a (0,0,0) vector if not in Shift+U mode? The docs just say:
// Position vector (Vec Pos) - in SHIFT+U mode, Pos can be either relative or absolute.
So the behavior outside Shift+U is not defined. I thought it used to actually provide the camera's current position.
The reason i ask is that if I hit the Shift+U, it enters the mode at the place the current car was at that point, but if i request a IS_CPP, just set the ShiftU flag and send that back, it puts the camera at (0,0,0) and makes LFS upset.
The only workaround I can see is to request a IS_CPP and get the IS_MCI for the current car and use that coordinate info to mod the IS_CPP before sending it back.
Not that I can tell. While Pth files widen the drivable area to include the pits, this is a clue easily picked out visually, but not programmatically. On top of that, I don't know of a place where the "pit enter/pit leave" nodes are recorded.
It would be useful information to map out, imho. I'd start with recording the nodes for pit start & pit end. Once you have that you could see if you get any false positives if you just say
if(car between pitstartNode and pitEndNode && car between currentNode.DriveLeft and currentNode.LimitLeft) { // this assumes pits are always on the left of the track (bad assumption) car is in pit }
the Pth Limit on the pit side gives you the outer bounds, but whether the Drive line gives you the inner bounds is something that would have to be tested.
[offtopic]You might say, it's one of the theoretical beauties of virtual machines. Except that .NET is the only one actively pushing the multi-language to one bytecode aspect, while Java does it almost despite of Sun and Mozilla and Adobe aren't even considering letting you address their VMs with bytecode.[/offtopic]
That said, yes, LFSLib.NET can be used in any language that can consume .NET dlls and I've even got it running under mono on linux (and i got a modified version mostly runnning on WM5 phones as well). As for IronRuby, the early alpha is finally out and will be hosted on RubyForge, but it's probably another 6 months out from being a viable .NET language.
I'm not sure I understand what the valid vs. lacking valid versions of the penalty are, but I just looked at the packets coming in and that's what LFS is sending. So that's either what it's supposed to be or it's a bug in LFS.
I'm done with my testing and the relay seems to work as advertised. The only suggestion I would still have is adding ReqI for IR_ERR_PACKET2. Might help people debugging, although it's a design time thing really. Once you know that a packet is invalid, you shouldn't be sending it again or at least not be reacting to it at runtime.
I just tested this (with no server side handicap), just joining with the FZR and 200kg of handicap and whether i was connected to the server via the client's or the servers insim connection, the 200 came through fine in the NPL and the connection stayed alive
BTW, I thought i saw that TINY NONE was a valid response now... I was connected to the LX server via the relay and was getting TINY NONE as keep-alive from the server, to which my API automatically response with TINY NONE. This results in an IR_ERR for me.
Also, would it be possible to let me set up a server and have you add it to the relay.. i want to make sure my lib does things properly and the easiest would be if i could syntesize action on the server to watch.
Only now getting around to implementing this. I should probably wait until i queue requests up, but here goes one
Can we make IR_HLR use a ReqI for consistency? My API always returns a request id to the caller to use for checking incoming messages and since IR_HLR is a request, it would be nice if it fit into that paradigm
Well, this just lets the server do it per player. So CTRA could look at the player and his/her car and set the restrictions depending on car or driver skill.
It be a nice way for a license server system to create closer races, i.e. restrict the players based on past performance and dole out points according to race results and restrictions in place.
But, I agree, that would be useful. Although i think it would be more versatile and wouldn't require InSim changes if we could just get commands for these actions, such as:
Just connected to CTRA Bump & Jump and my InSim died. Are you using TCP or UDP? I'm using TCP and I thought the socket was being closed on me. But may I was reading the debug trace wrong and LFSLib.NET dies for some reason.. Lemme track it down
Update: Problem solved. It is on my end. There is a bug in LFSLib.NET with AXI and AXO packets. Ok, time to prep 0.15b
Update 2 : And I see you've amended your post pointing out that same bug Yeah, I had the case statement for what to do when you get that type of packet, but not the case statement to recognize it in the first place. duh.
Last edited by sdether, .
Reason : Found the problem
I just noticed that the same happens if i start up a single player game using a track that has a layout file associated. So it doesn't seem to be a server issue, but something in the track loading process kicks InSim
I guess we need a bit more info on how you are writing this app. What language are you writing it in, are you using any kind of insim library?
Also, the connection packet you are looking for is IS_NCN. Your insim application connected to a server will receive this when a new user connects to the server (not joins the game, btw).
Right now, there is a message the server sends to all connections notifying them that user 'x' connected. You want to send more information of that kind to everyone?
I've spent too much time trying to watch IS_STA packets and created this real quick to help me figure out what i need to watch out for. There's both binary and source releases.