The online racing simulator
Thanks to DarkTimes and FlameCZE for the last (silent) update to Version 2.3.1!
Only new Blackwood configurations are added to the TrackHelper but this keeps InSim.Net up to date.
Hello! Can someone help me? I have a problem with BTT on .Net. BTT is Button Text when I click a button must open a text box but it is not working.. Can u help me, please?
Show the code of the button that is clickable. Read the documentation to make sure the button is clickable and you can type in it.


{
byte Size; // 12 + TEXT_SIZE (a multiple of 4)
byte Type; // ISP_BTN
byte ReqI; // non-zero (returned in IS_BTC and IS_BTT packets)
byte UCID; // connection to display the button (0 = local / 255 = all)

byte ClickID; // button ID (0 to 239)
byte Inst; // some extra flags - see below
byte BStyle; // button style flags - see below
byte TypeIn; // max chars to type in - see below

byte L; // left : 0 - 200
byte T; // top : 0 - 200
byte W; // width : 0 - 200
byte H; // height : 0 - 200

// char Text[TEXT_SIZE]; // 0 to 240 characters of text
};

You know when go to bank You can see button insert, button witdraw and etc. I want when click button insert to open text box and write the sum what i need t o insert Smile

I make it with command !insert , !withdraw and etc. but it is not usable... it is not comfortably
Hey all,

It seems I missed a patch last year, which added the SMALL_LCS packet, plus the ISS_DIALOG and ISS_TEXT_ENTRY options for StateFlags. I have added SMALL_LCS to the SmallType enum, but I also added a class called LocalCarSwitches, that helps you with setting these options. It is just constants for the various values, which you can set for UVal.


<?php 
// Turn siren on
insim.Send(new IS_SMALL
{
    
SubT SmallType.SMALL_LCS,
    
UVal LocalCarSwitches.LCS_SIREN_SLOW
});

// Turn horn and lights on
insim.Send(new IS_SMALL
{
    
SubT SmallType.SMALL_LCS,
    
UVal LocalCarSwitches.LCS_HORN_1 LocalCarSwitches.LCS_FLASH_ON
});

// Turn horn off
insim.Send(new IS_SMALL
{
    
SubT SmallType.SMALL_LCS,
    
UVal LocalCarSwitches.LCS_HORN_OFF
});
?>

Which will sound the horn and flash the lights etc.

I've updated GitHub, will put out a new version soon.

Edit: new version out on GitHub and NuGet.
Someone was asking a while back for a version of InSim.NET compatible with .NET Core. I recently made the changes needed to get it working on .NET Core.

You can find it here: https://github.com/alexmcbride/insimdotnetcore

This is not super tested or supported, but I will obviously fix bugs or issues people have. If you don't know or care what .NET Core is then don't use this!

There are a few breaking changes in this version, mainly that you can no longer call InSim.Initialize(), you have to use InSim.InitializeAsync(). This change is because TcpClient.Connect() was removed from .NET, for some reason.

Additionally I decided to switch the string encoding over the new one that I had written, which was/is not massively tested. Basically this string conversion stuff still converts bytes to unicode and back again, but it does not otherwise mess with the strings, so it leaves language, colour, and escape codes in there. You can use the StringHelper Strip() and Escape()/Unescape() methods if you want to display strings in your own UI. I didn't want to have multiple different versions of the string encoding stuff to maintain. Also I needed to make some changes to how the strings worked to make sure it ran without problems on Mac and Linux, as I wanted to ditch the interop stuff once and for all.

As I say, use at own risk.
Ah cool! I asked about that and was wondering if you had time for it.

I'll try it ASAP!
How to place objects with Command?
Using the IS_AXM packet. Check the documentation. This is not the place to ask for people to make stuff for you.
There seems to be a bug with the LCS_ constants - in InSim.NET, LCS_HORN_5 has the value 2162696, but should be 327688.

To avoid some of the confusing magic numbers, you could define the horns by shifting:

