AB.socketStart(); // Start socket for this World. // Any user who runs the World joins me in the same multi-user World. AB.socketStart ( password ); // Start socket for this World, with password (alphanumeric). // Only users who have called AB.socketStart with the same password can join me // (rather than all users who run the World). AB.socketOut ( data ); // send any JS data to all other clients // Could check socket has been set up first (socket takes time to set up): if ( AB.socket ) if ( AB.socket.connected ) AB.socketOut ( data ); AB.socketIn = function ( data ) { ... }; // Handler for incoming data from other clients. // World author must define this function. AB.socketUserlist = function ( array ) { ... }; // Keep track of other users in multi-user World. // The server triggers this to tell us the latest list of users of this World. // This is called when we connect, and any time another user arrives or leaves. // The array is a list of (userid, username) pairs. // World author must define this function (what to do with array) if desired.