Commit graph

80 commits

Author SHA1 Message Date
4ef3574427 WIP empdump, can't shrink tables 2008-02-26 08:18:58 +01:00
b9c725224e Make xdump code available for future use outside the server
Move the bits useful there from src/lib/commands/xdump.c to new
include/xdump.h and src/lib/common/xdump.c.
2008-02-26 08:09:52 +01:00
d83dd2f5e4 Prepare some xdump code for future use outside the server
We don't have player->cnum, player->god and pr() there.  Pass
parameters instead.
2008-02-26 08:09:52 +01:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
96b20c90b2 (xdump): Fix test whether to deny access to game state. Rev. 1.72
added that test to make xdump available before break, and faithfully
denied access exactly when xdump wasn't available before.  This denied
access when maximum minutes per day were exceeded.  Don't.
2007-12-08 18:05:51 +00:00
7dd8b8a305 New xdump updates:
(EF_UPDATES, update_ca): New.
(empfile): Add it.
(update_time): Move to src/lib/global/updtime.c.
2007-07-18 06:16:33 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
ed88f3140d (EF_IS_VIEW): New.
(xdump): Use it to deny access to views when denying access to game
state.  Fixes the previous revision.
2006-08-13 07:29:30 +00:00
f7233ff841 Allow xdump before break; partial solution for #1417871:
(player_coms): Set xdump's c_permit to VIS.
(xdump): Deny countries that couldn't run xdump before access to game
state.
2006-08-13 07:13:37 +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
Ron Koenderink
79ee88f7c6 (nxtitemp, trade_getitem, trade_desc, trade_check_item_ok, nxtitem,
oprange, show_mission, nameofitem, build_mission_list_type,
unit_map, xdvisible, trdswitchown, ontradingblock, trad, check_trade,
unit_type_name, start_stop_unit, scut, scra, mission, multifire,
perform_mission, fuel, NSC_GENITEM): Replace struct genitem with
struct empobj.  Remove genitem.h and create a new file empobj.h.
Replace multiple instances of unions of ef_type structures with
one standard union empobj_storage which is a superset of the individual
instances.
2006-07-07 15:15:43 +00:00
c432e3107d Symbolic names for table entries in conditionals, closes #928376:
(ef_elt_byname): New.
(nstr_match_val): Use it to generalize to arbitrary table with
uniquely named elements.  Use ca_type to find table, remove parameter
type.  Callers changed.
(nstr_mkselval): Adapt sanity check accordingly.
(NSC_TYPEID): No longer needed, remove, users changed to use
appropriate integer type instead.  This fixes signedness of sector
selectors des and newdes.
(meta_type): Remove entry for NSC_TYPEID.
(nstr_coerce_val): Can't detect typeid - integer mismatch anymore.
Was nice to have; perhaps revive it later.
2006-06-01 18:48:42 +00:00
93b6a54356 (nat_ca, cou_ca, ef_init_srv, xdvisible): Plug major information leak:
nat_ca[] was designed for visibility to the owner only, while cou_ca[]
was designed for the public.  xdvisible() implemented that for xdump.
But selectors don't care for that!  Since nat_ca[] applies to
EF_NATION, it must be for public visibility.  Broken in 4.2.21.  Fix
by exchanging contents of nat_ca[] and and cou_ca[].  This breaks
clients relying on xdump.
2006-05-22 20:59:11 +00:00
8f998de170 Remove dead code. 2006-04-30 08:43:28 +00:00
071bf4da06 (xdvisible): Add case EF_REALM. Should have been added along with
EF_REALM (file.h rev. 1.52).  This made xdump leak everybody's realms.
2006-04-23 12:33:33 +00:00
6fee3f4535 (CANT_REACH): New. Use it instead of CANT_HAPPEN() where possible.
(oops): Cope with NULL argument passed by CANT_REACH().
2006-04-17 17:36:07 +00:00
4c6fb12377 Code formatting. No functional changes. 2006-03-26 13:52:23 +00:00
c52a9a2822 New doc/xdump. 2006-03-06 18:27:37 +00:00
433bcb0d19 (xdump): Nicer prompts. 2006-02-26 18:16:10 +00:00
2ddc989e09 Fit for the general public, not just for GUINEA_PIGS. Closes #928396. 2006-02-19 18:47:50 +00:00
58f67c8e19 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.
2006-02-17 18:38:50 +00:00
09773ca8cc (xdvisible): Fix case EF_NATION for deities not to return true for
STAT_UNUSED.
2006-02-16 21:49:27 +00:00
Ron Koenderink
b7d0b66161 (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.
2006-02-16 02:14:08 +00:00
c50c2d2518 (xdeval): Passed uninitialized val->val_as.sym.len to nstr_exec_val(),
which broke NSC_STRINGY.  Initialize from new parameter len.  Callers
changed.
2006-02-11 07:25:28 +00:00
5d50b2accf Doc update. 2006-02-09 19:48:21 +00:00
Ron Koenderink
aaea73a595 Update comment to indicate page_headings[] is done. 2006-01-29 19:29:10 +00:00
b4a76e04a3 (xdver): Dump version string. 2006-01-28 17:26:05 +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
847bf6901c (xdvisible): Fix the nuke-chr case to work for deities. 2006-01-21 17:35:13 +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
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
8b16c31223 Change nation status from bits to a simple enum:
(nat_status, STAT_UNUSED, STAT_VIS, STAT_ACTIVE): New.
(STAT_NEW, STAT_SANCT, STAT_GOD): Change into nat_status members.
(STAT_INUSE, STAT_NORM): Remove.
(natstr): Use new nat_status for nat_stat.
    New value       Old value
    STAT_UNUSED     0
    STAT_NEW        STAT_INUSE | STAT_NEW
    STAT_VIS        STAT_INUSE
    STAT_SANCT      STAT_INUSE | STAT_SANCT
    STAT_ACTIVE     STAT_INUSE | STAT_NORM
    STAT_GOD        STAT_INUSE | STAT_NORM | STAT_GOD
Users changed.
2006-01-04 22:49:42 +00:00
9101fe2bd9 Fix the previous revision. 2006-01-03 19:07:53 +00:00
de8aea7a0f (xdvisible): New.
(xditem): Use it.  This plugs all known information leaks.  It also
avoids dumping of unused records.
2006-01-03 17:07:41 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
ade510f787 Turn options into ordinary econfig keys:
(configkeys): Add options.
(KM_OPTION): New.
(vers): Find options in configkeys[] instead of Options[].
(xdump): Remove xdump opt syntax.
(xdopt): Remove.
(emp_config, print_config): Remove option special case.
(option_list, Options, setoption): Remove.
2005-12-25 10:32:50 +00:00
Ron Koenderink
0b15696223 (xdump): Add EF_MAX check for table selection by number.
Fixes a crash when selecting a table over EF_MAX.
2005-11-12 13:38:01 +00:00
610b1cded4 (xdopt, xdver): Simplify the previous rev.
(xdump): Support selecting a dump by table number in addition to name.
2005-11-06 11:05:48 +00:00
Ron Koenderink
a16b3266ff (xdhdr,xdhdr1,xditem,xdmeta,xdopt,xdver,xdfldnam):
Remove the column header.
Not need as the xdump meta is functional.
2005-11-05 17:46:17 +00:00
Ron Koenderink
ba5b1b0a79 (xdopt,xdver,xdump): Add meta data for opt and ver. 2005-11-05 01:49:47 +00:00
Ron Koenderink
0d0800f4ac (xdmeta): Fix the printing of the number of rows dumped.
Incorrectly included the skipped rows.
2005-11-04 23:32:05 +00:00
a4fcd52cd0 (xdmeta): Don't dump meta data for stuff that is not dumped by
xdflds().
2005-11-04 19:56:47 +00:00
b30f4e7591 (xdmeta): Fix rev. 1.36. 2005-11-04 12:44:33 +00:00
f2eaedfe75 (xdopt, xdver): Fix missing footer. 2005-11-03 09:24:52 +00:00
Ron Koenderink
66f61616cb (xdmeta): Add NULL ca check.
Fixes a crash for xdump meta pow.
2005-11-03 00:03:55 +00:00
d6581717f2 (xdump): Use xditem() for all empfile tables.
(xdchr, xdmeta): Specialize for meta-tables, rename.
2005-10-29 16:44:53 +00:00
19f2948620 (rpt): Add sentinel.
(EF_NEWS_CHR): New.
(empfile): Add its entry.
2005-10-29 06:27:00 +00:00
01c248cb59 (EF_IS_GAME_STATE): New.
(xdump, main): Use it.

(EF_MAX): Change to largest table ID + 1.  This is now possible
because the changes above get rid of the assumption that
empfile[0..EF_MAX-1] is only game state.  Code can now work on any
table using the advertized empfile interface, not just on game state.
(my_ef_byname): Remove, use ef_byname().
2005-10-28 07:03:31 +00:00
Ron Koenderink
2df98825e9 (xdftr): Change footer to / instead of dumped. 2005-10-27 21:22:33 +00:00
Ron Koenderink
f9ac7a1f8c (xdump,xdchr,xdhdr,xdhdr1): Add meta data dump to xdump. 2005-10-27 19:37:19 +00:00