LCS_HORN_1 = (1 << 16) + LCS_SET_HORN;
LCS_HORN_2 = (2 << 16) + LCS_SET_HORN;
LCS_HORN_3 = (3 << 16) + LCS_SET_HORN;
LCS_HORN_4 = (4 << 16) + LCS_SET_HORN;
LCS_HORN_5 = (5 << 16) + LCS_SET_HORN;
LCS_HORN_OFF = LCS_SET_HORN;

-
(Chag16) DELETED by Chag16
Quote from DarkTimes :Someone was asking a while back for a version of InSim.NET compatible with .NET Core. I recently made the changes needed to get it working on .NET Core.

You can find it here: https://github.com/alexmcbride/insimdotnetcore

This is not super tested or supported, but I will obviously fix bugs or issues people have. If you don't know or care what .NET Core is then don't use this!

There are a few breaking changes in this version, mainly that you can no longer call InSim.Initialize(), you have to use InSim.InitializeAsync(). This change is because TcpClient.Connect() was removed from .NET, for some reason.

Additionally I decided to switch the string encoding over the new one that I had written, which was/is not massively tested. Basically this string conversion stuff still converts bytes to unicode and back again, but it does not otherwise mess with the strings, so it leaves language, colour, and escape codes in there. You can use the StringHelper Strip() and Escape()/Unescape() methods if you want to display strings in your own UI. I didn't want to have multiple different versions of the string encoding stuff to maintain. Also I needed to make some changes to how the strings worked to make sure it ran without problems on Mac and Linux, as I wanted to ditch the interop stuff once and for all.

As I say, use at own risk.

Done a few quick tests and it seems to work fine. Good job. Are you planning to make it a NuGet package?

Anyway, I'm planning to make it into a UWP (Or Xamerin) app for managing severs (kick, ban, execute commands etc).

edit: I get this error in debug mode when I create a new InSim object:

System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'

Seems to run in Release mode for some reason though.

edit2: Tried to convert it to a .netstandard 1.4 project and now it doesn't give an error while connecting, but I get this in LFS: InSim - TCP : did not receive InSimInit packet

Any idea?
I don't know, I get the same error now, but no idea why. It was working for me when I created it, now it doesn't work at all.

I have to say, I absolutely hate .NET Core, I find it so confusing and hard to use.
It's a little confusing me for me as well..

I've got it to work now. I've made the InSim project netstandard1.4 (change the InSimDotNetCore.csproj file), and included "System.Text.Encoding.CodePages" in my UWP project. I then build the InSim .dll and reference to it in my UWP project. Seems to be working fine now.

When I get from work I'll try to run the app on my WM10 phone, would be amazing to run InSim from a phone!

Also did a quick test in a Xamerin project, and seems to work as well. Don't have the Android SDK etc to test that, but looks like that can work as well.
OK - cool.

I noticed there was an update for VS, so I updated it to the latest version, and that seems to have done the trick. Not sure what was going on before.

I'm on VS 2017 15.1 (26403.7) and it's working now.
Hello! I made MySQL data base, but I am getting this error... Can you help me?

CNL - There is already an open DataReader associated with this Connection which must be closed first.
Where you're getting that?
Hi Darktimes, insim.net library sample source code cruise insim share?
Quote from racerss :Where you're getting that?

in patcketerror.txt this file say to me all errors of insim
Isn't the solution right in the error you posted?

Show us the code you're trying to run.
Hello! I fix error, but when i leave my server i can't join again probably im staying online and when I try to join server kick me, because the server see me online... LMAO Big grin
Hello guys!

I have been experimenting with this InSim .NET library, it's really cool, but I've come across a problem which i have not seen anywhere explained.
I can't send two IS_BTN packets with one Send command like this:

InSim inSim = new InSim();
inSim.Initialize(new InSimSettings()
{
Host = "127.0.0.1",
Port = 29999,
});

