Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
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, Bing, Yahoo!

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » areaconvert problems
Forum Rules | Mark all | Recent Posts

areaconvert problems
< Newer Topic :: Older Topic > specificly with date

Pages:<< prev 1 next >>
Post is unread #1 Dec 15, 2007, 8:49 am
Go to the top of the page
Go to the bottom of the page

ransom
Fledgling
GroupMembers
Posts22
JoinedSep 7, 2006

converted areas crash afkmud when rebooting problem lies on line nine which shows as
Dates           % %


can be spoofed by doing something like rip a good date
Dates           982900000 982900000


haven't looked into a fix..
smaug1.4* areas seem to be really problematic in converting without running it through talisman first. tried orb but that seems to make it worse.
       
Post is unread #2 Dec 15, 2007, 10:08 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

There is no date stuff on stock smaug areas and at least stock 2.02 doesn't seem to auto set the area->creation_date or the area->install_date. Personally I would just set them when the area is converted so that it has valid data to save in those fields.
       
Post is unread #3 Dec 15, 2007, 10:11 am
Go to the top of the page
Go to the bottom of the page

ransom
Fledgling
GroupMembers
Posts22
JoinedSep 7, 2006

yup that's what I've done so far once I figured out what it was.. if I had brains though I'd probably read the date off the file & use that.. but I ant that smart. at least not enough to code it.
       
Post is unread #4 Dec 15, 2007, 10:29 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

take a look at do_finger in finger.cpp most of it is where it gets the laston info and right before it (if you are talking about using the last modified date of the area)
       
Post is unread #5 Dec 15, 2007, 11:52 am
Go to the top of the page
Go to the bottom of the page

ransom
Fledgling
GroupMembers
Posts22
JoinedSep 7, 2006

   time_t;
   tarea->creation_date = time_t;  // Timestamp for when this area was first created. Samson 1/20/07
   tarea->install_date = time_t;   // Timestamp for when this area was "live" installed. Samson 1/20/07
   tarea->last_resettime time_t; // Tracking for when the area was last reset. Debugging tool. Samson 3-6-04


that needs to go in their somewhere just not sure exactly how/where hope someones that knows something can fix it up from my poking an perusing.
       
Post is unread #6 Dec 15, 2007, 12:23 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

heres how i would do it
in areaconvert.cpp in function load_stock_area_file
after
   area_data *tarea = NULL;
   char *word;

add
   struct stat fst;
   time_t umod = 0;

change
   if( manual )
   {
      char fname[256];

      snprintf( fname, 256, "%s%s", AREA_CONVERT_DIR, filename );
      if( !( fpArea = fopen( fname, "r" ) ) )
      {
         perror( fname );
         bug( "%s: Error locating area file for conversion. Not present in conversion directory.", __FUNCTION__ );
         return;
      }
   }
   else if( !( fpArea = fopen( filename, "r" ) ) )
   {
      perror( filename );
      bug( "%s: error loading file (can't open) %s", __FUNCTION__, filename );
      return;
   }

to
   if( manual )
   {
      char fname[256];

      snprintf( fname, 256, "%s%s", AREA_CONVERT_DIR, filename );
      if( !( fpArea = fopen( fname, "r" ) ) )
      {
         perror( fname );
         bug( "%s: Error locating area file for conversion. Not present in conversion directory.", __FUNCTION__ );
         return;
      }
      if( stat( fname, &fst ) != -1 )
         umod = fst.st_mtime;
   }
   else if( !( fpArea = fopen( filename, "r" ) ) )
   {
      perror( filename );
      bug( "%s: error loading file (can't open) %s", __FUNCTION__, filename );
      return;
   }

   if( umod == 0 && stat( filename, &fst ) != -1 )
      umod = fst.st_mtime;

