Commit graph

58 commits

Author SHA1 Message Date
654335c621 New Empire table game, to be used for global stuff:
(gamestr, EF_GAME, game_ca): New.
(empfile): Declare the table.
(ef_open_srv, ef_close_srv): Open and close it.
(main): Create it.
(empobj_storage): New member game.

(EF_DYNMAX): New.
(EF_IS_GAME_STATE): Use it.
2007-07-14 14:49:58 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
cf1c69543e (empfile): Fix the previous revision: pretended ichr[], pchr[], dchr[]
and intrchr[] were still compile-time initialized.
2006-06-22 19:47:00 +00:00
3aea20e1de (ichr, pchr, dchr, intrchr): Move initializer to new builtin config
files item.config, product.config, sect.config, infra.config.
(empfile): Declare the new config files.  Reorder table entries so
that read_builtin_tables() reads the config files in the right order.

(bigcity_dchr, opt_BIG_CITY, init_dchr): Remove.  Deities can edit
sect.config instead.
2006-06-04 09:34:39 +00:00
0b1f561e97 Comments, whitespace. 2006-06-02 05:49:29 +00:00
89cd9b7ca0 (EF_NATION_REJECTS, nation_rejects): New.
(empfile): Add it.
(nat_ca): Use it.
2006-05-18 19:42:23 +00:00
ce79ad5a19 Fix another insufficiently parenthesized macro expansion. 2006-04-30 16:25:58 +00:00
f5a9284867 Update known contributors comment. 2006-02-24 21:35:27 +00:00
b4161cd7e2 (mchr, plchr, lchr, nchr): Move initializer to new builtin config
files ship.config, plane.config, land.config, nuke.config.
(empfile): Declare the new config files.
(install, installdirs): Install them.
(builtins): New make variable.
2006-02-19 09:15:46 +00:00
fd461e7bf5 (empfile, SYMTAB): Reorder so that symbol tables are together. Sort
them alphabetically.  Factor out commonalities into new SYMTAB().  No
functional changes.
2006-02-18 15:02:18 +00:00
bd65a84eb5 New way to read configuration tables:
(config_tables): New econfig key.
(read_config_tables): New, implements config_tables.
(main): Call it.  Need to call ef_init() and chdir(configdir) first.
(ef_init_srv): Don't call ef_init(), since main() did it already.

Remove old way to do the same:
(ef_load): Remove, along with calls.
(empfile): Set configuration tables' member file back to NULL.
2006-02-18 13:57:52 +00:00
Ron Koenderink
7b9fdf8b95 (show_news, news, empfile[], page_headings[], page_headings_symbols[]):
Change page_headings[] to struct symbol and removed
page_headings_symbols[].
2006-01-30 22:26:48 +00:00
Ron Koenderink
f438b74e85 (EF_PAGE_HEADINGS, page_headings_symbols, M_NOTUSED): New.
(empfile): Add it.
(rpt_ca): Use it.
2006-01-29 18:40:11 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
Ron Koenderink
4f20f3dd9c (EF_SECTOR_NAVIGATION, sector_navigation): New.
(empfile): Add it.
(dchr_ca): Use it.
(NAV_NONE): New.
2006-01-17 21:42:02 +00:00
9eba732cc3 (EF_COUNTRY, cou_ca): New.
(empfile): Add it.
(xdvisible): Deal with it.
(ef_open_srv, ef_close_srv): Set it up.
(ef_init_view, ef_fina_view): New.
2006-01-14 16:28:33 +00:00
Ron Koenderink
45adbdb00e Move realms from the nation file into a new realms file:
(boundstr, realmstr): Rename, new members ef_type, r_cnum, r_uid,
r_realm, r_timestamp.
(natstr): Remove member nat_b[].
(EF_REALM, realm_ca): New.
(empfile): Add it.
(ef_open_srv, ef_close_srv, main): Deal with new file.
(getrealm, putrealm): New.
(add, new, real, list_realm, sarg_getrange): Use them.
2006-01-13 13:18:56 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
a5c87a2b54 (EF_NATION_STATUS, nation_status): New.
(empfile): Add it.
(nat_ca): Use it.
2006-01-04 23:15:47 +00:00
028a1bf3d8 (EF_RESOURCES, resources): New.
(empfile): Add it.
(pchr_ca): Use it.
2005-12-31 10:29:32 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
d343fee727 Remove superflous include. 2005-12-11 10:09:09 +00:00
871ed677c2 (empfile): Space in Empire names requires players to quote the names
on the command line.  Replace by dash.
2005-12-01 19:53:51 +00:00
Ron Koenderink
555de3100c (dchr_ca, packing, empfile): Add packing symbol table.
(sect_ca, ship_ca, land_ca, plague_stages, empfile):
Add plague stages symbol table.

