]> git.pond.sub.org Git - empserver/log
empserver
12 years agoChange stmtch() to recognize only null as sentinel
Markus Armbruster [Mon, 25 Apr 2011 12:21:44 +0000 (14:21 +0200)]
Change stmtch() to recognize only null as sentinel

Before, it also recognized "" (since commit 844b654d, v4.2.14), but
no caller depends on that.

While there, back out the macro cleverness added in commit 844b654d.

12 years agoPermit omitting rows at the end of tables nat and game
Markus Armbruster [Tue, 14 Jun 2011 07:09:19 +0000 (09:09 +0200)]
Permit omitting rows at the end of tables nat and game

When not enough rows are supplied for a table with fixed size, treat
the rows missing at the end just like rows omitted elsewhere: make
them blank if the omission is permitted (tables nat and game), else
fail (tables sect and realm; no change).

12 years agoForbid omitting rows in config item and sect-chr
Markus Armbruster [Mon, 13 Jun 2011 09:27:04 +0000 (11:27 +0200)]
Forbid omitting rows in config item and sect-chr

Forbid omitting rows for tables with const fields: item and sect-chr.
This is consistent with the rule for truncation.

The server expects certain entries in these two tables, and
malfunctions when they're blank.  Omitting them in the builtin tables
has always left them blank, but deities are not supposed to edit them,
and maintainers are supposed to know what they're doing, so the issue
was deemed unimportant and ignored.  However, I plan to blank out
omitted rows in custom tables as well, and then the issue isn't
unimportant anymore.

12 years agoMake xundump check each partial table supplies the same rows
Markus Armbruster [Sun, 8 May 2011 04:56:11 +0000 (06:56 +0200)]
Make xundump check each partial table supplies the same rows

Also streamline the error message for missing rows at end of table.

12 years agoMake xundump reject out-of-order rows
Markus Armbruster [Sat, 7 May 2011 15:45:19 +0000 (17:45 +0200)]
Make xundump reject out-of-order rows

This also catches duplicate rows.  Will make blanking out gaps easier.

12 years agoPermit truncating table product
Markus Armbruster [Sat, 18 Jun 2011 15:10:34 +0000 (17:10 +0200)]
Permit truncating table product

Truncating is actually fine for table product.  It's forbidden because
selector sname has flag NSC_CONST set.  I don't remember why sname was
made const in commit 445dfec9 along with item selector mnem, sect-chr
selector mnem and infrastructure selector name.  Unlike the other
tables, no code depends on product's builtin values.  Clear the flag.

12 years agoClean up xundump's test whether table may be truncated
Markus Armbruster [Sun, 22 May 2011 09:05:01 +0000 (11:05 +0200)]
Clean up xundump's test whether table may be truncated

A table may be truncated when its size is variable and it doesn't have
const fields.  The old code tested table IDs instead.

12 years agoOverhaul how xundump keeps track of current object
Markus Armbruster [Sat, 7 May 2011 15:30:44 +0000 (17:30 +0200)]
Overhaul how xundump keeps track of current object

Factor tracking of cur_type, cur_obj, cur_id and cur_is_blank into a
set of functions.  They replace getobj().  While there, improve some
error messages.

12 years agoMove src/lib/subs/empobj.c back to src/lib/common/
Markus Armbruster [Sat, 21 May 2011 13:52:26 +0000 (15:52 +0200)]
Move src/lib/subs/empobj.c back to src/lib/common/

Commit 77e95bd7 (v4.3.12) moved it from its natural home because
obj_nameof() required stuff from subs/.  Now that obj_nameof() is
gone, move it back.

12 years agoRename obj_nameof() to unit_nameof() and move to unitsub.c
Markus Armbruster [Sat, 21 May 2011 13:42:38 +0000 (15:42 +0200)]
Rename obj_nameof() to unit_nameof() and move to unitsub.c

12 years agoRemove unused get_empobj_chr()
Markus Armbruster [Sat, 21 May 2011 13:33:31 +0000 (15:33 +0200)]
Remove unused get_empobj_chr()

Unused since commit 5e77193c, v4.3.24.

12 years agoRefuse to grow or truncate files with fixed size
Markus Armbruster [Wed, 4 May 2011 18:51:54 +0000 (20:51 +0200)]
Refuse to grow or truncate files with fixed size

Make ef_write() treat it like any other invalid write beyond the file
size: oops.  Be less harsh in ef_extend() and ef_truncate(): log an
error.

12 years agoMake ef_open() extend files with fixed size automatically
Markus Armbruster [Wed, 4 May 2011 05:45:05 +0000 (07:45 +0200)]
Make ef_open() extend files with fixed size automatically

Turns the fixed size into an invariant.  Before, the files utility
created them empty, then extended them.

