Re: Resolving "daemon", room teleport ObCircle

From: Mark A. Heilpern (heilpern@MINDSPRING.COM)
Date: 07/15/98


At 02:46 PM 7/14/98 -0400, you wrote:
>"Mark A. Heilpern" <heilpern@MINDSPRING.COM> writes:

> it will be general enough to be
>useable in much more than just a mud program.  I've looked a bit but
>not found a satisfactory solution to asynchronous name lookups.
>Hopefully this will accomplish it using a minimum of system resources
>and with enough simplicity to be easily added to other programs.
>

>Pthreads is not the way to go, since it wouldn't be a general
>solution.

RPC's then are, in my humble opinion, the best way to do this.
By best, I mean most versitile. If you've never used them before
and are interested, before you code anything, I'd strongly reccommend
getting the O'Reilly book "Power Programming with RPC" and reading
chapter 1. The whole book is excellent, but chapter 1 will really give
you the tools you need to accomplish this.

If you're not familiar with RPC's, basically they are a means of calling
a subroutine in another task, either on the local system or remotely.
If remote, the remote machine can be of any architecture out there
and the RPC's "XDR" mechanism (external data representation) will
perform the appropriate endian translations.

ObCircle:
<Yep, the above is definitely beyond the scope of this list.>
<think... think... think...>
Ok; if you're interested in teleporting rooms, here's what I did for them
in eQuoria (which will come back!)..... Each room, in the structure for
them, contains a vnum, 3 char pointers, and a integer flag, and 2 more
integers. The vnum, if not 0, is the room that this room teleports the
player to. The 2 integers are a minimum and maximum amount of delay
time for the transfer; if they are not equal, I pick a random number between
them and use an event to cause the teleport (if the player is still in the
same room). The three character pointers are act() strings to be sent to the
player, the room the player was in, and the room the player teleports to, to
explain the dissappearance/appearance of the player. The flags control certain
aspects of the teleport such as "night only", "day only", "sleeping only",
"not mobs", and "silent". The first two let you build a day and night
version of
a zone; each room has a teleport to the equivelent room in the other version
at the appropriate time of day. Silent means don't display any messages.
Sleeping only allows you to build a zone that can only be reached via
"dreaming".
"Not mobs" should be apparent.

Sure, this could have been done with DG Scripts, but a) that'd be more
work, and
b) I've had this installed for longer than I've known about DG.

For the interested out there, sorry, I don't have a patch for it. I built
it as I went
along.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST