Jump to content

Need Help with Script-Object Permission Settings


gregwen71
 Share

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

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

Recommended Posts

I really can't tell you why, after almost 6 years, I cannot wrap my head around this, but... it's true. I'm forever having to ask about how permissions work.

Here is my issue:  I am working on a script project that I will be selling. Once sold, one item in that project will be sold by my client to their customers. Another item, possibly 2, will be transferred to people involved in my clients event.  I am trying to vision the permissions necessary to make sure everything will work as intended.

The customers, client, nor clients "people" will need to modify the scripts in any way, So, I'll be setting the scripts to no-modify. I do not want the scripts given away, however. No-Modify takes care of being able to read the scripts, but what about say.. a friend wants a copy of the system to use.

3 objects w/ scripts will be kept by the client.
2 objects w/ scripts will be passed on by the client to their "people" (basically people involved in the event the client is running) 
1 object w/scripts is sold to the customer

Could someone help my addled brain?  Let me know if you need more information.

Edited by gregwen71
Link to comment
Share on other sites

As for the one passed on/sold to the client's customer, how are they to set it up? You could sell it to your client in a locked state as copy/trans. Have them in the setup set the perms of the script to either no copy or no trans. On a changed event it will detect changed inventory. (CHANGED_INVENTORY is triggered by adding/removing things from the object's inventory, and by changing the permanent of something in the inventory.) It can then check the perms of itself and see if it is set to no cop or no trans (for next user) and switch to a usable state. If not, stay in or change to the locked state.

Link to comment
Share on other sites

I would take it a little further and store the ID of the person setting it up, so that it will only respond to chat issued by objects owned by them. if it's reset by the next owner, or if the next owner ends up with a copy/trans version, when trying to set it up, it won't work for them if they don't have the other items to use with it

hope this helps

key stored_id;//store the event coordinator's UUID here, automatically done below

integer chan = -12345;//this number used for testing purpose, set channel to something not easily guessed
integer handle;
string scriptname;

integer acceptibleperms()
{
    integer perms = llGetInventoryPermMask(scriptname,MASK_NEXT);
    if((perms & PERM_TRANSFER && perms & PERM_COPY)){return FALSE;}
    return TRUE;
}

debug_perms()
{
    llListenRemove(handle);
    llOwnerSay("Next owner perms for: " + scriptname + " need to be set to either copy only or transfer only to be usable");
}
    
default
{
    state_entry()
    {
        scriptname = llGetScriptName();
        if(acceptibleperms())
        {
            stored_id = llGetOwner();
            string name = llKey2Name(stored_id);
            llOwnerSay("Perms set. This object will now only listen to objects owned by: " + name);
            handle = llListen(chan,"","","");
            //add any other things you want to happen in state_entry() when in operational mode
        }
        else
        {
            state locked;
        }
    }

    touch_start(integer total_number)
    {
        //whatever Touch stuff you want to happen when in operrational mode
    }
    
    listen(integer chan, string name, key id, string message)
    {
        if(llGetOwnerKey(id) == stored_id)
        {
            //do stuff that applies to the intention of the script listening to objects owned by the stored_id
        }
        else
        {
            //do stuff if the speaking object isn't owned by the stored_id, such as if chat commands by the customer are necessary
        }
    }
    
     changed(integer change)
    {
        if(change & CHANGED_INVENTORY)
        {
            if(acceptibleperms())
            {
                state default;
            }
            else
            {
                state locked;
            }
        }
    }
}

state locked
{
    state_entry()
    {
        debug_perms();
    }
    
    changed(integer change)
    {
        if(change & CHANGED_INVENTORY)
        {
            if(acceptibleperms())
            {
                state default;
            }
            else
            {
                debug_perms();
            }
        }
    }
}

 

  • Like 1
Link to comment
Share on other sites

Thank you for your reply.

The item being sold by my client to their customer is actually a HUD. The script sets up the hud automatically (name/desc/scale). The only thing they would need to do is add their own texture to it. As for the "clickable options" on the HUD, that is handled via script and setup elsewhere in the system (by using one of the objects that client keeps for themselves). 

It's in the client's best interest to make sure that permissions are set correctly, or they could lose out on money. For that item, I was thinking how I can't set a no transfer setting on the script, initially, because then they wouldn't be able to sell the HUD.. if my thinking is correct.  Like I said, my mind gets twisted up when thinking about it. I guess it's more apt to say that I'm confused about how to handle "3rd Owner Permissions", or if I even should rather than let the client handle it themselves.

Edited the Original Post: To provide more info about the pieces of the system

Edit Again:
Actually, as often happens, my mind falls into a problem and I either solve it, or overthink it into confusion.  

Since the system involves a few pieces, and the pieces kept by the client are what drives the entire system, I don't necessarily need to worry about permissions and script protection (beyond no-mod) of the passed on items. They can't be used without the 3 client objects, which will have no mod/trans.

Thanks for your attempts to help, Ruthven.

Edited by gregwen71
Link to comment
Share on other sites

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