Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot, Yandex, Google

Members: 0
Guests: 16
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Bug: Purge
Forum Rules | Mark all | Recent Posts

Bug: Purge
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Nov 4, 2006, 6:09 am
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Heh, i don't know if its just me, or what. but if you have someone who is switched, you purge the room, the person thats switched is in the room as the victim switched, it'll cause either a crash, or Segfault.. I'm not sure of how to fix this problem..

Here is a Core dump of it..

Loaded symbols for /lib/ld-linux.so.2
#0  0x0808ee76 in do_purge (ch=0x87002e8, argument=0x0) at act_wiz.c:2889
2889             for( tch = ch->in_room->first_person; tch; tch = tch->next_in_room )
Current language:  auto; currently c++
(gdb) bt
#0  0x0808ee76 in do_purge (ch=0x87002e8, argument=0x0) at act_wiz.c:2889
#1  0x080ffb8c in interpret (ch=0x87002e8, argument=0xbfffd8d5 "";) at interp.c:997
#2  0x080cda55 in game_loop () at comm.c:4288
#3  0x080cdd9d in main (argc=7, argv=0xbfffe184) at comm.c:4798


Laterz.
       
Post is unread #2 Nov 5, 2006, 11:12 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Try this:

In do_purge, locate:
         /*
          * GACK! Why did this get removed?? 
          */
         if( !IS_NPC( victim ) )
            continue;


And see if changing it to this works:
         /*
          * GACK! Why did this get removed?? 
          */
         if( !IS_NPC( victim ) || victim->switched )
            continue;
       
Post is unread #3 Nov 5, 2006, 2:11 pm
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Tried that, didn't really fix anything :O

Heres a log of what happens through the mud, i think i forgot to put it in the last post, meant to but slipped my mind heh..

Anyhow, here it is..

Log: [*****] BUG: interpret: illithid traveller mindflayer null in_room!
Log: Obtained 9 stack frames.
Log: afkmud(_Z3bugPKcz+0xec) [0x80d15b6]
Log: afkmud(_Z9interpretP9char_dataPc+0xe3) [0x80ff3db]
Log: afkmud(_Z12extract_charP9char_datab+0x48a) [0x80f63b0]
Log: afkmud(do_purge+0x114) [0x808ef4a]
Log: afkmud(_Z9interpretP9char_dataPc+0x8a0) [0x80ffb98]
Log: afkmud(_Z9game_loopv+0x2f5) [0x80cda61]
Log: afkmud(main+0x199) [0x80cdda9]
Log: /lib/tls/libc.so.6(__libc_start_main+0xe0) [0x4013aea0]
Log: afkmud(__gxx_personality_v0+0x85) [0x8069f41]
Log: [*****] BUG: Close_socket: dclose->original without character Testchar
Log: Obtained 9 stack frames.
Log: afkmud(_Z3bugPKcz+0xec) [0x80d15b6]
Log: afkmud(_Z12close_socketP15descriptor_datab+0xc9) [0x80ca26f]
Log: afkmud(_Z12extract_charP9char_datab+0x53a) [0x80f6460]
Log: afkmud(do_purge+0x114) [0x808ef4a]
Log: afkmud(_Z9interpretP9char_dataPc+0x8a0) [0x80ffb98]
Log: afkmud(_Z9game_loopv+0x2f5) [0x80cda61]
Log: afkmud(main+0x199) [0x80cdda9]
Log: /lib/tls/libc.so.6(__libc_start_main+0xe0) [0x4013aea0]
Log: afkmud(__gxx_personality_v0+0x85) [0x8069f41]
Comm: Closing link to Testchar.
Testchar has lost his link.
       
Post is unread #4 Nov 5, 2006, 2:20 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Dunno what to tell you then. Switch is evil and is barely worth the effort it consumes to try and fix. I've thought long and hard many times about just ripping it out and never putting it back. This kind of gotcha comes up ALL the time with it.
       
Post is unread #5 Nov 5, 2006, 2:21 pm
Go to the top of the page
Go to the bottom of the page

Kigen

GroupMembers
Posts38
JoinedNov 3, 2006

Looks like the mob had his in_room pointer NULLed. The mud generally hates NULL pointers to such important variables. Can someone post the entire function for me, me is too lazy to download AFKMud.
       
