Spell ID and UID consistently all-caps Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
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>
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>
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>
doc/xdump: Document hidden flag Missed in commit 41f00fd, v4.3.33. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
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>
doc/xdump: Fix grammar nit Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
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.
Provide proper ca_table for meta selector table No idea why it was missing.
Fix documentation not to refer to client as emp_client
Fix trailing whitespace
Fix whitespace: space before tab
Fix xdump.pl reference in doc/xdump
Doc fix: don't claim empdump doesn't exist yet
Minor xdump documentation edit
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.
Spelling fixes.
Fix grammar for human-readable header. Clarify state of symbolic indexes.
Update for current code. Minor edits.
New doc/xdump.