Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Best way to email a really long string?

Alberrt Steptoe
Second Life Resident
Join date: 31 Oct 2004
Posts: 19
03-25-2009 06:42
Hello all,

I need to send a list from one object to another. Best way I can think of is to email. I can either send from object to object or send as http_request to my web server then back in to SL to the object. Either way is good with me only http will be faster.

Now the bit of code I have so far is as follows;

CODE

//Maximum characters allowed to be sent
integer gMax = 1000;

//Turn the product list in to a string
string Raw = llList2CSV(gProdList);

//Get the stringlength
integer Prodnum = llStringLength(Raw);

integer i;
for(i=0;i<Prodnum;i = i + gMax)
{
integer Start = i;
integer End = i + gMax;

//split the string
string Split = llGetSubString(Raw, Start, End);

//email the above string
}

//send message saying end of string


Untested code.

Obviously if I send object to object email I have to decrease the Max string size because all the rubbish it will send with it.

Anyways. Is this method the best?

The way I was thinking of putting it together at the other end was to collect it all as 1 big string then convert back to a list as I will be sending through a CSV BUT if my emails lag up then it will receive it in odd parts and then wont go back together properly.

Any ideas suggestion or even a dont bother would help a lot.

Thanks all.

- Alberrt
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
03-25-2009 09:49
if you're sending more than one email, you'll have to number them so that the receiving end can reassemble them in order, and check to see if pieces are missing. If order isn't an issue, then each email should contain something that indicates the number of pieces to expect overall. You didn't get into much detail, but I'm assuming that the sender and receiver objects are in different sims. Otherwise you could just use llRegionSay() to transfer data between objects that are not linked together.
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
03-25-2009 10:02
Yeah, HTTP is probably your better option. Not only better performance, but you can easily fix the ordering problem that way, and you'll have a lot better reliability. The same consideration of limited transfer size will apply, since the size of a HTTP reply is restricted in a way very similar to the size of an e-mail.