12 years agoMove pln_oninit(), lnd_oninit(), nuk_oninit() to filetable.c
Markus Armbruster [Tue, 3 May 2011 19:47:29 +0000 (21:47 +0200)]
Move pln_oninit(), lnd_oninit(), nuk_oninit() to filetable.c

They set up invariants, and thus should be always active, not just in
the server.  Since ef_blank() isn't used for these files outside the
server right now, this isn't a bug fix, just cleanup.

12 years agoMove file initialization from files.c to empfile oninit()
Markus Armbruster [Tue, 3 May 2011 18:48:56 +0000 (20:48 +0200)]
Move file initialization from files.c to empfile oninit()

files.c writes initial contents to game state files with fixed size.
Necessary for setting up invariants, such as struct sctstr members
sct_x, sct_y matching sct_uid.

Do that from the oninit() callback, so ef_blank() sets up invariants
correctly.  Since ef_blank() isn't used for these files right now,
this isn't a bug fix, just cleanup.

12 years agoInitialize empfile user callbacks explicitly
Markus Armbruster [Tue, 3 May 2011 18:46:38 +0000 (20:46 +0200)]
Initialize empfile user callbacks explicitly

Instead of stuffing NULL initializers into the cache initializer
macros UNMAPPED_CACHE(), ARRAY_CACHE(), PTR_CACHE(), ARRAY_TABLE().
In preparation of having some non-NULL initializers.

12 years agoFix empdump not to grow game state files with fixed size
Markus Armbruster [Tue, 3 May 2011 05:53:37 +0000 (07:53 +0200)]
Fix empdump not to grow game state files with fixed size

empdump -i now complains about extra rows instead of silently growing
the file to a size the server will reject.  Affects tables sector,
nation, realms, game.

Bonus fix: better error message on I/O error or insufficient memory.

12 years agoFix empdump not to truncate game state files with fixed size
Markus Armbruster [Mon, 2 May 2011 20:27:26 +0000 (22:27 +0200)]
Fix empdump not to truncate game state files with fixed size

empdump -i now complains about missing rows instead of silently
truncating the file to a size the server will reject.  Affects tables
sector, nation, realms, game.

12 years agoClean up how game state file sizes are checked
Markus Armbruster [Sun, 1 May 2011 12:18:24 +0000 (14:18 +0200)]
Clean up how game state file sizes are checked

New struct empfile member nent replaces ef_open() parameter nelt.
Cleaner, because the expected size is a property of the file, not of
how it's used.  Also fixes empdump to check file sizes.

Complication: with EFF_CREATE, ef_open() creates an empty file, to be
extended to the correct size.  Callers passed nelt argument -1 along
with EFF_CREATE, to make ef_open() accept the empty file.  Can't do
the same for empfile member nent.  Instead, make ef_open() not check
the (zero) size then.

Replaces commit 5750107b, v4.3.15.

12 years agoFix empdump to open views, too
Markus Armbruster [Sun, 1 May 2011 12:09:35 +0000 (14:09 +0200)]
Fix empdump to open views, too

ef_verify() assumes views are open.  Bug is harmless, because
ef_nelem() returns zero for closed views, and ef_verify() accesses
only immutable parts of struct empfile then.

12 years agoClean up how a view's base table is defined
Markus Armbruster [Sun, 1 May 2011 11:59:17 +0000 (13:59 +0200)]
Clean up how a view's base table is defined

New struct empfile member base replaces ef_open_view() parameter base.
Cleaner, because the base table is a property of the view, not of how
it's used.

Use it to clean up verify_fail()'s base table access, and for extra
sanity checks in ef_open() and ef_open_view().

12 years agoSimplify how ef_write() handles write beyond end of file
Markus Armbruster [Fri, 29 Apr 2011 05:23:07 +0000 (07:23 +0200)]
Simplify how ef_write() handles write beyond end of file

12 years agoMake ef_close() set fids later, so it's cleaned up on error
Markus Armbruster [Thu, 28 Apr 2011 18:52:37 +0000 (20:52 +0200)]
Make ef_close() set fids later, so it's cleaned up on error

Just for cleanliness.

12 years agoClean up ef_close() to zap csize along with cache
Markus Armbruster [Thu, 28 Apr 2011 18:41:59 +0000 (20:41 +0200)]
Clean up ef_close() to zap csize along with cache

12 years agoChange struct empfile callback onresize() to return void
Markus Armbruster [Thu, 28 Apr 2011 18:38:39 +0000 (20:38 +0200)]
Change struct empfile callback onresize() to return void

ef_open() handles onresize() failing incorrectly.  Instead of fixing
that, drop the failure mode.  It's not really used: unit_onresize()
fails only when used incorrectly.  It isn't.  If it ever is, ignoring
the failure is safe.

