Commit graph

4523 commits

Author SHA1 Message Date
ee1f146dd8 Update change log again for 4.3.32
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-25 09:56:58 +02:00
4f6a3c9aae actofgod: Simplify fmtflags()'s error checking
Permit finding length by passing no buffer.  Not currently used.

Oops at most once.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-25 09:51:39 +02:00
1a27107bed server: Grow small thread stacks from 50 KiB to 64 KiB
Affected are threads AcceptPlayers, MarketUpdate, shutdownSeq.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:40 +02:00
8330b6f322 lwp: Increase EventHandler's stack size from 16 KiB to 64 KiB
Stack overflow observed on IBM Power 730 Express running AIX 7.1.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00
41c8033346 src/client/Makefile.in: Avoid :=, it breaks traditional make
Broken in commit c4ffd0a, v4.3.0.  Observed on AIX 7.1.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00
26a03abfd8 configure: Fix check for term.h to include curses.h first
Traditional curses needs this.  Observed on AIX 7.1.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00
3cc23a3cd4 Update change log for 4.3.32
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00
122cb5fc3b accept: Drop outdated FIXME SO_KEEPALIVE
SO_KEEPALIVE isn't useless with long idle timeouts.  Before v4.3.30's
idle timeout changes, such long timeouts had serious drawbacks (easy
denial of service), but they're just fine since then.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:37 +02:00
682a035b7c doc/clients-howto: Document use of bell character
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:36 +02:00
1621522c1c supply: Fix harmless bug in supply from ship in same sector
Bug bites when a ship supplies the sector it's in.  First the sector
is charged zero mob for moving the stuff, and is written back.  Next,
the sector receives the stuff, and is written back, clobbering the
first write (no effect), and triggering a seqno oops.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-08-17 17:57:23 +02:00
7d78c586c6 fairland: Fix usage information to include -v
Forgotten in commit 68a7ae7, v4.3.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-09 17:20:37 +02:00
2a6b6c941a fairland.6: Belatedly drop reference to ore
Missed in commit e3eadcd8, v4.2.14.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-09 17:04:00 +02:00
60ffa63779 doc/xdump: Fix grammar nit
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-09 17:03:59 +02:00
d743a38257 tests/actofgod: Disable in "make check" unless LWP
Expected to work only with thread package LWP, just like the smoke
test.  Commit 7a91041 carelessly enabled it for all thread packages.
Revert, except with LWP.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-09 16:58:08 +02:00
005ba942d0 build: Factor out pick_unused_unit_uid()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-08 13:36:57 +02:00
827e2e4cc0 edit: Trim trailing tab in output
print_plane() ends its output with '\t' instead of '\n'.  Next is a
prompt, which supplies the missing newline (see pr_id()).

Ugly, clean up.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-08 13:36:57 +02:00
fbaaed0322 info/edit info/give: Add see also swapsector
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-08 13:36:57 +02:00
4c68d14cc0 break: Honor new designation of sanctuaries
Breaking sanctuary turns 100% sanctuaries into capitals, all others
into highways.  Before Empire 3, sanctuaries always became capitals.

Give deities more control over initial state of countries than
choosing between 100% capital and <100% highway sectors: turn
sanctuaries into their new designation on break.  Except make a
capital when the new designation is sanctuary (which it normally is).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-08 13:36:32 +02:00
5900e9b279 setsector setresource: Mark as obsolete
"info setsector" claims you "can change anything that appears in dump
or peek (I think)", which has always been wrong.

edit is much more complete.  However, edit used to be more limited in
that it could change only one sector.  For mass-changes, you had to
use setsector and setresource.  Since that limitation is gone, there's
no real use left for setsector and setresource.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:59:30 +02:00
f3cb215e1f edit: Generalize edit to multiple objects
Accept general <SECTS|SHIPS|PLANES|LANDS|NATS> argument instead of
just <SECT|SHIP|PLANE|LAND|NAT>.

