Client Implementation
The client library is a single shared library through which individual
clients communicate with the server. Its implementation is fairly
straightforward, with clients accessing all functionality through a single
'Comm' interface. With regards to network communications, the client library
is implemented in the same fashion as the server -- two threads are spawned
which handle mainline code and network communications, respectively.
'Comm'
This component provides the interface that is exposed to actual clients.
When it is initialized, it creates the local object database and initializes
a connection to the server. It also keeps track of the agents that are
controlled by this client.
The comm component provides a set of calls that clients use to create agents,
update their status, retrieve the status of other agents in the world, and
send messages. It also provides a set of callbacks that it can use to inform
the clients of incoming messages and state changes in the world and other
agents.
'Network'
The network component, as described above, looks a great deal like the
server's network component. With the exception that it does not need to deal
with multiple connections, it performs basically the same tasks.
'World' and 'Agent'
These components serve basically the same purpose as their analogs in the
server. They form a local version of the server's object database, so that
clients do not have to constantly request information from the server. The
information stored in this database reflects the most recent information
received from the server, but does not necessarily contain all objects in the
world (only those that the client is aware of).
Java Interfaces
In addition to the standard 'C' interface to the client library, there is a
Java interface that provides access to the client library to Java classes.
This is intended primarily for the development of intelligent agents.
This layer is implemented via the JNI (Java Native Interface) layer provided
by the java virtual machine. A simple set of classes encapsulating the 'Comm',
'World', and 'Agent' components of the client library provide access to client
library functionality in a way that appears seamless to the java programmer.