Update to current command syntax, cover meta. Refer to doc/xdump (to
be written). Less detail on output. Document current shortcomings.
This commit is contained in:
parent
433bcb0d19
commit
c9d883e78b
1 changed files with 81 additions and 91 deletions
172
info/xdump.t
172
info/xdump.t
|
@ -1,117 +1,107 @@
|
||||||
.TH Command XDUMP
|
.TH Command XDUMP
|
||||||
.NA xdump "Experimental dump of everything under the sun"
|
.NA xdump "Extended dump of everything under the sun"
|
||||||
.LV Expert
|
.LV Expert
|
||||||
.SY "xdump <STATE-TABLE> <ENTRIES>"
|
.SY "xdump <TYPE|NUMBER> <RECORDS>"
|
||||||
.SY "xdump chr <CONFIG-TABLE>"
|
.SY "xdump meta <TYPE|NUMBER>"
|
||||||
.SY "xdump ver"
|
.SY "xdump ver"
|
||||||
|
.SY "xdump meta ver"
|
||||||
The xdump command displays information on game configuration and state
|
The xdump command displays information on game configuration and state
|
||||||
in machine readable tables. It is intended for use by clients and
|
in machine readable format. It is intended for use by clients and
|
||||||
tools.
|
tools. This info page explains little more than command syntax; see
|
||||||
|
doc/xdump in the source distribution for complete documentation.
|
||||||
.s1
|
.s1
|
||||||
.L NOTE
|
Game configuration and state consists of a a number of tables or
|
||||||
This command is \fIexperimental\fP and thus only available if option
|
files. xdump shows only things that are \fIcertainly\fP visible to
|
||||||
GUINEA_PIGS is enabled. It may still change in incompatible ways. It
|
you: sectors you own, ship types known, etc.
|
||||||
is released in this early stage of development to show were we are
|
|
||||||
headed, and to solicit feedback.
|
|
||||||
.s1
|
.s1
|
||||||
The <STATE-TABLE> argument in
|
The output of xdump is a table consisting of a header line, the table
|
||||||
.SY "xdump <STATE-TABLE> <ENTRIES>"
|
body and a footer line.
|
||||||
is one of the following game state table names: sect (sectors), ship,
|
|
||||||
plane, land, nuke, news, treaty, trade, pow (power report), loan,
|
|
||||||
commodity (commodity market), lost (recently lost items). Tables
|
|
||||||
power and nat do not work, yet. Unique abbreviations of table names
|
|
||||||
are recognized.
|
|
||||||
.s1
|
.s1
|
||||||
The <ENTRIES> argument selects table entries to display, in common
|
The header line is of the form \*QXDUMP <TYPE> <TIMESTAMP>\*U. <TYPE>
|
||||||
Empire syntax for the kind of things in this table.
|
identifies the dump. The timestamp permits incremental dumps (see
|
||||||
\" FIXME reference
|
below).
|
||||||
For example, to dumps all sectors in realm #5, you can use:
|
|
||||||
.EX xdump sect 0,0
|
|
||||||
.NF
|
|
||||||
XDUMP sect 1103018538
|
|
||||||
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
|
|
||||||
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
|
|
||||||
dumped 1
|
|
||||||
.FI
|
|
||||||
This dumps all ships with mobility in fleet a:
|
|
||||||
.EX xdump ship a ?mobil>0
|
|
||||||
.s1
|
.s1
|
||||||
This dumps all loans:
|
The body consists of records; one record per line. A record consists
|
||||||
.EX xdump loan *
|
of fields separated by a space. All records have the same number of
|
||||||
.s1
|
fields. Fields match records in the table's meta-table (see below).
|
||||||
For tables of things that have an owner (sect, ship, plane, land,
|
|
||||||
nuke), \*Qxdump\*U shows only things you own, unless you are a deity.
|
|
||||||
.s1
|
|
||||||
Table columns correspond to selectors used in Empire conditionals (see
|
|
||||||
\*Qinfo Selector\*U). Naturally, \*Qxdump\*U shows columns
|
|
||||||
corresponding to selectors that only deities may access only to
|
|
||||||
deities.
|
|
||||||
.s1
|
|
||||||
.L "FUTURE DIRECTIONS"
|
|
||||||
We plan to extend the syntax to select columns to be shown.
|
|
||||||
.s1
|
|
||||||
The <CONFIG-TABLE> argument in
|
|
||||||
.SY "xdump chr <CONFIG-TABLE>"
|
|
||||||
is one of the following game configuration table names: sect (sector
|
|
||||||
characteristics), ship, plane, land, nuke, news, treaty, item,
|
|
||||||
infrastructure, product. Table news does not work, yet. Unique
|
|
||||||
abbreviations of table names are recognized.
|
|
||||||
.s1
|
|
||||||
.L "FUTURE DIRECTIONS"
|
|
||||||
We plan to extend the syntax to select rows and columns to be shown.
|
|
||||||
.s1
|
|
||||||
Finally,
|
|
||||||
.SY "xdump ver"
|
|
||||||
displays configuration parameters.
|
|
||||||
.s1
|
|
||||||
The output of \*Qxdump\*U is a table, which consists of two header
|
|
||||||
lines, the table body and a footer line.
|
|
||||||
.s1
|
|
||||||
The first header line is of the form \*QXDUMP <TABLE-NAME>
|
|
||||||
<TIMESTAMP>\*U. It identifies the dump.
|
|
||||||
.s1
|
|
||||||
The second header line lists column names. The name of a column is
|
|
||||||
the name of the corresponding selector. If a name is followed by a
|
|
||||||
decimal number, it applies to that many columns, which form an array.
|
|
||||||
.s1
|
|
||||||
The body consists of records; one record per line.
|
|
||||||
.s1
|
|
||||||
A record consists of fields separated by a space. All records have
|
|
||||||
the same number of fields, which matches the header.
|
|
||||||
.s1
|
.s1
|
||||||
A field is either in integer, floating-point number or string format.
|
A field is either in integer, floating-point number or string format.
|
||||||
In no case does it contain space or newline. All fields in the same
|
In no case does it contain space or newline. All fields in the same
|
||||||
column have the same format.
|
column have the same format.
|
||||||
.s1
|
.s1
|
||||||
Integer fields are in decimal; they can be parsed by scanf %d.
|
Integer fields are in decimal; they can be parsed by scanf %d.
|
||||||
Conversely, if that succeeds, it's an integer field.
|
Conversely, if that succeeds and consumes the complete field, it's an
|
||||||
|
integer field.
|
||||||
.s1
|
.s1
|
||||||
Floating-point fields can be parsed by scanf %g (or equivalents %e,
|
Floating-point fields can be parsed by scanf %g (or equivalents %e,
|
||||||
%f). Conversely, if that succeeds, it's a floating-point field.
|
%f). Conversely, if that succeeds, it's a floating-point field.
|
||||||
.s1
|
.s1
|
||||||
String fields are in C syntax. Funny characters including space,
|
String fields are in C syntax. Funny characters including space,
|
||||||
newline and doublequote are shown as octal escape sequences. Example:
|
newline and double-quote are shown as octal escape sequences. Example:
|
||||||
"gold\\040mine". If a field starts with a double-quote, it's a string
|
"gold\\040mine". If a field starts with a double-quote, it's a string
|
||||||
field. Here's a scanf format string: "\\"%[^\\"]\\"". You have to
|
field.
|
||||||
postprocess the value to translate escapes.
|
|
||||||
.s1
|
.s1
|
||||||
.L "FUTURE DIRECTIONS"
|
.L "FUTURE DIRECTIONS:"
|
||||||
We might decide to use simple escape sequences as well, but never \\".
|
We might decide to support more C escape sequences, but never \\".
|
||||||
.s1
|
.s1
|
||||||
Some columns can contain null strings. A null string is the three
|
Some fields can contain null strings. A null string is the three
|
||||||
letters nil. If a field contains nil, it's a string field.
|
letters \*Qnil\*U. If a field contains nil, it's a string field.
|
||||||
.s1
|
.s1
|
||||||
If you know all the fields and their format, and none of them can be a
|
Each table has a meta-table, which defines format and meaning of its
|
||||||
null string, you can parse a complete record with a single scanf. The
|
fields. To show the meta-table for <TYPE>, use
|
||||||
null string exception is unfortunate.
|
.EX xdump meta <TYPE>
|
||||||
.s1
|
.s1
|
||||||
If you don't know field formats, you can still parse field by field.
|
All meta-tables share the same meta-meta-table, which is its own
|
||||||
|
meta-table. The command to show it is
|
||||||
|
.EX xdump meta meta
|
||||||
.s1
|
.s1
|
||||||
.L "FUTURE DIRECTIONS"
|
Fields correspond to selectors used in Empire conditionals (see
|
||||||
We plan to add meta-dumps describing the dumps. Without such
|
\*Qinfo Selector\*U), and they use the same names. Naturally, xdump
|
||||||
meta-data, tools have to know the server's internal coding of various
|
shows fields corresponding to deity-only selectors only to deities.
|
||||||
.L BUGS
|
|
||||||
\*Qxdump\*U discloses all units, regardless of player's tech level.
|
|
||||||
\*Qxdump\*U fails to suppress empty rows in some tables.
|
|
||||||
.s1
|
.s1
|
||||||
.SA "dump, ldump, ndump, pdump, sdump, lost, Clients, Communication, LandUnits, Planes, Sectors, Ships"
|
The command to display table <TYPE> is
|
||||||
|
.EX xdump <TYPE> <RECORDS>
|
||||||
|
.s1
|
||||||
|
Argument <RECORDS> selects which records to show, in common Empire
|
||||||
|
syntax for the kind of things in that table. \*Q*\*U always shows the
|
||||||
|
complete table.
|
||||||
|
.s1
|
||||||
|
To dump sector -22,2, for example, you can use:
|
||||||
|
.EX xdump sect -22,2
|
||||||
|
.s1
|
||||||
|
This dumps all ships with mobility in fleet a:
|
||||||
|
.EX xdump ship a ?mobil>0
|
||||||
|
.s1
|
||||||
|
This dumps all sectors changes after timestamp 1141068862:
|
||||||
|
.EX xdump sect * ?timestamp>1141068862
|
||||||
|
.s1
|
||||||
|
Use this with a value one less than the timestamp in the xdump header
|
||||||
|
to get everything that changed since that xdump (incremental dump).
|
||||||
|
.s1
|
||||||
|
.L "FUTURE DIRECTIONS:"
|
||||||
|
We plan to extend the syntax to select fields to be shown.
|
||||||
|
.s1
|
||||||
|
The table \*Qtable\*U is the table of (non-meta-)tables. It contains
|
||||||
|
table names and numbers. xdump accepts table numbers as well as
|
||||||
|
names.
|
||||||
|
.s1
|
||||||
|
There's a special pseudo-table \*Qver\*U, which collects configuration
|
||||||
|
parameters in a single record. It is not listed in \*Qtable\*U, it
|
||||||
|
doesn't have a table number, but it does have a meta-table.
|
||||||
|
.s1
|
||||||
|
.L BUGS:
|
||||||
|
Still missing are game state files power, map, bmap; the list of
|
||||||
|
commands; foreign relations and levels, contact and reject
|
||||||
|
information, budget priorities; mortal access to sector selector
|
||||||
|
mines, ship selectors xbuilt, ybuilt, trade selectors xloc, yloc,
|
||||||
|
commodity selectors xbuy, ybuy, xsell, ysell. Some information is not
|
||||||
|
yet available in human-readable form: the lost file, sect-chr selector
|
||||||
|
nav, ship and land plague status (deity only), plane theta (governs
|
||||||
|
satellite movement), trade selectors xloc, yloc, commodity selectors
|
||||||
|
xbuy, ybuy.
|
||||||
|
.s1
|
||||||
|
.L "FUTURE DIRECTIONS:"
|
||||||
|
xdump is still fairly new, and experience with it may lead to changes.
|
||||||
|
Client writers should be prepared for that.
|
||||||
|
.s1
|
||||||
|
.SA "dump, ldump, ndump, pdump, sdump, lost, show, version, Clients, Communication, LandUnits, Planes, Sectors, Ships"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue