Re: Oasis - Fatal Problems [FIXED(?)]

From: John Evans (evansj@HI-LINE.NET)
Date: 08/31/97


On Sun, 31 Aug 1997, Gary Barnett wrote:

> On Sunday, August 31, 1997 10:29 AM, John Evans [SMTP:evansj@HI-LINE.NET]
> wrote:
> > On Fri, 1 Aug 1997, Will Shaw wrote:
> >
> > > Ok...there may have been a thread about this before, so forgive me if I'm
> > > bringing up something that has been discussed previously.
> > >
> > > Here is a sequence of events that occured on my mud recently:
> > > 1) Bob enters OLC.
> > > 2) Bob loses his link to the mud while still in OLC.
> > >
> > > 3) When Bob reconnects, he has cloned himself...in a sense.  There are
> > > two
> > > Bobs in the room, one of them is still shown as (writing) in OLC.  The
> >
> > I have a similar problem:
> > 1) Bob enters OLC.
> > 2) Bob drops link.
> > 3) Bob reconnects, and the MUD crashes.
> >
> > I don't have any corruption of the playerfiles, or problems with
> > duplicate "Bobs" in the game or anything.
>
> You need to add a check when the player enters the game to
> see if they are in an OLC state and put them back to CON_PLAYING
> or the game will dupe them. Also need to cleanup their OLC
> structure.. for Oaises see cleanup_olc
>
> --Mallory

Here is the fix that I've found that works quite well. I don't know if it
will lead to other problems as I have no thad time to test it fully. The
code is simple and straight-forward, so I forsee no problems at all.

Here goes...

File: comm.c
Function: void close_socket(struct descriptor_data *d)

FIND:
  if (d->snoop_by) {
    SEND_TO_Q("Your victim is no longer among us.\r\n", d->snoop_by);
    d->snoop_by->snooping = NULL;
  }

INSERT the following after the above code:
  if ((d->connected == CON_OEDIT) || (d->connected == CON_REDIT) ||
      (d->connected == CON_ZEDIT) || (d->connected == CON_MEDIT) ||
      (d->connected == CON_SEDIT)) {
    cleanup_olc(d, 1);  /* Same as cleanup_olc(d, CLEANUP_ALL); */
    d->connected = CON_PLAYING;
  }

Of course, if you have additional editors (AEDIT, etc.), You'll want to
modify the if statement.

The above code pulls the character out of the OLC, cleans up after the
player, and (in cleanup_olc) sets then to CON_PLAYING so no ill effects
take place when they reconnect. Any changes that the builder made before
losing link, will, of course, be lost, but that's what they get for
dropping link. :P

George,
        If find this code acceptable for adding into your Oasis patches,
would you please add it into the next release?


John Evans
mailto: evansj@hi-line.net    http://www.hi-line.net/~evansj

I don't suffer from Insanity!  I enjoy every minute of it!


     +------------------------------------------------------------+
     | 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/08/00 PST