12 years agoFix clearing mutable flags on ef_close()
Markus Armbruster [Thu, 28 Apr 2011 18:20:43 +0000 (20:20 +0200)]
Fix clearing mutable flags on ef_close()

Make ef_close() clear them always, even for views.  Harmless, as
ef_open_view() always sets the same flags.

Drop redundant assignment to ep->flags in ef_open().  ef_close()
clears mutable flags, no need to clear them some more right before
calling it.  Missed in commit 3eb3607f, v4.3.0.

12 years agoFix EFF_IMMUTABLE to include EFF_SENTINEL
Markus Armbruster [Wed, 27 Apr 2011 17:46:15 +0000 (19:46 +0200)]
Fix EFF_IMMUTABLE to include EFF_SENTINEL

ef_open() and ef_close() clear EFF_SENTINEL because of that.  Broken
since commit 1492845c (v4.3.17) added EFF_SENTINEL.  Harmless, as no
file-backed table has a sentinel.

12 years agoFix ef_open()'s error message for file larger than static cache
Markus Armbruster [Wed, 27 Apr 2011 17:44:26 +0000 (19:44 +0200)]
Fix ef_open()'s error message for file larger than static cache

The message claims the file is larger than it actually is.  Broken
since commit 71908018 (v4.3.0) implemented static cache in ef_open().
Harmless, because no file-backed table has a statically allocated
cache.

12 years agoFix how empdump rejects attempt to split table sect
Markus Armbruster [Sun, 8 May 2011 10:40:56 +0000 (12:40 +0200)]
Fix how empdump rejects attempt to split table sect

Split tables require the record index in the leftmost column.
defellipsis() correctly rejects "..." when the table doesn't have one.
It fails to reject it when it has one that is NSC_EXTRA, and thus not
permitted in a dump.  This is the case for table sect.  defellipsis()
happily succeeds, then chkflds() demands column "uid" if it's missing,
and rejects it if its present.

12 years agoempdump failed to catch some invalid column names
Markus Armbruster [Sun, 8 May 2011 10:12:09 +0000 (12:12 +0200)]
empdump failed to catch some invalid column names

It missed those with more flags than just NSC_EXTRA set: table sect
name uid, table nat names passwd, xorg, yorg, contacts, rejects.
Since xundump() doesn't provide space for these, the bug could lead to
buffer overruns.  Fixes flawed commit 726a8e3d, v4.3.12.

12 years agoFix empdump to check for truncation failure
Markus Armbruster [Sat, 7 May 2011 19:05:02 +0000 (21:05 +0200)]
Fix empdump to check for truncation failure

xubody() neglected to check ef_truncate()'s return value.  Two failure
modes: invalid arguments, and ftruncate() failure.  The former
shouldn't happen, and the latter can happen only for file-backed
tables, hence only in empdump -i.

12 years agoMake xundump report invalid record IDs
Markus Armbruster [Sat, 7 May 2011 15:17:06 +0000 (17:17 +0200)]
Make xundump report invalid record IDs

It failed silently before.

12 years agoMake xundump reject numbers that don't fit into integral field
Markus Armbruster [Sat, 7 May 2011 15:12:05 +0000 (17:12 +0200)]
Make xundump reject numbers that don't fit into integral field

Numbers are read into a double, then cast to the field type.  The cast
may change the value.  Flag that as error, except for floating-point
fields.

12 years agoRestrict xundump to tables with a file name
Markus Armbruster [Mon, 2 May 2011 20:20:58 +0000 (22:20 +0200)]
Restrict xundump to tables with a file name

Tables with a file name are: any game state, and any table that's
initialized from a .config file.

Tables that are no longer customizable: "updates" (customization had
no effect, because update_get_schedule() overwrote it), "table",
"meta" and the symbol tables (customization couldn't change them
anyway), and news-chr (customizing r_newsstory[] was kind of neat, but
unsafe because they are format strings for sprintf()).

12 years agoFix xdump updates not to dump bogus extra updates
Markus Armbruster [Sat, 30 Apr 2011 05:35:14 +0000 (07:35 +0200)]
Fix xdump updates not to dump bogus extra updates

"xdump updates" believes there are always 15 (UPDATE_TIME_LEN - 1)
scheduled updates.  When fewer than 15 updates are scheduled, it shows
whatever crap update time happens to be in the unused part of
update_time[]: the initial zero or a previously scheduled update.

Root cause is that table EF_UPDATES has always UPDATE_TIME_LEN - 1
entries, which is incorrect when fewer updates are scheduled.  Only
xdump is affected, as the other users ignore the length and stop at
the sentinel.

Fix update_get_schedule() to resize table EF_UPDATES.

12 years agoCheck record uid comes first in split config tables
Markus Armbruster [Wed, 27 Apr 2011 05:15:00 +0000 (07:15 +0200)]
Check record uid comes first in split config tables