change
   if( tarea )
   {
      tarea->sort_name(  );
      tarea->sort_vnums(  );
      if( tarea->version == 0 && !dotdcheck )
         log_printf( "%-20s: Converted Smaug 1.02a Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );
      else if( tarea->version == 1 && !dotdcheck )
         log_printf( "%-20s: Converted Smaug 1.4a Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );
      else if( dotdcheck )
         log_printf( "%-20s: Converted DOTDII 2.3.6 Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );
      else
         log_printf( "%-20s: Converted SmaugWiz Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );

      if( tarea->low_vnum < 0 || tarea->hi_vnum < 0 )
         bug( "%-20s: Bad Vnum Range", tarea->filename );
      if( !tarea->author )
         tarea->author = STRALLOC( "Unknown" );
   }
   else
      log_printf( "(%s)", filename );

to
   if( tarea )
   {
      tarea->sort_name(  );
      tarea->sort_vnums(  );
      if( tarea->version == 0 && !dotdcheck )
         log_printf( "%-20s: Converted Smaug 1.02a Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );
      else if( tarea->version == 1 && !dotdcheck )
         log_printf( "%-20s: Converted Smaug 1.4a Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );
      else if( dotdcheck )
         log_printf( "%-20s: Converted DOTDII 2.3.6 Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );
      else
         log_printf( "%-20s: Converted SmaugWiz Zone  Vnums: %5d - %-5d", tarea->filename, tarea->low_vnum, tarea->hi_vnum );

      if( tarea->low_vnum < 0 || tarea->hi_vnum < 0 )
         bug( "%-20s: Bad Vnum Range", tarea->filename );
      if( !tarea->author )
         tarea->author = STRALLOC( "Unknown" );
      if( !tarea->creation_date )
         tarea->creation_date = umod;
      if( !tarea->install_date )
         tarea->install_date = umod;
   }
   else
      log_printf( "(%s)", filename );

Up to you on the last_resettime It should already auto update that somewhere when it finaly resets it. If it doesn't id just set it to the current_time

*Notice I didn't try this but that's where I would start if I used the codebase Hope it helps some.
       
Post is unread #7 Dec 16, 2007, 1:00 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

ransom said:

   time_t;
   tarea->creation_date = time_t;  // Timestamp for when this area was first created. Samson 1/20/07
   tarea->install_date = time_t;   // Timestamp for when this area was "live" installed. Samson 1/20/07
   tarea->last_resettime time_t; // Tracking for when the area was last reset. Debugging tool. Samson 3-6-04


that needs to go in their somewhere just not sure exactly how/where hope someones that knows something can fix it up from my poking an perusing.


Where did you find this code? That format is not correct and should have tripped up the compiler.

And what version of AFKMud are you using? There was a bug fixed with the fwrite_area_header function in area.cpp for the 2.02 release. 2.0 and 2.01 were saving a bad line in the file. The bugfix is sadly missing at the moment. Apparently a casualty of the October crash.
       
Post is unread #8 Dec 16, 2007, 1:01 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

BTW, even with an area that has the Dates line with a pair of 0's on it will load fine. Though I doubt anyone built areas for AFKMud back in 1969 :P
       
Post is unread #9 Dec 16, 2007, 1:39 pm
Go to the top of the page
Go to the bottom of the page

ransom
Fledgling
GroupMembers
Posts22
JoinedSep 7, 2006

I'm not a grate coder been dabbling at on and off for a long time but not a constant c coder.. that's just bits and pieces I looked at.. and yes that tripped up the compiler..

I just noticed that the date line in the converted files shows as % % without the proper date stamp and was trying to rig up a sort of fix for it..

haven't had time to check out Remcon's fix yet.. but it looks more authentic if I have time I'll test it later..
       
Post is unread #10 Dec 16, 2007, 1:48 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

I'm not sure what you mean by "more authentic" but his fix performs a different service. The one you really want to double check is the bad line in fwrite_area_header. I've reposted that bugfix since it was missing and is important.
       
Post is unread #11 Dec 16, 2007, 3:57 pm   Last edited Dec 16, 2007, 4:24 pm by ransom
Go to the top of the page
Go to the bottom of the page

ransom
Fledgling
GroupMembers
Posts22
JoinedSep 7, 2006

not "authentic"
more of problem converted areas are broken

solution
add a dummy date to the file

hopefully as authentic as possible.. the "date created" being tied to the files date
tarea->creation_date = time_t; // Timestamp for when this area was first created. Samson 1/20/07
and the current date being tied to
tarea->install_date = time_t; // Timestamp for when this area was "live" installed. Samson 1/20/07

those are from the area.cpp file and I assume define the types for that data.. like I said I'm not a good or even 1/2 decent coder I just dabble in it for fun.. I like problem solving and it's a fun way to keep my brain from rotting.. I just tossed them into the areaconverter.cpp to see what would happen heh..

it's also a fairly major problem with the converter.. and allow more seemless transition between ORB, Talisman or some other offline area editor, or just getting a basic living world with SMAUGFUSS areas, and AFKmud.

hope that makes it a bit more clear what I mean by problem with the converter..


EDIT: I'm using 2.02 AFKmud on a debian box remote editing it with Eclipse IDE 3.3 probably TMI heh
       
Post is unread #12 Dec 16, 2007, 5:21 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

   time_t;
   tarea->creation_date = time_t;  // Timestamp for when this area was first created. Samson 1/20/07
   tarea->install_date = time_t;   // Timestamp for when this area was "live" installed. Samson 1/20/07
   tarea->last_resettime time_t; // Tracking for when the area was last reset. Debugging tool. Samson 3-6-04


I think you're going to need to go back and take a more careful, close look at what you pulled and from where. If you put those in exactly as I'm quoting them here, then it won't work. I'd be surprised if it compiled. If it did then it would explain why it's crashing. Those statements did not come from area.cpp.

If you got them from anywhere, they would have been here, in area.h:
   time_t creation_date;  // Timestamp for when this area was first created. Samson 1/20/07
   time_t install_date;   // Timestamp for when this area was "live" installed. Samson 1/20/07
   time_t last_resettime; // Tracking for when the area was last reset. Debugging tool. Samson 3-6-04


Take note of the difference. There's no time_t sitting by itself on a line, and the order of how things are written is different. These are critically important details that you should master if you're planning to dive head first into coding.

In any case, Remcon's fix will address your issue. I've also tested the 2.02 package and verified it loads stock Smaug zones just fine. The emphasis on *STOCK* Smaug zones.
       
Post is unread #13 Dec 16, 2007, 5:22 pm   Last edited Dec 16, 2007, 5:25 pm by ransom
Go to the top of the page
Go to the bottom of the page

ransom
Fledgling
GroupMembers
Posts22
JoinedSep 7, 2006

I read yer post: http://www.smaugmuds.org/index.php?a=topic&t=3533&unread=1#unread

I'm using afk2.02
fprintf( fpout, "Dates %l %l\n", area->creation_date, area->install_date );

double checking now that it's 2.02 just to make sure..

Edit:
Yup checked afkmud2.02tgz
area.cpp contains
fprintf( fpout, "Dates %l %l\n", area->creation_date, area->install_date );
at line 3407 if you want to double check me
thanks for posting the fix :D
       
Post is unread #14 Dec 16, 2007, 5:31 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

I see what happened now. Apparently the copy of the file that was in the downloads area was not the correct version. I just updated it with a verified copy of 2.02 that has the area fix. Thanks for being patient enough to put up with me :P
       
Pages:<< prev 1 next >>