The online racing simulator
Insim CNL packet questions
(18 posts, started )
#1 - PoVo
Insim CNL packet questions
Hey guys,

I was wondering, if someone looses connection or times out in a server, do they still go through the CNL packet, in the insim?

Thanks!
Yes.

struct IS_CNL // ConN Leave
{
byte Size; // 8
byte Type; // ISP_CNL
byte ReqI; // 0
byte UCID; // unique id of the connection which left

byte Reason; // leave reason (see below)
byte Total; // number of connections including host
byte Sp2;
byte Sp3;
};

enum
{
LEAVR_DISCO, // 0 - disconnect
LEAVR_TIMEOUT, // 1 - [b]timed out[/b]
LEAVR_LOSTCONN, // 2 - [b]lost connection[/b]
LEAVR_KICKED, // 3 - kicked
LEAVR_BANNED, // 4 - banned
LEAVR_SECURITY, // 5 - OOS or cheat protection
LEAVR_NUM
};

#3 - PoVo
Nice information, but where did you get it? Maybe you have a full file, with packet explanations?


Thanks!!!
Quote from PoVo :Nice information, but where did you get it? Maybe you have a full file, with packet explanations?

It comes with LFS, see docs/InSim.txt.
I think we need a HTML version of the InSim.txt that will link the structs possible member values to it's enum. Something along the lines of the attachment, as it would be nice to have an offline version as well. The Wiki could also use this level of referencing it's self.
Attached files
InSim.HTML.zip - 18.9 KB - 216 views
Good thing for new programmers but I think people who can't understand text version of InSim.txt should not touch it. It's only my opinion....
Quote from misiek08 :Good think for new programmers but I think people who can't understand text version of InSim.txt should not touch it. It's only my opinion....

I understand where your coming from, however, everyone has got to learn from something. I started programming many, many, many moons ago. I'm still horrible at it, but every now and again the community benefits from the code I produce. So, I would hope that some day these people would want to give back to the community that has taught them.

We as teachers, mentors, more experienced peers, or what ever it is you wish to call the wiser programmers of the community, could make it easier for people to start programming for Live For Speed. At the end of the end of the day, would this not produce a better environment for the community as a whole?
There is no point contributing to the community, as anything meaningful you do is just lost in space. For every guy who really cares about programming, there are ten guys asking "HOW DO U BUTTON I HAV INSIM BASE U HAV DO SKYPE?!?!?!" I write programs for LFS because I enjoy writing programs and sometimes the two overlap. However I have no desire to teach anyone on this forum any more, as so much of the discussion here is just infantile nonsense that has nothing to do with writing computer programs, or anything else for that matter.
So, just direct people to StackOverflow and be done with it then? I'll be sure to make an InSim tag there .
Quote from Dygear :I think we need a HTML version of the InSim.txt that will link the structs possible member values to it's enum. Something along the lines of the attachment, as it would be nice to have an offline version as well. The Wiki could also use this level of referencing it's self.

Very nice and not only usefull for beginners.
I will have a look at some doc-generators if it can improved further (e.g. index).
Quote from yankman :Very nice and not only usefull for beginners.
I will have a look at some doc-generators if it can improved further (e.g. index).

That would be great! I would love to see a real InSim documentation manual, I feel that the current Wiki falls quite severely short.
Well having written almost the entire Wiki entry on InSim, I would be happy to learn of which areas you feel are most in need of improvement. Of course as a Wiki anyone can edit it, so instead of saying that it sucks you could always improve it.
I let doxygen generate a documentation for the vanilla version of insim.txt.
I think it looks quite well.

Next step would be to change the appearance of scawens comments so doxygen recognizes them.
live
download
In my experience the way I learnt most about how insim works, even after having read the whole insim.txt and having programmed my own example applications was using DarkTimes' InSimSniffer. It should be mandatory to use it before trying any attempt to program using it.

Now, about buttons, sending commands, abd stuff... you just have to read the insim doc. It's not that hard, all text editors have a very nice funtion called FIND, and even though there is a lot of information in insim.txt you can always search things and play with them.

Anyway, the main problem is people trying to pick a big project when they do not even understand the basics of programming, and they try to do things that are too hard for them by imitation and not understanding how it works...
Quote from DarkTimes :Well having written almost the entire Wiki entry on InSim, I would be happy to learn of which areas you feel are most in need of improvement.

Quote from yankman :I let doxygen generate a documentation for the vanilla version of insim.txt.
live & download

@DarkTimes: Sorry mate, I appreciate the effort.
@Yankman: I like it! But it is still missing some fundamental information.

Quote from DarkTimes :Of course as a Wiki anyone can edit it, so instead of saying that it sucks you could always improve it.

As I was was saying about fundamental information. We all know that the header of the packet (Size, Type) that the Type can be found and read by the first enum we come across in the txt file. I just want a way that links the Type in each of the files back to the first enum (Like I did in my example.) There are other things like Button colors and the like, where you just forget what enum that connects to, so you have to look that up. Just parsing the document can become quite time consuming in and of it's self.

So, I would like a way of showing what enum connects to what, what const connections to what variable, what bit field connections to what struct member, et cetera, et cetera.

Quote from MaKaKaZo :In my experience the way I learnt most about how insim works, even after having read the whole insim.txt and having programmed my own example applications was using DarkTimes' InSimSniffer. It should be mandatory to use it before trying any attempt to program using it.

Now, about buttons, sending commands, abd stuff... you just have to read the insim doc. It's not that hard, all text editors have a very nice funtion called FIND, and even though there is a lot of information in insim.txt you can always search things and play with them.

Anyway, the main problem is people trying to pick a big project when they do not even understand the basics of programming, and they try to do things that are too hard for them by imitation and not understanding how it works...

I like that programming for InSim is hard, I like that. It's a real programmers job, but it could just be that little bit easier too. Why not make it easier? We are after all, all of us, the lazy types of people on the planet. Lazy Progammers.
I've updated insim.txt, so code description as well as general usage description is now being parsed by doxygen (see here).
The zip file includes the changed insim.txt (ispackets.h).
Maybe this can be added to the wiki (although I got no idea how).
Quote from yankman :I've updated insim.txt, so code description as well as general usage description is now being parsed by doxygen (see here).
The zip file includes the changed insim.txt (ispackets.h).
Maybe this can be added to the wiki (although I got no idea how).

I still don't see it very useful. The info that I look for the most in insim.txt are the structs of the different type of packets to see their fields and what they mean, and I can't find that in the doxygen generated html

Insim CNL packet questions
(18 posts, started )
FGED GREDG RDFGDR GSFDG