|OPENSMUS HELP: SERVER SIDE SCRIPTING|
OpenSMUS introduces a powerful new feature for Shockwave developers: Java server side scripting. This opens OpenSMUS for deep customization, allowing the developer to extend the server in almost any way. Server side scripts can implement connection to databases, web servers, mail programs and almost any piece of software that can be accessed by a java application.
Server side scripts are an advanced feature in OpenSMUS. A good understanding of the Java language is absolutely required, and developers need access to a Java development environment in order to test and compile their server side script classes. Server side scripts are actually compiled Java .class files, mapped to OpenSMUS movies using the scriptmap.cfg file.
A server side script class is loaded by OpenSMUS when a movie is created on the server and it matches the name of a movie configured in the scriptmap table. Each server side script is a compiled Java Class that extends the ServerSideScript class, defined in the OpenSMUS server side scripting API. The methods inherited from the ServerSideScript class allow the script to be called by OpenSMUS when a message with the subject "system.script.*" is received by the server. ServerSideScripts also implement the ServerUser interface, so they can join movies and groups and send messages as if they were an user connected to the OpenSMUS server.
The OpenSMUS server side scripting API is documented in javadoc format, in the DOC subdirectory at the SVN server for the project. Classes are provided for conversion between Java types and native Lingo values (LValues), and to encapsulate the Shockwave MultiUser Server message protocol. An effort has been made to provide interfaces that match the Server Object Model defined by Macromedia for SMUS 3. Java developers should probably start by examining the ServerObject, ServerMovie, ServerGroup and ServerUser interfaces.
OpenSMUS scripting API also exposes interfaces to the ServerUserDatabase and SQLGateway objects used by the server, so scripts can interact directly with databases and return results to connected users as native Lingo types, represented by LValues in the OpenSMUS API. Almost all aspects of the server can be accessed by a ServerSideScript class, including every movie, group or user connected.