setnum() requires the record uid to come first, so we better ensure it
does.

12 years agoDon't stop checking xdump field headers when join field is missing
Markus Armbruster [Wed, 27 Apr 2011 05:03:09 +0000 (07:03 +0200)]
Don't stop checking xdump field headers when join field is missing

Also improve the error message a bit.

12 years agoA few comment fixes for nsc.[ch] file.[ch]
Markus Armbruster [Mon, 25 Apr 2011 08:45:04 +0000 (10:45 +0200)]
A few comment fixes for nsc.[ch] file.[ch]

12 years agoBetter document how .config must match compiled-in UIDs
Markus Armbruster [Mon, 25 Apr 2011 08:27:32 +0000 (10:27 +0200)]
Better document how .config must match compiled-in UIDs

12 years agoProvide proper ca_table for carrier unit# selectors
Markus Armbruster [Mon, 25 Apr 2011 05:45:20 +0000 (07:45 +0200)]
Provide proper ca_table for carrier unit# selectors

Makes ef_verify() check carrier UIDs are sane.  Partially protects
unit_cargo_init(), which oopses on bad carriers.

This has become possible only since commit 64a53c90 (v4.3.17) set
their values to -1 in newly created units.  Before, they were zero in
units that had never been used, and a proper ca_table would have made
ef_verify() fail when unit#0 didn't exist.

The only unit# selectors left without a proper ca_table are ship's
follow, lost's id and trade's unitid.  Document why.

12 years agoUpdate examples in doc/xdump to current server's output
Markus Armbruster [Mon, 25 Apr 2011 05:17:49 +0000 (07:17 +0200)]
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.

12 years agoProvide proper ca_table for meta selector table
Markus Armbruster [Mon, 25 Apr 2011 05:15:57 +0000 (07:15 +0200)]
Provide proper ca_table for meta selector table

No idea why it was missing.

12 years agoRefer to table names instead of C identifiers in .config
Markus Armbruster [Sun, 24 Apr 2011 06:30:31 +0000 (08:30 +0200)]
Refer to table names instead of C identifiers in .config

The C identifier permits looking up the table in the source.  The
table name permits lookup with xdump.

Coders should know how to go from table name to C identifier.  Deities
aren't all coders; we shouldn't ask them to guess table names from C
identifiers.

12 years agoOops in verify_row() when non-integral selector references a table
Markus Armbruster [Sat, 23 Apr 2011 17:58:29 +0000 (19:58 +0200)]
Oops in verify_row() when non-integral selector references a table

12 years agoDon't ignore non-virtual NSC_EXTRA columns in ef_verify.c
Markus Armbruster [Sat, 23 Apr 2011 17:28:57 +0000 (19:28 +0200)]
Don't ignore non-virtual NSC_EXTRA columns in ef_verify.c

These are commonly timestamps (no verification implemented), or
aliases for a non-extra column (which gets verified).  Commit 49780e2c
(v4.3.12) added the exception: EF_SECTOR's uid.  Proof by example that
ignoring these columns is wrong.  Fix: ignore only virtual columns.

12 years agoFix use-after-free when plane gets shot down or aborted by flak
Markus Armbruster [Mon, 6 Jun 2011 17:15:05 +0000 (19:15 +0200)]
Fix use-after-free when plane gets shot down or aborted by flak

ac_fireflak() dereferenced plp after ac_planedamage() freed it.
Broken in commit 16b16e34, v4.3.27.  Diagnosed with valgrind.

12 years agoDrop superfluous parameter vec[] of build_ship() & friends
Markus Armbruster [Sat, 23 Apr 2011 14:29:58 +0000 (16:29 +0200)]
Drop superfluous parameter vec[] of build_ship() & friends

All callers pass sp->sct_item.

12 years agoBetter diagnostics when build can't find suitable sectors
Markus Armbruster [Sat, 23 Apr 2011 09:11:23 +0000 (11:11 +0200)]
Better diagnostics when build can't find suitable sectors

Report "No sectors" when there are no *owned* sectors, instead of "Bad
sector specification" when there are no sectors at all.

12 years agoClean up buil()'s variable declarations
Markus Armbruster [Sat, 23 Apr 2011 08:51:35 +0000 (10:51 +0200)]
Clean up buil()'s variable declarations

12 years agoMake "build n" accept the optional tech argument
Markus Armbruster [Sat, 23 Apr 2011 08:15:16 +0000 (10:15 +0200)]
Make "build n" accept the optional tech argument

It has currently no real effect on the nuke built (nukes don't improve
with tech), but the special case is ugly, and is inconsistent with
info build.

12 years agoSimplify buil(): factor "can't build" handling out of switch cases
Markus Armbruster [Sat, 23 Apr 2011 07:22:00 +0000 (09:22 +0200)]
Simplify buil(): factor "can't build" handling out of switch cases

