|
Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
|
11-09-2008 22:58
What is the best way to do this.
I working on a server that will get e mails from objects. Now it may send 1 to 10 at any given time I know about the dealy. But what is the best way to send back to the objects. Now I tried to run 3 Email Modules to send back the info. But it would send 3 e mails to the one object.
Is there a way to do this with out sending back the info with out sending 3 e mails to the one object?
Jenn
|
|
Faust Vollmar
llSetAgentSanity(FALSE);
Join date: 3 Feb 2007
Posts: 87
|
11-09-2008 23:22
Give the Link Messages a small amount of Serialization.
integer SlaveNumber; integer SlaveCount;
sendmail(stuff) { llMessageLinked(LINK_THIS, SlaveNumber, (stuff),(stuff); SlaveNumber += 1; if(SlaveNumber > SlaveCount) { SlaveNumber = 1; } }
That way only the slave with the correct number (Have it grab its number from its name on bootup or something) will send a mail.
|
|
Tarak Voss
Meanderer
Join date: 14 Oct 2006
Posts: 330
|
11-09-2008 23:51
AWWW - a slave's life is not an appy one - Branded, collared and now spammed!
|
|
Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
|
:/
11-10-2008 01:04
From: Faust Vollmar Give the Link Messages a small amount of Serialization.
integer SlaveNumber; integer SlaveCount;
sendmail(stuff) { llMessageLinked(LINK_THIS, SlaveNumber, (stuff),(stuff); SlaveNumber += 1; if(SlaveNumber > SlaveCount) { SlaveNumber = 1; } }
That way only the slave with the correct number (Have it grab its number from its name on bootup or something) will send a mail. I'm not sure what you mean by this
|
|
Faust Vollmar
llSetAgentSanity(FALSE);
Join date: 3 Feb 2007
Posts: 87
|
11-10-2008 01:32
The scripts that spit out Emails would get a number from some source. (Such as the Number that's appended onto Duplicate Items)
When the Link Message comes in, they only respond if the Number sent matches their number.
Since the main script increments numbers, it changes which script responds.
Something in the Slave Scripts...
integer MyNumber
state_entry() { MyNumber = (integer)llGetSubString(llGetScriptName(),-1,-1); }
link_message( integer sender_num, integer num, string str, key id ) { if(num == MyNumber) { email stuffs } }
The way the script gets names assumes a number has been appended on the end. (The original without a number *SHOULD* result in registering itself as Number 0, assuming the last character of its name isn't a number.)
I also made a slight mistake on the if(SlaveNumber > SlaveCount) { SlaveNumber = 1; } part, it should be = 0 not = 1.
|