]> git.pond.sub.org Git - empserver/blob - src/lib/global/file.c
(empfile, empfile_ca): New struct empfile member ef_uid.
[empserver] / src / lib / global / file.c
1 /*
2  *  Empire - A multi-player, client/server Internet based war game.
3  *  Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
4  *                           Ken Stevens, Steve McClure
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  *  ---
21  *
22  *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
23  *  related information and legal notices. It is expected that any future
24  *  projects/authors will amend these files as needed.
25  *
26  *  ---
27  *
28  *  file.c: Empire game data file descriptions.
29  * 
30  *  Known contributors to this file:
31  *     
32  */
33
34 #include <stddef.h>
35 #include "misc.h"
36 #include "xy.h"
37 #include "loan.h"
38 #include "nsc.h"
39 #include "nuke.h"
40 #include "plane.h"
41 #include "ship.h"
42 #include "land.h"
43 #include "sect.h"
44 #include "trade.h"
45 #include "treaty.h"
46 #include "file.h"
47 #include "power.h"
48 #include "news.h"
49 #include "nat.h"
50 #include "lost.h"
51 #include "product.h"
52
53 #include "gamesdef.h"
54 #include "commodity.h"
55 #include "nsc.h"
56
57 struct empfile empfile[] = {
58     /* Dynamic game data */
59     {EF_SECTOR, "sect", "sector", EFF_XY | EFF_OWNER,
60      0, sizeof(struct sctstr), NULL, NULL, NULL,
61      -1, -1, 0, 0, NULL, 0, sect_ca},
62     {EF_SHIP, "ship", "ship", EFF_XY | EFF_OWNER | EFF_GROUP,
63      0, sizeof(struct shpstr), NULL, NULL, NULL,
64      -1, -1, 0, 0, NULL, 0, ship_ca},
65     {EF_PLANE, "plane", "plane", EFF_XY | EFF_OWNER | EFF_GROUP,
66      0, sizeof(struct plnstr), NULL, NULL, NULL,
67      -1, -1, 0, 0, NULL, 0, plane_ca},
68     {EF_LAND, "land", "land", EFF_XY | EFF_OWNER | EFF_GROUP,
69      0, sizeof(struct lndstr), NULL, NULL, NULL,
70      -1, -1, 0, 0, NULL, 0, land_ca},
71     {EF_NUKE, "nuke", "nuke", EFF_XY | EFF_OWNER,
72      0, sizeof(struct nukstr), NULL, NULL, NULL,
73      -1, -1, 0, 0, NULL, 0, nuke_ca},
74     {EF_NEWS, "news", "news", 0,
75      0, sizeof(struct nwsstr), NULL, NULL, NULL,
76      -1, -1, 0, 0, NULL, 0, news_ca},
77     {EF_TREATY, "treaty", "treaty", 0,
78      0, sizeof(struct trtstr), NULL, NULL, NULL,
79      -1, -1, 0, 0, NULL, 0, treaty_ca},
80     {EF_TRADE, "trade", "trade", 0,
81      0, sizeof(struct trdstr), NULL, NULL, NULL,
82      -1, -1, 0, 0, NULL, 0, trade_ca},
83     {EF_POWER, "pow", "power", 0,
84      0, sizeof(struct powstr), NULL, NULL, NULL,
85      -1, -1, 0, 0, NULL, 0, NULL},
86     {EF_NATION, "nat", "nation", EFF_OWNER,
87      0, sizeof(struct natstr), NULL, NULL, NULL,
88      -1, -1, 0, 0, NULL, 0, nat_ca},
89     {EF_LOAN, "loan", "loan", 0,
90      0, sizeof(struct lonstr), NULL, NULL, NULL,
91      -1, -1, 0, 0, NULL, 0, loan_ca},
92     {EF_MAP, "map", "map", 0,
93      0, DEF_WORLD_X * DEF_WORLD_Y / 2, NULL, NULL, NULL,
94      -1, -1, 0, 0, NULL, 0, NULL},
95     {EF_BMAP, "bmap", "bmap", 0,
96      0, DEF_WORLD_X * DEF_WORLD_Y / 2, NULL, NULL, NULL,
97      -1, -1, 0, 0, NULL, 0, NULL},
98     {EF_COMM, "commodity", "commodity", 0,
99      0, sizeof(struct comstr), NULL, NULL, NULL,
100      -1, -1, 0, 0, NULL, 0, commodity_ca},
101     {EF_LOST, "lost", "lostitems", EFF_OWNER,
102      0, sizeof(struct loststr), NULL, NULL, NULL,
103      -1, -1, 0, 0, NULL, 0, lost_ca},
104
105     /* Static game data (configuation) */
106     {EF_SECTOR_CHR, "sect chr", NULL, EFF_MEM,
107      0, sizeof(dchr[0]), NULL, NULL, NULL,
108      -1, -1, 0, 0, (char *)dchr, 0, dchr_ca},
109     {EF_SHIP_CHR, "ship chr", NULL, EFF_MEM,
110      0, sizeof(mchr[0]), NULL, NULL, NULL,
111      -1, -1, 0, 0, (char *)mchr, 0, mchr_ca},
112     {EF_PLANE_CHR, "plane chr", NULL, EFF_MEM,
113      0, sizeof(plchr[0]), NULL, NULL, NULL,
114      -1, -1, 0, 0, (char *)plchr, 0, plchr_ca},
115     {EF_LAND_CHR, "land chr", NULL, EFF_MEM,
116      0, sizeof(lchr[0]), NULL, NULL, NULL,
117      -1, -1, 0, 0, (char *)lchr, 0, lchr_ca},
118     {EF_NUKE_CHR, "nuke chr", NULL, EFF_MEM,
119      0, sizeof(nchr[0]), NULL, NULL, NULL,
120      -1, -1, 0, 0, (char *)nchr, 0, nchr_ca},
121 #if 0
122     /* FIXME rpt[] lacks sentinel, xdchr() doesn't terminate */
123     {EF_, "news chr", NULL, EFF_MEM,
124      0, sizeof(rpt[0]), NULL, NULL, NULL,
125      -1, -1, 0, 0, (char *)rpt, 0, rpt_ca},
126 #endif
127     {EF_TREATY_CHR, "treaty chr", NULL, EFF_MEM,
128      0, sizeof(tchr[0]), NULL, NULL, NULL,
129      -1, -1, 0, 0, (char *)tchr, 0, tchr_ca},
130     {EF_ITEM, "item", NULL, EFF_MEM,
131      0, sizeof(ichr[0]), NULL, NULL, NULL,
132      -1, -1, 0, 0, (char *)ichr, 0, ichr_ca},
133     {EF_INFRASTRUCTURE, "infrastructure", NULL, EFF_MEM,
134      0, sizeof(intrchr[0]), NULL, NULL, NULL,
135      -1, -1, 0, 0, (char *)intrchr, 0, intrchr_ca},
136     {EF_PRODUCT, "product", NULL, EFF_MEM,
137      0, sizeof(pchr[0]), NULL, NULL, NULL,
138      -1, -1, 0, 0, (char *)pchr, 0, pchr_ca},
139     {EF_TABLE, "table", NULL, EFF_MEM,
140      0, sizeof(empfile[0]), NULL, NULL, NULL,
141      -1, -1, 0, 0, (char *)empfile, 0, empfile_ca},
142     {EF_SHIP_CHR_FLAGS, "ship chr flags", NULL, EFF_MEM,
143      0, sizeof(ship_chr_flags[0]), NULL, NULL, NULL,
144      -1, -1, 0, 0, (char *)ship_chr_flags, 0, lookup_ca},
145     {EF_PLANE_CHR_FLAGS, "plane chr flags", NULL, EFF_MEM,
146      0, sizeof(plane_chr_flags[0]), NULL, NULL, NULL,
147      -1, -1, 0, 0, (char *)plane_chr_flags, 0, lookup_ca},
148     {EF_LAND_CHR_FLAGS, "land chr flags", NULL, EFF_MEM,
149      0, sizeof(land_chr_flags[0]), NULL, NULL, NULL,
150      -1, -1, 0, 0, (char *)land_chr_flags, 0, lookup_ca},
151     {EF_NUKE_CHR_FLAGS, "nuke chr flags", NULL, EFF_MEM,
152      0, sizeof(nuke_chr_flags[0]), NULL, NULL, NULL,
153      -1, -1, 0, 0, (char *)nuke_chr_flags, 0, lookup_ca},
154
155     /* Sentinel */
156     {EF_BAD, NULL, NULL, 0,
157      0, 0, NULL, NULL, NULL,
158      -1, -1, 0,0,NULL, 0, NULL}
159 };