Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » key'd area format
Forum Rules | Mark all | Recent Posts

key'd area format
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #21 Sep 6, 2014, 8:49 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

  Compiling o/db.o
db.c: In function ‘void load_area_file(AREA_DATA*, const char*)’:
db.c:8523:13: error: void value not ignored as it ought to be
       tarea = fread_fuss_areadata( fpArea, tarea );
             ^
make[1]: *** [o/db.o] Error 1
make: *** [all] Error 2
       
Post is unread #22 Sep 6, 2014, 12:36 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

ok try
   // New FUSS area format support -- Samson 7/5/07
   if( !str_cmp( word, "AREADATA" ) )
   {
      fread_fuss_areadata( fpArea, tarea );

sorry it doesn't return area format lol
       
Post is unread #23 Sep 6, 2014, 1:27 pm
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Now it crashed

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00000000004c7929 in fread_fuss_areadata (fp=0x13edd20, 
    tarea=tarea@entry=0x0) at db.c:8194
8194	            KEY( "Name", tarea->name, fread_string_nohash( fp ) );
(gdb) bt
#0  0x00000000004c7929 in fread_fuss_areadata (fp=0x13edd20, 
    tarea=tarea@entry=0x0) at db.c:8194
#1  0x00000000004c911d in load_area_file (tarea=tarea@entry=0x0, 
    filename=filename@entry=0x8d2ac0 <strArea> "limbo.are";) at db.c:8523
#2  0x00000000004ce90f in boot_db (fCopyOver=fCopyOver@entry=0 '\000')
    at db.c:1245
#3  0x000000000049b7d0 in main (argc=<optimized out>, argv=0x7fffe38ba9c8)
    at comm.c:725
(gdb) frame 0
#0  0x00000000004c7929 in fread_fuss_areadata (fp=0x13edd20, 
    tarea=tarea@entry=0x0) at db.c:8194
8194	            KEY( "Name", tarea->name, fread_string_nohash( fp ) );
(gdb) list
8189	               break;
8190	            }
8191	           break;
8192	
8193	         case 'N':
8194	            KEY( "Name", tarea->name, fread_string_nohash( fp ) );
8195	            break;
8196	
8197	         case 'R':
8198	            KEY( "ResetMsg", tarea->resetmsg, fread_string_nohash( fp ) );
(gdb) print tarea->name
Cannot access memory at address 0x48
(gdb) print *tarea
Cannot access memory at address 0x0
(gdb) print tarea
$1 = (AREA_DATA *) 0x0

       
Post is unread #24 Sep 6, 2014, 1:35 pm   Last edited Sep 6, 2014, 1:39 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Try it like this
   // New FUSS area format support -- Samson 7/5/07
   if( !str_cmp( word, "AREADATA" ) )
   {
      if( !tarea )
         tarea = create_area(  );
      fread_fuss_areadata( fpArea, tarea );

       
Post is unread #25 Sep 6, 2014, 2:04 pm
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

wow this is interesting.

Sat Sep 6 17:04:06 2014 :: Reading in area files...
(help.are)
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
limbo.are : Rooms: 0 - 0 Objs: 0 - 0 Mobs: 0 - 0
       
Post is unread #26 Sep 6, 2014, 2:09 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

lol ok, really tried to avoid this, but give me a few :)
       
Post is unread #27 Sep 6, 2014, 4:12 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

