The online racing simulator
I'm trying to install it via NuGet in a UWP W10 app, but it returns this error:
Quote :Package restore failed. Rolling back package changes for...

Any idea if this is a problem on my end? All other packages seem to work fine.

Also, I'm wondering what the InSim.NET_Package on NuGet is, sounds fake.

edit: When I try to add a reference to the .dll I get this:
Quote :
The project targets '.NETCore' while the file reference targets '.NETFramework'.

Make sure your project targets .NET Framework rather than .NET Core (check project properties).

.NET Core has just been released, I've not taken any time to look at it yet, but from that message it appears InSim.NET doesn't support it.
I'm creating a UWP app, so that's not an option.

Would be great if you could make the library up-to-date. I've checked what has to be changed, and mainly it's threaded timers, but I'm not sure what everything does, so I'll have to take a closer look at it.
It looks to be more than just the timers, here's a report from the portability analyser, looks like everything with an X in the .NET Core column would need changed.

I'll look into what can be fixed, but I can't promise anything, I'm not prepared to sink a lot of time into this to be honest.
Attached files
PortabilityAnalysis.zip - 5.5 KB - 910 views
-
(pbbolt) DELETED by pbbolt
Hey I want to simply be able to get the datas (ax,ay,az,vx,vy,vz and etc.) from LFS but I have no idea how to do it...
Can someone help me please?
where should I write a code and where should I get started to finally be able to write the code...
I've been struggling about 16 hours between these forums LFS programming manual INsim and Outsim but I wasn't able to connect to LFS nor with outsim nor with insim and I really want to do it...
where should I start what should I read/learn please help me please Frown
It sounds like what you need is OutSim. What is your programming background? Helper libraries like InSim.NET take care of the communication, all you have to do is process the received packets. Did you not see this sample code? (https://github.com/alexmcbride/insimdotnet#outgauge--outsim)
Quote from MadCatX :It sounds like what you need is OutSim. What is your programming background? Helper libraries like InSim.NET take care of the communication, all you have to do is process the received packets. Did you not see this sample code? (https://github.com/alexmcbride/insimdotnet#outgauge--outsim)

Thanks for your answer My programming is so basic not so good at all, do you have any suggestions so that I can become something like you guys in future?
and I tried the codes I only can get the headings, RPM and vector things doesn't work because I think C# cannot writeline vectors so I don't know what to do about that.
I have two other questions anyways:

1) I've tried the outsim code for python which is written here : http://en.lfsmanual.net/wiki/OutSim_/_OutGauge
It seems that the code is running but no data will come to there (cfg.text is correct), do you know what is going on? It will be awesome if I can get all the values from the game.

2) I want to decode a UDP packet sent from a micro autobox in a car to send it to a motion simulator seat. Any suggestions about that??
It has nothing to do with these right???
Is it easy to do it with wireshark?

Sorry for all the questions it will be so good if you can answer them somehow...
Regards,
Parsa
..
Quote from pbbolt :Thanks for your answer My programming is so basic not so good at all

What exactly does that mean? What language(s) do you have some experience with? Do you know at least the basics of network communication?

Quote from pbbolt :
1) I've tried the outsim code for python which is written here : http://en.lfsmanual.net/wiki/OutSim_/_OutGauge
It seems that the code is running but no data will come to there (cfg.text is correct), do you know what is going on? It will be awesome if I can get all the values from the game.

If you are sure you have OutSim and OutGauge enabled, you also should notice that the sample code does not display the received data anywhere. It only reads the raw data from the received packet and stores it in individual variables.
Quote from MadCatX :What exactly does that mean? What language(s) do you have some experience with? Do you know at least the basics of network communication?

Ummm I know MATLAB and a bit of Vb,Vb.net and C. I think I know the basics of network communication.

Quote from MadCatX : If you are sure you have OutSim and OutGauge enabled, you also should notice that the sample code does not display the received data anywhere. It only reads the raw data from the received packet and stores it in individual variables.

So how can I get the values of the stored variables?
Is it possible to see them with wireshark?
I tried to track the packets with wireshark but I was not able to do it so I'm trying to find something (some video or whatever) about how to track UDP packets with wireshark or whatever to be able to do it.
Quote from pbbolt :Ummm I know MATLAB and a bit of Vb,Vb.net and C. I think I know the basics of network communication.

Good. If you know C you can find a fully working OutGauge code right on the forum. It will also spare you the trouble of converting the raw packet format to something processable in VB.

Quote from pbbolt :
So how can I get the values of the stored variables?