(treaty_ca, loan_ca, agreement_statuses, empfile):
Add agreement status symbol table.
Combine treatystatuses (TS_FREE, TS_SIGNED and TS_PENDING)
and loan statuses (LS_FREE, LS_SIGNED and LS_PENDING)
into a single agreement status.

(pchr_ca, level, empfile): Add packing symbol table.
2005-11-13 12:27:02 +00:00
af824c3ed1 (EF_MISSION_FLAGS, EF_MISSIONS, mission_flags, missions): Rename, as
these are not flags.
2005-11-12 17:29:11 +00:00
Ron Koenderink
d8422caa84 (init_server, ef_load, xundump): Add ability to customize game
configurations.  The custom game configurations are loaded via
text files in the data directory.  Closes #752881.
2005-11-12 16:53:52 +00:00
Ron Koenderink
0a44c4893e (plane_flags, plane_ca): Add plane flags table.
(retreat_flags, ship_ca, land_ca, plane_ca): Add retreat flags table.

(nation_flags, nation_relations, nat_ca): Add nation flags and
nation relations tables.

(empfile_ca): Remove flags and file name fields.
They are internal and not needed by the client.
2005-11-09 22:56:43 +00:00
Ron Koenderink
23f134aa75 (empfile,mission_flags,ship_ca,land_ca,plane_ca): Add mission flags table. 2005-11-06 13:43:09 +00:00
41bf5be715 (UNMAPPED_INIT, UNMAPPED_CACHE, ARRAY_INIT, ARRAY_TABLE, PTR_INIT)
(PTR_CACHE): Rename.

(ARRAY_CACHE): New.
(empfile): Use it to set csize of elements EF_SHIP_CHR, EF_PLANE_CHR,
EF_LAND_CHR, EF_NUKE_CHR.
(ef_init_chr): Now that empfile[]'s initializer sets csize, remove the
temporary csize initialization here.  The value wasn't correct, but
better than nothing.
2005-11-03 18:25:26 +00:00
b2ae3257ca (empfile): Rename member ef_uid to uid for consistency with other
members.

(empfile): Reorder members for clearer documentation.

(EFF_IMMUTABLE): New.
(EFF_OPEN): Remove, use ~EFF_IMMUTABLE.

(empfile): Don't initialize member size to a useless value for EF_MAP
and EF_BMAP.  ef_init() writes the real value.
2005-10-30 12:50:13 +00:00
b96b9baced (rpt, page_headings): Declare with array size. Define without.
(empfile): Correctly initialize members cids, csize, fids for all
EFF_STATIC tables except EF_SHIP_CHR, EF_PLANE_CHR, EF_LAND_CHR,
EF_NUKE_CHR, EF_META and the symbol tables.
2005-10-29 14:48:32 +00:00
ef48271974 (EF_TREATY_CHR, EF_TREATY_FLAGS): Rename for consistency with other flags.
(treaty_ca): Add missing EF_TREATY_FLAGS to selectors acond, bcond.
2005-10-29 14:36:10 +00:00
e612db5cb6 (tchrstr, tchr_ca): Remove, use struct symbol and symbol_ca. Users
changed.
(tchr, treaty_flags): Rename for consistency with other flags.
2005-10-29 14:10:23 +00:00
02ec5df820 (lookup, symbol): Rename. Rename members to match selectors and
better reflect their purpose.  Users changed.
(lookup_ca, symbol_ca): Rename.
2005-10-29 07:46:42 +00:00
19f2948620 (rpt): Add sentinel.
(EF_NEWS_CHR): New.
(empfile): Add its entry.
2005-10-29 06:27:00 +00:00
Ron Koenderink
551263cb07 (empfile,mdchr_ca,meta_type,meta_flags):
Add meta table and associated symbol tables.
2005-10-25 00:37:59 +00:00
babf467e15 (EFF_STATIC): New.
(empfile): Use it.
(ef_open): Oops on it (not implemented).
(ef_close): Implement it (trivial).
2005-10-24 23:35:18 +00:00
64d8f6babe (ef_open, EFF_RDONLY, EFF_CREATE, EFF_OPEN): Replace mode parameter
(really open flags, not mode) by new flags EFF_RDONLY, EFF_CREATE.
Open flags were needlessly general.  Callers changed.
(empfile): Member mode now unused, remove.
2005-10-24 18:18:59 +00:00
Ron Koenderink
898aaf3d3d (empfile, empfile_ca): New struct empfile member ef_uid. 2005-10-22 19:10:22 +00:00
Ron Koenderink
fcf5c59513 (castr,empfile,ship_chr,plane_chr,land_chr,nuke_chr):
Add table index to castr to create a reference to the symbol table.
Add "ship chr flags" table to empfile.
Add "plane chr flags" table to empfile.
Add "land chr flags" table to empfile.
Add "nuke chr flags" table to empfile.
Add EF_SHIP_CHR_FLAGS reference to ship_chr.
Add EF_PLANE_CHR_FLAGS reference to plane_chr.
Add EF_LAND_CHR_FLAGS reference to land_chr.
Add EF_NUKE_CHR_FLAGS reference to nuke_chr.

