Fileref:sl distrib/sl send object linker.php
From SLIS Second Life Wiki
This Linker Script allows in-world selector objects to fetch a list of available objects for distribution from the Moodle database (query mode), and to request that a specific object be distributed to an avatar (sendobject mode).
Contents |
[edit] Dependencies
Sloodle files:
[edit] Parameters
The following HTTP parameters are always required when requesting this script:
- sloodlepwd = the site's Prim Password
- sloodlecmd = the name of the mode requested (either 'query' or 'sendobject')
When in 'sendobject' mode, the following additional parameters are also required:
- sloodleuuid = UUID of the avatar to whom an object should be sent (NOTE: this is optional if 'sloodleavname' is specified and the avatar is in the Moodle database)
- sloodleavname = name of the avatar to whom an object should be sent (NOTE: this is ignored if 'sloodleuuid' is specified)
- sloodleobject = name of the object to send to the avatar
[edit] Response
If the mode specified by parameter 'sloodlecmd' is not recognised, then the script returns the -811 status code.
In 'query' mode, if successful, the script will return status code 1, and each data line will contain the name of an object available for distribution. Otherwise, various standard error codes might be returned in the event of a problem.
Note: the status code may be 1 even if there are no objects. Please check the number of data lines before attempting to process them.
In 'sendobject' mode, the returned status code will be 1 if successful, and the name of the distributed object will be specified in the first data line. (Note: the UUID of the avatar to whom the object was sent will be specified in the status line, in accordance with the Sloodle communications specification).
Various error codes may be returned if something goes wrong in 'sendobject' mode:
- -812 if requested object is not found in database
- -103 if the distribution channel is not known
- -105 if the XML-RPC fails
[edit] Algorithm
- Construct SloodleLSLHandler object
- Process basic request data
- Authenticate request
- Fetch additional parameters
- Make sure script mode is recognised (terminate if not)
- Fetch the XMLRPC channel from the database (terminate if it cannot be found)
- Fetch the list of available distribution objects from the database (terminate if none can be found)
- Is script in query mode? If yes then:
- Output list of objects available for distribution
- Else if script is in sendobject mode then:
- Is avatar UUID available? If not:
- Look-up name in database to fetch stored UUID (terminate on failure)
- Make sure the requested object is specified in the database (terminate on failure)
- Construct and send XMLRPC message
- Output success or error message
- Is avatar UUID available? If not:
- Render response
- Terminate script
| This page is part of the Sloodle documentation | |||
|---|---|---|---|
| SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home | |||