inSim.Send(new IS_BTN()
{
BStyle = ButtonStyles.ISB_DARK,
ClickID = 0,
UCID = 255,
ReqI = 1,
L = 50,
T = 50,
W = 30,
H = 10,
Text = "heey"
}, new IS_BTN()
{
BStyle = ButtonStyles.ISB_DARK,
ClickID = 1,
UCID = 255,
ReqI = 2,
L = 50,
T = 60,
W = 30,
H = 10,
Text = "hooo"
});

It works perfectly if I send it once at a time, otherwise it throws an ArgumentException.
Why is that?
OK thanks, I've fixed that error on Github.
Hello! When i start insim why insim is saying ''Stop responding'' or inisim is loading too slow interface can you help me?
DarkTimes or others, can explain about the packets OutSim


i use Arduino, and i can print the values of Sim.

But i have many question below,

int time, ----- is ok to me
Angular Velocity : 3 floats, ----- Where i use it ??
Orientation :3 floats Heading, Pitch, Roll, ----- is ok to me
Acceleration :3 floats X, Y, Z ----- same that accelerometer
Velocity :3 floats X, Y, Z ----- velocity in axes ??
Position :3 ints X, Y, Z (metres x 65536) ----- position of what ?
what the reference ?

Game ID :1 int, ----- is ok to me

Can anyone help me ??, or have a document do read about it ??

TKS
Can someone give me a hand please?

I need a code that when a user goes through node 53 on the Blackwood track, he sends it directly to the pits.
and also to show the reaction time of a user when leaving when the traffic light turns green.

This is a part of the traffic light code and the green light...


<?php 
                
else if (LuzSpeed == 2)
                {
                    if (
C.Counter == 15)
                    {
                        
C.Counter 0;
                        if (
C.DragStage == 2)
                        {
                            
C.DragStage 3;
                            
InSim.Send_BTN_CreateButton("^3•"Flags.ButtonStyles.ISB_C121219317419C.UniqueID2false); //LUZ1-IZQUIERDA - GRANDE
                            
InSim.Send_BTN_CreateButton("^3•"Flags.ButtonStyles.ISB_C121219318520C.UniqueID2false); //LUZ1-DERECHA - GRANDE
                        
}
                        else if (
C.DragStage == 3)
                        {
                            
C.DragStage 4;
                            
InSim.Send_BTN_CreateButton("^3•"Flags.ButtonStyles.ISB_C1212110317421C.UniqueID2false); //LUZ2-IZQUIERDA - GRANDE
                            
InSim.Send_BTN_CreateButton("^3•"Flags.ButtonStyles.ISB_C1212110318522C.UniqueID2false); //LUZ2-DERECHA - GRANDE
                        
}
                        else if (
C.DragStage == 4)
                        {
                            
C.DragStage 5;
                            
InSim.Send_BTN_CreateButton("^3•"Flags.ButtonStyles.ISB_C1212111317423C.UniqueID2false); //LUZ3-IZQUIERDA - GRANDE
                            
InSim.Send_BTN_CreateButton("^3•"Flags.ButtonStyles.ISB_C1212111318524C.UniqueID2false); //LUZ3-DERECHA - GRANDE
                        
}
                        else if (
C.DragStage == 5)
                        {
                            
C.DragStage 6;
                            
InSim.Send_BTN_CreateButton("^2•"Flags.ButtonStyles.ISB_C1212112317425C.UniqueID2false); //LUZ4-IZQUIERDA - GRANDE
                            
InSim.Send_BTN_CreateButton("^2•"Flags.ButtonStyles.ISB_C1212112318526C.UniqueID2false); //LUZ4-DERECHA - GRANDE
                        
}
                        else if (
C.DragStage == 6)
                        {
?>

If someone could make me a code with those functions, I'd really appreciate it since I'm learning how to use Insim.Net

.NET - InSim.NET - InSim library
(758 posts, started )
FGED GREDG RDFGDR GSFDG