Usermessage help

I am trying to send a large table from the server to the client by using multiple usermessages. After it sends about 6 strings in the table, it will stop working and I get this error on the server:


lua\includes\modules\glon.lua:248: Expected unescaped  to end string at position 113! (Got EOF)

I made a thread about this error yesterday but if not all of the encoded string is there then why is it still sending about 6 strings from the table?

This is my code:

Server:


local Table = glon.decode(GetGlobalString("table"))

umsg.Start("SetTable", ply)
   for k,v in ipairs(table) do
      umsg.String(v)
   end
umsg.End()

SetGlobalString("table", table.Empty(Table))

Client:


local Table = glon.decode(GetGlobalString("table"))
	
table.insert(Table, um:ReadString())
	
SetGlobalString("table", glon.encode(Table))

All while you should actually be pondering on where your design went wrong if you need to send a large table.

Instead of usermessages I used a shared lua file. I am still getting this error on the client only:


lua\includes\modules\glon.lua:248: Expected unescaped  to end string at position 197! (Got EOF)

Im starting to think that maybe it has something to do with the global variable?

Does the client really need the entire table? Maybe set up a way so the client asks for a specific part of the table and only that is sent via the usermessage.

The client does need all of the table. Using a shared lua file is less complicated and maybe better. I just don’t understand why I am getting that error. Is there a better way to temporarily store a table than global strings and glon?

Why not just send the string through the usermessage then decode it on the client?

That’s what he originally did to get the error.

Do you have to use GLON?

You can’t send tables with usermessages.

What are you putting inside this table of yours

I found out it was not because of the usermessages. It was something with the global vars, I stopped using them and it worked. Thanks your your help!