The online racing simulator
It's better if you make a thread where you ask basic questions of the InSim you downloaded somewhere. This is not relevant to this library.
Quote from Bose321 :It's better if you make a thread where you ask basic questions of the InSim you downloaded somewhere. This is not relevant to this library.

Sorry I got the code wrong, it was this code.

https://pastebin.com/6HSgNDtD

I need to add a random time on the green light
How do you expect us to magically know what you want here? Can't you ask the person where you downloaded this from?

Also, this code is bad in so many ways... Thread.Sleep is also really bad practice.
You've got "Thread.Sleep(1000);" on line 54, which is the one second pause between yellow and green - I don't know about the lang/framework you're using (edit: or best practices for it as Bose says), but that 1000 just needs to be a random integer between 1000 and say 5000 for a random 1 - 5 second delay.
Hi, I've forked and converted the lib to .NET 5 (for running on a linux host and single-file self-contained runtime capabilities) and decided to share the code if anyone's interested: https://github.com/xspeedasx/insimdotnet
Cool stuff! Maybe do a pull request? Would only improve the base of the code if it's stable.
Quote from Bose321 :Cool stuff! Maybe do a pull request? Would only improve the base of the code if it's stable.

Well, the .net5 version doesn't really fit with any of the branches in the original repository (there are versions for .net 4.5, .net core 2 and .net core 3).

So for me to do a PR, the original author should create a new branch that I could create a PR to.
Hi, nice to see you still active on LFS forum Smile
I've raised a PR, but since net5 branch was created based on master (.net 4.5), the PR looks a bit messy, but it should merge(overwrite everything) nicely and work fine - I'm using a package from that exact branch now.

For the future - maybe adding some async/async options for event handlers and inSim commands would be cool.

Although I can attest that the .Net5 version is quite stable - I wrote an app that is capable of handling 5 servers simultaneously, cross-server chat works fine, Discord bot works without any glitches, and servers haven't had any major downtimes.
Ah, would it be better to branch from a different version?
Its alright as it is, you just have to fix the conflicts by overwriting files from my branch Smile

btw, updated the net5 branch to support 0.6W version (Insim 9)
OK I've merged it. You better check it looks alright as the process was a bit confusing!
Are we(old school 4.5 framework guys) going to receive an update for the updated car names and everything else as well? Smile
Quote from crazyboy232 :Are we(old school 4.5 framework guys) going to receive an update for the updated car names and everything else as well? Smile

Hi, sure, I'll give it a crack after work - should be pretty straightforward
Well, just now, the .NET 6 LTS has been released.. and its going to be supported for the next 3 years (hence the LTS).
While the .NET 5 is not LTS and will not be getting any patches soon.
So I'll probably be upgrading net5 branch to net6, but a pull request will have to be made to the net5 branch in the main repository and then renamed to net6. Does that sound good?

P.S. the net 4.5 InSim.NET was upgraded to support 0.6W (insim 9). It just wasn't posted to NuGet so you (InSim.NET users) have to clone/download the source and build it yourself Big grin it shouldn't be very hard, post here if you're having any difficulties with that.
Yeah that's fine.

I was going to update the nuget release at some point once it was stable.
To test out the changes to support mods I would need to buy S3, which is not expensive of course but still trying to figure out whether I want to buy an update to a game I don't play anymore. Rofl
Also I haven't coded in .NET for years, I'm a Java developer these days, so I don't really understand all the different versions of it and how they fit together anymore.
Quote from DarkTimes :Also I haven't coded in .NET for years, I'm a Java developer these days, so I don't really understand all the different versions of it and how they fit together anymore.

TL;DR is that 4.5 is the final version of the traditional .NET Framework, 5 and up is based on .NET Core
Just raised a PR to the net5 branch Smile after you merge, you should probably rename it to net6

the upgrade was easier than I thought Big grin just replacing 5 to 6.. all external dependency packages are still compatible Smile
I've merged the PR and made a new branch for net6.

There's too many versions now though, so I want to simplify it as I don't see a reason to support anything other than .NET 6.

Currently there are:
  • master - .NET 4.5 version of InSim.NET 2.x.x (nuget package)
  • core - .NET Core version of InSim.NET 2.x.x
  • core-version-3 - .NET Core version of InSim.NET 3.x.x
  • net6 - .NET 6 version of InSim.NET 3.x.x
Therefore I intend to simplify it to just:
  • master - .NET 6 version of InSim.NET 2.x.x (nuget package)
  • version3 - .NET 6 version of InSim.NET 3.x.x
  • legacy - the current master which will no longer receive updates
Does this make sense?
Quote from DarkTimes :Therefore I intend to simplify it to just:
  • master - .NET 6 version of InSim.NET 2.x.x (nuget package)
  • version3 - .NET 6 version of InSim.NET 3.x.x
  • legacy - the current master which will no longer receive updates
Does this make sense?

I think you meant .NET 4.5 version of InSim.NET 2.x.x

but there can be 2 nuget packages for both versions (its common practice in nuget.org) so I imagine there's only a need for 2 branches:
  • master - .NET 4.5 version of InSim.NET 2.x.x (InSimDotNet nuget package)
  • core (or net6) - .NET 6 version of InSim.NET 3.x.x (InSimDotNet.Core nuget package)
both of them should get updates, since everybody's probably using the .net 4.5 and I'm the only one using the 6.0 Big grin

p.s. if you're a Java dev - maybe consider porting this to Java (OpenJDK probably) - it would be in great demand since its so much easier to do cross-platform stuff with java Smile and many new programmers choose Java as the one with most community support/job possibilities
No, I meant a .NET 6 version of InSim.NET 2.x.x, which basically already exists in the core branch.

It's not a question of having different nuget packages, it's about having to support different versions. Each time there is an InSim change I will have to update four versions, which I'm not going to do. I don't see any point in supporting any other version than .NET 6 from now on.
Well as I've mentioned before, I think that there are main 2 branches that should get updates
- .NET 4.5 (as its still the one everyone uses for insim/outgauge experiments, servers)
- and .NET 6 (for the rising popularity of linux-able hosting)

Other (2.1, 3(.1) and 5) can be deleted since they are the "in-betweeners" and don't have any features that would make them more desirable than the main two.

arguably the 4.5 could be upgraded to 4.8 at some point, but that could cause some older system incompatibility - there's probably someone that has their insim running on some old windows server 2008 pc in their workplace Big grin
I think now that mods are out, it would be a good time to update the CarHelper class, more specifically the CarMap of cars. The GetFullCar method doesn't work for modded cars.

FGED GREDG RDFGDR GSFDG