Difference between revisions of "Check Animations Permissions Tool"

From Second Life Wiki
Jump to navigation Jump to search
(New page: Purpose: a tool to check that animations have correct the permissions for the next owner. Catches errors that tired eyes may miss! The logic is based on the assumption that full perms yo...)
 
Line 20: Line 20:
  //yet another running script to be monitoring in SIMs. Plus, customers would get a msg from it
  //yet another running script to be monitoring in SIMs. Plus, customers would get a msg from it
  //each time they clicked the prim, which would confuse them.
  //each time they clicked the prim, which would confuse them.
//Chaz Longstaff. June 2008.
  checkPerms() {
  checkPerms() {
     string perms_copy;
     string perms_copy;

Revision as of 16:16, 15 June 2008

Purpose: a tool to check that animations have correct the permissions for the next owner.

Catches errors that tired eyes may miss!

The logic is based on the assumption that full perms you have licenced should never have both copy and transfer enabled, only one or the other.

Copy the text below the line into a script, and follow the directions below.

_______________________________________________________________


//Purpose: a tool to check that animations have correct the permissions for the next owner
//The logic is based on the assumption that full perms you have licenced
//should never have both copy and transfer enabled, only one or the other.
//Confirms to you if all is well; let's you know what the problem ones are otherwise.
//Drop into the prim holding your MLPV2 when you have finished set up.
//Correct any errors.
//Then click the prim to check one more time; correct any errors then repeat until you get all is well msg.
//Then delete this script; customers don't need it, and the SL backend server doesn't need
//yet another running script to be monitoring in SIMs. Plus, customers would get a msg from it
//each time they clicked the prim, which would confuse them.
//Chaz Longstaff. June 2008.
checkPerms() {
   string perms_copy;
   integer i;
   string perms_xfer;
   string ObjectName;
   list WarningList = [];
   integer num = llGetInventoryNumber(INVENTORY_ANIMATION);

   for (i = 0; i < num; ++i) {
       ObjectName = llGetInventoryName(INVENTORY_ANIMATION, i);
       if (llGetInventoryPermMask(ObjectName, MASK_NEXT) & PERM_COPY) {
           perms_copy = "Copy";
           }
       if (llGetInventoryPermMask(ObjectName, MASK_NEXT) & PERM_TRANSFER) {
           perms_xfer = "Transfer";
           }
       if ( ( perms_copy == "Copy") && (perms_xfer == "Transfer") ) {
           WarningList += ObjectName + ": " + perms_copy + " " + perms_xfer;
       }
       perms_copy = "";
       perms_xfer = "";
   }
   integer WarningNum = llGetListLength(WarningList);
   if (WarningNum == 0) {
       llSay(0, "All animation permissions are correct!");
       return;
   }
   else {
       for (i = 0; i < WarningNum; ++i) {
           string tmp01 = llList2String(WarningList, i);
           llSay(0,tmp01);
       }
   }
   WarningList = [];
}


default {
   state_entry() {
       checkPerms();
   }
   
   on_rez(integer params) {
       llResetScript();
   }
   
   touch_start(integer start) {
     checkPerms();
   }
}