Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Sogou

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » Reset fix and SWFOTE
Forum Rules | Mark all | Recent Posts

Reset fix and SWFOTE
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
* #1 Apr 6, 2005, 12:15 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Wow. No posts in this forum. Must fix. Heh.

Anyway. Would there be any potential objection to implementing the reset fix in SWFOTE FUSS? Any safety issues anyone might see?
       
Post is unread #2 Apr 14, 2005, 3:48 pm
Go to the top of the page
Go to the bottom of the page

Krylan
Fledgling
GroupMembers
Posts39
JoinedApr 14, 2005

I can't see any safety issues or anything. I'd like to see it in the FUSS package. I plan on doing it myself regardless.
Krylan
       
Post is unread #3 May 7, 2005, 12:21 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

The reset fix has now been added to the SWFOTE FUSS package and its version number has been bumped up to 1.2 to distinguish it from the non-fixed package. Also there is now a fix posted to the downloads page for older muds to update to the new system.

This completes the updating of all of the FUSS packages with the new reset system.
       
Post is unread #4 Jun 4, 2005, 11:16 am
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

For some reason (even in fuss1.2) when you do a redit rlist you get something like:

1) (object) Durasteel Backpack (132) -> Goku's Office Room: 109 [1]
11200) (put) An Immortal-Sized bag (4561) -> Durasteel Backpack (132) [1]
2088) (put) Durasteel Backpack (132) -> An Immortal-Sized bag (4561) [1]
14888) (put) shopping bag (25) -> Durasteel Backpack (132) [1]
2) Open [0] the north [0] door Goku's Office (109)

which makes it kind of hard to delete those put resets.
Lemme know what you think.

Thanks,
KeB
       
Post is unread #5 Jun 4, 2005, 5:28 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Which is why you have to fix anything that comes up wrong from that. The fix corrects the behaviour. Anything that then loads up wrongly was relying on the previous bugs to operate.
       
Post is unread #6 Jun 4, 2005, 6:16 pm   Last edited Jun 4, 2005, 6:17 pm by Keberus
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Not Sure what you mean. I logged into SW:FotEFUSS1.2 after installing it and created the resets by oinvoking the objects, putting them in each other, then instarooming after dropping them. I'm not sure from your previous post if you thought that I just went to a room that already had resets and checked them. I actually created them to get those results, so I am still unclear on what exactly you meant in your previous post.

Thanks,
KeB
       
Post is unread #7 Jun 4, 2005, 7:36 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well then I'm not sure because I tested the hell out of that reset system before even considering a release. For AFKMud and SMAUG, I know for sure it works. Greven said it works fine in SWR, and when I got little or no response on SWFOTE, I assumed it worked fine there too. If this is not the case, then I need to know the exact conditions under which you produced the results you listed. Exact commands entered, reboots, whatever.
       
Post is unread #8 Jun 4, 2005, 7:48 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

okay simple enough....


here are the stacked commands i used to the T

oinvoke 25;oinvoke 132;put bag backpack;oinvoke 4561;put backpack bag;oinvoke 132;put bag backpack;get bag;put bag backpack;drop bag;instaroom;redit rlist

to get those results.

As far as the codebase I was curious to see if the problem was in the stock version so I downloaded it....did a make in the src directory and started it up...logged in and did the commands above.

Thanks,
KeB

Btw:It seems like the code isn't passing back the correct "reset number" when counting the resets. Probably obvious to you already though.
       
Post is unread #9 Jun 4, 2005, 10:23 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Okay...finally got it to work...here's what I did (someone may have a better way but this works for me).

In build.c replace the rlist argument of redit with this...
if( !str_cmp( arg, "rlist" ) )
   {
      RESET_DATA *pReset;
      char *rbuf;

      if( !location->first_reset )
      {
         send_to_char( "This room has no resets to list.\n\r", ch );
         return;
      }
      resetcounter = 0;
      for( pReset = location->first_reset; pReset; pReset = pReset->next )
      {
         resetcounter++;
         if( !( rbuf = sprint_reset( pReset ) ) )
            continue;
         send_to_char( rbuf, ch );
      }
      return;
   }


at the top of build.c after:
extern bool     fBootDb;

add:
sh_int    resetcounter;