(show_ship_capab,show_plane_capab,show_land_capab,
show_nuke_capab,ship_flags,land_flags,plane_flags,nuke_flags):
Move ship_flags nsc.c from show.c
Rename ship_flags to ship_chr_flags.
Move plane_flags nsc.c from show.c
Rename plane_flags to plane_chr_flags.
Move land_flags nsc.c from show.c
Rename land_flags to land_chr_flags.
Move nuke_flags nsc.c from show.c
Rename nuke_flags to nuke_chr_flags.
This is to accomodate future symbol table for EF_PLANE table.
2005-10-22 16:39:45 +00:00
Ron Koenderink
cf4faac293 (ef_init): Remove cadef member from fileinit,
insert directly into the empfile structure.
Add ef_type member to fileinit to identify rows with data.
Remove unused rows of fileinit.
2005-10-22 13:55:04 +00:00
Ron Koenderink
29d21997b9 (empfile[]) Add table of tables to empfile[]. 2005-10-22 12:38:58 +00:00
0ab9260151 (empfile, chr_camap): Merge chr_camap[] into empfile[]. No existing
user sees the new elements of empfile[].
(EF_SECTOR_CHR, EF_SHIP_CHR, EF_PLANE_CHR, EF_LAND_CHR, EF_NUKE_CHR)
(EF_TREATY_CHR, EF_ITEM, EF_INFRASTRUCTURE, EF_PRODUCT): New.  Not yet
used.
(my_ef_byname): Replacement for ef_byname() that sees the new
elements.
(xdchr): Work with empfile[] instead of chr_camap[].
(xdump): Use my_ef_byname() instead of ef_byname() and
chridx_by_name().
(camap, chr_camap, chridx_by_name): Remove.
2005-10-21 19:38:37 +00:00
ff8c7c249a (empfile): Member itemoffs is unused since file.c rev. 1.15; remove. 2005-09-30 20:02:57 +00:00
Marc Olzheim
84bc824f65 Change 0 to NULL for pointer initializations. No functional changes. 2005-08-22 18:52:43 +00:00
326ac671ba (EFF_OWNER): The assertion that EFF_OWNER implies ef_read() sets
player->owner is no longer used.  Use it to indicate that owner can be
accessed through struct genitem, similar to EFF_XY and EFF_GROUP.
(xdump): Fix ownership checking.  Old version worked only when
nxtitem() set player->owner.

(empfile): Set EFF_OWNER for EF_LOST.  This fixes `xdump lost'
disclosing other countries' losses.
(loststr): Document implications of EFF_OWNER.

(empfile): Set EFF_OWNER for EF_NATION.
(natstr): Rearrange members for EFF_OWNER, document.
(nat_ca): Unused so far.  Clean it up, add most missing selectors.
(fileinit): Use it.  This implements `xdump nation'.

(fileinit): Simplify setting map file size.
2005-05-29 14:14:33 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
7f000ce9cc Fix ugly line breaks. 2005-03-10 19:17:15 +00:00
29da4b6cf4 (empfile, teldir, motdfil, downfil, disablefil, telfil, annfil)
(banfil, authfil, timestampfil): Make file names relative to DATADIR.
(main): emp_server and files change to the data directory.  fairland
has to write newcap_script to the initial current directory, so it
keeps it and makes file names relative to DATADIR absolute.
(fixup_files): Nothing to do, remove.  This fixes the following bug:
fixup_files() formed file names by appending ep->name instead of the
base name of ep->file to datadir.  Thus, fixup_files() changed file
names even when datadir had the compiled-in value.  When emp_config()
couldn't open econfig, it failed to call fixup_files(), and different
file names got used.  Note that with this revision the file names
revert to the names used before fixup_files() was introduced.  Closes
#1146080.
(print_config): Printing file names as comments is not really useful,
remove.
(otherfiles, ofiles): Unused, remove.
(emp_config, main): Previously, pconfig had to call emp_config() even
when it didn't want to read econfig, just to run fixup_files().  This
is no longer necessary.  Simplify.
2005-03-09 18:44:50 +00:00