]> git.pond.sub.org Git - empserver/blob - info/xdump.t
Turn options into ordinary econfig keys:
[empserver] / info / xdump.t
1 .TH Command XDUMP
2 .NA xdump "Experimental dump of everything under the sun"
3 .LV Expert
4 .SY "xdump <STATE-TABLE> <ENTRIES>"
5 .SY "xdump chr <CONFIG-TABLE>"
6 .SY "xdump ver"
7 The xdump command displays information on game configuration and state
8 in machine readable tables.  It is intended for use by clients and
9 tools.
10 .s1
11 .L NOTE
12 This command is \fIexperimental\fP and thus only available if option
13 GUINEA_PIGS is enabled.  It may still change in incompatible ways.  It
14 is released in this early stage of development to show were we are
15 headed, and to solicit feedback.
16 .s1
17 The <STATE-TABLE> argument in
18 .SY "xdump <STATE-TABLE> <ENTRIES>"
19 is one of the following game state table names: sect (sectors), ship,
20 plane, land, nuke, news, treaty, trade, pow (power report), loan,
21 commodity (commodity market), lost (recently lost items).  Tables
22 power and nat do not work, yet.  Unique abbreviations of table names
23 are recognized.
24 .s1
25 The <ENTRIES> argument selects table entries to display, in common
26 Empire syntax for the kind of things in this table.
27 \" FIXME reference
28 For example, to dumps all sectors in realm #5, you can use:
29 .EX xdump sect 0,0
30 .NF
31 XDUMP sect 1103018538
32 owner xloc yloc des effic mobil terr terr1 terr2 terr3 xdist ydist avail work newdes min gold fert ocontent uran oldown off civil milit shell gun petrol iron dust bar food oil lcm hcm uw rad c_dist m_dist s_dist g_dist p_dist i_dist d_dist b_dist f_dist o_dist l_dist h_dist u_dist r_dist c_del m_del s_del g_del p_del i_del d_del b_del f_del o_del l_del h_del u_del r_del fallout access road rail dfense
33 1 0 0 5 100 127 0 0 0 0 8 0 6440 100 5 77 0 0 0 42 1 0 9900 1 0 0 0 0 1 0 50 0 0 0 0 0 0 0 0 0 0 0 1 0 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1078505792 0 0 99
34 dumped 1
35 .FI
36 This dumps all ships with mobility in fleet a:
37 .EX xdump ship a ?mobil>0
38 .s1
39 This dumps all loans:
40 .EX xdump loan *
41 .s1
42 For tables of things that have an owner (sect, ship, plane, land,
43 nuke), \*Qxdump\*U shows only things you own, unless you are a deity.
44 .s1
45 Table columns correspond to selectors used in Empire conditionals (see
46 \*Qinfo Selector\*U).  Naturally, \*Qxdump\*U shows columns
47 corresponding to selectors that only deities may access only to
48 deities.
49 .s1
50 .L "FUTURE DIRECTIONS"
51 We plan to extend the syntax to select columns to be shown.
52 .s1
53 The <CONFIG-TABLE> argument in
54 .SY "xdump chr <CONFIG-TABLE>"
55 is one of the following game configuration table names: sect (sector
56 characteristics), ship, plane, land, nuke, news, treaty, item,
57 infrastructure, product.  Table news does not work, yet.  Unique
58 abbreviations of table names are recognized.
59 .s1
60 .L "FUTURE DIRECTIONS"
61 We plan to extend the syntax to select rows and columns to be shown.
62 .s1
63 Finally,
64 .SY "xdump ver"
65 displays configuration parameters.
66 .s1
67 The output of \*Qxdump\*U is a table, which consists of two header
68 lines, the table body and a footer line.
69 .s1
70 The first header line is of the form \*QXDUMP <TABLE-NAME>
71 <TIMESTAMP>\*U.  It identifies the dump.
72 .s1
73 The second header line lists column names.  The name of a column is
74 the name of the corresponding selector.  If a name is followed by a
75 decimal number, it applies to that many columns, which form an array.
76 .s1
77 The body consists of records; one record per line.
78 .s1
79 A record consists of fields separated by a space.  All records have
80 the same number of fields, which matches the header.
81 .s1
82 A field is either in integer, floating-point number or string format.
83 In no case does it contain space or newline.  All fields in the same
84 column have the same format.
85 .s1
86 Integer fields are in decimal; they can be parsed by scanf %d.
87 Conversely, if that succeeds, it's an integer field.
88 .s1
89 Floating-point fields can be parsed by scanf %g (or equivalents %e,
90 %f).  Conversely, if that succeeds, it's a floating-point field.
91 .s1
92 String fields are in C syntax.  Funny characters including space,
93 newline and doublequote are shown as octal escape sequences.  Example:
94 "gold\\040mine".  If a field starts with a double-quote, it's a string
95 field.  Here's a scanf format string: "\\"%[^\\"]\\"".  You have to
96 postprocess the value to translate escapes.
97 .s1
98 .L "FUTURE DIRECTIONS"
99 We might decide to use simple escape sequences as well, but never \\".
100 .s1
101 Some columns can contain null strings.  A null string is the three
102 letters nil.  If a field contains nil, it's a string field.
103 .s1
104 If you know all the fields and their format, and none of them can be a
105 null string, you can parse a complete record with a single scanf.  The
106 null string exception is unfortunate.
107 .s1
108 If you don't know field formats, you can still parse field by field.
109 .s1
110 .L "FUTURE DIRECTIONS"
111 We plan to add meta-dumps describing the dumps.  Without such
112 meta-data, tools have to know the server's internal coding of various
113 .L BUGS
114 \*Qxdump\*U discloses all units, regardless of player's tech level.
115 \*Qxdump\*U fails to suppress empty rows in some tables.
116 .s1
117 .SA "dump, ldump, ndump, pdump, sdump, lost, Clients, Communication, LandUnits, Planes, Sectors, Ships"