Print them out to screen.
Quote from MadCatX :Good. If you know C you can find a fully working OutGauge code right on the forum. It will also spare you the trouble of converting the raw packet format to something processable in VB.

You mean the one which prints the RPM?


Quote from MadCatX :Print them out to screen.

Yeah I did thanks, but after some printing it gives an error: unpack requires a string argument of length 64 :/
It didn't happen before without printings so I don't know I have no idea why it gives it do you know ?
Quote from pbbolt :You mean the one which prints the RPM?

There is a sample C code that let's you connect to OutGauge and receive data. What you do with that data is up to you.

Quote from pbbolt :
Yeah I did thanks, but after some printing it gives an error: unpack requires a string argument of length 64 :/
It didn't happen before without printings so I don't know I have no idea why it gives it do you know ?

[/quote]
Not without seeing the code.
Quote from MadCatX :There is a sample C code that let's you connect to OutGauge and receive data. What you do with that data is up to you.

Yeah I think I've seen it Wink


Quote from MadCatX :
Not without seeing the code.

Oh sorry here is the code:

import socket
import struct

# Create UDP socket.
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

# Bind to LFS.
sock.bind(('127.0.0.1', 30000))

while True:
# Receive data.
data = sock.recv(256)

if not data:
break # Lost connection

# Unpack the data.
outsim_pack = struct.unpack('I12f3i', data)
time = outsim_pack[0]
angvel = [outsim_pack[1], outsim_pack[2], outsim_pack[3]]
header = outsim_pack[4]
pitch = outsim_pack[5]
roll = outsim_pack[6]
accel = [outsim_pack[7], outsim_pack[8], outsim_pack[9]]
vel = [outsim_pack[10], outsim_pack[11], outsim_pack[12]]
pos = [outsim_pack[13], outsim_pack[14], outsim_pack[15]]

print "udp received"
#print "time is ", time
#print "angvel is ", angvel
#print "header is ", header
#print "pitch is ", pitch
#print "roll is ", roll
#print accel
print "vel is ", vel
#print "pos is ", pos
# Release the socket.
sock.close()

It actually was so much better but now it just gives one "udp received":/
It used to give like 30, 40 or something...

And is there a way to tell the time between each time it prints or gets the packet?
The code you posted lost indentation so it's impossible to tell what happens in the while loop. The OutSim packet has the a "Time" field, use that to get time deltas.
-
(MadCatX) DELETED by MadCatX
Hi bro, My demo cars handicaps system replicate

NPL.Cname = "VWS"; error

Property or indexer 'InSimDotNet.Packets.IS_NPL.CName' cannot be assigned to -- it is read only

Help pls
This property is set by LFS and it doesn't make sense to change it
Quote from PeterN :This property is set by LFS and it doesn't make sense to change it

Add tweaked car with handicap demo?
The NPL occurs after a player joins a race or rejoins from pits. At this moment the car is already choosen from the player. You can't change it by setting another value to the NPL.Cname property. The property would only affect your own code in your InSim but not LfS at all.

At the end it looks to me, you have the idea to get the licensed cars for free. There may be ways to success but you will struggle with InSim.
Quote from DarkTimes :InSim.NET is a InSim library for Live for Speed, written for the .NET Framework. It allows you to create a socket connection with the game and to send and receive packets of data. These packets can be used to control LFS, issue commands and request information. The library has been designed for flexibility, extensibility and performance. It tries to match the original InSim API as closely as possible, while taking care not to get in your way.

Note: InSim.NET was originally known as Spark, but changed its name to prevent it clashing with another .NET project with the same name. Note: Many code examples in this thread were written for version 1.0 the library and probably won't work correctly in the newer version. You can find up-to-date examples in the documentation.

Quick LinksWhat's New?

This release is for version 2.0 of the library, which has seen a number of large changes
  • Full support for InSim, InSim Relay, OutSim and OutGauge
  • Full support for all LFS character encodings
  • Improved API
  • Improved networking code
  • Improved documentation
  • A new home on GitHub
  • New Git source code repository
Requirements

InSim.NET requires .NET Framework 4.5 and is CLS compliant with all .NET languages. It is written in C# and compiled with Visual Studio 2013.

Source Code

InSim.NET now uses Git distributed source control, which means it's easy to clone the latest repository, create forks and make changes. Anyone is welcome to clone the repository and create their own version of the library.

License

InSim.NET is released under the Lesser General Public License (LGPL).

Download

InSim.NET is available through NuGet, the .NET package manager. To install it type the following command at the package manager console.

