Jump to content

HUD/Attachment owner only communication


Rubberene
 Share

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

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

Recommended Posts

I've googled this, but since it must be a fairly common thing, I must not be searching the right terms. This is for a product, and I need to ensure that if there are two avatars at the same place with the same item that their attachments won't listen to each other's HUDs. 

To state the obvious, with the two example scripts, this is exactly what happens, If I use "llListen( 3, "", llGetOwner(), "" );", then, of course, the attachment won't listen to the HUD. 

 

HUD Script:

list buttons = ["Scare", "Sound"];
string msg = "Select an option:";

key Owner;
integer channel_dialog;
integer listen_id;
default{
state_entry() {
Owner = llGetOwner();
channel_dialog = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-5,-1)) );
}

touch_start(integer total_number) {
if(llDetectedKey(0)==Owner){
llDialog(Owner, msg, buttons, channel_dialog);
listen_id = llListen( channel_dialog, "", Owner, "");

}
}


listen(integer channel, string name, key id, string choice) {
if (choice == "-") {
llDialog(Owner, msg,buttons, channel_dialog);
}
else if (choice == "Scare") {
llSay(3, "Scare");
llListenRemove(listen_id);
}
else if (choice == "Sound") {
llSay(3, "Sound");
llListenRemove(listen_id);
}


}

timer() {
llListenRemove(listen_id);
llSetTimerEvent(0.0);
}

 on_rez(integer start_param)
    {
        llResetScript();
    } 
}

 

 

Attachment script:

default
{

    state_entry() {
        llListen(3,"", NULL_KEY, "");
    }

    listen(integer channel, string name, key id, string message) {
        if (message == "Scare") {llSay(0, "Boo!"); state default;}{
        if (message == "Sound") {llPlaySound("ed124764-705d-d497-167a-182cd9fa2e6c",1); state default;}{
      
        
        
        }
    }
}
}

 

 

There must be a simple way to fix this. Any help will be muchly appreciated. ;)

Link to comment
Share on other sites


Estelle Pienaar wrote:

Easiest method, but absolutely no security. If a product ever gets popular and a griefer searches the channels for the communication, he/she can send commands to your customers attachments! 

See also this discussion:

 

You don't need to lecture me on security. I was lead developer for the DCS2 combat meter for a while. I was merely responding within the scope of the original message which requested assistance in ensuring there wouldn't be any cross talk between hud and avatar attachment. If you really want, you can create a hash so that everyone's hud/attachment picks a communication channel unique to that avatar so that it doesn't matter if a griefer scans out their own channel number...yours will be different. You could even go further to encrypt all channel comms but the original poster did not specify the need for any of these options.

Link to comment
Share on other sites

Creating a hash for unique channels sounds like an interesting idea to check out. 

Just to add to the list of possible security measures: A scripter could create a "hash ID" by taking the value of minutes from llGetTimeStamp at the moment the message is sent, run them through a function, shorten it e.g. to the first four digits and add them to the string which is sent by the HUD. Make the same mathematical calculations in the receiving attachment and check if the numbers are identical. 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3537 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...