[##:##] Command : xdump <STATE-TABLE> <ENTRIES>
[##:##] Command : xdump chr <CONFIG-TABLE>
[##:##] Command : xdump opt
[##:##] Command : xdump ver
The xdump command displays information on game configuration and state in machine readable tables. It is intended for use by clients and tools.
This command is experimental and thus only available if option GUINEA_PIGS is enabled. It may still change in incompatible ways. It is released in this early stage of development to show were we are headed, and to solicit feedback.
The <STATE-TABLE> argument in [##:##] Command : xdump <STATE-TABLE> <ENTRIES>
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.
The <ENTRIES> argument selects table entries to display, in common
Empire syntax for the kind of things in this table.
For example, to dumps all sectors in realm #5, you can use:
[##:##] Command : xdump sect 0,0
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
This dumps all ships with mobility in fleet a:
[##:##] Command : xdump ship a ?mobil>0
This dumps all loans:
[##:##] Command : xdump loan *
For tables of things that have an owner (sect, ship, plane, land, nuke), xdump shows only things you own, unless you are a deity.
Table columns correspond to selectors used in Empire conditionals (see info Selector). Naturally, xdump shows columns corresponding to selectors that only deities may access only to deities.
We plan to extend the syntax to select columns to be shown.
The <CONFIG-TABLE> argument in [##:##] Command : 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.
We plan to extend the syntax to select rows and columns to be shown.
Finally, [##:##] Command : xdump opt
displays game options, and [##:##] Command : xdump ver
displays configuration parameters.
The output of xdump is a table, which consists of two header lines, the table body and a footer line.
The first header line is of the form \Q*XDUMP <TABLE-NAME> <TIMESTAMP>. It identifies the dump.
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.
The body consists of records; one record per line.
A record consists of fields separated by a space. All records have the same number of fields, which matches the header.
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 column have the same format.
Integer fields are in decimal; they can be parsed by scanf %d. Conversely, if that succeeds, it's an integer field.
Floating-point fields can be parsed by scanf %g (or equivalents %e, %f). Conversely, if that succeeds, it's a floating-point field.
String fields are in C syntax. Funny characters including space, newline and doublequote are shown as octal escape sequences. Example: "gold\\040mine". If a field starts with a double-quote, it's a string field. Here's a scanf format string: "\\"%[^\\"]\\"". You have to postprocess the value to translate escapes.
We might decide to use simple escape sequences as well, but never \\".
Some columns can contain null strings. A null string is the three letters nil. If a field contains nil, it's a string field.
If you know all the fields and their format, and none of them can be a null string, you can parse a complete record with a single scanf. The null string exception is unfortunate.
If you don't know field formats, you can still parse field by field.
We plan to add meta-dumps describing the dumps. Without such meta-data, tools have to know the server's internal coding of various
xdump discloses all units, regardless of player's tech level. xdump fails to suppress empty rows in some tables.
See also : dump , ldump , ndump , pdump , sdump , lost , Clients , Communication , LandUnits , Planes , Sectors , Ships