]> git.pond.sub.org Git - empserver/blobdiff - src/lib/global/constants.c
Fix trailing whitespace
[empserver] / src / lib / global / constants.c
index 1b27a8b6a39262aae1b033c445154754c3e134f4..2611679f509bc9114562013f1a05f39598f352da 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
- *  constants.c: Global constants file.  Note that the "hours" file can
- *               override these, as does the global "econfig" file.
- * 
+ *  constants.c: Global constants
+ *
  *  Known contributors to this file:
  *     Ken Stevens, 1995
  *     Steve McClure, 1996
- *     
+ *     Markus Armbruster, 2004-2008
  */
 
-#include "gamesdef.h"
-#include "misc.h"
+#include <config.h>
+
+#include "optlist.h"
+
+/* Name of the deity */
+char *privname = "Deity forgot to edit econfig";
+/* E-mail of the deity */
+char *privlog = "careless@invalid";
+/* Divine hosts and networks */
+char *privip = "127.0.0.1 ::1 ::ffff:127.0.0.1";
 
-char *privname = PRVNAM;       /* name of priv user */
-char *privlog = PRVLOG;        /* logname of priv user */
+char *post_crash_dump_hook = "";
 
-int WORLD_X = DEF_WORLD_X;     /* World size - x */
-int WORLD_Y = DEF_WORLD_Y;     /* World size - y */
+char *disabled_commands = "";
+
+int keep_journal = 0;          /* journal log file enabled */
+
+int WORLD_X = 64;              /* World size - x */
+int WORLD_Y = 32;              /* World size - y */
 
 int MARK_DELAY = 7200;         /* Seconds to bid on commodities */
 int TRADE_DELAY = 7200;                /* Seconds to bid on units */
 
 int m_m_p_d = 1440;            /* max mins of play per day (per country) */
-int s_p_etu = DEF_S_P_ETU;     /* seconds per Empire time unit */
-int etu_per_update = ETUS;     /* # of etu's per update, from misc.h */
-int adj_update = 0;            /* update time adjustment */
-int update_window = 0;         /* update window adjustment */
-int hourslop = 5;              /* amount of slop to match update times */
-char *update_times = "";       /* times regular update is allowed */
-int update_policy = 0;         /* update policy for regular updates */
-int update_demandpolicy = 2;   /* update policy for demand updates */
-int update_missed = 999;       /* demand updates missed before veto */
-int update_wantmin = 0;                /* number of votes required for demand update */
-int blitz_time = 10;           /* number of minutes between blitz updates */
-char *update_demandtimes = ""; /* times demand update is allowed */
+int etu_per_update = 60;       /* # of etu's per update */
+int update_window = 0;         /* update window adjustment, in seconds */
+int update_demand = UPD_DEMAND_NONE;
+int update_wantmin = 1;                /* votes required for demand update */
+char *update_demandtimes = ""; /* demand update time ranges */
 char *game_days = "";          /* days game is running */
 char *game_hours = "";         /* hours game is running */
 char *pre_update_hook = "";
@@ -82,8 +85,8 @@ int sect_mob_neg_factor = 2;  /* ETU/neg_factor = negative amount of mobility
                                   a sector has after being taken */
 
 int anno_keep_days = 7;                /* How long until annos expire (<0 never) */
-int news_keep_days = 10;       /* How long until news expire (<0 never) */
-int lost_items_timeout = 172800;       /* How long before removing from database */
+int news_keep_days = 10;       /* How long until news expire */
+int lost_keep_hours = 48;      /* How long until lost items expire */
 
 double combat_mob = 5.0;       /* how much mob do units spend for combat? */
 
@@ -99,24 +102,14 @@ double people_damage = 1.00;       /* Civs/mil/uw take this fraction of damage */
 double collateral_dam = 0.10;  /* Side effect damage to sector */
 double assault_penalty = 0.50; /* attack factor for para & assault troops */
 
-/* START_UNITS */
-#ifdef START_UNITS
-int start_unit_type[START_UNITS] = { 0, 1 };   /* type of unit */
-#endif /* START_UNITS */
-
-/* opt_FUEL */
-int fuel_mult = 10;            /* 1 fuel = 10 mob */
-
-int land_grow_scale = 2;       /* how fast eff grows for land units (xETUS) */
-int ship_grow_scale = 3;       /* how fast eff grows for ships (xETUS) */
-int plane_grow_scale = 2;      /* how fast eff grows for planes (xETUS) */
+float land_grow_scale = 2.0;   /* how fast eff grows for land units (xETUS) */
+float ship_grow_scale = 3.0;   /* how fast eff grows for ships (xETUS) */
+float plane_grow_scale = 2.0;  /* how fast eff grows for planes (xETUS) */
 
 double fgrate = 0.0012;                /* food growth rate (dt * fert) */
 double fcrate = 0.0013;                /* food cultivate rate (dt * workforce) */
 double eatrate = 0.0005;       /* food eating rate (dt * people) */
