The online racing simulator
Searching in All forums
(75 results)
Kiyoshi
S3 licensed
Thank you - that is pretty much how I ended up doing it for now, and it seems to work ok.
I think the old InSim instances do still exist, because they seem to still be associated with my packet event handlers. I might try releasing those on the disconnect event & see if that helps. Still, I don't think there should be a problem as it is, unless it reconnects 1000's of times!
InSimDotNet, problems reconnecting to a LFS client.
Kiyoshi
S3 licensed
I am writing a very basic InSim program, connecting to a local LFS client. I am polling the connection periodically, by calling insim.Initialize() if IsConnected is false, to connect when the LFS client is started, which works fine. When LFS is closed however, the next attempt to connect finds my InSim object to have Disposed of itself, and an exception is thrown.
Questions:

Is catching the ObjectDisposed event the correct way to handle this?

Is it ok to just create a new instance at that point & continue with that?

Will all my event binds be ok bound to the new instance? The old instance still appears to exist, even though it 'isDisposed' and still appears to be bound to all my event handlers.

Is there a better way I could handle it, say on the Disconnected event, and somehow keep my existing InSim object alive?
Kiyoshi
S3 licensed
Did you copy the whole code? I renumbered the 'case' statements.
That code should go:

default
case 1
case 2
case 3
case 4
default
case 1
case 2
etc...

If you put a breakpoint and step through the code, you can see how the 'Message' is changing, and how that chooses each case. You can then change it yourself to do any thing you want. Wink
It would be good for you to understand how this code works - read about switch-case statements. It's a simple bit of code, but very useful.
Kiyoshi
S3 licensed
This should work, unless something is happening to the variable 'Message' somewhere else.

private void MinuteTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
#region ' Auto Message '
if (Connections.Count > 1)
{
switch (Message)
{
case 1:
MsgAll("»^7 Drive on the ^1Right side of the Road!");
break;

case 2:
MsgAll("»^7 Swearing, Ramming, Insults and Disrespecting");
MsgAll("»^7 May Result to ban.");
break;


case 3:
MsgAll("»^7 Please visit us for more information");
MsgAll("»^7 " + Website);
break;

case 4:
MsgAll("»^7 Keep the server clean from swearing.");
break;

default: // always have a 'default' in a case which sets everything to known values. This will also be 'case 0'.
MsgAll("»^7 Welcome to the server.");
Message = 0; // 'Message' must be reset somewhere to start the loop again
break;
}
Message += 1; // 'Message' must be changed each time for a different message
}
#endregion

Kiyoshi
S3 licensed
Alles klar, danke! ;D
Kiyoshi
S3 licensed
Can we change driver between qualifying and race?
The Rules state that the qualifying driver must take part in the race, but not that he must start the race.
Kiyoshi
S3 licensed
Yes, Happy Birthday LFS!

I've played this game for 10 years, & still playing.

So before you complain, go do something for yourself that people will still be talking about in 10 years...
Kiyoshi
S3 licensed
Hope you had a great day & having a great eveing!
Kiyoshi
S3 licensed
Kiyoshi
S3 licensed
Quote from sermilan :Yes, but he can not hide from mighty spdo database
Here are spdo statistics for his other account

No, he was on cargame.S1 later that evening & disconnected at 23:38. There is no connect or disconnect record on the spdo database, check for yourself. The drivers who disconnected either side are there.
replay is here:
http://www.cargame.nl/dl_s1.php?id=283668

SPDO database entry is around here at the moment:
http://replays.spdoracing.com/ ... t/115218/drivers/page/51

He also 'won' a race & in lfsw, the record for that race has a missing 1st place driver.

Hopefully this doesn't matter any more.
Kiyoshi
S3 licensed
FYI, apparently this hacker now has no active LFS account, but is still connecting to servers. Account name on the server still blank, but no name showing at all in the server list in LFSW.
Kiyoshi
S3 licensed
I had a closer look at the dependancy issues I had. It does seem to be a Windows nodejs/npm issue, similar to this one here:
http://stackoverflow.com/quest ... d-when-installed-with-npm

'npm link' doesn't work on Windows, apparently, and I don't think the npm install can install any dependancies into nodejs, which might just be the problem.
When trying to run XI4N, the missing modules nodejs reported were:
express; kdtree.js; socket.io; underscore

