Commander Wyatt":3ufgxlsj said:
Ah, I thought my way was too easy.
The trouble is though, how would variables and switches be sent? They are huge arrays; I know how to convert them into a string but it's likely that string would exceed 4096 bytes with the amount of possible variables or switches. (Not that I use that many, but obviously it poses a limitation for the future.)
Well, In my game - I have a switches and variables table. Each with id, value and description. All entry's are changed variables, thus need to be send. I just send switch by switch and variable by variable. Every x I call Graphics.update, but since its only very short data (switch becomes : #GS2|1 for swith 2 is true etc.) it goes pretty fast

.
Also, the 4096 bytes limit only counts for async commands. Just call get_command(...) from Netplay 2 (works well in 1.6 I suppose) and you can receive unlimited data. Though it is slower, because data is received byte wise instead of packet wise. In short, the method calls an method which does:
until (char = recv(1)) == "\n" do message += char end
So first you send a number request to the server (#GS) and then you iterate: n.times do get_switch end where get_switch simply calls a get_command(#GS), retrieves the data, evaluates the value and saves the switch. You COULD make a superlarge string from all the data anf just send #GS to the server to notify that it must now send the switch data and receive the data by get_command, but I don't know if that goes wrong if the string length becomes very large...