The online racing simulator
InSim base for Visual Basic .NET 2005
1
(28 posts, started )
InSim base for Visual Basic .NET 2005
This is an InSim base for VB .NET 2005
It can handle most important packets for online play. Though it can't handle MCI and NLP yet cus I had some problems with that. I might add them later, or you can add them yourself. It can also maintain the connection, and it comes with an auto-reconnect feature. You should start looking in the modMain module for more information.

Good luck, hope you like it.

This version is obsolete, use this version instead!
Attached files
insim_base_vb8.zip - 149.5 KB - 544 views
God Bless U Man
#3 - Zyber
Nice one. havent tested it yet but this was exactly what i needed to test some stuff on my 3d renderer
Quote from T-RonX :It can also maintain the connection

UDP is actually connection-less IIRC. But I think you mean keepalive packets!
Yes, by maintaining the connection I mean keeping it alive with ACKs, else the server will close InSim after being idle for 120 seconds.
I think that I will try to make a universal UDP relay, not just for insim. Imagine having like 10 different programs sending and recieving UDP to LFS.
I think writing a program working with another interface would be something more interesting.
With a plugin system as interface or a script language.
I don´t have the knowledges here
Hi! I'm using Your Base now to make my own application.
I recive the MCI packet (i sent ISP(MSI) to the server, and it comes back) , but can get info from compcar. From MCI i can get the other data like NumNodes etc.
Can you help me how can get the info from compcar structure? I'm a beginner in VB too so pls post a code if you can.

For examlpe send it back to the server with MST the actual speed.
As I said in the first post, I'v had some problems with the MCI packet. I will have a look at it again when I'v got some time to do so.
THX man
Quote from T-RonX :As I said in the first post, I'v had some problems with the MCI packet. I will have a look at it again when I'v got some time to do so.

Hi T-RonX,

I just wanted to say that I am using your Code since a few months as a Basic for my Program. There where many Problems when using your Code on Windows Mobile because the .NET Compact Framework is somehow crippled. But I think I got it all sorted out. And when I was on my way to make it 100% .NET Compact Framework + .NET Framework compatible someone decided to rework the Insim Protocol
What I started now is converting all again to the new Insim Protocol. As you offered your Source for download in the Forum I will do this too when I am finished (could take some time for me, because I am not very good at Programming right now). And I won´t forget the Credits. I think there is not much left of your code, but it got me a very good Start into Coding and using the Insim Protocol. Without it I would have never got that far.

So I can just say Thank you very much
Thanks! If I find some free time I might update this version to the latest version of InSim too.
Hi T-Ronx,

if you read this maybe you have an answer.
Currently I have problems sending Packets to LFS. In your Code when you send Data you call the Shared Sub Senddata. Within this Sub you create a new Socket to which you send the Data.

If I understand correctly how the new InSim Version works I have to open a Socket (i.e. UDP) and let it open until I close InSim again. The Problem with the Senddata Sub in the current state is that I can send my 1st Packet to LFS (ISI Packet). But when I send a 2nd Packet (i.e. a IS_Tiny for Keep Alive) I get the Message from LFS: "Packet received before ISI Packet". So my Package got sent, but LFS does not know that it came from the same Host / Socket who has sent the ISI Packet.

I am searching the Web and MSDN Offline / Online for 2 hours now but I don´t get it. I don´t want a solution, but maybe you can push me into the right Direction so I should get it on my own then.


BTW: My Listen Socket seems to be open all the Time because I can receive Packets from LFS (i.e. I get the Version Packets and those IS_TINY Packets for Keep Alive testing). But somehow I must make something different when sending Packets.
The new InSim version 4 has a diffrent ISI packet. This current verion is based on InSim version 2. Version 4 does not recognise a version 2 ISI packet. Thats why it comes up with that message.
Im currenlty working on a Version 4 compatable version.
Yeah, some problems can be caused by the new insim version.
My program isn't workin' cuz of the insim version, and i used mostly t-ron'z sollutions, in the code.
Hi T-RonX,

no problem here with the ISI Packet. IMHO I upgraded all necessary Bits to V4. When I send my ISI Packet I see the Connection in LFS and I even get the Version Packet back into my App which I can process and display on my Screen. And LFS sends all 30 Seconds a IS_TINY Package for Keep Alive to me..
So the Connection is established, InSim is initialized and I get Packets from LFS.
But LFS seems not to believe me that the following Packets I send are for the InSim Connection I previously opened. I used Wireshark to find differences in my Packets. And what I recognized so far is that my 1st UDP Package has an SRC Port of i.e. 1130, the 2nd one of 1131 and so on. Does LFS expect the same SRC Port Value in the UDP Packets it receives to know which Packets are for which InSim Connection?
Strange, but you are right, I have the same problem now. I'm goiing to investigate...
Quote from buedi :Hi T-RonX,

no problem here with the ISI Packet. IMHO I upgraded all necessary Bits to V4. When I send my ISI Packet I see the Connection in LFS and I even get the Version Packet back into my App which I can process and display on my Screen. And LFS sends all 30 Seconds a IS_TINY Package for Keep Alive to me..
So the Connection is established, InSim is initialized and I get Packets from LFS.
But LFS seems not to believe me that the following Packets I send are for the InSim Connection I previously opened. I used Wireshark to find differences in my Packets. And what I recognized so far is that my 1st UDP Package has an SRC Port of i.e. 1130, the 2nd one of 1131 and so on. Does LFS expect the same SRC Port Value in the UDP Packets it receives to know which Packets are for which InSim Connection?

You want to send with UDP ?? Wright ??
Make sure that you not allway´s set a new connection cause then every time the next Port is chosen. Establish 1 Connection and use this.

greets
I am currently looking into this:
UDPClient.Client Property

It looks like it lets you reuse your existing UDPClient Connection. But I am not sure if it´s the right path to a solution.
Quote from riskredruM :You want to send with UDP ?? Wright ??
Make sure that you not allway´s set a new connection cause then every time the next Port is chosen. Establish 1 Connection and use this.

Yes, I am using UDP. And what you explained is exactly what I try to achieve. But thanks to my very limited Programming Knowledge I am researching how to do this since many hours now. If you would have seen what I tried maybe you would have a good laugh
But I am trying further until my GF shouts at me. But currently she plays with my PDA, so I think I have some time left until the Battery is empty
May you send your code and i will have a look ??

Don´t forgett to charge he Battery
My code is currently a big mess, you really don't wanna have a look at it.
buedi might want to provide his code.
Quote from T-RonX :My code is currently a big mess, you really don't wanna have a look at it.
buedi might want to provide his code.

The post was for buedi
@ buedi

check PN
1

InSim base for Visual Basic .NET 2005
(28 posts, started )
FGED GREDG RDFGDR GSFDG