then in reset.c replace the sprint_reset function with this one:
char *sprint_reset( RESET_DATA *pReset )
{
   RESET_DATA *tReset, *gReset;
   static char buf[MAX_STRING_LENGTH];
   char mobname[MAX_STRING_LENGTH], roomname[MAX_STRING_LENGTH], objname[MAX_STRING_LENGTH];
   static ROOM_INDEX_DATA *room;
   static OBJ_INDEX_DATA *obj, *obj2;
   static MOB_INDEX_DATA *mob;

   switch( pReset->command )
   {
      default:
         snprintf( buf, MAX_STRING_LENGTH, "%2d) *** BAD RESET: %c %d %d %d %d ***\n\r",
                   resetcounter, pReset->command, pReset->extra, pReset->arg1, pReset->arg2, pReset->arg3 );
         break;

      case 'M':
         mob = get_mob_index( pReset->arg1 );
         room = get_room_index( pReset->arg3 );
         if( mob )
            strncpy( mobname, mob->player_name, MAX_STRING_LENGTH );
         else
            strncpy( mobname, "Mobile: *BAD VNUM*", MAX_STRING_LENGTH );
         if( room )
            strncpy( roomname, room->name, MAX_STRING_LENGTH );
         else
            strncpy( roomname, "Room: *BAD VNUM*", MAX_STRING_LENGTH );
         snprintf( buf, MAX_STRING_LENGTH, "%2d) %s (%d) -> %s Room: %d [%d]\n\r", resetcounter, mobname, pReset->arg1,
            roomname, pReset->arg3, pReset->arg2 );

         for( tReset = pReset->first_reset; tReset; tReset = tReset->next_reset )
         {
            resetcounter++;
            switch( tReset->command )
            {
               case 'E':
                  if( !mob )
                     strncpy( mobname, "* ERROR: NO MOBILE! *", MAX_STRING_LENGTH );
                  if( !( obj = get_obj_index( tReset->arg1 ) ) )
                     strncpy( objname, "Object: *BAD VNUM*", MAX_STRING_LENGTH );
                  else
                     strncpy( objname, obj->name, MAX_STRING_LENGTH );
                  snprintf( buf+strlen(buf), MAX_STRING_LENGTH-strlen(buf), "%2d) (equip) %s (%d) -> %s (%s) [%d]\n\r",
                     resetcounter, objname, tReset->arg1, mobname, wear_locs[tReset->arg3], tReset->arg2 );
                  break;

               case 'G':
                  if( !mob )
                     strncpy( mobname, "* ERROR: NO MOBILE! *", MAX_STRING_LENGTH );
                  if( !( obj = get_obj_index( tReset->arg1 ) ) )
                     strncpy( objname, "Object: *BAD VNUM*", MAX_STRING_LENGTH );
                  else
                     strncpy( objname, obj->name, MAX_STRING_LENGTH );
                  snprintf( buf+strlen(buf), MAX_STRING_LENGTH-strlen(buf), "%2d) (carry) %s (%d) -> %s [%d]\n\r",
                     resetcounter, objname, tReset->arg1, mobname, tReset->arg2 );
                  break;
            }
            if( tReset->first_reset )
            {
               for( gReset = tReset->first_reset; gReset; gReset = gReset->next_reset )
               {
                  resetcounter++;
                  switch( gReset->command )
                  {
                     case 'P':
                        if( !( obj2 = get_obj_index( gReset->arg1 ) ) )
                           strncpy( objname, "Object1: *BAD VNUM*", MAX_STRING_LENGTH );
                        else
                           strncpy( objname, obj2->name, MAX_STRING_LENGTH );
                        if( gReset->arg3 > 0 && ( obj = get_obj_index( gReset->arg3 ) ) == NULL )
                           strncpy( roomname, "Object2: *BAD VNUM*", MAX_STRING_LENGTH );
                        else if( !obj )
                           strncpy( roomname, "Object2: *NULL obj*", MAX_STRING_LENGTH );
                        else
                           strncpy( roomname, obj->name, MAX_STRING_LENGTH );
                        snprintf( buf+strlen(buf), MAX_STRING_LENGTH-strlen(buf), "%2d) (put) %s (%d) -> %s (%d) [%d]\n\r",
                           resetcounter, objname, gReset->arg1, roomname, obj ? obj->vnum : gReset->arg3, gReset->arg2 );
                        break;
                  }
               }
            }
         }
         break;

      case 'O':
         if( !( obj = get_obj_index( pReset->arg1 ) ) )
            strncpy( objname, "Object: *BAD VNUM*", MAX_STRING_LENGTH );
         else
            strncpy( objname, obj->name, MAX_STRING_LENGTH );
         room = get_room_index( pReset->arg3 );
         if( !room )
            strncpy( roomname, "Room: *BAD VNUM*", MAX_STRING_LENGTH );
         else
            strncpy( roomname, room->name, MAX_STRING_LENGTH );
         snprintf( buf, MAX_STRING_LENGTH, "%2d) (object) %s (%d) -> %s Room: %d [%d]\n\r",
            resetcounter, objname, pReset->arg1, roomname, pReset->arg3, pReset->arg2 );

         for( tReset = pReset->first_reset; tReset; tReset = tReset->next_reset )
         {
            resetcounter++;

            switch( tReset->command )
            {
               case 'P':
                  if( !( obj2 = get_obj_index( tReset->arg1 ) ) )
                     strncpy( objname, "Object1: *BAD VNUM*", MAX_STRING_LENGTH );
                  else
                     strncpy( objname, obj2->name, MAX_STRING_LENGTH );
                  if( tReset->arg3 > 0 && ( obj = get_obj_index( tReset->arg3 ) ) == NULL )
                     strncpy( roomname, "Object2: *BAD VNUM*", MAX_STRING_LENGTH );
                  else if( !obj )
                     strncpy( roomname, "Object2: *NULL obj*", MAX_STRING_LENGTH );
                  else
                     strncpy( roomname, obj->name, MAX_STRING_LENGTH );
                  snprintf( buf+strlen(buf), MAX_STRING_LENGTH-strlen(buf), "%2d) (put) %s (%d) -> %s (%d) [%d]\n\r",
                     resetcounter, objname, tReset->arg1, roomname, obj ? obj->vnum : tReset->arg3, tReset->arg2 );
                  break;

               case 'T':
                  snprintf( buf+strlen(buf), MAX_STRING_LENGTH-strlen(buf), "%2d) (trap) %d %d %d %d (%s) -> %s (%d)\n\r",
                     resetcounter, tReset->extra, tReset->arg1, tReset->arg2, tReset->arg3, flag_string( tReset->extra, trap_flags ),
                     objname, obj ? obj->vnum : 0 );
                  break;

               case 'H':
                  snprintf( buf+strlen(buf), MAX_STRING_LENGTH-strlen(buf), "%2d) (hide) -> %s\n\r", resetcounter, objname );
                  break;
            }
         }
         break;

      case 'D':
         if( pReset->arg2 < 0 || pReset->arg2 > MAX_DIR + 1 )
            pReset->arg2 = 0;
         if( !( room = get_room_index( pReset->arg1 ) ) )
         {
            strncpy( roomname, "Room: *BAD VNUM*", MAX_STRING_LENGTH );
            snprintf( objname, MAX_STRING_LENGTH, "%s (no exit)", dir_name[pReset->arg2] );
         }
         else
         {
            strncpy( roomname, room->name, MAX_STRING_LENGTH );
            snprintf( objname, MAX_STRING_LENGTH, "%s%s", dir_name[pReset->arg2], get_exit( room, pReset->arg2 ) ? "" : " (NO EXIT!)" );
         }
         switch ( pReset->arg3 )
         {
            default:
               strncpy( mobname, "(* ERROR *)", MAX_STRING_LENGTH );
               break;
            case 0:
               strncpy( mobname, "Open", MAX_STRING_LENGTH );
               break;
            case 1:
               strncpy( mobname, "Close", MAX_STRING_LENGTH );
               break;
            case 2:
               strncpy( mobname, "Close and lock", MAX_STRING_LENGTH );
               break;
         }
         snprintf( buf, MAX_STRING_LENGTH, "%2d) %s [%d] the %s [%d] door %s (%d)\n\r",
                   resetcounter, mobname, pReset->arg3, objname, pReset->arg2, roomname, pReset->arg1 );
         break;

      case 'R':
         if( !( room = get_room_index( pReset->arg1 ) ) )
            strncpy( roomname, "Room: *BAD VNUM*", MAX_STRING_LENGTH );
         else
            strncpy( roomname, room->name, MAX_STRING_LENGTH );
         snprintf( buf, MAX_STRING_LENGTH, "%2d) Randomize exits 0 to %d -> %s (%d)\n\r", resetcounter, pReset->arg2, roomname, pReset->arg1 );
         break;

      case 'T':
         if( !( room = get_room_index( pReset->arg3 ) ) )
            strncpy( roomname, "Room: *BAD VNUM*", MAX_STRING_LENGTH );
         else
            strncpy( roomname, room->name, MAX_STRING_LENGTH );
         snprintf( buf, MAX_STRING_LENGTH, "%2d) Trap: %d %d %d %d (%s) -> %s (%d)\n\r",
            resetcounter, pReset->extra, pReset->arg1, pReset->arg2, pReset->arg3, flag_string( pReset->extra, trap_flags ),
            roomname, room ? room->vnum : 0 );
         break;
   }
   return buf;
}



then in mud.h after:
extern  int     top_herb;

add:
extern  sh_int  resetcounter;


That should do it.

It seems to me like the variable wasn't being passed properly (don't know why) from 'redit rlist' to sprint_reset so any nested resets would not be properly numerated, instead thier numbers would be garbled. So I basically made the resetcounter a variable and since before it starts listing it is always set back to zero there shouldn't really be any problems.

Alright, thats all I got for tonight.

Later,
KeB


       
Post is unread #10 Jun 5, 2005, 12:15 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Yikes. Global variables bad.... :)

Much simpler fix is this - in sprint_reset, wherever *num++ comes up, change to (*num)++ and it will fix the entire problem.
       
Post is unread #11 Jun 5, 2005, 5:57 am   Last edited Jun 5, 2005, 6:00 am by Keberus
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

LOL....so what was it doing, multiplying? instead of dereferencing....I never thought of something so simple.

Thanks,
KeB

Edit: Nevermind the question ...hadn't read your other post yet.
       
Pages:<< prev 1 next >>