12 years agoSimplify buil(): factor getting third argument out of switch cases
Markus Armbruster [Sat, 23 Apr 2011 06:42:37 +0000 (08:42 +0200)]
Simplify buil(): factor getting third argument out of switch cases

12 years agoSimplify buil(): replace a switch by a function pointer
Markus Armbruster [Sat, 23 Apr 2011 06:34:35 +0000 (08:34 +0200)]
Simplify buil(): replace a switch by a function pointer

To enable that, make build_ship() & friends all take the same int type
argument instead of each one its own pointer.  Passing pointers
triggered "may be used uninitialized" compiler warnings (the code was
safe despite the warnings).

12 years agoDon't truncate research before multiplying with drnuke_const
Markus Armbruster [Sat, 23 Apr 2011 06:26:36 +0000 (08:26 +0200)]
Don't truncate research before multiplying with drnuke_const

For drnuke_const 0.33, research level 92.4 now suffices for a tech 280
nuke.  Before, you needed 93, which was inconsistent with what
version's promise "need 0.33 times the tech level in research".

12 years agoCreate nukes at the tech level permitted by research
Markus Armbruster [Sat, 23 Apr 2011 06:05:40 +0000 (08:05 +0200)]
Create nukes at the tech level permitted by research

The tech level is visible to players, but currently has no effect.

12 years agoBridge building required 0.005 tech less than advertized, fix
Markus Armbruster [Sat, 23 Apr 2011 06:03:17 +0000 (08:03 +0200)]
Bridge building required 0.005 tech less than advertized, fix

Has been that way since bridge building required tech.

12 years agoSimplify build_bridge(): replace a switch by a function pointer
Markus Armbruster [Sat, 23 Apr 2011 05:55:45 +0000 (07:55 +0200)]
Simplify build_bridge(): replace a switch by a function pointer

12 years agoFactor bridge building out of buil()
Markus Armbruster [Sat, 23 Apr 2011 05:50:32 +0000 (07:50 +0200)]
Factor bridge building out of buil()

Also avoids a "may be used uninitialized" compiler warning (the code
was safe despite the warning).

12 years agoMove bridge building functions together, rename
Markus Armbruster [Sat, 23 Apr 2011 05:46:54 +0000 (07:46 +0200)]
Move bridge building functions together, rename

Rename build_bridge() to build_bspan(), and build_tower() to
build_btower().

12 years agoCheck build's first argument before asking for the second
Markus Armbruster [Sat, 23 Apr 2011 05:19:55 +0000 (07:19 +0200)]
Check build's first argument before asking for the second

12 years agoImplement toggle techlists for show nuke
Markus Armbruster [Fri, 22 Apr 2011 18:00:26 +0000 (20:00 +0200)]
Implement toggle techlists for show nuke

This was probably neglected when the techlists feature was added in
v4.0.0, because compiled-in nukes were sorted by tech, unlike ships,
planes and land units.  Customization can break that.

12 years agoRewrite implementation of toggle techlists in show
Markus Armbruster [Fri, 22 Apr 2011 17:30:59 +0000 (19:30 +0200)]
Rewrite implementation of toggle techlists in show

To get rid of the ugly global variables.

Unlike before, the sort by tech is stable.

12 years agoFuse a few pr() in show_ship_stats() & friends
Markus Armbruster [Fri, 22 Apr 2011 16:11:29 +0000 (18:11 +0200)]
Fuse a few pr() in show_ship_stats() & friends

Also trim trailing space in output.

12 years agoBelatedly clean up after commit 3b4de2fe Remove option FUEL
Markus Armbruster [Fri, 22 Apr 2011 16:07:13 +0000 (18:07 +0200)]
Belatedly clean up after commit 3b4de2fe Remove option FUEL

12 years agoFix "show land s" to show columns xpl and lnd again
Markus Armbruster [Fri, 22 Apr 2011 16:06:33 +0000 (18:06 +0200)]
Fix "show land s" to show columns xpl and lnd again

Broken in commit 3b4de2fe, v4.3.15.

12 years agoFactor show_load() out of show_ship_capab(), show_land_capab()
Markus Armbruster [Fri, 22 Apr 2011 15:39:40 +0000 (17:39 +0200)]
Factor show_load() out of show_ship_capab(), show_land_capab()

12 years agoSimplify show_capab(), don't print trailing space
Markus Armbruster [Fri, 22 Apr 2011 15:35:23 +0000 (17:35 +0200)]
Simplify show_capab(), don't print trailing space

12 years agoFactor show_capab() out of show_ship_capab() & friends
Markus Armbruster [Fri, 22 Apr 2011 15:25:22 +0000 (17:25 +0200)]
Factor show_capab() out of show_ship_capab() & friends

