Commit graph

20 commits

Author SHA1 Message Date
a1ba346736 Spell ID and UID consistently all-caps
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00
89a06ec2d4 xdump: Make meta-type numbers portable, get rid of meta-type "c"
The xdump field data types are abstract symbols "d", "f", "s" and "c".
However, the abstraction leaks: we dump the enum nsc_type ca_type
values verbatim in meta table field "type", and have symbol table
meta-type map all integer types to "d", and both floating-point types
to "f".  Not a problem for well-behaved clients, since all they do
with the dumped value is referencing table meta-type.  It is a problem
for version-test: since the integer type compatible with an
enumeration type is implementation-defined, the type value of
selectors of enumeration type can vary between compilers.  It also
makes table meta-type a somewhat ugly exception to the rule that a
symbol table maps integers to names 1:1.

Virtual selectors let us seal the abstraction: dump the promoted
ca_type value.

The integer types get all promoted to NSC_LONG.  This takes care of
version-test.

The floating-point types get all promoted to NSC_DOUBLE.  Makes sense.

NSC_STRINGY gets promoted to NSC_STRING.  This changes all field data
types "c" to "s".  Getting rid of "c" is a welcome simplification,
because now the meaning of meta type field "len" no longer depends on
"type", but always means that the array is dumped as that many fields.
We lose string length limit information, though.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 20:09:17 +02:00
6316072508 doc/xdump: Fix definition of identifier in grammar
getid() requires identifiers to start with a letter.  Fix the
documentation to match the code.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 19:59:59 +02:00
dc58018cd7 nsc: Replace NSC_EXTRA, NSC_CONST by enum ca_dump
struct castr ca_flag NSC_EXTRA was introduced in commit 3e5c064
(v4.2.18) to permit selectors that aren't in xdump.

Flag NSC_CONST was introduced in commit 445dfec, and put to use in
commit d8422ca (both v4.3.0) to protect certain table elements that
should not be changed in customized tables.

Both flags apply only to xdump, not to other uses of struct castr,
such as conditionals.

Combining NSC_EXTRA | NSC_CONST makes no sense.

I'll shortly need a way to keep selectors out of configuration tables
for conditional selector and xdump command forward compatibility.
Doing it as a third flag would add more nonsensical combinations.

Convert the flags to a separate enum ca_dump instead:

    neither   -> CA_DUMP
    NSC_CONST -> CA_DUMP_CONST
    NSC_EXTRA -> CA_DUMP_NONE

Bonus: unlike the flags it replaces, ca_dump is not visible in xdump.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 19:59:56 +02:00
e2fd233aa5 doc/xdump: Document hidden flag
Missed in commit 41f00fd, v4.3.33.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-06 19:59:56 +02:00
a109de948b Remove option TREATIES
TREATIES has issues:

* Treaties can cover attack, assault, paradrop, board, lboard, fire,
  build (s|p|l|n) and enlist, but not bomb, launch, torpedo and
  enlistment centers.

* Usability is very poor.  While a treaty is in effect, every player
  action that violates a treaty condition triggers a prompt like this:

    This action is in contravention of  treaty #0 (with Curmudgeon)
    Do you wish to go ahead anyway? [yn]

  If you decline, the action is not executed.  If you accept, it is.
  In both cases, your decision is reported in the news.

  You cannot get rid of these prompts until the treaty expires.

* Virtually nobody uses them.

* Virtually unused code is buggy code.  There is at least one race
  condition: multifire() reads the firing sector, ship or land unit
  before the treaty prompt, and writes it back after, triggering a
  generation oops.  Any updates made by other threads while trechk()
  waits for input are wiped out, triggering a seqno mismatch oops.

* The treaty prompts could confuse smart clients that aren't prepared
  for them.  WinACE isn't, but is reported to work anyway at least
  common usage.  Ron Koenderink (the WinACE maintainer) suspects there
  could be a few situations where it will fail.

This feature is not earning its keep.  Remove it.  Drop command
treaty, consider treaty, offer treaty, xdump treaty, reject treaties.
Output of accept changed, obviously.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-02-16 11:44:14 +01:00
60ffa63779 doc/xdump: Fix grammar nit
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-09 17:03:59 +02:00
54fa510425 Update examples in doc/xdump to current server's output
The NSC_CONST flags added in commit fa63f87b have always been missing
here.  The previous commit changed xdump meta meta.  Other than that,
it's just different encodings.
2011-06-25 16:44:04 +02:00
b461cd3ae7 Provide proper ca_table for meta selector table
No idea why it was missing.
2011-06-25 16:44:04 +02:00
f30ecd3da7 Fix documentation not to refer to client as emp_client 2009-04-05 11:34:57 +02:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
a9653c475b Fix whitespace: space before tab 2008-09-17 19:29:42 -04:00
88339ae77e Fix xdump.pl reference in doc/xdump 2008-07-25 08:16:38 -04:00
2725d6e736 Doc fix: don't claim empdump doesn't exist yet 2008-04-06 14:48:12 +02:00
5ef6559c6a Minor xdump documentation edit 2008-03-14 20:25:42 +01:00
da8a1daeef Virtual selectors
Where ordinary selectors specify a value stored in some object,
virtual selectors specify a function to call to compute a value
associated with some object.

Use them to replace the special case xdump ver by new table
EF_VERSION.

Move configkeys[] to lib/common because nsc_init() needs it to
initialize empfile[EF_VERSION].cadef.
2008-03-14 20:25:41 +01:00
aa38b1f31b Spelling fixes. 2007-12-02 16:22:15 +00:00
1d330548ea Fix grammar for human-readable header.
Clarify state of symbolic indexes.
2007-08-24 17:03:44 +00:00
c05ecb8781 Update for current code. Minor edits. 2006-06-14 18:02:20 +00:00
c52a9a2822 New doc/xdump. 2006-03-06 18:27:37 +00:00