[MUD-Dev] Flow of messages

Ben Chambers bjchamb at bellsouth.net
Fri May 9 22:38:13 New Zealand Standard Time 2003

From: "Ammon Lauritzen" <ammon at simud.org>
> On Fri, 2 May 2003, sanxion sanxion wrote:

> Events and log messages can't take the same text as a message that
> is being sent to the client, so they've got to be separate method
> calls anyways. So I don't see what you're getting at.

With DGD going multithreaded, perhaps you are considering a more
multi-threaded approach?  The way that I was envisioning this is
that when an event occurs it could insert some type of object into a
queue of outbound messages, something like an object with the
following fields:

   String toTarget;
   String toActor;
   String toObservers;
   String toWorld;
   String toLog;
   Object Actor;
   Object Target;
   Object Environment;

You could provide the ability for the toTarget to be something like
"@doFunc" where that would then call the doFunc function as well.
The advantage of this is that the messages could be manipulated and
managed in a central place.  The problem is the overhead associated
with a) adding messages to the queue and b) processing messages in
the queue.  The real benefit of this is in the ability to have
functions do it.  Then to damage a player you could do:

  toTarget="@takeDamage(" + dmgAmount + "," + msg + ")";

Which would call the take damage with the given amount and output
the message.  Again, the only drawback is the added overhead
associated with processing this type of communication.

Pretty much the problem comes down to this:

  The more generic the output handling is, the more processing that
  must be done on the output.

MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list