[CODE][LONG]Imporper Saving - why ?

From: Pure Krome (Pure@SPRINT.COM.AU)
Date: 03/08/98


Hello all.
    i think i've not modified my code correctly in regards to saving
players when they quit.

Sypnosis.
-----------
i've made it so that renting is needed, but at no cost. (free).
also, when the player quits, if they have a special flag set (just some
rent flag) they can
quit ok. otherwise, they drop their eq.

anyways .. this is what the syslog says.

Mon Mar  9 14:12:50 :: Everan [ter1-d57.mel.sprint.com.au] has
connected.
Mon Mar  9 14:12:53 :: Everan un-renting and entering game.
Mon Mar  9 14:13:11 :: Everan has quit the game successfully.
Mon Mar  9 14:13:11 :: Losing player: Everan.

so it seems to be ok. BUT when i do a stat everan, it says CSH which
means it needs to be crash saved or somethig .. some internal checking
thing right? So does this mean that even though i might have the code
set up to display what looks like the correct thing, it isn't fully
correct ... yeah?

i'll post some code now .. not sure if it's useful though

** This function is called from inside of ACMD(do_quit), which checks
for stuff like
is the player invis, have they got their special flag set, blah blah. If
they pass the check, then
this is called. **

------------------------------------------------------------------------------

void general_quit(struct char_data *ch, sh_int save_room)
/* This is a low end last stage of a normal quit.
   IN  : The character structure
         The room the character is going to be saved in.
*/
{
        sh_int r_room = 0;      /* Real Room for saving chars */
        struct descriptor_data *d, *next_d;

        /* First, change the VNUM into a RNUM */
        r_room = real_room(save_room);
        ch->player_specials->saved.load_room = world[r_room].number;
        save_char (ch, r_room);

        /* Bug Fix here - removed the if (free_rent check) */
        Crash_rentsave(ch, 0);                  /* This SHOULD save
their eq now */
        extract_char(ch, r_room);               /* Char is saved in
extract char */

    /* If someone is quitting in their house, let them load back here */

        if (ROOM_FLAGGED(r_room, ROOM_HOUSE))
                save_char(ch, r_room);

        /* Now get the characters descriptor again*/

    for (d = descriptor_list; d; d = next_d) {
                next_d = d->next;
                if (d->character->pfilepos != ch->pfilepos)
                        /* We haven't found our descriptor, so continue
*/
                        continue;
                else
                        break;
    }

        /* BUG FIX : Jus - 13/3/97
            Was crashing when the player was link dead and an imm
             'switched' over to him
        */

        if (d)
                STATE(d) = CON_CLOSE;

        return;
}


Thanks all - Jussy


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