![]() |
Sending data
Basically, here's my problem:
I have an object clientside which I need to send serverside, so I use object.saveVarsToArray(false). When the object is received serverside, it's loading it, then saving it to a text file (for this example, data/test.txt). Then, on demand, I need a player to be able to load the object that was saved serverside. Normally I would loadVars() the file, then saveVarsToArray(false) and send it clientside, where it can be loaded to recover the object. However, I will be sending potentially huge amounts of data. I doubt that I will exceed the limits of triggerclient/server, but I want it to be robust in case it should happen. As far as I know, triggerclient/server will cut off the paramaters, rather than split into multiple packets (this may be the wrong word, correct me if so) and waiting for all of them to arrive to trigger the action. If this is the case, how can I send large amounts of data back and forth (client -> server and server -> client) without losing any of it? I suppose I could split the trigger up manually, but that would be a bit messy, and I'm hoping there's a better way. Any suggestions? |
Split the data to be sent into 64kb (or 60kb to be safe) packets and send one at a time. Why are you needing to send such a massive amount of data anyways?
|
Quote:
|
60k is still quite a lot for that. The next Graal version supports bigger data. It's also possible to store the news in a text/html file and download it by the client (levels/era_news.html or so).
|
It would be nice if it was actually possible to do some image manipulation ( I.e: GD2 & PHP ) on the serverside, so you could render the page after it has been finalized.
|
Quote:
I took another look, and played around with what Stefan said. Basically, I uploaded a text file into a place where txt files were downloadable (via folder config), then used showimg(200, "news_1234.txt", 0, 0), and waited for it to download. Funny way of doing it, but it worked. However, it seems I waaaay underestimated the amount of data that can be sent back and forth, so I think I will be used triggers after all. |
| All times are GMT +2. The time now is 09:50 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.