]> git.pond.sub.org Git - empserver/blobdiff - src/lib/global/file.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / global / file.c
index 7ac86be4ec319d301079ba9431f74df89031cf01..11809e1084fb5c7a26ff7ed1d56a66e1a676c778 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-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  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.
  *
  *  ---
  *
@@ -31,6 +31,8 @@
  *     
  */
 
+#include <config.h>
+
 #include <stddef.h>
 #include "misc.h"
 #include "xy.h"
@@ -50,7 +52,6 @@
 #include "lost.h"
 #include "product.h"
 
-#include "gamesdef.h"
 #include "commodity.h"
 #include "nsc.h"
 
@@ -88,7 +89,7 @@
 
 struct empfile empfile[] = {
     /*
-     * How empfile[] is initialized:
+     * How this initializer works:
      *
      * Members uid, name, file, size, cadef, and the EFF_IMMUTABLE
      * bits of flags get their final value.
@@ -104,6 +105,11 @@ struct empfile empfile[] = {
      * ef_init().
      */
 
+    /*
+     * Keep in mind that player command arguments are matched against
+     * member name; no whitespace please.
+     */
+
     /* Dynamic game data */
     {EF_SECTOR, "sect", "sector", sect_ca,
      UNMAPPED_CACHE(struct sctstr, EFF_XY | EFF_OWNER)},
@@ -135,34 +141,59 @@ struct empfile empfile[] = {
      UNMAPPED_CACHE(struct comstr, 0)},
     {EF_LOST, "lost", "lostitems", lost_ca,
      UNMAPPED_CACHE(struct loststr, EFF_OWNER)},
+    {EF_REALM, "realm", "realms", realm_ca,
+     UNMAPPED_CACHE(struct realmstr, EFF_OWNER)},
 
     /* Static game data (configuration) */
-    {EF_SECTOR_CHR, "sect chr", NULL, dchr_ca, ARRAY_TABLE(dchr, EFF_CFG)},
-    {EF_SHIP_CHR, "ship chr", NULL, mchr_ca, ARRAY_CACHE(mchr, EFF_CFG)},
-    {EF_PLANE_CHR, "plane chr", NULL, plchr_ca, ARRAY_CACHE(plchr, EFF_CFG)},
-    {EF_LAND_CHR, "land chr", NULL, lchr_ca, ARRAY_CACHE(lchr, EFF_CFG)},
-    {EF_NUKE_CHR, "nuke chr", NULL, nchr_ca, ARRAY_CACHE(nchr, EFF_CFG)},
-    {EF_NEWS_CHR, "news chr", NULL, rpt_ca, ARRAY_TABLE(rpt, EFF_CFG)},
-    {EF_TREATY_FLAGS, "treaty flags", NULL, symbol_ca,
+    {EF_SECTOR_CHR, "sect-chr", "sect_def", dchr_ca, ARRAY_TABLE(dchr, EFF_CFG)},
+    {EF_SHIP_CHR, "ship-chr", "ship_def", mchr_ca, ARRAY_CACHE(mchr, EFF_CFG)},
+    {EF_PLANE_CHR, "plane-chr", "plane_def", plchr_ca, ARRAY_CACHE(plchr, EFF_CFG)},
+    {EF_LAND_CHR, "land-chr", "land_def", lchr_ca, ARRAY_CACHE(lchr, EFF_CFG)},
+    {EF_NUKE_CHR, "nuke-chr", "nuke_def", nchr_ca, ARRAY_CACHE(nchr, EFF_CFG)},
+    {EF_NEWS_CHR, "news-chr", NULL, rpt_ca, ARRAY_TABLE(rpt, EFF_CFG)},
+    {EF_TREATY_FLAGS, "treaty-flags", NULL, symbol_ca,
      PTR_CACHE(treaty_flags, EFF_CFG)},
-    {EF_ITEM, "item", NULL, ichr_ca, ARRAY_TABLE(ichr, EFF_CFG)},
-    {EF_INFRASTRUCTURE, "infrastructure", NULL, intrchr_ca,
+    {EF_ITEM, "item", "item_def", ichr_ca, ARRAY_TABLE(ichr, EFF_CFG)},
+    {EF_INFRASTRUCTURE, "infrastructure", "infrastructure_def", intrchr_ca,
      ARRAY_TABLE(intrchr, EFF_CFG)},
-    {EF_PRODUCT, "product", NULL, pchr_ca, ARRAY_TABLE(pchr, EFF_CFG)},
+    {EF_PRODUCT, "product", "product_def", pchr_ca, ARRAY_TABLE(pchr, EFF_CFG)},
     {EF_TABLE, "table", NULL, empfile_ca, ARRAY_TABLE(empfile, EFF_CFG)},
-    {EF_SHIP_CHR_FLAGS, "ship chr flags", NULL, symbol_ca,
+    {EF_SHIP_CHR_FLAGS, "ship-chr-flags", NULL, symbol_ca,
      PTR_CACHE(ship_chr_flags, EFF_CFG)},
-    {EF_PLANE_CHR_FLAGS, "plane chr flags", NULL, symbol_ca,
+    {EF_PLANE_CHR_FLAGS, "plane-chr-flags", NULL, symbol_ca,
      PTR_CACHE(plane_chr_flags, EFF_CFG)},
-    {EF_LAND_CHR_FLAGS, "land chr flags", NULL, symbol_ca,
+    {EF_LAND_CHR_FLAGS, "land-chr-flags", NULL, symbol_ca,
      PTR_CACHE(land_chr_flags, EFF_CFG)},
-    {EF_NUKE_CHR_FLAGS, "nuke chr flags", NULL, symbol_ca,
+    {EF_NUKE_CHR_FLAGS, "nuke-chr-flags", NULL, symbol_ca,
      PTR_CACHE(nuke_chr_flags, EFF_CFG)},
     {EF_META, "meta", NULL, mdchr_ca, PTR_CACHE(mdchr_ca, EFF_CFG)},
-    {EF_META_TYPE, "meta type", NULL, symbol_ca,
+    {EF_META_TYPE, "meta-type", NULL, symbol_ca,
      PTR_CACHE(meta_type, EFF_CFG)},
-    {EF_META_FLAGS, "meta flags", NULL, symbol_ca,
+    {EF_META_FLAGS, "meta-flags", NULL, symbol_ca,
      PTR_CACHE(meta_flags, EFF_CFG)},
+    {EF_MISSIONS, "missions", NULL, symbol_ca, PTR_CACHE(missions, EFF_CFG)},
+    {EF_PLANE_FLAGS, "plane-flags", NULL, symbol_ca,
+     PTR_CACHE(plane_flags, EFF_CFG)},
+    {EF_RETREAT_FLAGS, "retreat-flags", NULL, symbol_ca,
+     PTR_CACHE(retreat_flags, EFF_CFG)},
+    {EF_NATION_FLAGS, "nation-flags", NULL, symbol_ca,
+     PTR_CACHE(nation_flags, EFF_CFG)},
+    {EF_NATION_RELATIONS, "nation-relationships", NULL, symbol_ca,
+     PTR_CACHE(nation_relations, EFF_CFG)},
+    {EF_LEVEL, "level", NULL, symbol_ca, PTR_CACHE(level, EFF_CFG)},
+    {EF_AGREEMENT_STATUS, "agreement-status", NULL, symbol_ca,
+     PTR_CACHE(agreement_statuses, EFF_CFG)},
+    {EF_PLAGUE_STAGES, "plague-stages", NULL, symbol_ca,
+     PTR_CACHE(plague_stages, EFF_CFG)},
+    {EF_PACKING, "packing", NULL, symbol_ca, PTR_CACHE(packing, EFF_CFG)},
+    {EF_RESOURCES, "resources", NULL, symbol_ca, PTR_CACHE(resources, EFF_CFG)},
+    {EF_NATION_STATUS, "nation-status", NULL, symbol_ca,
+     PTR_CACHE(nation_status, EFF_CFG)},
+    {EF_SECTOR_NAVIGATION, "sector-navigation", NULL, symbol_ca,
+     PTR_CACHE(sector_navigation, EFF_CFG)},
+
+    /* Views */
+    {EF_COUNTRY, "country", NULL, cou_ca, UNMAPPED_CACHE(struct natstr, 0)},
 
     /* Sentinel */
     {EF_BAD, NULL, NULL, NULL, 0, 0, NULL, 0, 0, 0, 0, -1, NULL, NULL, NULL},