LSL Protocol/Restrained Love Open Relay Group/custom

From Second Life Wiki
Jump to navigation Jump to search

!x-custom

STATUS: proposal

VERSION: 001

!x-custom: Asks the relay for a list of custom commands

!x-custom/command: Triggers the command or menu "command"

!x-custom/command/parameter: Triggers the command or menu "command" with parameter string "parameter"


General syntax: !x-custom[/STRING]*, to which the relay acknowledges either "ok" if it is recognized, accepted and no answer is expected, "ko" if it is refused, and "<prompt>[/<choice>['+']]*" if the controller is supposed to be presented a new list of choices. The "+" after an item name means that the item expects a string parameter.


Example:

C -> R: !x-custom
C <- R: !x-custom,Relay main menu. Make a choice./CollarMenu/InfoMenu/Titler+

(the controlling device shows a dialog to its user with prompt "Relay main menu. Make a choice.", and buttons "CollarMenu", "InfoMenu", "Titler")

C -> R: !x-custom/InfoMenu
C <- R: !x-custom/InfoMenu,About the wearer:/Gender/Species/Owner

(the controlling device shows a dialog to its user with prompt "About the wearer", and buttons "Gender", "Species", "Owner")

C -> R: !x-custom/InfoMenu/Species
C <- R: !x-custom/InfoMenu/Species,Elf

(the controlling device pops up either a dialog with the answer "Elf"... or informs the wearer by any other suitable mean)

C -> R: !x-custom/Titler
R <- R: !x-custom/Titler,ko

(the command "Titler" expects one argument, because in the "+" in the first announce, so "ko". Alternately it could return an error dialog using the previous mechanism and explaining the syntax of the parameter of the "Titler" command.)

C -> R: !x-custom/Titler/Cage me!
R <- R: !x-custom/Titler/Cage me!,ok

(... and the relay changes the floating text above the wearer to "Cage me!")


Note that the parameters of those message could potentially include various characters. Maybe this calls to some higer level standardization, stating that any string of the relay protocol can include escaped characters (for instance "\," should be interpreted as a comma, and not as a high level separator of relay protocol message). Unfortunately it is a pain to manage in LSL, as llParseString2List won't abstract escaped characters.

Other important thing: this mechanism allows the relay not to send directly a llDialog to the device user. It could be quite useful in cases the relay protocol is going over e-mail or http and the device user is not in the same region as the relay wearer. Moreover, those command lists could be dispayed by a different mean than a llDialog.