Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Object - Object Email Communication

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-09-2007 17:07
im working on a in world comunication server and im having some trouble trying to figure out how to send message back, i can send messeges to the server itself but i have no idea how to get it to come back to all the other objects

CODE


//Radio\\

string Email = "(object key)@lsl.secondlife.com";
default
{
state_entry()
{
llOwnerSay("Talk on channel 164 (/164 Message) to send a message to your friends");
llOwnerSay((string)llGetKey());
//llEmail( Email, "", "" );
llListen(164,"",llGetOwner(),"");
}
listen(integer channel, string name, key id, string message)
{
string name = llKey2Name(llGetOwner());

{
llEmail( Email,name+":"+message,"");
}
}

}

--------------------------//SERVER\\----------------------------------

string subj = "+subj+";
default {
state_entry() {
llOwnerSay((string)llGetKey());
llSetTimerEvent(1); //Don't go much lower than this...
}

timer() {
llGetNextEmail("",""); //Check for emails
}

email(string time, string address, string subj, string message, integer num_left) {

llMessageLinked(LINK_SET,0 ,(string)subj,"");

}
}
----------------------------//linkedscript\\---------------------------
default
{
state_entry()
{
//llSay(0, "Hello, Avatar!");
}

link_message(integer sender_num, integer num, string msg, key id)
{
llWhisper(0,msg);
}
}


i know i have to send it to some other script to send it ot other otherjects and that is about as far as i got
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
12-09-2007 18:30
From: Mrc Homewood
i know i have to send it to some other script to send it ot other otherjects and that is about as far as i got
The email() event includes the address of the sender, so you can reply to it. Or, if you know the UUIDs for all the objects you want to send email to, you can easily format their addresses as UUID + "@lsl.secondlife.com".

The reason you might want to do that from separate "slave" scripts is that the llEmail call has a built-in 20 second delay. But email has some overhead, so it's probably not a good idea to cheat too much. (It's not *that* bad. As Kelly Linden explained in comments to the recently closed XML-RPC jira, http://jira.secondlife.com/browse/SVC-29, "If you are communicating between objects llEmail is THE way to go. It isn't really email on the back end, and is much more reliable than any other option.";)
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-09-2007 18:41
From: Qie Niangao
The email() event includes the address of the sender, so you can reply to it. Or, if you know the UUIDs for all the objects you want to send email to, you can easily format their addresses as UUID + "@lsl.secondlife.com".


how would i go about doing that tho, wouldnt i have to have objects send there address to the server and somehow record them?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
12-09-2007 19:12
From: Mrc Homewood
how would i go about doing that tho, wouldnt i have to have objects send there address to the server and somehow record them?
Yep. They'd need to send a kind of registration email first so the server knew they existed, and then the server would store their addresses in a list of recipients. (How the server knows they're genuine recipients and not "spy" objects is... a complication. ;) )

Of course, they need to know the server's UUID to know where to send that registration email. And the server better not get un-rezzed, or all the other objects won't know who the new server is (which is why, for any "production" use of llEmail based systems, redundant servers are hosted in multiple sims, with a "new server announcement" built into whatever protocol you define for administering the system).

(Btw, If the objects will all stay within a sim, you'd use llRegionSay instead of llEmail.)
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-09-2007 19:29
hehe ya, i already made a regiansay verson, im able to email messages to the server but i just cant find out the registration stuff, email dosent seam like the ezyest thing to do lol

but that still comes back to the orinal question how do i acculy store the emails
Papalopulus Kobolowski
working mind
Join date: 11 Aug 2006
Posts: 326
12-09-2007 21:14
if the message in back from the server to de object you only need take first the object key and send it to the server with the message, then the server recive the messaje and the key to response, (you can store to a list for permanent storage or just for that message), about for object faked the message you can send some type of "password" with the message and check in some place in the server side script with a "if" sentence.
you can see this type of script comunication here /15/5f/78451/1.html
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-10-2007 16:28
was thinking for logging the keys could i do something like this

llEmail((email address),";(avatar name)",(string)llGetKey());

when the radio is rezed email with the subject ";(avatar name)" and message the radios key and somehow add it to a string kinda make a key list? and when a messag is recived send it to everyone on that list?