-
Notifications
You must be signed in to change notification settings - Fork 2
User Defined Permission
User Defined Permissions (UDP) is an extension of the Button Permissions, which allows all scripts to register their own button permissions which are than handled by the menu script. To do so, the menu have to know 3 things:
- the Name of the UDP
- the Type of the UDP
- the Value of the UDP
LSL example UDPBOOL:
integer UDPBOOL -804
string UDP_NAME="*** the name ***";
string udpValue="*** the value ***"; //must not contain a "," or "|"
llMessageLinked(LINK_SET, UDPBOOL, llDumpList2String([UDP_NAME + "=" + udpValue], "|"), NULL_KEY);LSL example UDPLIST:
integer UDPLIST -805
string UDP_NAME="*** the name ***";
string udpValue="*** the value ***"; //must not contain a "," or "|"
llMessageLinked(LINK_SET, UDPLIST, llDumpList2String([UDP_NAME + "=" + udpValue], "|"), NULL_KEY);Every time the udpValue changes, this linkMessage has to be send.
Syntax of the string part of the linkmessage:
UDP_NAME1=udpValue1[|UDP_NAME2=udpValue2[| ...]]
The name is chosen by you. It has to be unique. Therefore we maintain a list with registered UDP names (UDP Register).
If you want to use UDP for your own purpose (don't want to give your scripts away) you should prefix your UDP name with my. UDP names with the myprefix don't need to be registered.
Currently there are 2 types of User Defined Permissions, a bool type and a list type.
The bool type expects a simple boolean value as the udpValue:
0: FALSE
all other values: TRUE
Using this type allows you to simply switch on/off menu buttons.
The list type expects a list of Avatar UUIDs (concentrated into a string) as the udpValue. You may use any seperator except "," (colon). If the UUID of the Avatar using the menu is inside this "list", the corresponding UDP is evaluated as TRUE (the button is shown).
There are two example scripts inside the nPose plugins folder:
This shows you the use of the bool type. You may also find it here:
https://github.com/LeonaMorro/nPose-DayNight-plugin
This shows you the use of the list type (and also the use of the new NC Reader). You may also find it here:
https://github.com/LeonaMorro/nPose-AccessControlList-plugin
-
Getting started
-
Reference
-
Changelogs
-
Internals