12 years agoBump version to 4.3.28
Markus Armbruster [Fri, 22 Apr 2011 15:24:05 +0000 (17:24 +0200)]
Bump version to 4.3.28

13 years agoFix compile under Window MinGW environment v4.3.27
Ron Koenderink [Sun, 17 Apr 2011 21:43:55 +0000 (15:43 -0600)]
Fix compile under Window MinGW environment

Switch to __int64 from _int64.  Change the constant
declaration to use LL instead of a cast.

13 years agoClean up extra headline in info Bridges
Markus Armbruster [Sun, 17 Apr 2011 15:45:25 +0000 (17:45 +0200)]
Clean up extra headline in info Bridges

13 years agoUpdate info History and Overview to cover 1998-present
Markus Armbruster [Sun, 17 Apr 2011 15:09:44 +0000 (17:09 +0200)]
Update info History and Overview to cover 1998-present

13 years agoClean up info Bugs
Markus Armbruster [Sun, 17 Apr 2011 09:56:23 +0000 (11:56 +0200)]
Clean up info Bugs

Add bug reporting instructions.

Drop the bugs documented as fixed.  File was last changed in Empire 2,
so these have been fixed for a while...

Remaining bugs:

    The classification scheme used by report is dumb.

It still is.

    You can make a sector temporarily useless by filling up all its
    fields with delivery and distribution information.  This is useful
    when an enemy is trying to capture the sector (his mil don't have
    room to move in :-) You have to halt some of the deliveries or
    distributions to make room for the military to move in.  (Mostly
    fixed by changing the number of available fields)

