Game Development Community

Do commandToClient()s arrive in guaranteed order ?

by Orion Elenzil · in Torque Game Engine · 05/10/2006 (12:38 pm) · 1 replies

Hiya -

if i issue a series of commandToClient() calls,
are they guaranteed to execute on the client in the order in which they were issued on the server ?

what i want to do is (very) occasionally send a list of all logged-in players and a few other items down to one of the clients. This list can be over 100 entries long, and each entry can be say 64 characters.

i could send it all in one lump via rolling them all into a newline-delimited string via SetRecord,
except it looks like each parameter to commandToClient() is truncated at 255 characters.

actually i can get the job done even if the command to clients *don't* execute in the order they were issued, it'll just be more of a hassle.

tia,
orion

#1
05/10/2006 (12:51 pm)
Only if the NetEvent mGuaranteeType is set to GuaranteedOrdered (an enum), which is by default true (see netConnection.h line 254).

You can of course inherit a new subclass and default (or set as you need) to any of the other types: Guaranteed or Unguaranteed.

For further info see the dOxygen docs on NetEvent, and a code search on commandToServer in the source code (not script, you'll see a bunch of them!).