Re: signals

From: Patrick Dughi (dughi@imaxx.net)
Date: 09/17/00


> I was looking over comm.c while checking out the autowiz system, and I
> was completely befuzzled (is that a word?:P) by what I found.  Exactly
> how does one call these functions??  I know that somehow autowiz is
> called by a player being advanced to LVL_IMMORT or higher, but where/how
> is this detected. And unrestrict, how do you call that?  I must assume
> that some of these signals would originate within the game, but what
> would the commands be? And if from the shell, how would the game pick
> the signals up?  Do I have to make commands for most of these?  I wanted
> to be able to call autowiz without having to advance anyone, to hide
> certain players (!WIXL chars), but simply calling reboot_wizlists()
> doesn't actually re-read them according to current player's levels, and
> it also doesn't hide !WIZL chars.  Any help/pointers would be greatly
> appreciated.
>

        Okay, here's how it works.

        Any calls to 'check_autowiz' will run the program 'autowiz' in the
bin directory.  The source for this program is in the utils directory, and
it's made automatically.  That program simply makes and formats the text
file for the display in 'immlist' or 'wizlist' commands.

        Then, before check_autowiz exits, it calls reboot_wizlists() which
actually reads in the file, and replaces the string which previously held
the info in the previously altered file.

        The signals are intersting.  They're used to tell circle 'hey, an
external program just ran and re-read your wizlist.'  That's not the
interesting part.  The interesting part is that SIGHUP is usually used to
re-read any sort of external file, and in circle it kills the mud :)
Then, we look at the regular execution cycle, with autowiz being called
from within the mud (which is how it normally works), and we see this
execution path:

        check_autowiz()
          system(-run /bin/autowiz-)
            autowiz; creates files
            autowiz; signals mud to reread
   Mud signal processor calls reboot_wizlists()
          check autowiz calls reboot_wizlists()

        So, you get to re-reads for the price of one.  Interesting.

        But in the end it is inconsequential, afterall, it works.

                                        PjD


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



This archive was generated by hypermail 2b30 : 04/11/01 PDT