Is there a size limit for strings in usermessages? If so, what is it?
I'm not completely positive, but I'm pretty sure there is.
If there is, then I'd imagine it's 256 characters.
Though why you're networking a string that big is terrifying, anyways. :gonk:
I was thinking of sending a usermessage with a glon'd table, but I guess datastream would be more efficient.
You can only use 255 of the 256 if I recall correctly.
You dont need to use datastream,
just send each peice of the table via umsg to the client and store it. Not hard.
And yes, the limit of a umsg is 256 characters, therefore you shouldnt really send a huge table
in one usermessage as it will probably fail.
[lua]
local table = { "example1", "example2", "example3" };
local delay = 0;
for k, v in pairs( table ) do
local function send( data )
umsg.Start( "SEND", ply );
umsg.String( data );
umsg.End();
end
timer.Simple( delay, send, v );
delay = delay + .2;
end
[/lua]
Then on the client
[lua]
local table = { }
function Get( msg )
local piece = msg:ReadString();
table.insert( table, piece );
end
usermessage.Hook( "SEND", Get );
[/lua]
Basicly send each value by usermessage to the client with a small delay between each piece.
Datastream is not efficient at all.
Shouldn't the limit be 255. I thought the last one was use to send or something along those lines.
Yeah 255 the last one is used for the player index or something.
Sorry, you need to Log In to post a reply to this thread.