Hi. I'm trying to store car contacts made in a race but I'm not getting the right values for variable "Time" if the race is long. Here is the packet specification from InSim.txt:
The packet size is 40 bytes. The first 4 bytes are for Size, Type,Reql and Zero. CarContact A and B are 16 bytes each one and SpClose and Time are 2 bytes integers each. According to Wikipedia for a 2 bytes unsigned integer the range is 0 to 65535. So, for Time, it can't have values larger than 65535 and in real time measure (100 = 1 second) that is like 655 seconds or so. If the race length is longer than that the Time value will not be correct.
For tests I've used Pyinsim library.
I wonder if this is a Insim or Pyinsim bug, or perhaps I'm doing something wrong. Thanks.
                
            struct IS_CON // CONtact - between two cars (A and B are sorted by PLID)
{
	byte	Size;		// 40
	byte	Type;		// ISP_CON
	byte	ReqI;		// 0
	byte	Zero;
	word	SpClose;	// high 4 bits : reserved / low 12 bits : closing speed (10 = 1 m/s)
	word	Time;		// looping time stamp (hundredths - time since reset - like TINY_GTH)
	CarContact	A;
	CarContact	B;
};
The packet size is 40 bytes. The first 4 bytes are for Size, Type,Reql and Zero. CarContact A and B are 16 bytes each one and SpClose and Time are 2 bytes integers each. According to Wikipedia for a 2 bytes unsigned integer the range is 0 to 65535. So, for Time, it can't have values larger than 65535 and in real time measure (100 = 1 second) that is like 655 seconds or so. If the race length is longer than that the Time value will not be correct.
For tests I've used Pyinsim library.
I wonder if this is a Insim or Pyinsim bug, or perhaps I'm doing something wrong. Thanks.