[Bug] Converted areas don't have valid datestamps on them.
< Newer Topic
:: Older Topic >
AFKMud 2.02
Pages:<< prev 1 next >>
#1 Dec 16, 2007 3:07 pm
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:
areaconvert.cpp, load_stock_area_file
Locate:
Change to:
Locate:
Change to:
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.
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 >>