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:
[CODE]lua\includes\modules\glon.lua:248: Expected unescaped to end string at position 113! (Got EOF)[/CODE]
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:
[CODE]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))[/CODE]
Client:
[CODE]local Table = glon.decode(GetGlobalString("table"))
table.insert(Table, um:ReadString())
SetGlobalString("table", glon.encode(Table))[/CODE]
Instead of usermessages I used a shared lua file. I am still getting this error on the client only:
[CODE]lua\includes\modules\glon.lua:248: Expected unescaped to end string at position 197! (Got EOF)[/CODE]
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.
[QUOTE=Drakehawke;23617355]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.[/QUOTE]
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?
[QUOTE=DestroyHim;23617557]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?[/QUOTE]
Why not just send the string through the usermessage then decode it on the client?
[QUOTE=deathrat;23621105]Why not just send the string through the usermessage then decode it on the client?[/QUOTE]
That's what he originally did to get the error.
Do you have to use GLON?
[QUOTE=LauScript;23621203]Do you have to use GLON?[/QUOTE]
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!
Sorry, you need to Log In to post a reply to this thread.