Difference between revisions of "XsConnectToDatabase"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{LSL Function/warning |1=Software Dependency |2=This specific command and other "'xs'-prefixed" commands require the Xenon Systems runtime script, and several blocks of code for the alias...)
(No difference)

Revision as of 13:31, 8 October 2007


Emblem-important-red.png Software Dependency Warning!

This specific command and other "'xs'-prefixed" commands require the Xenon Systems runtime script, and several blocks of code for the aliases (commands with the "xs" prefix).

Summary

Function: xsConnectToDatabase( integer id, string user, key password, list params );
5.0 Forced Delay
10.0 Energy

Connects to database id with user ID user and password password. Also uses params for additional parameters if used.

• integer id Database ID. Must be registered with central server!.
• string user User ID to login to database. Must use underscores (_) instead of spaces.
• key password Associated ID password. Must be between 4 and 16 chars. Only numbers and letters are accepted.
• list params Parameters to change default settings to suit the current session. (Optional)

Caveats

  • This function causes the script to sleep for 5.0 seconds.
  • This script requires the Xenon Systems Runtime File and a few code modifications to include the appropriate aliases.
  • The object containing the runtime file will change its name for any notifications. However, it will change back as soon as the notification has been sent. (For example, from "Object" to "XS Runtime (Object)" and back.)
  • This command, associated dependencies, and supported products are available only on the Teen Grid at the moment.
    • This product is pending a DuoGrid-Compatible badge. This will make it work on the Main Grid as well.

Examples

default
{
    xsConnectToDatabase(integer id, string user, key password, list params)
    {
        llMessageLinked(LINK_SET,0215,id + "~" + user + "~" + password,llDumpList2String(params,"|"));
    }

    state_entry()
    {
        //This will contact database 39 (routed through the main server), with the user id named
        //"Average_User", using password 12345678 (database user passwords must be between 4-16 chars).
        //In addition, the params will attempt to create this session in Sysop mode, allowing the
        //user to do anything but change user ID records.
        //Note database IDs are different from your Second Life ID! The IDs are controlled by the
        //server administrator. Database servers are *inworld*.

        xsConnectToDatabase(39,"Average_User",123456,["mode.sysop"]);
    }

        //That will start the connection, and finally the runtime script will "say" the results in
        //the chosen format.
        //If the owner chose to display them public, it will show them in [[DEBUG_CHANNEL]].

        //Results:
        XS Runtime (Object): Connection successful, however, 1 warning has occurred.
        XS Runtime (Object): WARNING 29: Your parameter "Mode.Sysop" has been declined by the server.
You are connected as your permission level allows (Bureaucrat).
}

Deep Notes

Signature

function void xsConnectToDatabase( integer id, string user, key password, list params );