NEWBIE Quit of recall

From: Marcelo Valle Moreira (pira@dcc.unicamp.br)
Date: 05/14/96


This is _NOT_ the best solution, but as gurus remain silent this is what I've done to avoid players who are far away from midgaard to type quit, instead of buying scrolls of recall.
This also allows the player to continue enduring where they were even after being ages away from the MUD.
 here goes my do_quit.

 I wonder if  
House_crashsave(world[ch->in_room].number);

 would be the same as:

    SET_BIT(PLR_FLAGS(ch), PLR_LOADROOM);
    GET_LOADROOM(ch) = world[ch->in_room].number;

any ideas?

WidowMaker
 the code:
ACMD(do_quit)
{
  void die(struct char_data * ch);
  void Crash_rentsave(struct char_data * ch, int cost);
  extern int free_rent;
  int save_room;
  struct descriptor_data *d, *next_d;

  if (IS_NPC(ch) || !ch->desc)
    return;
  if (subcmd != SCMD_QUIT && GET_LEVEL(ch) < LVL_IMMORT)
    send_to_char("You have to type quit--no less, to quit!\r\n", ch);
  else if (GET_POS(ch) == POS_FIGHTING)
    send_to_char("No way!  You're fighting for your life!\r\n", ch);
  else if (GET_POS(ch) < POS_STUNNED) {
    send_to_char("You die before your time...\r\n", ch);
    die(ch);
  } else {
    if (!GET_INVIS_LEV(ch))
      act("$n has left the game.", TRUE, ch, 0, 0, TO_ROOM);
    sprintf(buf, "%s has quit the game.", GET_NAME(ch));
    mudlog(buf, NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);
    send_to_char("Goodbye, friend.. Come back soon!\r\n", ch);
    
    if (GET_LEVEL(ch) < LVL_IMMORT){

    SET_BIT(PLR_FLAGS(ch), PLR_LOADROOM);
    GET_LOADROOM(ch) = world[ch->in_room].number;
    }
    /*
     * kill off all sockets connected to the same player as the one who is
     * trying to quit.  Helps to maintain sanity as well as prevent duping.
     */
    for (d = descriptor_list; d; d = next_d) {
      next_d = d->next;
      if (d == ch->desc)
        continue;
      if (d->character && (GET_IDNUM(d->character) == GET_IDNUM(ch)))
        close_socket(d);
    }

   save_room = ch->in_room;
   if (free_rent)
      Crash_rentsave(ch, 0);
    extract_char(ch);		/* Char is saved in extract char */

    /* If someone is quitting in their house, let them load back here */
   /* if (ROOM_FLAGGED(save_room, ROOM_HOUSE)) */

   if (GET_LEVEL(ch) < LVL_IMMORT)
         save_char(ch, save_room); 
  }
}



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