The online racing simulator
How to make IS_REO packet?
(8 posts, started )
How to make IS_REO packet?
Hi guys,

I know that this fore isn't apropiate for my question, but in the other fore I haven't got answer..

I am programming an aplication for LFS. In this, I want reorder the start grid. I know that I have to send a IS_REO packet to LFS, but I don't know how make it... Exist a function "Send_TINY(Packet.Enum Type, byte parm)" in C# External Library LFS, but I don't understand it very well...

Somebody can explainme how make a IS_REO packet and how send it correctly with an example?

Thankyou and sorry for disturbe you with other topic...
Well, I do not know the External Library you mention, so I do not know what it allows you to do. If it goes a bit above basic level, it should have a method to send the IS_REO packet. You'd supply array of byte values, specifically player IDs, and it will create the right packet and send it to server.

In case the library just manages the connection for you and leaves out the packet creation, you could use code similar to this one:

static public byte[] IS_REO(byte[] PLIDs)
{
byte[] packet = new byte[36];
packet[0] = (byte)packet.Length; // = 36
packet[1] = (byte)Enums.ISP.REO; // = also 36 (by pure chance)
packet[2] = 0;
packet[3] = (byte)Math.Min(PLIDs.Length, 32)
Array.Copy(PLIDs, 0, packet, 4, Math.Min(PLIDs.Length, 32));
return packet;
}

You supply player IDs as a byte array and get back fully formed IS_REO packet as byte array, ready for sending. But you cannot use Send_TINY, because that function accepts only one byte as a parameter, not array of bytes. REO is not a TINY packet. (Is there Send_ISP available? You'd need that one.)

Note that you need to send this packet after restart vote was called, but before the grid is formed, that is about the moment when Race Restart shows 2 or 1. Another option is to use fixed grid, but I have no experience with this mode.

So the hardest part is getting player IDs (which are changing after every spectating), sorting them based on some criteria, and capturing the right moment to send the packet. The packet itself is rather simple.
I understand the IS_REO packet, but I haven't got Send_ISP function... Can you paste me the code of it? or any example similar?

I've got this function: Send_SMALL(Enums.Small Type, byte ReqI, uint Value)

The values for Enums.Small are:
SMALL_NLI
SMALL_NONE
SMALL_RTP
SMALL_SSG
SMALL_SSP
SMALL_STP
SMALL_TMS
SMALL_VTA

Anyone is valid for REO packet? I think not...


Thankyou EQ Worry
I took a look into LFS External documentation and I'm afraid the option to send requested race order is missing there. I also do not see any option to send your own constructed packet, so I think you're stuck. You need to ask LFS External developers to add the necessary code and the Set_REO_RaceOrder method...
Thank you EQ! I wait for the LFS_External answer my question
One more question...

How can I do for use /start=fixed command? How can I reorder if I use it?
I really do not know how FIXED option is used. I would say the server then does no reordering, but where does it take the initial order from I do not know. Probably it must be set by the REO packet or something very similar to random order is used. That means you still need to use some communication packet. Another option is manual ordering in the race end (lobby) screen, but that is really cumbersome.
Uhmm... Thanks EQ!

How to make IS_REO packet?
(8 posts, started )
FGED GREDG RDFGDR GSFDG