edit with <KEY> <VALUE>... arguments applies the arguments to all
selected objects.  Without such arguments, edit lets you edit the
selected objects interactively one after the other.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:59:18 +02:00
4d99e1df37 edit: De-duplicate code in edit()'s main switch
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:03 +02:00
0faceac070 edit: Detect concurrent updates during interactive nation edit
Unlike other edits, editing a country modifies the object in-place.
It has to, because editing may send bulletins, which updates nat_tgms,
and writing back a copy would clobber these updates, triggering a
seqno mismatch oops.

However, the in-place editing neglects to detect concurrent updates.
Fix that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:03 +02:00
9eec1a57e7 edit: Move write-back from edit_nat() to edit(), check for errors
This is how edit() works for everything else.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:03 +02:00
2b4eaca8b1 edit: Clean up a few assignments within conditionals
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:03 +02:00
859627c416 edit: Make uninmplemented edit n fail instead of doing nothing
Doing nothing is in the way.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:03 +02:00
a48b24ff33 edit: Use empobj_storage
In preparation of some refactoring.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:03 +02:00
f2bf352e66 edit: Don't reprint edited object when done with it
Interactive edit prints the edited object, then reads player input.
If it gets key and value, it applies them to the object, and repeats.
If it gets nothing, it prints the edited object again, and stops.

Remove this last print, because it's not really useful.  The object is
commonly the same after reading input as before.  Except when a nation
gets updated while "edit c" is waiting for input: then the second
print actually reflects the updates.  Has always been that way.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
2975ea02ae edit: Add remaining missing nation change reporting
Print a message describing the actual change for keys 't' (nat_tgms)
and 's' (nat_status).  The message is necessary to give the deity a
chance to catch unexpected changes, e.g. a player reading telegrams
just before the deity edits nat_tgms.

Send a bulletin to the country for key 's'.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
d006791ed6 edit: Improve remaining existing nation change reporting
Print "FOO of CNAME (#CNUM)" instead of just "FOO".  Print "unchanged"
instead of "changed from X to X" on no-op.

Send a bulletin to the country and report news when appropriate.

Affected keys:

        key   struct member   before  after   notes
        -------------------------------------------
         n    nat_cnam        --      BN         1
         r    nat_pnam        --      B-         2
         b    nat_btu         --      BN         3
         m    nat_reserve     BN      BN
         c    nat_xcap,ycap   --      B-
         o    nat_xorg,yorg   --      B-
         u    nat_timeused    --      BN
         M    nat_money       B-      BN

Notes:

1. Reports N_NAME_CHNG rather than N_AIDS/N_HURTS.

2. Message improved to accurately reflect string truncation.

3. Greengrocers' apostrophe in message fixed.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
93aa604b67 edit: Improve tech, research, edu, happiness change reporting
Print "Technology" instead of "Tech".  Print "FOO of CNAME (#CNUM)"
instead of just "FOO".  Print "unchanged" instead of "changed from X
to X" on no-op.

Send a bulletin to the unit owner and report news on change.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
e6c1476c2f actofgod: New divine_nat_change(), similar to divine_sct_change()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
a03d804ffc edit: Add remaining missing unit change reporting
Print a message (always), send a bulletin to the unit owner and report
news (sometimes).

The message is necessary to give the deity a chance to catch
unexpected changes, e.g. a player spending mobility right before the
deity edits it.  Watching out for such changes is especially important
with non-interactive edit.

Affected keys:

    cmd  key    struct member   action
    ----------------------------------
    edit s L    shp_x,y         B-
           E    shp_effic       BN
           M    shp_mobil       BN
           F    shp_fleet       B-
           T    shp_tech        BN
           a    shp_pstage      --
           b    shp_ptime       --
           R    shp_rpath       B-
    edit p l    pln_x,y         B-
           e    pln_effic       BN
           m    pln_mobil       BN
           w    pln_wing        B-
           t    pln_tech        BN
           r    pln_range       B-
    edit u L    lnd_x,y         B-
           e    lnd_effic       BN
           M    lnd_mobil       BN
           a    lnd_army        B-
           t    lnd_tech        BN
           F    lnd_harden      BN
           Z    lnd_retreat     B-
           R    lnd_rpath       B-

