Re: Poof in/poof out saving

From: Peter Ajamian (
Date: 12/27/99

Damian Jurzysta wrote:


> struct player_special_data {
>    struct player_special_data_saved saved;
>    char    *poofin;        /* Description on arrival of a god.     */
>    char    *poofout;        /* Description upon a god's exit.       */
>    struct alias_data *aliases;    /* Character's aliases            */
>    long last_tell;        /* idnum of last tell from        */
>    void *last_olc_targ;        /* olc control                */
>    int last_olc_mode;        /* olc control                */
> };
> shouldnt this mean that poofin and poofouts are saved in the stock-code? if so,
> why is it not working?

All that will be saved by this is the address in memory where the poofin
and poofout is stored, and this memory is (or at least it should be)
freed as soon as the player exits the game.  The actual text of the
poofin and poofout will not be saved in this way.

There is a problem with saving messages such as the poofin and poofout
in the binary pfile, the length of the message will vary, and since the
records in the pfile have a fixed length, the only way to store the
message is to fix the size of the message at something like
MAX_INPUT_LENGTH.  This, of course, will be wastefull as most messages
will not need even half that amount of storage space.

You can work around the fixed length problem in other ways also, one
possibility is to switch to ascii pfiles.  Another possibility is to
save the poofin and poofout messages in another file.

The solution that I came up with is somewhat different.  I modified the
MUD so that whenever a player enters the game a new command called
autorun is passed to the command parser for them (a new command called
"autorun" was created which does absolutely nothing, it simply
returns).  A player may then define an alias with the name "autorun" and
it will be run whenever that player enters the MUD, a common use of the
autorun alias is to set the player's poofin and poofout.

Good Luck, Peter

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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