[WF-General] Messaging in WorldForge

Alistair Riddoch alriddoch at googlemail.com
Thu Mar 25 17:23:25 PDT 2010

On 24 March 2010 23:35, Manohar Vanga <manohar.vanga at gmail.com> wrote:
> Hi,
> Could someone help me understand the messaging system in Cyphesis? By
> messaging system, I am referring to systems such as the publish/subscribe
> model. How does Cyphesis do it? When a specific message (say a client moves)
> is received by Cyphesis, how is it passed to the right place?

The network socket is owned by an instance of the CommClient class,
which passes deserialized objects to the Connection class. Connection
is the first dispatch point, which determines which of the server
objects associated with the client connection the message applies to.
It routes the message to that object. Most of the time the message
will relate to a character or avatar that the player is controlling in
which case the message is passed to the world simulation code.
Messages in Atlas are referred to as operations. Connection is
responsible for setting up the object instances used to route
operations from the world simulation back to the client connection
handling a given character, and it does this the first time after
connection that the player attempts to control their character.

The operation is passed to the externalOperation() method of the
character, which pre-processes the operation before passing it into
the simulation core in WorldRouter as Erik describes. WorldRouter
routes operations to the right entities. Most operations have a
specific target, though some are broadcast in which case a sight range
calculation is used on the fly to determine which entities receive the

Alistair Riddoch
alriddoch at googlemail.com

More information about the General mailing list