ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/init.C
(Generate patch)

Comparing deliantra/server/server/init.C (file contents):
Revision 1.23 by root, Sat Dec 30 10:16:11 2006 UTC vs.
Revision 1.28 by pippijn, Wed Jan 3 00:46:53 2007 UTC

236 * pass system very easy, and it is very easy to add in new options. 236 * pass system very easy, and it is very easy to add in new options.
237 */ 237 */
238struct Command_Line_Options options[] = { 238struct Command_Line_Options options[] = {
239 239
240/* Pass 1 functions - STuff that can/should be called before we actually 240/* Pass 1 functions - STuff that can/should be called before we actually
241 * initialize any data. 241 * initialise any data.
242 */ 242 */
243 {"-h", 0, 1, help}, 243 {"-h", 0, 1, help},
244 244
245/* Honor -help also, since it is somewhat common */ 245/* Honor -help also, since it is somewhat common */
246 {"-help", 0, 1, help}, 246 {"-help", 0, 1, help},
379 FILE *fp; 379 FILE *fp;
380 materialtype_t *mt; 380 materialtype_t *mt;
381 int i, value; 381 int i, value;
382 382
383 sprintf (filename, "%s/materials", settings.datadir); 383 sprintf (filename, "%s/materials", settings.datadir);
384 LOG (llevDebug, "Reading material type data from %s...", filename); 384 LOG (llevDebug, "Reading material type data from %s...\n", filename);
385 if ((fp = fopen (filename, "r")) == NULL) 385 if ((fp = fopen (filename, "r")) == NULL)
386 { 386 {
387 LOG (llevError, "Cannot open %s for reading\n", filename); 387 LOG (llevError, "Cannot open %s for reading\n", filename);
388 mt = get_empty_mat (); 388 mt = get_empty_mat ();
389 mt->next = NULL; 389 mt->next = NULL;
1013 init_library (); /* Must be called early */ 1013 init_library (); /* Must be called early */
1014 load_settings (); /* Load the settings file */ 1014 load_settings (); /* Load the settings file */
1015 load_materials (); 1015 load_materials ();
1016 parse_args (argc, argv, 2); 1016 parse_args (argc, argv, 2);
1017 fprintf (logfile, "Welcome to CrossFire, v%s\n", VERSION); 1017 fprintf (logfile, "Welcome to CrossFire, v%s\n", VERSION);
1018 fprintf (logfile, "Copyright (C) 2005, 2006, 2007 Marc Lehmann.\n");
1018 fprintf (logfile, "Copyright (C) 1994 Mark Wedel.\n"); 1019 fprintf (logfile, "Copyright (C) 1994 Mark Wedel.\n");
1019 fprintf (logfile, "Copyright (C) 1992 Frank Tore Johansen.\n"); 1020 fprintf (logfile, "Copyright (C) 1992 Frank Tore Johansen.\n");
1020 1021
1021 if (strcmp (settings.dm_mail, "") != 0) 1022 if (strcmp (settings.dm_mail, "") != 0)
1022 { 1023 {
1207 printf ("Save player:\t<true>\n"); 1208 printf ("Save player:\t<true>\n");
1208 printf ("Save mode:\t%4.4o\n", SAVE_MODE); 1209 printf ("Save mode:\t%4.4o\n", SAVE_MODE);
1209 printf ("Playerdir:\t<VAR>/%s\n", settings.playerdir); 1210 printf ("Playerdir:\t<VAR>/%s\n", settings.playerdir);
1210 printf ("Itemsdir:\t<VAR>/%s\n", settings.uniquedir); 1211 printf ("Itemsdir:\t<VAR>/%s\n", settings.uniquedir);
1211 printf ("Tmpdir:\t\t%s\n", settings.tmpdir); 1212 printf ("Tmpdir:\t\t%s\n", settings.tmpdir);
1212 printf ("Map max timeout:\t%d\n", MAP_MAXTIMEOUT);
1213 printf ("Max objects:\t%d\n", MAX_OBJECTS);
1214#ifdef USE_CALLOC 1213#ifdef USE_CALLOC
1215 printf ("Use_calloc:\t<true>\n"); 1214 printf ("Use_calloc:\t<true>\n");
1216#else 1215#else
1217 printf ("Use_calloc:\t<false>\n"); 1216 printf ("Use_calloc:\t<false>\n");
1218#endif 1217#endif
1316 return; 1315 return;
1317 init_done = 1; 1316 init_done = 1;
1318 first_race = 0; 1317 first_race = 0;
1319 1318
1320 sprintf (fname, "%s/races", settings.datadir); 1319 sprintf (fname, "%s/races", settings.datadir);
1321 LOG (llevDebug, "Reading races from %s...", fname); 1320 LOG (llevDebug, "Reading races from %s...\n", fname);
1322 if (!(file = fopen (fname, "r"))) 1321 if (!(file = fopen (fname, "r")))
1323 { 1322 {
1324 LOG (llevError, "Cannot open races file %s: %s\n", fname, strerror (errno)); 1323 LOG (llevError, "Cannot open races file %s: %s\n", fname, strerror (errno));
1325 return; 1324 return;
1326 } 1325 }
1367 if (cp[strlen (cp) - 1] == '\n') 1366 if (cp[strlen (cp) - 1] == '\n')
1368 cp[strlen (cp) - 1] = '\0'; 1367 cp[strlen (cp) - 1] = '\0';
1369 1368
1370 /* set creature race to race value */ 1369 /* set creature race to race value */
1371 if ((mon = archetype::find (cp)) == NULL) 1370 if ((mon = archetype::find (cp)) == NULL)
1372 LOG (llevError, "\nCreature %s in race file lacks archetype", cp); 1371 LOG (llevError, "Creature %s in race file lacks archetype\n", cp);
1373 else 1372 else
1374 { 1373 {
1375 if (set_race && (!mon->clone.race || strcmp (mon->clone.race, race))) 1374 if (set_race && (!mon->clone.race || strcmp (mon->clone.race, race)))
1376 { 1375 {
1377 if (mon->clone.race) 1376 if (mon->clone.race)
1378 LOG (llevDebug, "\n Resetting race to %s from %s for archetype %s", race, &mon->clone.race, &mon->name); 1377 LOG (llevDebug, "Resetting race to %s from %s for archetype %s\n", race, &mon->clone.race, &mon->name);
1379 1378
1380 mon->clone.race = race; 1379 mon->clone.race = race;
1381 } 1380 }
1382 1381
1383 /* if the arch is a monster, add it to the race list */ 1382 /* if the arch is a monster, add it to the race list */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines