Difference for common/init.c from version 1.10 to 1.11


version 1.10 version 1.11
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_init_c =   * static char *rcsid_init_c =
  *   "$Id: init.c,v 1.10 2001/10/07 07:14:34 garbled Exp $";   *   "$Id: init.c,v 1.11 2001/12/18 08:58:03 garbled Exp $";
  */   */
   
 /*  /*
Line 87
 
Line 87
     init_archetypes(); /* Reads all archetypes from file */      init_archetypes(); /* Reads all archetypes from file */
     init_dynamic ();      init_dynamic ();
     init_attackmess();      init_attackmess();
       init_clocks();
 }  }
   
 /* init_environ initializes values from the environmental variables.  /* init_environ initializes values from the environmental variables.
Line 211
 
Line 212
     exit (-1);      exit (-1);
 }  }
   
   unsigned long todtick;
   
   /*
    * Write out the current time to the file so time does not
    * reset every time the server reboots.
    */
   
   void write_todclock()
   {
       char filename[MAX_BUF];
       FILE *fp;
   
       sprintf(filename, "%s/clockdata", settings.datadir);
       if ((fp = fopen(filename, "w")) == NULL) {
    LOG(llevError, "Cannot open %s for writing\n", filename);
    return;
       }
       fprintf(fp, "%lu", todtick);
       fclose(fp);
   }
   
   /*
    * Initializes the gametime and TOD counters
    * Called by init_library().
    */
   
   void init_clocks()
   {
       char filename[MAX_BUF];
       FILE *fp;
       static int has_been_done=0;
   
       if (has_been_done)
           return;
       else
           has_been_done = 1;
   
       sprintf(filename, "%s/clockdata", settings.datadir);
       LOG(llevDebug, "Reading clockdata from %s...", filename);
       if ((fp = fopen(filename, "r")) == NULL) {
           LOG(llevError, "Can't open %s.\n", filename);
    todtick = 0;
    write_todclock();
    return;
       }
       fscanf(fp, "%lu", &todtick);
       LOG(llevDebug, "todtick=%lu\n", todtick);
       fclose(fp);
   }
   
 /*  /*
  * Initializes the attack messages.   * Initializes the attack messages.
  * Called by init_library().   * Called by init_library().


Legend:
line(s) removed in v.1.10 
line(s) changed
 line(s) added in v.1.11

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:07