(banfil, authfil): Remove. Matching user is useless, because the
player can send whatever he wants. Banning IPs is better done with a
packet filter. That leaves restricting deity IPs.
(privip): New econfig key to restrict deity IPs.
(may_play): Implement it.
(match_user): Unused, remove.
(may_play): New, factored out of play_cmd() and kill_cmd().
(play_cmd, kill_cmd): Use it.
(player_main): Don't check authfil, caller takes care of that.
Permit field repetition in each part of vertically split tables,
provided the values all match:
(caseen): New.
(xundump): Initialize and finalize it.
(xundump2): Update it.
(deffld): Deal with repetition.
(fldval_must_match): New, considers repetition as well as NSC_CONST.
(setnum, setstr): Use it.
(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.
(builtindir): New econfig key, variable and make variable.
(subst.in): Substitute it. Fix prerequisites.
(read_builtin_tables): New.
(main): Call it. This doesn't do anything, because no builtin tables
have been defined.
(empfile, SYMTAB): Reorder so that symbol tables are together. Sort
them alphabetically. Factor out commonalities into new SYMTAB(). No
functional changes.
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.
Change xdump nat to show only own country, and xdump cou to show to
deities what xdump nat used to show:
(cou_ca): Remove initializer.
(ef_init_srv): Initialize cou_ca[] from nat_ca[].
(xdvisible): Change case EF_NATION to return true only for owner
even for deities.
Ron Koenderink [Thu, 16 Feb 2006 02:14:08 +0000 (02:14 +0000)]
(buil, drnuke_const, opt_DRNUKE, show, show_nuke_build)
(show_nuke_capab, vers, xdvisible, build.t, Options.t):
Remove opt_DRNUKE and replace with the following check
drnuke_const > MIN_DRNUKE_CONST.
Set MIN_DRNUKE_CONST to 0.001 to prevent issues with tiny values.
Change the default drnuke_const to 0.0 because in the stock game
opt_DRNUKE was disabled.
Support vertically split configuration tables (human-readable only):
(ellipsis): New.
(xuheader1): Initialize it. Compute nflds. Allow repetition of index
field in continued tables.
(xundump): Don't set nflds.
(xufldname, defellipsis): Accept ... and call new defellipsis().
(xufldname, chkflds): Update and elaborate check for missing fields,
move it to new chkflds(). Require repetition of index field in
continued tables.
(xundump2): New, factored out of xundump(). Parse continued tables.
Xdumps don't contain records not in use, cope with that:
(xundump1, setnum, setstr, getobj, cur_id): Delay table lookup until
first field is about to be assigned.
(xundump1): Record largest ID, because it's no longer given by final
value of row.
(xuheader1, xundump1, xundump): Move initialization of cur_type to
xundump().
(xundump1): Don't suppress table growth just because it has NSC_CONST
selectors. That's wrong for EF_SECTOR_CHR and EF_PRODUCT. Don't
allow table shrinking just because it has no NSC_CONST selectors.
That's wrong for EF_NEWS_CHR. Allow it for game state and unit
characteristics.
(has_const): Unused, remove.
Ron Koenderink [Thu, 9 Feb 2006 13:31:05 +0000 (13:31 +0000)]
(lchr_ca[]): Change the name for l_rnd from "rad" to "rmax".
This removes a conflict between rad items and reaction radius.
Now the name matches the equivalent name in land_ca[].
Accept fields out of order in human-readable syntax (indexes must
still be in order), support abbreviated field names:
(nxt_sel, nxt_idx, nxtfld, ca4fld): Remove.
(nflds, fldca, fldidx, caflds, getfld): New.
(xundump): Initialize and finalize them.
(xundump1): New, factored out of xundump().
(deffld): Match names, record field order in fldca[], fldidx[] for
getfld(). Use caflds[] to detect duplicates.
(xufldname): Catch negative index. Used to pass it to deffld(), which
now interprets it as no index.
(setnum, setstr, setsym, mtsymset, add2symset): Use getfld().
(xufld): Improve error message.
(setstr): Fix for NULL strings.
(xuheader): Catch null ef_cadef().
(xuheader): Don't oops when an unexpected table can't be undumped.
The separation between parsing and semantic actions is awkward and
leaks memory; rework it:
(deffld): New; semantic action for field headers.
(xufldname): Use it instead of storing a value for xucolumnheader().
(xucolumnheader): Remove, use xuflds() directly instead.
(setnum, setstr, setsym): New; semantic actions for field values.
(xufld): Use it instead of storing a value for xuloadrow().
(xuloadrow): Remove. Was incomplete.
(xufldname, xufld, xuflds): Remove parameter values. Callers
changed.
(cur_type, cur_obj, nxt_sel, nxt_idx, nxtfld, ca4fld, getsymtab): New
helpers.
(xundump): Initialize them.
(enum_value, value, freeflds, xunsymbol): Remove.
(mtsymset, add2symset): New.
(xufld): Use them to build a symbol set along the parse.
(xufldname, xufld, xuheader, xutrailer, xundump): Increment lineno
when and only when a linefeed is consumed, to make sure it is correct.
Move some semantic checks so that errors get reported for the correct
line.
(xundump): Use compare filenames as pointers, not strings, when
checking whether to reset lineno.
(xundump): Keep empfile[type] consistent during parse, to make
ef_ptr() usable.
(xundump): Don't call ep->init() on sentinels.
(xuinitrow): Unused, remove.
(xufldname, xufld): New, factored out of xuflds and specialized for
headers and for body lines, respectively.
(xflds): Call them through new parameter parse. Callers changed.
(realm_ca): Remove selector uid. It's not useful for players, and not
needed for xdump, because it doesn't occur as ca_table.
(lost_ca): Remove selector uid. Reasons as for realm_ca. The value
is incorrect in unused records, which is semantically tolerable, but
needlessly complicated to check in ef_verify.c.
(news_ca): Remove selector uid. Reasons as for realm_ca, plus the
value is incorrect, because nws_uid is not used.
When sources.mk is needed to find directories, don't test whether it's
there, just use it. If it's not there, things will fail down the
road. Better to fail early.
Ron Koenderink [Sun, 5 Feb 2006 17:37:58 +0000 (17:37 +0000)]
(vers): Add collateral damage matrix to version report.
Add unit_damage and collateral_dam to the collateral damage matrix.
Move people_damage into matrix.
Ron Koenderink [Sun, 5 Feb 2006 15:52:26 +0000 (15:52 +0000)]
(vers): Add the following the configuration values to the version report:
torpedo_damage, flakscale, people_damage, assault_penalty,
decay_per_etu, fallout_spread, fuel_mult, max_btus and max_idle.
Ron Koenderink [Thu, 2 Feb 2006 13:20:14 +0000 (13:20 +0000)]
(vers): Add the following econfig values to version report:
MARK_DELAY, TRADE_DELAY, mission_mob_cost ,
money_ship, money_plane, money_land,
fort_max_interdiction_range, ship_max_interdiction_range,
land_max_interdiction_range, combat_mob and
sect_mob_neg_factor.