The online racing simulator
Searching in All forums
(82 results)
IS_NPL passenger byte - wrong info?
xspeedasx
S3 licensed
Hi, as I was updating InSim.NET passengers flags, I've noticed that insim returned value is different from what documentation states:

Quote from insim.txt :// Passengers byte

// bit 0 female
// bit 1 front
// bit 2 female
// bit 3 rear left
// bit 4 female
// bit 5 rear middle
// bit 6 female
// bit 7 rear right



either insim.txt should look like this:
Quote from insim_proposal.txt :// Passengers byte

// bit 0 front male
// bit 1 front female
// bit 2 rear left male
// bit 3 rear left female
// bit 4 rear middle male
// bit 5 rear middle female
// bit 6 rear right male
// bit 7 rear right female

or every bit pair should have high bit set if the seat is occupied and low set if female
xspeedasx
S3 licensed
Do you mean something like this? Big grin It follows "checkpoints" with some corrections that have been recorded previously (could be recorded in replay also).
xspeedasx
S3 licensed
In my 10 year LFS Cruise dev "career", I haven't used this command even once... We usually have !a/!c/!m/!pm/!anything which is also hidden, and since all commands use ! as a prefix its easier to remember and type for users.

P.S. what is the correct thread for InSim (the InSim system itself, not apps that use insim) requests? I have a few suggestions that could be useful especially for Cruise, but also some other modes too.
xspeedasx
S3 licensed
AFAIK lapper is based on a .Net 4.x framework which makes it unable to run on Linux host without some trickery (Wine, Mono).
You'd be better off looking for a "shared" windows host.

IIRC - @Bass-Driver (Dan) used to provide a dcon+lapper hosting. Maybe its possible to host lapper only and prices are pretty good from what I've heard.
xspeedasx
S3 licensed
Quote from activitylog :
Nov 30 14:03:31 InSim - TCP : LfsHostingNode


Ah this is common message - some sort of monitoring, I suppose. I just haven't noticed it before Smile

Quote from Victor :I'm doing hosting updates and sometimes have to restart hosts. This was one of those occasions. Thanks for reporting though.

So that's why the host IP changed Uhmm
xspeedasx
S3 licensed
After setting host to W51, it ran for a while, then I got kicked out and host is gone (Host not found on master server).
The activity shows insim connection:
Quote from activitylog :
Nov 30 14:03:31 InSim - TCP : LfsHostingNode


EDIT: It came back to life after stopping and starting it again.
Last edited by xspeedasx, .
xspeedasx
S3 licensed
Well until it is explicitly forbidden, for backwards-compatibility purposes InSim.NET will still have the 4.5 version. The end user can choose their own framework at will Smile

Quote from PeterN :Should really move away from .NET 4.5, it'll be unsupported soon...

https://devblogs.microsoft.com/dotnet/net-framework-4-5-2-4-6-4-6-1-will-reach-end-of-support-on-april-26-2022/

the 4.5 version is already in lower priority than the .NET 6 version, meaning when there will be more inSim changes, version 6 will be updated first.
xspeedasx
S3 licensed
Quote from DarkKostas :Just a note on this. I had to add this line

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;