PM> Install-Package InSimDotNet

Alternatively you can download it from the GitHub project page.

https://github.com/alexmcbride/insimdotnet

Quote from KlausAdam :The NPL occurs after a player joins a race or rejoins from pits. At this moment the car is already choosen from the player. You can't change it by setting another value to the NPL.Cname property. The property would only affect your own code in your InSim but not LfS at all.

At the end it looks to me, you have the idea to get the licensed cars for free. There may be ways to success but you will struggle with InSim.

DarkTimes


<?php 
NPL
.Cname "VWS"// Error

AutoProperty remove pls

Before 
//Error
        /// <summary>
        /// Gets the car name of the player.
        /// </summary>
        
public string CName get; private set; }

After //No Error
        /// <summary>
        /// Gets the car name of the player.
        /// </summary>
        
public string CName getset; }


if (
NPL.CName == "XFG" && NPL.H_TRes == 50 && NPL.H_Mass == 200)
                {
                    
NPL.CName "VWS";
                    
//Leave pit message
                    
MsgAll(PlayerName "Car: Volkswagen Scirocco");
                }
// No buy xfg
// !buy VWS
// Select XFG
// Intake Restriction = 50
// Added Mass = 200
// Leave pit VWS Tweaked Cars Nto open VWS Real sv :)
// No buy VWS
// !buy XFG
// Select XFG and Intake Restriction 50 Added Mass 200 Thief Car :)

// + Payout System
if (C.Cars == "VWS")
{
cash.Next(510);
}

// Dealer
case "VWS": return 35000;

// Buy

if (StrMsg[1].ToUpper() == "VWS")
{
MsgPly("Volkswagen Scirocco (VWS) ^7This car is in the garage!"MSO.UCID);
}

if (
StrMsg[1].ToUpper() == "VWS")
{
MsgPly("Insufficient amount of money ^1Volkswagen Scirocco (VWS)"MSO.UCID);
if (
Connections[GetConnIdx(MSO.UCID)].Cash <= Dealer.GetCarPrice(StrMsg[1]))
{
MsgPly("^9 Prices: ^1$" Dealer.GetCarPrice(StrMsg[1]) + " ^7Necessary: ^2$" + (9000 Connections[GetConnIdx(MSO.UCID)].Cash), MSO.UCID);
}
}

case 
"VWS":
Cars Cars " " "VWS";
Connections[GetConnIdx(MSO.UCID)].Cars Cars;
Connections[GetConnIdx(MSO.UCID)].Cash -= Dealer.GetCarPrice("VWS");
MsgAll("^9 " Connections[GetConnIdx(MSO.UCID)].PlayerName " ^7bought ^VWS");
MsgPly("^9 Buy Car: ^1Volkswagen Scirocco (VWS) Garage Add"MSO.UCID);
MsgPly("^9 Car Prices: ^1$" Dealer.GetCarPrice("VWS") + " ^7Remaining Money: ^2$" Connections[GetConnIdx(MSO.UCID)].Cash ""MSO.UCID);
break;

// Sell

if (StrMsg[1].ToUpper() == "VWS")
{
MsgPly("^9 sold ^1Volkswagen Scirocco (VWS)"MSO.UCID);
MsgPly("^9 Cash: ^1$" Dealer.GetCarValue(StrMsg[1].ToUpper()) + " ^7Remaining Money: ^2$" Connections[GetConnIdx(MSO.UCID)].CashMSO.UCID);
}

// Prices List
MsgAll("^3[VWS]^7 Volkswagen Scirocco ^1$" string.Format("{0:n0}"Dealer.GetCarPrice("VWS")) + " ^9- ^2" string.Format("{0:n0}"Dealer.GetCarValue("VWS")) + "$");
?>

Quote from mokoko1234 :...
if (NPL.CName == "XFG" && NPL.H_TRes == 50 && NPL.H_Mass == 200)
{
NPL.CName = "VWS";
//Leave pit message
MsgAll(PlayerName + "Car: Volkswagen Scirocco");
}
...
if (C.Cars == "VWS")
{
cash.Next(5, 10);
}

