Fileref:sloodle object distributor.lsl

From SLIS Second Life Wiki
Jump to: navigation, search

Folder.gif (parent)

This LSL script provides the functionality for the Sloodle Object Distributor.


Contents

Constants

  • integer SLOODLE_OBJECT_DIALOG_CHANNEL = channel used for inter-script communication in-world (see Sloodle channels)
  • integer SLOODLE_CHANNEL_AVATAR_SETTING = channel used for avatar dialogs (see Sloodle channels)
  • integer SLOODLE_CHANNEL_AVATAR_IGNORE = channel used for avatar dialogs which are ignored (see Sloodle channels
  • string linkerscript = address of the object distribution linker script, relative to the server root
  • list ignorelist = contains the names of the objects which the distributor should ignore (i.e. not make available for distribution)


Variables

  • string sloodleserverroot = WWW root of the Moodle installation
  • string sloodlepwd = Prim Password of the Moodle site
  • key ch = the UUID of the remote data channel opened by the distributor
  • integer lastping = not used yet
  • integer pingtimeout = not used yet
  • integer timebetweenpings = not used yet


Functions

  • sloodle_debug(string msg) = outputs debug information
  • sloodle_handle_command(string str) = handles a Sloodle configuration command
  • string get_available_inventory() = returns a pipe-delimited string of all the inventory of the object that is available for distribution (not including items in 'ignorelist')
  • integer sloodle_init() = if the script is fully configured, it returns 1. Otherwise 0.


States

default

Destination states: sloodle_wait_for_configuration, connecting
When in this state, the script has may or may not be configured. It will immediately switch to the 'connecting' state if it is configured, or to the 'sloodle_wait_for_configuration' state if not.

connecting

Destination states: default, shutdown, connected
In this state, the script opens an XMLRPC channel, and attempts to send the channel key to the Moodle site. If successfuly, it automatically moves on to the 'connected' state. If the owner clicks the object, then they are presented with a menu, and they can choose to retry the connection process (which goes back to the 'default' state), reset the entire script, or go to the 'shutdown' state.

connected

Destination states: default, shutdown
When in this state, the script has an open XMLRPC channel, and is ready to receive object distribution requests from Moodle. The owner can click the object to see a menu, which they can use to force a re-connection (which just goes back to the default state), a complete reset of the script, or to move to the 'shutdown' state.

shutdown

Destination states: default
This state is a temporary disabled state. The owner can put the script into this state to prevent the distributor from being used. By clicking it, they can see a menu which can be used to re-connect (goes to the 'default' state), or completely reset the entire script.

sloodle_wait_for_configuration

Destination states: default
This standard state simply waits and listen for link messages containing configuration commands. When all necessary data has been received, it will go back to the default state automatically. If rezzed in this state, it will reset the whole script.


Known Issues

Due to Second Life and LSL limitations, on a single XMLRPC message can be queued up at one time for the script to receive. This is compounded by the script delays incurred by certain function calls. As such, if lots of people use the object distribution tools at the same time, then some may not received their objects.


This page is part of the SLOODLE documentation
Docs: Users | Administrators | Developers
Wiki Frontpage Sloodle.org
Personal tools