The online racing simulator
Node.js - jsinsim - InSim library
jsinsim is a InSim library for Live For Speed, written in javascript runtime Node.js.
This library allows you to create socket connection to the game server and share packets trought TCP stream.

Current version is 1.0
Current InSim version is 9

Github
https://github.com/Iamproplayer7/jsinsim


RequirementsRequired dependeciesSource of this project
jsinsim is free to all, you can clone, fork repository and make changes to it. (do whatever you want with this).


Future
I will be very happy if you will use this library and will help to improve it, comment or share your code, create issues threads, write improvement suggestions. This library always will be updated to a newest InSim version.
(this library not giving his full potential, i am talking about OutSim, OutGauge, not every packet for InSim works right now.)


Added Classes
Right now this library have a list of classes that will help you program faster and simplier, don't be scared to use them, those classes will be updated and there will added more functionality to it.Multiple hosts
jsinsim supports connection to one host, two hosts or even 10 hosts. All packets have info about his host, premade classes uses hostName in some functions to make clear which host will be affected.

First code

// import InSim library
const InSim = require('./module/insim');

// init InSim connection
InSim.Server.start({
host: { // host name used only in module
ip: '127.0.0.1', // your host ip
port: 53330, // your host port
admin: 'admin password', // your host admin password
prefix: '!', // command prefix like (-> !command)
pps: 12 // vehicle info update per second (max: 12)
}
}, (hostName) => { // host name defined above
InSim.Server.message(hostName, '^2InSim: Node.js connected.');
});

Examples
jsinsim have a list of examples how to use some classes, this list will be updated.
Github Examples list

Do you have questions?
Find me at discord Vidmantas#9888 if you think you need help in private. If not just let me know in comments and i will help you and answer your questions.
Quote from iamproplayer7 :jsinsim is a InSim library for Live For Speed, written in javascript runtime Node.js.
This library allows you to create socket connection to the game server and share packets trought TCP stream.

Current version is 1.0
Current InSim version is 9

Github
https://github.com/Iamproplayer7/jsinsim


RequirementsRequired dependeciesSource of this project
jsinsim is free to all, you can clone, fork repository and make changes to it. (do whatever you want with this).


Future
I will be very happy if you will use this library and will help to improve it, comment or share your code, create issues threads, write improvement suggestions. This library always will be updated to a newest InSim version.
(this library not giving his full potential, i am talking about OutSim, OutGauge, not every packet for InSim works right now.)


Added Classes
Right now this library have a list of classes that will help you program faster and simplier, don't be scared to use them, those classes will be updated and there will added more functionality to it.Multiple hosts
jsinsim supports connection to one host, two hosts or even 10 hosts. All packets have info about his host, premade classes uses hostName in some functions to make clear which host will be affected.

First code

// import InSim library
const InSim = require('./module/insim');

// init InSim connection
InSim.Server.start({
host: { // host name used only in module
ip: '127.0.0.1', // your host ip
port: 53330, // your host port
admin: 'admin password', // your host admin password
prefix: '!', // command prefix like (-> !command)
pps: 12 // vehicle info update per second (max: 12)
}
}, (hostName) => { // host name defined above
InSim.Server.message(hostName, '^2InSim: Node.js connected.');
});

Examples
jsinsim have a list of examples how to use some classes, this list will be updated.
Github Examples list

Do you have questions?
Find me at discord Vidmantas#9888 if you think you need help in private. If not just let me know in comments and i will help you and answer your questions.

Looks great
How can I write with Typescript ES6?
Quote from EfsaneTosun :Looks great...

Yes, now you can, I finished my new module named: tsinsim https://github.com/Iamproplayer7/tsinsim,
it's a base InSim module at the time, but I will start to work on bigger framework on this module, with a lot of Functions, Plugins and etc. Let me know if you have some ideas.
Did you take inspiration from Node InSim? The code looks suspiciously similar. Uhmm It’s MIT so it’s not an issue, I’m just wondering.
Quote from Flame CZE :Did you take inspiration from...

Structure is very similar its simple and easy to understand: enums, types, structs it just stuck in my head, I took idea how decorators work because it looks very useful and easy to use, but as you can see a lot of things my implementation.
I like your idea with including the binary data types in the reflect metadata and ditching the very long lfspack.ts file - I'm not a big fan of that one either Big grin
Quote from Flame CZE :I like your idea with including the binary data types in the reflect metadata...

I used ezstruct in jsinsim it was easy to add and simple, but not supported in typescript, tried lfspack at first, but best I think is raw bytes handling. There should be even simpler handling than I did.



FGED GREDG RDFGDR GSFDG