Fixed since 4.2.14 eliminated `variables'.  Delete.

    Warehouses can't distribute all commodities simultaneously, due to
    limited fields for this information.  This becomes a problem if
    you have a countrywide network of warehouses distributing to each
    other.  (Mostly fixed by changing the number of available fields)

Fixed since 4.2.14 eliminated `variables'.  Delete.

    You can sometimes move small quantities of certain items from
    warehouses at no mobility cost, even into mountains (this is my
    favorite bug, I'd hate to see it fixed :-)

Feature; delete.

    Guerrillas don't seem to carry the plague.

They still don't.

    You can sometimes trick someone into paying a huge price for
    commodities by changing the price suddenly.  Therefore one should
    always check prices when buying commodities.

You can't increase prices anymore.  Delete.

    When two countries are attacking each other simultaneously, you
    can sometimes move into a sector he is in the process of
    attacking.  If you get the timing right, he will take the sector
    but you will get it back, along with all his military.

Can't reproduce; delete.

    If a plane is out to trade, and gets shot down, it can still be
    bought until the next update.  If another country builds a new
    plane that gets the number of the plane that was shot down, the
    new plane will go on the trading market automatically.  Then if
    that plane is bought, the money goes to the country whose plane
    was shot down, not the country that built the plane.  I stole
    numerous planes (including nuclear missiles :-) this way (by
    deliberately putting low numbered planes up for trade, then having
    them shot down).

Planes on a trading block can't get shot down, because they can't fly.
They can get destroyed on the ground, though.  A new plane with the
same number still goes on the market automatically.  Same for ships,
land units and nukes.  check_trade() deletes a trade when the object's
owner changed.  Reword the paragraph accordingly.

    If a plane has negative mobility, then gets traded, mobility goes to 0.

Still correct.

    Firing on sectors with land-locked sunken ships does strange
    things.

Can't reproduce; delete.

    If two countries are cooperating, its possible to raid an enemy
    airport and steal the planes by putting them out to trade.

Still correct.

    You can also strip enemy sectors of commodities using "sell", if
    you have military control temporarily.

Requires mobility now.  Delete.

    One can make work go back to 100 everywhere in a country by moving
    all civil- ians in low-work sectors onto a bridge, then collapsing
    the bridge.  Work then goes to 100 at the next update, if you
    leave some mil in the vacated sectors.  Or you can move mil out
    too, letting the sector ownership change to the Deity, then move
    back in from a 100% working sector, and work goes immediately to
    100.

Feature; delete.

    Two cooperative countries can move commodities around at no
    mobility cost using the market.

Still correct.

    You can collapse enemy bridges by making a lightning raid on his
    bridgeheads and redesignating them, even if you only hold the
    bridgehead for a short time.  (In this games, bridges work
    differently, see info build, info bridges")

Still correct.  The parenthesis is cryptic, though; delete it.

    You can map out enemy territory by raiding his radar stations.

Feature; delete.

    Condition checking is very treacherous.  Global commands with
    conditions are unreliable.  I never figured out exactly what was
    wrong, although I think your method of putting conditions towards
    the front of the line helped sometimes.

Can't reproduce; delete.

    You can have more than 26 ships in a fleet, but only the first 26
    will move when you navigate the fleet (I think 26 is the right
    number, but I'm not cer- tain.  It might be 32).

Can't reproduce; delete.

    "Look" only spots subs (from destroyers) at a certain distance.
    If you are too close you won't see them (unless you are in the
    same sector).

Can't reproduce; delete.

    You can only fly as many planes on a mission as you can fit on the
    command line (so low numbered planes have an advantage this way).
    USE WINGS

The real issue here is truncation of long input lines.  Replace.

    When a sector has a visible ship, radar doesn't show whether the
    sector is land or sea, just the ship.  This has interesting
    possibilities for exploita- tion (like land-locking a battleship
    in your capital in order to deceive the enemy :-)

Feature; delete.

    I don't think you can land planes on a land-locked aircraft
    carrier anymore.

Yes, you can.  Is that good or bad?  Anyway, delete.

    Its common to mistakenly set the price of a plane or ship
    incorrectly so one should check trade after using set.

Pilot error; delete.

    The "must be accepted by" date on offered loans is bogus.

Why is it bogus?  The date looks good to me.  The offer expires at
that time.  Delete.

    "Turn off" doesn't stop updates.

Feature; delete.

13 years agoUpdate change log again for 4.3.27
Markus Armbruster [Sun, 17 Apr 2011 09:42:04 +0000 (11:42 +0200)]
Update change log again for 4.3.27

13 years agoDon't .ds <= and >=, use \(<= and \)>= directly
Markus Armbruster [Sun, 17 Apr 2011 09:29:03 +0000 (11:29 +0200)]
Don't .ds <= and >=, use \(<= and \)>= directly

The symbols work fine even with CRT.MAC.  In fact, they've been used
by Food.t since Empire 2.

13 years agoClarify info turn: turn off doesn't disable updates
Markus Armbruster [Sun, 17 Apr 2011 09:23:50 +0000 (11:23 +0200)]
Clarify info turn: turn off doesn't disable updates

13 years agoBelatedly update designate's c_form
Markus Armbruster [Sun, 17 Apr 2011 09:21:47 +0000 (11:21 +0200)]
Belatedly update designate's c_form

Commit 8227d8c8 (v4.3.12) removed its optional argument without
updating c_form.

13 years agoMake option RAILWAYS disable rail infrastructure
Markus Armbruster [Sun, 17 Apr 2011 09:16:01 +0000 (11:16 +0200)]
Make option RAILWAYS disable rail infrastructure

Rail infrastructure isn't used with RAILWAYS.  Disable, to make the
improve command reject it.

13 years agoClean up mark()'s test for its optional argument
Markus Armbruster [Sun, 17 Apr 2011 07:53:40 +0000 (09:53 +0200)]
Clean up mark()'s test for its optional argument

Commit 60bbb6b0 (v4.2.15) accidentally changed the test from "absent
or empty" to "absent".  Leave it that way, just clean it up.

13 years agoFix buy not to wipe out concurrent updates
Markus Armbruster [Sun, 17 Apr 2011 04:44:21 +0000 (06:44 +0200)]
Fix buy not to wipe out concurrent updates

buy() reads the lot, prompts for input, then writes back the lot,
triggering a generation oops.  Any updates made by other threads while
buy() waits for input are wiped out, triggering a seqno mismatch oops.

Since commodities are taken from the seller when he puts them on the
market, and given to the buyer when the trade executes, the wiped out
lot's seller loses his goods without compensation, the other seller
gets to keep his goods, and the buyer receives their duplicates.

This can be abused by two conspiring countries to duplicate
commodities.  The seller puts them on the market (say 100 gold bars).
The buyer starts a buy command, and waits at its last prompt for the
lot to be replaced.  The seller takes them off the market (possible,
since there's no bid, yet), and sells something else (say one food)
quickly enough to get the same lot number assigned.  The buyer then
completes the buy command.  The seller loses one food, the buyer gains
100 gold bars.

Replaces a partial fix from v4.0.1, which only caught lots gone away,
not lots replaced by new ones.

13 years agoUse SECS_PER_DAY instead of literal 86400
Markus Armbruster [Sat, 16 Apr 2011 19:05:06 +0000 (21:05 +0200)]
Use SECS_PER_DAY instead of literal 86400

13 years agoDon't let planes on trading block intercept or interdict
Markus Armbruster [Sat, 16 Apr 2011 19:00:27 +0000 (21:00 +0200)]
Don't let planes on trading block intercept or interdict

Fighters, SAMs, ABMs and anti-sats could intercept, and tactical
missiles could interdict ships or land units.

Missed when the other missions were fixed in v4.2.7.

13 years agoFix setsector and setres not to wipe out concurrent updates
Markus Armbruster [Sat, 16 Apr 2011 18:34:26 +0000 (20:34 +0200)]
Fix setsector and setres not to wipe out concurrent updates

setsector() reads the sector, prompts for input, then writes back the
sector, triggering a generation oops.  Any updates made by other
threads while setsector() waits for input are wiped out, triggering a
seqno mismatch oops.

Same for setres().

13 years agoReduce massive code duplication in setsector(), setres()
Markus Armbruster [Sat, 16 Apr 2011 18:30:22 +0000 (20:30 +0200)]
Reduce massive code duplication in setsector(), setres()

There's the same sector loop in every switch case.  Loop around the
switch instead.

13 years agoMake info pray point to version (for e-mail) and flash
Markus Armbruster [Sat, 16 Apr 2011 13:53:01 +0000 (15:53 +0200)]
Make info pray point to version (for e-mail) and flash

13 years agoCommit 44db5453 added a FIXME comment accidentally, drop it
Markus Armbruster [Sat, 16 Apr 2011 12:50:51 +0000 (14:50 +0200)]
Commit 44db5453 added a FIXME comment accidentally, drop it

13 years agoCommit f04d1ae0 made journal escape '\t' again, fix
Markus Armbruster [Sat, 16 Apr 2011 11:25:47 +0000 (13:25 +0200)]
Commit f04d1ae0 made journal escape '\t' again, fix

13 years agoClean up write-only variable in path_find_to()
Markus Armbruster [Thu, 14 Apr 2011 19:20:09 +0000 (21:20 +0200)]
Clean up write-only variable in path_find_to()

13 years agoUpdate change log for 4.3.27
Markus Armbruster [Thu, 14 Apr 2011 18:54:16 +0000 (20:54 +0200)]
Update change log for 4.3.27

13 years agoClean up getcommand(): use sizeof() instead of literal 1024
Markus Armbruster [Thu, 14 Apr 2011 18:47:20 +0000 (20:47 +0200)]
Clean up getcommand(): use sizeof() instead of literal 1024

13 years agoFix client to log long input lines untruncated
Markus Armbruster [Thu, 14 Apr 2011 18:42:42 +0000 (20:42 +0200)]
Fix client to log long input lines untruncated

They can still get split by output arriving between two reads from
input, but that's unavoidable, because the client is designed to read
and write big chunks, not lines.

13 years agoFix client crash for long input lines
Markus Armbruster [Thu, 14 Apr 2011 05:48:14 +0000 (07:48 +0200)]
Fix client crash for long input lines

recv_input() misued lbuf_putc() and passed truncated lines without a
final newline to save_input(), failing the assertion in save_input().

13 years agoMark long info pages with `!' in subject pages
Markus Armbruster [Wed, 13 Apr 2011 17:50:31 +0000 (19:50 +0200)]
Mark long info pages with `!' in subject pages

13 years agoUpdate info version example to current output
Markus Armbruster [Wed, 13 Apr 2011 05:12:07 +0000 (07:12 +0200)]
Update info version example to current output

13 years agoRemove edit keys deprecated in 4.3.15, 4.3.17 and 4.3.20
Markus Armbruster [Tue, 12 Apr 2011 21:07:03 +0000 (23:07 +0200)]
Remove edit keys deprecated in 4.3.15, 4.3.17 and 4.3.20

These are: ship and land 'B', land 'P', and plane 'n'.

13 years agoUpdate known contributors comments
Markus Armbruster [Mon, 11 Apr 2011 20:40:57 +0000 (22:40 +0200)]
Update known contributors comments

13 years agoFix give not to wipe out concurrect updates
Markus Armbruster [Mon, 11 Apr 2011 19:52:10 +0000 (21:52 +0200)]
Fix give not to wipe out concurrect updates

give() reads the sector, prompts for input, updates the sector and
writes it back, triggering a generation oops.  Any updates made by
other threads during the yield are wiped out, triggering a seqno
mismatch oops.

13 years agoMake generation numbers catch more potential yields on input
Markus Armbruster [Mon, 11 Apr 2011 19:37:23 +0000 (21:37 +0200)]
Make generation numbers catch more potential yields on input

getstarg(), snxtitem() and snxtsct() can yield the processor, because
they call getstring().  But only for null or empty arguments.  For
other arguments, we should call ef_make_stale(), to catch errors.
Problem: if a caller never passes null or empty arguments, it may rely
on these functions not yielding.  We'd get false positives.  In
general, we can't know whether that's the case.  But we do know in the
common special case of player arguments.  Call ef_make_stale() for
those.

13 years agoDocument sequence numbers and generation numbers better
Markus Armbruster [Mon, 11 Apr 2011 19:21:19 +0000 (21:21 +0200)]
Document sequence numbers and generation numbers better

13 years agoSimplify map(): use getstarg() instead of getstring()
Markus Armbruster [Mon, 11 Apr 2011 17:49:10 +0000 (19:49 +0200)]
Simplify map(): use getstarg() instead of getstring()