Post is unread #6 Nov 5, 2006, 2:36 pm   Last edited Nov 10, 2006, 10:02 pm by Conner
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

It's in SmaugFUSS too.. the function that is, just check your act_wiz.c file.
       
Post is unread #7 Nov 5, 2006, 11:26 pm
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Or, in act_wiz.c find do_purge, add in

 if( IS_NPC( ch ) )
          return;


That'd prevent mobiles from using purge, thus ending the problem with mud crashing when someone is switched, the mobile gets purged :P
       
Post is unread #8 Nov 10, 2006, 3:34 pm   Last edited Nov 10, 2006, 3:39 pm by Kigen
Go to the top of the page
Go to the bottom of the page

Kigen

GroupMembers
Posts38
JoinedNov 3, 2006

Fixed code:

void do_purge( CHAR_DATA * ch, char *argument )
{
   char arg[MAX_INPUT_LENGTH];
   CHAR_DATA *victim;
   OBJ_DATA *obj;

   set_char_color( AT_IMMORT, ch );

   one_argument( argument, arg );
   if( arg[0] == '\0' )
   {
      /*
       * 'purge' 
       */
      CHAR_DATA *vnext;
      OBJ_DATA *obj_next;

      if ( !ch->in_room )
      {
         bug("do_purge: ch, %s, is not in a room!!", ch->name);
      }

      for( victim = ch->in_room->first_person; victim; victim = vnext )
      {
         vnext = victim->next_in_room;
         if( IS_NPC( victim ) && victim != ch && !victim->desc )
            extract_char( victim, TRUE );
      }

      for( obj = ch->in_room->first_content; obj; obj = obj_next )
      {
         obj_next = obj->next_content;
         extract_obj( obj );
      }

      act( AT_IMMORT, "$n purges the room!", ch, NULL, NULL, TO_ROOM );
      act( AT_IMMORT, "You have purged the room!", ch, NULL, NULL, TO_CHAR );
      return;
   }
   victim = NULL;
   obj = NULL;

   /*
    * fixed to get things in room first -- i.e., purge portal (obj),
    * * no more purging mobs with that keyword in another room first
    * * -- Tri 
    */
   if( ( victim = get_char_room( ch, arg ) ) == NULL && ( obj = get_obj_here( ch, arg ) ) == NULL )
   {
      if( ( victim = get_char_world( ch, arg ) ) == NULL && ( obj = get_obj_world( ch, arg ) ) == NULL ) /* no get_obj_room */
      {
         send_to_char( "They aren't here.\r\n", ch );
         return;
      }
   }

/* Single object purge in room for high level purge - Scryn 8/12*/
   if( obj )
   {
      separate_obj( obj );
      act( AT_IMMORT, "$n purges $p.", ch, obj, NULL, TO_ROOM );
      act( AT_IMMORT, "You make $p disappear in a puff of smoke!", ch, obj, NULL, TO_CHAR );
      extract_obj( obj );
      return;
   }

   if( !IS_NPC( victim ) || victim->desc )
   {
      send_to_char( "Not on PC's.\r\n", ch );
      return;
   }

   if( victim == ch )
   {
      send_to_char( "You cannot purge yourself!\r\n", ch );
      return;
   }

   act( AT_IMMORT, "$n purges $N.", ch, NULL, victim, TO_NOTVICT );
   act( AT_IMMORT, "You make $N disappear in a puff of smoke!", ch, NULL, victim, TO_CHAR );
   extract_char( victim, TRUE );
   return;
}
       
Post is unread #9 Nov 11, 2006, 2:05 pm
Go to the top of the page
Go to the bottom of the page

ToadVile

GroupMembers
Posts47
JoinedApr 1, 2006

Alright, Kigen, you had a purge that was fixed, but i assume it didn't come from AFKmud since its lacking the overland part.

Anyhow, I used the fix from kigen's post, applied it to purge originally in AFKmud, it works out fine.. Here iti s :)

Find:

         if( is_same_map( ch, victim ) )


Replace with:

         if( is_same_map( ch, victim ) && IS_NPC( victim ) && victim != ch && !victim->desc )


Then find:
   if( !IS_NPC( victim ) )


Replace with:
   if( !IS_NPC( victim ) || victim->desc )


That should do it..
       
Pages:<< prev 1 next >>