Re: [CODE] [SNIPPET IF REQUESTED] autowiz command

From: Sammy (samedi@ticnet.com)
Date: 02/10/99


From: Gordon Forsythe <baoh@interfold.com>
Date: Wednesday, February 10, 1999 9:39 AM


>On 10-Feb-99, Mark A. Heilpern wrote:
>
>> True enough, but it seems to me that it'd be much easier to make a call
>> to check_autowiz() in the case of a demotion from imm level to below.
>The autowiz would have to be rewritten to use ascii pfiles, and IMO would be
>easier if just made into an internal command which would use load_char.  I
>was about to do this in the next week or so, but looks like someone beat me.
>Also, if i remember right, autowiz can only be called externally from *nix
>systems (which I don't have to worry about).


Using load_char would cause noticeable lags on many muds.  If I rember
correctly, the 2.0 version of ascii pfiles adds player level to the
player_table array.  Here's a short snippet I wrote recently for someone else.
It's untested and it's probably been a year or more since I've looked at the
related code, but it should be close.

ACMD(do_wizlist)
{
  int i, p = 0;
  char buf[MAX_BUF_LENGTH];

  p += sprintf(buf, "Wizards:\r\n\r\n");

  for(i = 0; i < top_of_p_table; i++) {
    if(player_table[i].level > LVL_IMMORT)
      p += sprintf(buf + p, "%s\r\n", player_table[i].name);
  }
}

This is obviously very simplified and not pretty at all, but makes a good base
to start with.  It may even be useful to binary pfile users who have levels in
their player tables.

Sam


     +------------------------------------------------------------+
     | 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 : 12/15/00 PST