I originally got it working by 'npm installing' these in my xi4n folder, but that wasn't the right way to do it. I have now managed to install them to nodejs, though it was fiddly & I had to move their actual folders from node_modules into the nodejs root to get it to actually work.

So, don't let this distract you - I don't think it's any problem with the XI4N package, but a nodejs on Windows issue. nodejs version is 0.6.17 incidentally.
Kiyoshi
S3 licensed
Sorry, I didn't see this thread, just stumbled across the vid on you-tube.

If I was trying this, I think I'd give each racer an 'interesting' score, based upon (for example, but probably in this order of descending weighting):
> How close are they to the car in front?
> Are they currently being watched (and inversely, for how long)?
> Are they colliding?
> Are they off track?
> What is their position in the race?
> A 'Look - thats me!' lottery.
etc.
All cars are scanned each 'cycle' & the car with the highest score each cycle would be the one to watch.
It's a rather programmatical way to think of it, but should be easy to tune by weighting each category, rather than dealing with abstract things in code. I don't know whether this approach would work.
It did seem to spend quite a long time in it's 'hunt' mode sometimes.

Something else to consider, which does happen in real events, is that some parts of the track are more interesting than others. They are usually the ones where the cameras are located I suppose. It feels natural if the director switches cars between these sections of the track & not in the middle of them, or worse, just about to pass through one. Maybe there should be a track node weighting?
Kiyoshi
S3 licensed
Thanks for the response, it helped a bit.

I did manage to get this running at least, though I needed a few more steps than were in your readme - if others are going to try this in my situation, then it may be worth mentioning them:

I am running this on Windows, and have no experience of node.js or nmp.
I had to run 'nmp link' in the xi4n folder.
I also had to run 'npm install <module>' as I had several error messages reporting missing modules. I imagine this was due to a fresh install of node.js, though I'm not at all sure.

I haven't looked at the code yet. I don't know a great deal about JS either, but it looks interesting.
Kiyoshi
S3 licensed
This is very interesting, but a little confusing to an old-fashioned programmer.

It looks like at it's core, it basically translates insim packets (from a lfs server, or client?) to JSON versions, and can run local js plugins to 'do stuff' with the insim information locally. But what can it do beyond that? Does the lapper example just serve HTML to any connecting browser, or does it serve JSON insim packets directly to XIaN clients? Or could it do both? Should I just shut up & try to understand the code?

I'm only vaguely aware of the capabilities of nodejs, but it seems that this potentially gives it real flexibility. Have you any idea how it performs compared to similar things? That's probably not an issue with server insim information, but could be more important if all the other data is required.
Kiyoshi
S3 licensed
Good Luck!!
Kiyoshi
S3 licensed
While clients all connected to one server will be corrected, doesn't this mean that online laptimes will vary depending on the RTC of the server, as well as hotlaps varying depending on the offline PC?
Oh dear.
Kiyoshi
S3 licensed
ok, sorry, just the next number on your list will do then.
Kiyoshi
S3 licensed
Full name: Kiyoshi Shima
LFSWorld username: kiyoshi
Full team name:
Country: U.K.
Preferred number: 39
Car: XFG
Last edited by Kiyoshi, .
Kiyoshi
S3 licensed
Quote from unseen :Still having fun guys?

Meant to drop by recently to answer things and see how you`re doing, but a close relative recently caught a shitty dose of terminal cancer. Not really sure what to think right now, but I`m trying to keep on top of things.

I`m still here, if anyone wants to ask anything, I`m just not quite running at 100% atm.

Wow. Sorry to hear that. Hope things turn out as well as they can. :/

I know at least 2 of us are still having fun practicing.
I have had a server running most of the time & it's now back on the P&G cars set, with tracks selected from those in the first post. It's called 'kiyoshi's house of joy'. Maybe it needs a more sensible name.
Anyway, it would be nice if we could get enough people in one place for a race.

I don't really know what's involved in the mod, but thanks for your efforts, it's nice to dive these cars, even if some of them are real dogs to drive.
Kiyoshi
S3 licensed
12345? Race?
Kiyoshi
S3 licensed
I'm cooking/eating. Might have some time later though.
Kiyoshi
S3 licensed
I have some time.
Kiyoshi
S3 licensed
I'll do some laps head to head in Caterham...
Kiyoshi
S3 licensed
Too late?
FGED GREDG RDFGDR GSFDG