Yes, if you're using insim.net standard version, your project is probably also set to the .NET 4.5 version.
The .NET 4.5 only supports TLS 1.0 by default.
Upgrading your project to .NET 4.6 would support 1.2 by default (and would allow to use C# 6.0 syntax Big grin), and it should still allow to reference the 4.5 version dll, but this is trivial, since it can be solved with the ServicePointManager option adjust.

There shouldn't be such problems in .NET 6 insim.net version
xspeedasx
S3 licensed
usually in LFS data first byte in a block is the block size, and it is constructed in such blocks. knw files seem not to be of this case. It could may as well be just the weights for custom neural network layers inside the lfs game engine.
xspeedasx
S3 licensed
Layout square is not released yet, it is availbale only in testing version (LFS 0.6W)
xspeedasx
S3 licensed
Quote from chucknorris :A "soft-reset"-function for two-wheelers would be handy to get up right again. For servers that don't allow car-resets.

yes, something like this:
xspeedasx
S3 licensed
good progress Smile it will be a good addition to the Cruise/Roleplay aspect Big grin
xspeedasx
S3 licensed
Quote from CozmicDragon :You see, there isn't really a way right now for users to see the list of allowed mods on a server, unless the server itself tells us outright ...

It would honestly be better if we just had a way of seeing that list ourselves - And if so, we can turn this "bug" into a useful feature. If you're on a host with a limited list of allowed mods, the in-game list will only show the mods usable on that host. Makes for a nice QoL improvement.

Actually as of W45 server does hide unallowed mods leaving only whitelisted in "browse mods" page.

come to [RC-Core] Dev server to see for yourself. I have left only 2 mods enabled.
The password is "tempdisabled" for few hours.
Last edited by xspeedasx, .
xspeedasx
S3 licensed
Another suggestion: a server-controlled filter for players in mod selection - just like with regular cars setting allowed per player would be very useful in the mods page as well.

For example only show specific cars that player owns instead of trying to join with all the cars until insim allows to do it (JRR response)
xspeedasx
S3 licensed
Quote from Scawen :New update W45!

Changes from 0.6W43 to 0.6W45:

LFS:

New mod filters Staff picks only / Include tweak mods / Include WIP
You can now set list of mods allowed on host (via InSim or LFS.net)
...

Will there be staff_pick/tweak flags included in the mod data?


P.S. from what I saw - ratings go from 1 to 5, because you can't click 0 stars, right? Big grin
Quote :
"rating": int // Rating, from 0 - 5


And its also actually float
xspeedasx
S3 licensed
Quote from Scawen :I've looked in the code and it's really exactly the same code, only using 16 cars as the maximum per pack instead of 8. So I can't really see how it would go wrong.

Have you definitely got the number of cars per IS_MCI correct?

something like:

int pack_size = pack->Size * 4;
int num_cars = (pack_size - 4) / 28; // max 16

Hi I can confirm that there's something funky with IS_MCI
I've set up 17 AIs to a race and connected insim - i've got 2 MCI packets with 8 CompCars each:


I've tested some other combinations of cars:
3 AI cars - 1 MCI packet with NumC = 3
9 AI cars - 1 MCI packet with NumC = 8
15 AI cars - 1 MCI packet with NumC = 8
16 AI cars - 1 MCI packet with NumC = 8
17 AI cars - 2 MCI packets with NumC = 8 each (contains first 16 PLIDs)
25 AI cars - 2 MCI packets with NumC = 8 each (contains first 16 PLIDs)
32 AI cars - 2 MCI packets with NumC = 8 each (contains first 16 PLIDs)
couldn't test with more because couldn't think of a way to have more AI in track Big grin
xspeedasx
S3 licensed
Hi, just tested it - works fine Smile
Just a suggestion: maybe Flags in IS_MAL could be an "operation" - add mod to allowed or remove.
It would be easier to call it from GUI or commands without having to update local cache first.

Another flag option could be "force-remove players with disallowed cars" - spectate those who drive with no longer valid cars after updating.
xspeedasx
S3 licensed
Should be possible to reproduce with AIs?
xspeedasx
S3 licensed
Quote from LakynVonLegendaus :Ok now I'm confused. So lfs.net does host Airio and Lapper. Why do these 2 apps get the privilege? It's understandable for Lapper since that's open-source.. What if we provide (privately) source codes for our apps, can they be hosted then?

It is most likely because those apps are pretty limiting and can't be used maliciously to break the hosting server or data in it.
Other libs (like insim.net) are just tools for interfacing with insim, but the app is full executable that can do anything on the host.

It is technically possible to limit the app behavior by strictly configuring containers, but I guess the work needed outweighs benefits.

As Victor said before the best solution for both sides is renting a cheap linux VPS and connect from there. There are plenty libraries that work on linux now. For example insim.Net has .NET 6 version that can be built into linux-executable app. There's also prism (php), pyinsim (python), I've seen java version of insim and possibly many others.
xspeedasx
S3 licensed
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
xspeedasx
S3 licensed
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
xspeedasx
S3 licensed
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
xspeedasx
S3 licensed
Quote from sinanju :Would be nice to have an option for offline host to test InSim scripts, which is what I used to do via older version 'Local Host' option.

If you start a host from your LFS client, you get a "free" server on LFS.net. Scawen wrote about this:

Quote from Scawen :You can start a free server in game, using the "Start new host" button. But now, that starts a host running on one of our servers, instead of locally on your computer. When you leave a free server, it closes down after a few minutes.

open "Your hosts" in lfs.net and use those ip/port to test your insim Smile
xspeedasx
S3 licensed
I found the culprit... it was... me! Big grin
It was a bug that sent delete command (BFN) for all unused buttons in each GUI refresh..
This is how the traffic looks like:
Quote from bandwidth report file :
Running for: 00:13:30.1300717
Sent packets:
ISP_ISI: 0.00 packets/s, 0.05 bytes/s
ISP_TINY: 0.04 packets/s, 0.15 bytes/s
ISP_MTC: 0.01 packets/s, 0.42 bytes/s
ISP_BTN: 3.31 packets/s, 261.51 bytes/s
ISP_BFN: 393.37 packets/s, 3146.97 bytes/s


P.S. After the policer adjustment ddos message did not appear again Smile I'll keep monitoring the bandwidth for the future
xspeedasx
S3 licensed
Hi,
I've just wasted good 4 hours trying to figure out why the API server did not accept Authorization header Shrug
It looks like there's nginx standing as a load balancer before the API and it rewrites calls to the
https://api.lfs.net/vehiclemod endpoint
but it does it with a 302 Redirect response (to the same endpoint but with / at the end..) which somehow cancels Authorization flow in the .NET side.

So any .NET users (and possibly c++) should use the "correct" url: https://api.lfs.net/vehiclemod/ (with the / at the end).

Here's a code example to get List of all mod vehicles:

Quote from .net core :
public async Task<List<ModCarEntry>> GetModdedCars()
{
var client = new HttpClient();
var content = new FormUrlEncodedContent(new Dictionary<string, string>
{
{"client_secret", "your_client_secret"},
{"client_id", "your_client_id"},
{"grant_type", "client_credentials"}
});

var tokenResponse = await client.PostAsync("https://id.lfs.net/oauth2/access_token", content);
var tokenText = await tokenResponse.Content.ReadAsStringAsync();
var tokenObject = JsonConvert.DeserializeObject<TokenResponse>(tokenText);
var accessToken = tokenObject.access_token;

client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);
var carEntriesResponse = await client.GetStringAsync("https://api.lfs.net/vehiclemod/");

return JsonConvert.DeserializeObject<ModCarEntriesResponse>(carEntriesResponse).Data;
}

public class TokenResponse
{
public string token_type { get; set; }
public int expires_in { get; set; }
public string access_token { get; set; }
}

class ModCarEntriesResponse
{
public List<ModCarEntry> Data { get; set; }
}

public class ModCarEntry
{
public string id { get; set; }
public string name { get; set; }
public string descriptionShort { get; set; }
public string description { get; set; }
public int userId { get; set; }
public string userName { get; set; }
public bool wip { get; set; }
public int publishedAt { get; set; }
public int numDownloads { get; set; }
public int curUsage { get; set; }
public float rating { get; set; }
public int numRatings { get; set; }
public int version { get; set; }
public int lastDownloadedAt { get; set; }
public int _class { get; set; }
public bool ev { get; set; }
}


Last edited by xspeedasx, .
FGED GREDG RDFGDR GSFDG