Difference between revisions of "LlResetLandPassList"

From Second Life Wiki
Jump to navigation Jump to search
(template)
m (<lsl> tag to <source>)
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{LSL_Function
{{LSL_Function
|func=llResetLandPassList
|func=llResetLandPassList
|func_id=322
|func_id=322|func_sleep=0.1|func_energy=10.0
|func_sleep=0.1
|func_energy=10.0
|sort=ResetLandPassList
|sort=ResetLandPassList
|func_desc=Removes all residents from the land access/pass list.
|func_desc=Removes all residents from the land access/pass list.
Line 9: Line 7:
|return_type
|return_type
|return_text
|return_text
|p1_type|p1_name|p1_desc
|p2_type|p2_name|p2_desc
|p3_type|p3_name|p3_desc
|p4_type|p4_name|p4_desc
|p5_type|p5_name|p5_desc
|p6_type|p6_name|p6_desc
|p7_type|p7_name|p7_desc
|p8_type|p8_name|p8_desc
|p9_type|p9_name|p9_desc
|p10_type|p10_name|p10_desc
|p11_type|p11_name|p11_desc
|p12_type|p12_name|p12_desc
|constants
|constants
|spec
|spec
|caveats
|caveats
|examples
|examples=
<source lang="lsl2">
// This is not a complete solution, requires full avatar names to work - even for unbanning someone!
// This is meant only as an example of the land ban and pass management functions.
// free to copy, use, modify, distribute - just don't ask me to debug your modified code. ;-)
//
// Commands are:
//  /5 ban:full_avatar_name
//  /5 tempban:full_avatar_name
//  /5 unban:full_avatar_name
//  /5 pass:full_avatar_name
//  /5 unpass:full_avatar_name
//  /5 clearban
//  /5 clearpass
 
string command;
 
default
{
    state_entry()
    {
        llListen(5, "", llGetOwner(), "");
    }
   
    on_rez(integer param)
    {
        llResetScript();
    }
 
    listen(integer chan, string name, key id, string message)
    {
        if (command != "")
        {
            llOwnerSay("Sorry, still processing last command, try again in a second.");
        }
       
        list args = llParseString2List(message,[":"],[]);
        command = llToLower(llList2String(args,0));
       
        if (command == "clearbans")
        {
            llResetLandBanList();
        }
        if (command == "clearpass")
        {
            llResetLandPassList();
        }
        else
        {
            llSensor(llList2String(args,1),NULL_KEY,AGENT,96,PI);
        }
    }
   
    no_sensor()
    {
        command = "";
    }
   
    sensor(integer num)
    {
        integer i;
        for (i=0; i< num; ++i)
        {
            if (command == "ban")
            {
                // Ban indefinetely
                llAddToLandBanList(llDetectedKey(i),0.0);
            }
            if (command == "tempban")
            {
                // Ban for 1 hour.
                llAddToLandBanList(llDetectedKey(i),1.0);
            }
            if (command == "unban")
            {
                llRemoveFromLandBanList(llDetectedKey(i));
            }
            if (command == "pass")
            {
                // Add to land pass list for 1 hour
                llAddToLandPassList(llDetectedKey(i),1.0);
            }
            if (command == "unpass")
            {
                llRemoveFromLandPassList(llDetectedKey(i));
            }
        }
        command = "";
    }
}
</source>
|helpers
|helpers
|also_header
|also_header
|also_functions
|also_functions=
{{LSL DefineRow||[[llAddToLandBanList]]|}}
{{LSL DefineRow||[[llAddToLandPassList]]|}}
{{LSL DefineRow||[[llRemoveFromLandBanList]]|}}
{{LSL DefineRow||[[llRemoveFromLandPassList]]|}}
{{LSL DefineRow||[[llResetLandBanList]]|}}
|also_tests
|also_tests
|also_events
|also_events
Line 39: Line 120:
|permission
|permission
|negative_index
|negative_index
|cat1=Stub
|cat1=Security
|cat2
|cat2=Parcel
|cat3
|cat3
|cat4
|cat4

Latest revision as of 13:29, 22 January 2015

Summary

Function: llResetLandPassList( );
0.1 Forced Delay
10.0 Energy

Removes all residents from the land access/pass list.

Caveats

  • This function causes the script to sleep for 0.1 seconds.

Examples

// This is not a complete solution, requires full avatar names to work - even for unbanning someone!
// This is meant only as an example of the land ban and pass management functions.
// free to copy, use, modify, distribute - just don't ask me to debug your modified code. ;-)
// 
// Commands are:
//   /5 ban:full_avatar_name
//   /5 tempban:full_avatar_name
//   /5 unban:full_avatar_name
//   /5 pass:full_avatar_name
//   /5 unpass:full_avatar_name
//   /5 clearban
//   /5 clearpass

string command;

default
{
    state_entry()
    {
        llListen(5, "", llGetOwner(), "");
    }
    
    on_rez(integer param)
    {
        llResetScript();
    }

    listen(integer chan, string name, key id, string message)
    {
        if (command != "")
        {
            llOwnerSay("Sorry, still processing last command, try again in a second.");
        }
        
        list args = llParseString2List(message,[":"],[]);
        command = llToLower(llList2String(args,0));
        
        if (command == "clearbans")
        {
            llResetLandBanList();
        }
        if (command == "clearpass")
        {
            llResetLandPassList();
        }
        else
        {
            llSensor(llList2String(args,1),NULL_KEY,AGENT,96,PI);
        }
    }
    
    no_sensor()
    {
        command = "";
    }
    
    sensor(integer num)
    {
        integer i;
        for (i=0; i< num; ++i)
        {
            if (command == "ban")
            {
                // Ban indefinetely 
                llAddToLandBanList(llDetectedKey(i),0.0);
            }
            if (command == "tempban")
            {
                // Ban for 1 hour.
                llAddToLandBanList(llDetectedKey(i),1.0);
            }
            if (command == "unban")
            {
                llRemoveFromLandBanList(llDetectedKey(i));
            }
            if (command == "pass")
            {
                // Add to land pass list for 1 hour
                llAddToLandPassList(llDetectedKey(i),1.0);
            }
            if (command == "unpass")
            {
                llRemoveFromLandPassList(llDetectedKey(i));
            }
        }
        command = "";
    }
}

Deep Notes

Signature

function void llResetLandPassList();