Message List
Messages now have a simple structure which can be thought of similarly for
any of the protocol variants provided by zstar. Examples here will be given
in text mode for clarity.
We have introduced the concept of a loadable message handler written in java,
and we think that this will allow application writing to be much easier.
We will, of course, still need a way of messaging the client, and so these
messages stand. We have added one message, 'loadJar', which loads and runs
some java code. The client will be able to implement any type of message
handler using java code.
Client Messages
Message Name: controlDef
Format: ssiiii
- string -- Control proper name (e.g. generic.turn.x)
- string -- Control description
- integer -- Control integer id
- integer -- Control min value
- integer -- Control max value
- integer -- Control type, currently 0 is one shot, and 1 is continuous.
One shots are useful for cannons and other such, and continuous controls are
good for turning, throttles, etc.
Purpose: Define a control. If the client has a user action bound to
this control (by name) then that action will cause the client to send the
indicated control message.
Message Name: textureSet
Format: si
- string -- Texture image URL
- integer -- Texture id in the client
Purpose: Associate the indicated texture with an ID in the client when
the texture is loaded.
Note: The controlling party assigns the id as in the X-Window System.
Message Name: objectDef
Format: si
- string -- Mesh file URL
- integer -- Mesh id as used by objects
Purpose: Associate the indicated mesh with an ID in the client when
the mesh is loaded.
Message Name: primary
Format: s
- string -- Primary server URL.
Purpose: Hyperlink the client to a new primary server. Upon receiving
this message, the client redirects control messages to the indicated server
and sends a hello.
Message Name: contact
Format: s
- string -- Server address as above
Purpose: This message tells the client to send an olleh to the
indicated server. This mechanism may be used by servers to distribute world
updates across multiple originators. This does not affect the client's view
of the primary server.
Message Name: decontact
Format: #
Purpose: Cause the client to send termination messages (bye) to servers
contacted because of a contact message. This is needed when the
client hyperlinks to properly terminate connections to foreign servers.
Message Name: next
Format: #
Purpose: Cause the client to commit changes to the universe and redraw
the frame.
Message Name: config
Format: s
- string -- Configuration string.
Purpose: Send a configuration string to the client. This feature may
be used for feature negotiation at some later time.
Message Name: chatMSG
Format: si
- string -- The chat message
- integer -- Recipient ID
Purpose: Cause the client to display a chat message in the message
scroll.
Note: ID must be sent zero and is not yet used.
Message Name: systemMSG
Format: si
- string -- A message generated by the server
- integer -- Severity level
Purpose: Cause the client to display a system message in the message
scroll. The message may be distinguished from a normal chat message in some
way.
Note: Severity is not currently used and must be zero.
Message Name: camera
Format: [nf
- float array -- Six parameters of the camera are currently specified:
- x,y,z -- World position of the camera
- p,r,s -- World rotation of the camera in degrees
Purpose: Cause the client to move the camera.
Note: Extra parameters might be used later. Do not send more than
six elements in this array. It is acceptable to send less than six, however.
Message Name: object
Format: ii[nf
- integer -- Object id to change
- integer -- Mesh id to bind to the object
- float array -- Six parameters of the object are currently specified:
- x,y,z -- World position of the object
- p,r,s -- World rotation of the object in degrees
Purpose: Cause the client to move the indicated object, and bind it to
a new mesh. These messages are ganged, because it is likely that objects will
be animated by cycling a set of meshes over them. If the object is to have its
mesh changed, a zero-element floating array may be used.
Message Name: light
Format: ii[nf
- integer -- Light id to change
- integer -- Light type
- float array -- Three parameters are specified currently:
- x,y,z -- World position of the light
Purpose: Cause the client to move the indicated light.
Message Name: fog
Format: iiff
- integer -- Color as RGB triple (24 bits)
- integer -- Type:
- 0 -- Linear
- 1 -- 1/e
- 2 -- 1/e^2
- float -- Fog in distance.
- float -- Fog out distance.
Purpose: Cause the client to enable a fog effect for distance cues.
Message Name: meshPTS
Format: ii[nf
- integer -- Mesh ID to change
- integer -- First vertex to change
- float array -- Vertices specified as triplets
Purpose: The specified vertices will overwrite those currently in the
indicated mesh starting from the indicated start point. The mesh will be
expanded if necessary.
Message Name: meshTRI
Format: ii[ni
- integer -- Mesh ID to change
- integer -- First triangle to change
- integer array -- Triangles specified as triplets. Each value is a pointer
into the mesh's vertex array.
Purpose: The specified triangles will overwrite those currently in the
indicated mesh starting from the indicated start point. The mesh will be
expanded if necessary.
Message Name: rm
Format: si
- string -- Name domain to delete from:
- integer -- The ID of the object to remove.
Purpose: Removes the indicated object from the client's data set.
Message Name: cp
Format: sii
- string -- Name domain as above.
- integer -- Object ID to copy from.
- integer -- Object ID to copy to.
Purpose: Copies the indicated object to a new ID. The two copies are
completely independent, but are identical directly after the copy is made.
Message Name: mv
Format: sii
- string -- Name domain as above.
- integer -- Object ID to move from.
- integer -- Object ID to move to.
Purpose: Changes the ID of the indicated object to the new ID. The
object occupying the new ID before the mv command if any is deleted.
Message Name: clear
Format: #
Purpose: Erases all objects and lights from the scene. Provides a
completely clean slate for client redraws.
Message Name: hold
Format: #
Purpose: Prevens client redraws until the next next command is
processed. Useful at the beginning of a long refresh.
Message Name: meshVRML
Format: si
Purpose: Creates a mesh object from a VRML file read at the url given
in argument 1 and assigns it to the mesh number given in argument 2. Objects
bearing this mesh number are drawn as the VRML scene. The entire VRML scene
will be transformed by the object position and orientation last given by
the object command for that object.
Message Name: loadScript
Format: s
Purpose: Loads and executes a TCL script from the URL given by it's
argument. Any procs encountered, after effects, etc. go
into effect directly after this command is processed. It is useful for loading
scripts into the client and then later invoking them with tclcmd.
Message Name: tclcmd
Format: s
Purpose: Executes a TCL "one-liner" script. This is useful for invoking
commands stored in the client by the loadScript command. This makes
it easy for most environments to load complex effects into the client and start
them working with a single message passed, reducing server load.
Message Name: sndload
Format: sii
- s -- URL of sound file to load.
- i -- Type of sound (1 == clip, 0 == mod song)
- i -- Sound ID
Purpose: Load the clip from the url given, as either a clip or a MOD,
and store it in the given ID. The sound may be manipulated later by its ID.
Message Name: sndplay
Format: i
Purpose: Play the sound at the given ID.
Message Name: sndstop
Format: i
Purpose: Stop playing the sound at the given ID.
Message Name: sndpause
Format: i
Purpose: Pause the sound at the given ID. It can be resumed with
sndres.
Message Name: sndres
Format: i
Purpose: Resume the sound at the given ID.
Message Name: sndloop
Format: i
Purpose: Loop the sound at the given ID until some other action is
taken on that ID.
Message Name: loadJar
Format: ss
- s -- URL to a 'jar' file to load. All contained classes will be loaded.
- s -- Name of 'main' class. This class's public static void init()
method will be called, allowing it to create threads, register services, etc.
Purpose: This message is similar to the applet tag in HTML,
in that it causes the indicated java 'jar' file to be loaded and some
contained method to be executed. Classes can register currently for two
types of messages, frame messages, which transfer control to java before
a frame is rendered, and protocol messages, which relay unfamiliar network
messages to java classes for interpretation. This allows a game designer to
create new types of messages (such as compressed updates, abbreviated motion
updates, etc).
|