-/*double   eatrate     = 0.0001;*//* food eating rate (dt * people) */
 double babyeat = 0.0060;       /* food to mature 1 baby into a civilian */
-/*double   babyeat     = 0.0000;*//* food to mature 1 baby into a civilian */
 
 double obrate = 0.005;         /* other sectors birth rate */
 double uwbrate = 0.0025;       /* uncompensated worker birth rate */
@@ -124,16 +117,6 @@ double uwbrate = 0.0025;   /* uncompensated worker birth rate */
 int rollover_avail_max = 0;    /* max. avail that can roll over an update */
 
 /* opt_FALLOUT */
-/* these are the radioactive decay constants */
-/* fraction of commodity destroyed is
-   etus*fallout/(1000*melt_item_denom[item])
-   higher denominators for tougher commodities */
-int melt_item_denom[] =
-       /*   civ mil shell gun pet iron dust bar */
-{ 0, 4, 20, 80, 100, 50, 100, 100, 200,
-    2, 50, 100, 100, 2, 1000
-};
-       /*food oil lcm hcm UW rads */
 double decay_per_etu = 0.006;  /* This gives a half life of ? etus,
                                   about ? days.
                                   half life in Jt
@@ -146,7 +129,7 @@ double decay_per_etu = 0.006;       /* This gives a half life of ? etus,
                                   you can not get a precise number
                                   without intensive simulation
                                   (more than 3 digits). */
-double fallout_spread = 0.005; /* fraction of fallout that leaks into 
+double fallout_spread = 0.005; /* fraction of fallout that leaks into
                                   each surrounding sector */
 /* end opt_FALLOUT */
 
@@ -180,7 +163,7 @@ double hap_cons = 600000.0;
 double edu_cons = 600000.0;
 
 /* hap and edu avg mean that the weight on current happiness is
- *  (cur_hap * hap_avg + hap_prod * etu) / (hap_avg + etu);            */
+ *  (cur_hap * hap_avg + hap_prod * etu) / (hap_avg + etu); */
 float hap_avg = 16.0 * 3.0;
 float edu_avg = 16.0 * 12.0;
 
@@ -201,21 +184,19 @@ int at_least_one_100 = 1; /* init player with 100/100/100/100 sector? */
 float btu_build_rate = 0.0012; /* etu * civ * eff * btu_build_rate */
                                /* 8 * 999 * 100 * 0.0004 = 319 */
 int max_btus = 640;            /* maximum # of btu's */
-double powe_cost = 10.0;       /* btu cost to gen a power report */
 
 double buil_bt = 10.0;         /* tech level required to build a bridge */
 int buil_bh = 100;             /* hcm required to build a bridge */
-double buil_bc = 2000.0;       /* cash required to build a bridge */
+double buil_bc = 1000.0;       /* cash required to build a bridge */
 
 double buil_tower_bt = 100.0;  /* tech level required to build a tower */
 int buil_tower_bh = 400;       /* hcm required to build a bridge tower */
-double buil_tower_bc = 7500.0; /* cash required to build a bridge tower */
+double buil_tower_bc = 3000.0; /* cash required to build a bridge tower */
 
 /* opt_SLOW_WAR */
 int War_Cost = 1000;           /* Cost to declare war */
 
-/* opt_DRNUKE */
-float drnuke_const = .33;      /* research must be at least drnuke_const*tech */
+float drnuke_const = 0.0;      /* research must be at least drnuke_const*tech */
                                /* in order to build a nuke. For example, if
                                 * drnuke_const is .25, you need a 75 res to
                                 * build a nuke that takes 300 tech
@@ -233,8 +214,18 @@ float trade_ally_cut = 0.10;       /* 10% bonus for ally you trade with */
 
 int torpedo_damage = 40;       /* damage is X + 1dX + 1dX, so 40+1d40+1d40 */
 
+long start_cash = 25000;
+
 /* initial levels */
 float start_education = 0.0;
 float start_happiness = 0.0;
 float start_technology = 0.0;
 float start_research = 0.0;
+
+/* econfig keys */
+static int emp_config_dummy;
+struct keymatch configkeys[] = {
+#define        EMP_CONFIG_C_OUTPUT
+#include "econfig-spec.h"
+#undef EMP_CONFIG_C_OUTPUT
+};