Ejemplo n.º 1
0
void load_equipment_totals( bool fCopyOver )
{
   DIR *dp;
   struct dirent *dentry;
   char directory_name[100];
   short alpha_loop;

   check_pfiles( 255 ); /* Clean up stragglers to get a better count - Samson 1-1-00 */

   log_string( "Updating rare item counts....." );
   log_string( "Checking player files...." );

   for( alpha_loop = 0; alpha_loop <= 25; ++alpha_loop )
   {
      snprintf( directory_name, 100, "%s%c", PLAYER_DIR, 'a' + alpha_loop );

      dp = opendir( directory_name );
      dentry = readdir( dp );
      while( dentry )
      {
         /*
          * Added by Tarl 3 Dec 02 because we are now using CVS 
          */
         if( !str_cmp( dentry->d_name, "CVS" ) )
         {
            dentry = readdir( dp );
            continue;
         }
         if( dentry->d_name[0] != '.' )
         {
            scan_pfiles( directory_name, dentry->d_name, false );
         }
         dentry = readdir( dp );
      }
      closedir( dp );
   }

   log_string( "Checking corpses...." );

   snprintf( directory_name, 100, "%s", CORPSE_DIR );
   dp = opendir( directory_name );
   dentry = readdir( dp );
   while( dentry )
   {
      /*
       * Added by Tarl 3 Dec 02 because we are now using CVS 
       */
      if( !str_cmp( dentry->d_name, "CVS" ) )
      {
         dentry = readdir( dp );
         continue;
      }
      if( dentry->d_name[0] != '.' )
      {
         corpse_scan( directory_name, dentry->d_name );
      }
      dentry = readdir( dp );
   }
   closedir( dp );

   if( fCopyOver )
   {
      log_string( "Scanning world-state mob file...." );
      mobfile_scan(  );

      log_string( "Scanning world-state obj files...." );
      snprintf( directory_name, 100, "%s", HOTBOOT_DIR );
      dp = opendir( directory_name );
      dentry = readdir( dp );
      while( dentry )
      {
         /*
          * Added by Tarl 3 Dec 02 because we are now using CVS 
          */
         if( !str_cmp( dentry->d_name, "CVS" ) )
         {
            dentry = readdir( dp );
            continue;
         }
         if( dentry->d_name[0] != '.' )
         {
            objfile_scan( directory_name, dentry->d_name );
         }
         dentry = readdir( dp );
      }
      closedir( dp );
   }
}
Ejemplo n.º 2
0
void ev_pfile_check( void *data )
{
   check_pfiles( 0 );
   add_event( 86400, ev_pfile_check, nullptr );
}