Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-11-2009, 09:43 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
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?
__________________
Reply With Quote
  #2  
Old 06-11-2009, 09:53 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
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?
__________________
Reply With Quote
  #3  
Old 06-11-2009, 10:03 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
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?
Like I said, I doubt they will be massive, but it's for Era News... it'll be sending down the text, positions, offsets, images, fill colors, etc for every single object in the paper, and all of the pages, which could potentially be quite large.
__________________
Reply With Quote
  #4  
Old 06-11-2009, 10:11 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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).
Reply With Quote
  #5  
Old 06-12-2009, 01:00 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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:
Reply With Quote
  #6  
Old 06-12-2009, 03:16 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by fowlplay4 View Post
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.
I plan to do that for the final release. The reason I need to send it back/forth it so they can view/edit the templates.

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.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.