Ok so while this wasn't the complete function lets put it back this way
void load_area_file( AREA_DATA * tarea, const char *filename )
{
   char *word;
   char Newfile[MSL], check[MSL];
   int aversion = 0;

    if ( fBootDb )
        tarea = last_area;
    if ( !fBootDb && !tarea ) {
        bug( "%s", "Load_area: null area!" );
        return;
    }

    snprintf( check, MSL, "%s", BUILD_DIR );
    if ( !str_prefix( check, filename ) )
        snprintf( Newfile, MSL, "%s", filename );
    else
        snprintf( Newfile, MSL, "%s%s", AREA_DIR, filename );

    if ( ( fpArea = FileOpen( Newfile, "r" ) ) == NULL ) {
        perror( Newfile );
        bug( "load_area: %s error loading file (can't open)", Newfile );
        return;
    }

   if( fread_letter( fpArea ) != '#' )
   {
      if( fBootDb )
      {
         bug( "%s: No # found at start of area file.", __FUNCTION__ );
         exit( 1 );
      }
      else
      {
         bug( "%s: No # found at start of area file.", __FUNCTION__ );
         FileClose( fpArea );
         fpArea = NULL;
         return;
      }
   }

   word = fread_word( fpArea );

   // New FUSS area format support -- Samson 7/5/07
   if( !str_cmp( word, "AREADATA" ) )
   {
      tarea = fread_fuss_area( tarea, fpArea );
      FileClose( fpArea );
      fpArea = NULL;

      if( tarea )
         process_sorting( tarea );
      return;
   }

Which then brings us to this one, now understand that by this point the #AREADATA is stripped out already and we are loading in the areadata info
AREA_DATA *fread_fuss_area( AREA_DATA * tarea, FILE * fp )
{
   /* If NULL area lets create it */
   if( !tarea )
      tarea = create_area( );

   /* Since should already be in the area data info lets load that up first */
   /* Use which ever you want to load in this info, fread_areadata or fread_fuss_areadata */
   fread_areadata( fp, tarea );

   /* Now lets deal with all the other stuff that might be in the area after the area data */
   for( ;; )
   {
      const char *word;

      letter = fread_letter( fp );
      if( letter == '*' )
      {
         fread_to_eol( fp );
         continue;
      }

      if( letter == '#' )
      {
         bug( "%s: # not found. Invalid format.", __FUNCTION__ );
         if( fBootDb )
            exit( 1 );
         break;
      }

      word = ( feof( fp ) ? "ENDAREA" : fread_word( fp ) );

      if( word[0] == '\0' )
      {
         bug( "%s: EOF encountered reading file!", __FUNCTION__ );
         word = "ENDAREA";
      }

      /* Since this is already dealt with lets toss in a bug and end the loading if found again */
      if( !str_cmp( word, "AREADATA" ) )
      {
         bug( "%s: AREADATA should have already been read!, __FUNCTION__ );
         word = "ENDAREA";
      }

      /* Notice no else here because of how we are handling this, now handling all the others from here down for this area */
      if( !str_cmp( word, "MOBILE" ) )
         fread_fuss_mobile( fp, tarea );
      else if( !str_cmp( word, "OBJECT" ) )
         fread_fuss_object( fp, tarea );
      else if( !str_cmp( word, "ROOM" ) )
         fread_fuss_room( fp, tarea );
      else if( !str_cmp( word, "ENDAREA" ) )
         break;
      else
      {
         bug( "%s: Bad section header: %s", __FUNCTION__, word );
         fread_to_eol( fp );
      }
   }
   return tarea;
}

You will probably have issues with the way you have this
Ranges       soft 1 100 hard 1 100

considering all i see in either areadata handling is softranges and hardranges nothing in either to handle Ranges and the soft and hard etc... So id figure out a better output or handle loading of that.
       
Post is unread #28 Sep 7, 2014, 4:38 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Has some more errors now, but at least beyond that sticking point. Why did I have to do it that way instead of how smaugfuss has it? Was it because smaugfuss doesn't use AREA_DIR?
       
Post is unread #29 Sep 7, 2014, 7:38 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

what errors is it giving? Nope that doesn't have anything to do with it, shrug id have to take a look at how its done in it to give you an exact answer on how it was done in it.
       
Post is unread #30 Sep 7, 2014, 7:20 pm
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Yah, I don't know how much more you want to look into this, seems to just get deeper and deeper with issues. I put in your last code changes, then had found out that I didn't have extended bits for room flags but smaugfuss does, so I had to convert to that. Heh.

Now with that done, I have a issue with fread_room flags looking for the extended bit flags, but when I did fwrite_rooms with folda I had used the old room flags. I commented that out and just did a key for room flags bitvector, to see what else was going to come up.

It crashed, and I got logs like this.
Sun Sep 7 22:12:29 2014 :: Reading in area files...
(help.are)
limbo.are : Rooms: 2 - 99 Objs: 2 - 99 Mobs: 1 - 99
limbo.are : Rooms: 2 - 1299 Objs: 2 - 1299 Mobs: 1 - 1299
limbo.are : Rooms: 2 - 1299 Objs: 2 - 1299 Mobs: 1 - 1299
       
Post is unread #31 Sep 7, 2014, 8:55 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,857
JoinedJul 26, 2005

lol this all will take ages, email me a copy of the full mud your working on and ill take a look this week and see what its doing lol
       
Pages:<< prev 1, 2 next >>