The two characters in column action show whether the command sends a
bulletin (B) or not (-), and whether it reports news (N) or not (-).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
4aa2f071ba edit: Report flags change properly
Print a message, send bulletin to owner.  Affects ship key 'W', land
unit key 'W', and plane key 'f'.  The message is necessary to give the
deity a chance to catch unexpected changes, e.g. a player modifying
retreat conditions right before the deity edits them.  Watching out
for such changes is especially important with non-interactive edit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
ef2e2d08a2 edit: Teleport planes and land units to carrier on load
Edit lets deities load units onto remote carriers, resulting in a
carriers having cargo in another sector.  Not good.  Cargo gets
teleported to its carrier belatedly when the carrier moves.

Better let edit take care of the teleport.

Also tell the deity that he just caused a teleport.  Necessary to give
the deity a chance to catch unexpected changes, e.g. a player moving a
plane right before the deity edits it.  Watching out for such changes
is especially important with non-interactive edit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
3dceefbbc9 edit: Refuse to move planes and land units on carriers
They really need to stay with their carrier.  Else, cargo gets
silently teleported to its carrier when the carrier moves.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
cbe9897bfa edit: Report loading/unloading of planes & land units properly
Print a message, send bulletin to owner.  Affects plane keys 's', 'y',
and land unit keys 'S', 'Y'.  The message is necessary to give the
deity a chance to catch unexpected changes, e.g. a player loading a
plane right before the deity edits it.  Watching out for such changes
is especially important with non-interactive edit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
97b3aacaca edit: Report unit loss and gain properly for key 'U'
Send bulletin to owner and report news exactly like for key 'O' or
sector key 'L'.

Print a "duplicated" message, just for consistency with other keys.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
7a9104164f tests/actofgod: Enable in "make check"
The showstopper bugs have been fixed.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
1f950f6a70 edit: Report unit key 'U' failure more nicely, and avoid oops
Two failure modes:

* When the argument is negative, edit() attempts an invalid write,
  triggering an oops.  edit() detects the write failure, and returns
  RET_FAIL.

  Detect the negative argument instead, and return RET_SYN, like we do
  for other invalid edit arguments.

* When the argument requires the table to be extended, but the
  extension fails, edit() returns RET_FAIL.

  Additionally report the failure to the player.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
ccd4368679 edit: Report unit loss and gain properly for unit key 'O'
Print a message describing the actual change.  Necessary to give the
deity a chance to catch unexpected changes, e.g. a player boarding a
ship right before the deity edits it.  Watching out for such changes
is especially important with non-interactive edit.

Code already sends bulletins.  Also report news.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:02 +02:00
6e260f7f5e edit: Factor out edit_unit()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
b99a116dd6 edit: Report ship and land unit commodity change properly
Print a message describing the actual change.  Necessary to give the
deity a chance to catch unexpected changes, e.g. a player unloading
stuff right before the deity edits it, leaving fewer items than the
deity intends to take.  Watching out for such changes is especially
important with non-interactive edit.

Send bulletin to owner and report news exactly like the give command.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
5e4af4a6f0 actofgod: New divine_unit_change(), similar to divine_sct_change()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
2f475a54dc actofgod: Factor report_divine_gift() out of give()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
004c4d0f23 edit &c: Report sector non-change differently
Print "unchanged" instead of "changed from X to X".  Affects edit,
setresource, setsector.  Suppress bulletin and news.  Affects only
edit sector key 'L'.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
6ff503c288 actofgod: Factor divine_sct_change() out of edit.c
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
82a59fbcc3 edit: Streamline wording of sector change reports slightly
Most places use "FOO of X,Y changed", some use "FOO in X,Y changed",
"FOO in X,Y was changed", "FOO of sector X,Y changed".  Normalize to
the former.

Most places do not end the message with a period, some do.  Normalize
to no period.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
6f0cd10b81 sect: Catch clobbered sector coordinates in sct_prewrite()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
22d39b9afa ef_verify: Cover sector coordinates in game state verification
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00
0f3134fc15 sctoff2xy(): New, factored out of sct_oninit()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2013-06-06 19:55:01 +02:00