Jump to content
  • 0

llListen Efficiency


Sayrah Parx
 Share

You are about to reply to a thread that has been inactive for 4640 days.

Please take a moment to consider if this thread is worth bumping.

Question

Is it more efficient to have something like this:

 

state_entry()
{
llListen(12345, "Object 1", "", "");
llListen(12345, "Object 2", "", "");
llListen(12345, "Object 3", "", "");
}

listen(integer channel, string name, key id, string message)
{
do_something();
}


Instead of something like this:

 

state_entry()
{
llListen(12345, "", "", "");
}

listen(integer channel, string name, key id, string message)
{
if ((name == "Object 1") || (name == "Object 2") || (name == "Object 3"))
{
do_something();
}
}

 

Or is it always better to have fewer listens, even when the listens are narrowly defined?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

There's less load on the servers if you do your filtering in the script itself instead of making the servers do it three times.  My solution would be something like

default{    state_entry()    {        llListen(12345,"","","");    }    listen (integer channel, string name key id, string msg)    {        if (~llListFindList(["Object 1","Object 2","Object 3"],[name]))        {            //Do something        }    }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4640 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...