Fileref:login/sl loginzone linker.php

From SLIS Second Life Wiki

Jump to: navigation, search

Image:folder.gif (parent)

This Linker Script allows an in-world Sloodle Login Zone object to communicate with the Moodle server, reporting its size/position, or reporting new avatars.


Contents

[edit] Dependencies

Sloodle files:


[edit] Parameters

This linker script behaves in one of two modes, depending on the HTTP parameters passed in. The following parameter is always required, regardless of mode:


[edit] Mode 1

In this mode, the LoginZone object is reporting its position, size, and region. The following additional parameters are required:

  • sloodlepos = a vector ("<x,y,z>") indicating the position of the LoginZone object
  • sloodlesize = a vector ("<x,y,z>") indicating the size of the LoginZone object
  • sloodleregion = a string containing the name of the region where the LoginZone object is located


[edit] Mode 2

In this mode, the LoginZone object is reporting that a user has teleporting in to authenticate their avatar. The following parameters are required:

  • sloodlepos = the position at which the avatar has appeared (vector "<x,y,z>")
  • sloodleavname = name of the avatar
  • sloodleuuid = UUID of the avatar

Note: mode 2 is assumed if either parameter 'sloodleavname' or 'sloodleuuid' is provided.


[edit] Response

In either mode, the script will respond with status code 1 if successful. Various standard codes may be returned in the event on an error.

If in Mode 2, the UUID of the specified avatar will be returned in the status line, according to the Sloodle communications specification.


[edit] Algorithm

  1. Construct SloodleLSLHandler object
  2. Process request data
  3. Authenticate request
  4. If both the avatar name and UUID are missing then:
    1. Fetch the additional required parameters for Mode 1
    2. Round the position and size vectors
    3. Store the LoginZone data
    4. Output success or failure
  5. Else:
    1. Fetch additional required parameters for Mode 2
    2. Round the position vector
    3. If avatar is already in database with specified UUID and/or name then:
      1. Terminate with "already registered" message
    4. Find avatar with specified LoginZone position
    5. If avatar was found then:
      1. Add name and UUID details to database
      2. De-allocate LoginZone position
      3. Output success
    6. Else:
      1. Output error
  6. Render response
  7. Terminate script


This page is part of the Sloodle documentation
SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home
Personal tools