Hey, Any advice on networking large tables efficiently.
net/WriteTable is not advised so i have been told when it comes to large logs.
Use multiple net messages and only write simple types.
I encode the table and use [URL="https://github.com/SuperiorServers/plib_v2/blob/master/lua/includes/modules/netstream.lua"]netstream [/URL]to send it
In my leaderboard addon my table is laid out in the fashion of the board - month and Alltime then in each of them the user and the score.
So my tables can get quite big and when I used to use just net.writetable it got to the point not all data was sent and it was slow and it errored, now I never normally need to move that entire table to the client but when I do what I do is convert it to a string with util.TableToJSON then compress that and send it as data so here is the server sending it and the client getting it.
[URL]http://prntscr.com/6nt8dj[/URL][B]​[/B]
[url]http://prntscr.com/6nt8rm[/url]
You could write a library for efficiently networking tables. Would actually probably be really useful.
[QUOTE=MadParakeet;47432025]You could write a library for efficiently networking tables. Would actually probably be really useful.[/QUOTE]
There are couple out there already.
There's one I wrote: [URL="http://facepunch.com/showthread.php?t=1455587&p=47314472&viewfull=1#post47314472"]http://facepunch.com/showthread.php?t=1455587&p=47314472&viewfull=1#post47314472[/URL]
And there's Wyozi's one: [URL="http://facepunch.com/showthread.php?t=1453630&p=47362545#post47362545"]http://facepunch.com/showthread.php?t=1453630&p=47362545#post47362545[/URL]
Sorry, you need to Log In to post a reply to this thread.