Bug in Char Approval

From: Kyle Goodwin (vbmasta@EARTHLINK.NET)
Date: 08/19/98


I have implemented (or will have when this is fixed) the ability for
immortals to either accapt or decline all new players.  When a new player
logs in everything goes fine and it sends the massage to all the gods
telling them there is a new char and to either approve or reject him/her
based on his/her name.  The problem is that when a god tries to either
approve or deny a player the MUD stops responding to everyone but does not
crash and so produces no core dump.  The relevent code follows with a
comment in the place I have traced and see is the last part executed in
nanny.

**snip from nanny() in interpreter.c**

        d->character->approved = 0;
        STATE(d) = CON_APPROVE;
        // code definately executes to here
  break;

  case CON_APPROVE:
        SEND_TO_Q("Waiting...\r\n", d);  //this should say waiting everytime this
case is called but it never says it so it must never get there
          if (d->character->approved = 1) {
                SEND_TO_Q("\r\nYour character has been accepted!\r\n", d);
                save_char(d->character, NOWHERE);
                SEND_TO_Q(motd, d);
                SEND_TO_Q("\r\n\n*** PRESS RETURN: ", d);
                STATE(d) = CON_RMOTD;

                sprintf(buf, "%s [%s] new player approved.", GET_NAME(d->character),
d->host);
                mudlog(buf, NRM, LVL_IMMORT, TRUE);
        }
        else if(d->character->approved = -1) {
                SEND_TO_Q("Your character application has been denyed.\r\n", d);
                sprintf(buf, "%s [%s] new player denied.", GET_NAME(d->character),
d->host);
                SEND_TO_Q("Goodbye.\r\n", d);
                STATE(d) = CON_CLOSE;
        }
        else {
                STATE(d) = CON_APPROVE;
        }
        break;

  case CON_RMOTD:               /* read CR after printing motd   */
    SEND_TO_Q(MENU, d);
    STATE(d) = CON_MENU;
    break;

**end snip**

**snip of do_wizutil in act.wizard.c**


        case SCMD_APPROVE:
                if (STATE(vict->desc) == CON_APPROVE) {
                        vict->approved = 1;
                        send_to_char("New player approved.\r\n", ch);
                }
                else
                        send_to_char("That player is not waiting for approval!\r\n", ch);
                break;
        case SCMD_DENY:
                if (STATE(vict->desc) == CON_APPROVE) {
                        vict->approved = -1;
                        send_to_char("New player denied.\r\n", ch);
                }
                else
                        send_to_char("That player is not waiting for approval!\r\n", ch);
                break;
    default:
      log("SYSERR: Unknown subcmd passed to do_wizutil (act.wizard.c)");
      break;
    }
    save_char(vict, NOWHERE);
  }
}

**end snip**

Sorry about the length of this message but I think all the code for my
problem areas was necesary.

Kyle Goodwin
-Reluthan- FirocMUD: firoc.ml.org:4000


     +------------------------------------------------------------+
     | 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