Networked Array
by Rudolf Kajan · in Torque Game Engine · 03/17/2007 (4:37 pm) · 3 replies
Hi,
what is the best way to send status of inventory from from server to client ?
I tried string divided with TABs but the string is too long.
any ideas ?
what is the best way to send status of inventory from from server to client ?
I tried string divided with TABs but the string is too long.
any ideas ?
About the author
#2
you can break your data up into multiple parameters however, (i'm not sure how many you can use)
and also break it up into several commandToClient()s.
note that if you have a very large amount of data to send,
you may want to stagger the commandToClient()s over time
so as to avoid a server hiccup.
also,
tagging the string is only useful if you expect to be sending the exact same string to the same client again.
03/17/2007 (7:45 pm)
Each parameter of a commandToClient() is limited to 255 chars, i believe.you can break your data up into multiple parameters however, (i'm not sure how many you can use)
and also break it up into several commandToClient()s.
note that if you have a very large amount of data to send,
you may want to stagger the commandToClient()s over time
so as to avoid a server hiccup.
also,
tagging the string is only useful if you expect to be sending the exact same string to the same client again.
#3
03/18/2007 (3:44 am)
Thanks, I'll try it
Zod
%Weapon[0] = "blah"; %Weapon[1] = "foo"; for ( %i = 0; %Weapon[%i] !$=""; %i++ ) { %list = %list $="" ? %Weapon[%i] : %list TAB %Weapon[%i]; } commandToClient(%client, 'SendInventory', addTaggedString(%list));