The online racing simulator
Getting Penalty and Pit info from InSim
hi! i am trying to write a race monitor tool but came across this problem, does InSim provide info about a player's penalty and pit times while the race is going? IS_RES packet has these but it seems that IS_RES comes only after the driver finishes the race. so is there a way to get the penalty flags and pit times anytime in the race? thx
No you can´t get both.
You are right for the penaltys, you can get it only with the result packet
Also there is no packet with pit information. Only the count in again the result packet.
The penalty in the result packet don´t says if you got a penalty ever in the race. It only says if you have a penalty at the end of the race.

There are many design problems and bugs in InSim, I wrote some threads but don´t got a reply from Scaven if he want to do something in the future
#3 - Stuff
You can get that RES packet before the end of the race. Like InSim.txt says: To request a IS_RES, send a InSimPack with Id = "RES" and value = result number (0,1,2...)

However I'm not sure what's in it before the race ends. If you experiment with this, let us know what you get please.
You can measure (approximately of course) the pit times by looking at the MCI packets. For example define a box which is the pitlane and count the time a car is within the box or measure the time that the car has zero velocity inside that box.
@Stuff that isn´t really a good answer at all, you are right, thats in the insim documentation, but do you thought where to get a result number? - Yes from a result and you get that only if a result has given.

@Frankmd interesting idea, never thought of that, but I´m not for those unsecure solutions and thinks you have do hardcoding (nodes). Also you often stop on the wrong place and accelerate and stop again.
But yes, at least you should get a good result with thing of all
I had the a similar problem, because I want to know the lap number when someone enters the pits. My solution is that I parse the chat message that is send. It is not the prettiest way, because the message is language depended. But I don't no any simpler way.

I think this could also work for penalties.
I've made a new sticky thread where you can alert me to a new required function, after you have discussed it in detail as far as possible with other programmers.

http://www.lfsforum.net/showthread.php?t=20569

Please have a good think about how you think the pit packet should look, when it should be sent and a simple example of what you'd use it for, and that will help me to implement the packet. Then when you have discussed it, you can alert me by posting on that thread. I am subscribed to that thread so I'll get an email.

FGED GREDG RDFGDR GSFDG