You are using two totally different things. First you're using the NPL from InSim.net. This is only a notification from LfS to your InSim. It says a new player has joined the race or whatever. In your case the player may have joined with the XFG. It doesn't matter what you do in your InSim. LfS still knows, the player has choosen the XFG.
Now, you want to have a VWS in you InSim. From the sight of LfS this is a XFG with additional intake and weight. This is what you can read from the NPL. But then you'll have to save the information to another object. This could be a copy from the original NPL or a player object.
I don't know your InSim-Code but the C.Cars == "VWS" looks suspicious to me.
At least you only need another variable to store the information which "virtual" car a player has choosen. It is still senseless to store this information in the NPL.Cname property.
Quote from KlausAdam :You are using two totally different things. First you're using the NPL from InSim.net. This is only a notification from LfS to your InSim. It says a new player has joined the race or whatever. In your case the player may have joined with the XFG. It doesn't matter what you do in your InSim. LfS still knows, the player has choosen the XFG.
Now, you want to have a VWS in you InSim. From the sight of LfS this is a XFG with additional intake and weight. This is what you can read from the NPL. But then you'll have to save the information to another object. This could be a copy from the original NPL or a player object.
I don't know your InSim-Code but the C.Cars == "VWS" looks suspicious to me.
At least you only need another variable to store the information which "virtual" car a player has choosen. It is still senseless to store this information in the NPL.Cname property.

Add XFG suction and weight and tweak to make and maintain vws
Tweak xfg & xrg to make the actual vehicle settings will be xfg and xrg in appearance, but the internal properties are tweaked to the actual tool.
Quote from mokoko1234 :DarkTimes


<?php 
NPL
.Cname "VWS"// Error

AutoProperty remove pls

Before 
//Error
        /// <summary>
        /// Gets the car name of the player.
        /// </summary>
        
public string CName get; private set; }

After //No Error
        /// <summary>
        /// Gets the car name of the player.
        /// </summary>
        
public string CName getset; }


if (
NPL.CName == "XFG" && NPL.H_TRes == 50 && NPL.H_Mass == 200)
                {
                    
NPL.CName "VWS";
                    
//Leave pit message
                    
MsgAll(PlayerName "Car: Volkswagen Scirocco");
                }
// No buy xfg
// !buy VWS
// Select XFG
// Intake Restriction = 50
// Added Mass = 200
// Leave pit VWS Tweaked Cars Nto open VWS Real sv :)
// No buy VWS
// !buy XFG
// Select XFG and Intake Restriction 50 Added Mass 200 Thief Car :)

// + Payout System
if (C.Cars == "VWS")
{
cash.Next(510);
}

// Dealer
case "VWS": return 35000;

// Buy

if (StrMsg[1].ToUpper() == "VWS")
{
MsgPly("Volkswagen Scirocco (VWS) ^7This car is in the garage!"MSO.UCID);
}

if (
StrMsg[1].ToUpper() == "VWS")
{
MsgPly("Insufficient amount of money ^1Volkswagen Scirocco (VWS)"MSO.UCID);
if (
Connections[GetConnIdx(MSO.UCID)].Cash <= Dealer.GetCarPrice(StrMsg[1]))
{
MsgPly("^9 Prices: ^1$" Dealer.GetCarPrice(StrMsg[1]) + " ^7Necessary: ^2$" + (9000 Connections[GetConnIdx(MSO.UCID)].Cash), MSO.UCID);
}
}

case 
"VWS":
Cars Cars " " "VWS";
Connections[GetConnIdx(MSO.UCID)].Cars Cars;
Connections[GetConnIdx(MSO.UCID)].Cash -= Dealer.GetCarPrice("VWS");
MsgAll("^9 " Connections[GetConnIdx(MSO.UCID)].PlayerName " ^7bought ^VWS");
MsgPly("^9 Buy Car: ^1Volkswagen Scirocco (VWS) Garage Add"MSO.UCID);
MsgPly("^9 Car Prices: ^1$" Dealer.GetCarPrice("VWS") + " ^7Remaining Money: ^2$" Connections[GetConnIdx(MSO.UCID)].Cash ""MSO.UCID);
break;

// Sell

if (StrMsg[1].ToUpper() == "VWS")
{
MsgPly("^9 sold ^1Volkswagen Scirocco (VWS)"MSO.UCID);
MsgPly("^9 Cash: ^1$" Dealer.GetCarValue(StrMsg[1].ToUpper()) + " ^7Remaining Money: ^2$" Connections[GetConnIdx(MSO.UCID)].CashMSO.UCID);
}

// Prices List
MsgAll("^3[VWS]^7 Volkswagen Scirocco ^1$" string.Format("{0:n0}"Dealer.GetCarPrice("VWS")) + " ^9- ^2" string.Format("{0:n0}"Dealer.GetCarValue("VWS")) + "$");
?>


thank you Smile
solved

FGED GREDG RDFGDR GSFDG