Login
User Name:

Password:



Register

Forgot your password?
 I3 and IMC
Dec 26, 2024 3:27 am
By GatewaySysop
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
LOP 1.6
Author: Remcon
Submitted by: Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
Users Online
There are currently no members online.

Members: 0
Guests: 21
Stats
Files
Topics
Posts
Members
Newest Member
496
3,808
19,708
594
MaisieMacl

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Bugfix Lists » AFKMud Bugfix List » [Bug] Converted areas don't h...
Forum Rules | Mark all | Recent Posts

[Bug] Converted areas don't have valid datestamps on them.
< Newer Topic :: Older Topic > AFKMud 2.02

Pages:<< prev 1 next >>
Post is unread #1 Dec 16, 2007 3:07 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,697
JoinedJan 1, 2002

 
Bug: Converted areas don't have valid datestamps on them.
Danger: Trivial - Mainly a cosmetic thing. Has no real impact on anything.
Discovered in: AFKMud 2.02
Found by: Ransom
Fixed by: Remcon

---

areaconvert.cpp

At the top of the includes list, add:
#include 


areaconvert.cpp, load_stock_area_file

Locate:
   area_data *tarea = NULL;
   char *word;

   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;
   }


Change to:
   area_data *tarea = NULL;
   char *word;
   struct stat fst;
   time_t umod = 0;

   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;


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


Change to:
      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;


This is mainly an aesthetic thing. Converted areas will not carry a date/time stamp for their creation or installation since Smaug does not have these fields. Remcon's fix will use the file's last modification date to make a semi-educated guess. This is likely to result in inaccurate data, but it's still going to be marginally better than having areas show up as being created and installed in 1969.

Pages:<< prev 1 next >>