Commit graph

2474 commits

Author SHA1 Message Date
73e06535bf (disablefil): Remove, belatedly (unused since optlist.h rev. 1.46). 2007-07-28 19:31:30 +00:00
21946d0a63 (datarootdir): New; Autoconf 2.60 wants it. 2007-07-28 19:18:41 +00:00
62c8eea544 Remove the ancient, crufty non-UCONTEXT system-dependent LWP code.
Using it required manual hackery since 4.3.0, and it hasn't been
missed.
2007-07-28 13:58:58 +00:00
015d8d933b Update from http://autoconf-archive.cryp.to/ 2007-07-28 13:09:00 +00:00
8bd0a2cf81 (bp_ref): Use XYOFFSET(). Old code used only every other slot.
(bp_alloc): Use WORLD_SZ().  Allocates only half as much.
2007-07-28 12:16:50 +00:00
56de7a2151 (WORLD_SZ): New.
(isok, ef_init, bmaps_intersect, bp_init, player_accept)
(finish_sects, main): Use it.

(bp_neighbors, bp_lbcost, pathcost): Use XYOFFSET().  No
functional change.
2007-07-28 12:12:17 +00:00
e24b608dc6 (nav_map): Remove unused bitmap and its initialization. 2007-07-28 07:23:59 +00:00
cc2629d6cf (sctoff): Oops on bad arguments. Recovery by returning -1 seems
dangerous.  Not touching that now.

(sctoff): Use XYOFFSET().  No functional change.
2007-07-28 07:08:45 +00:00
6d9e78af4c (XYOFFSET): Returned twice the value it should.
(finish_sects): Allocated twice as much space as needed, to make it
work with the broken XYOFFSET().
2007-07-28 07:06:55 +00:00
e09f50a7d3 (empth_wait_for_signal) [EMPTH_W32]: Fix to return SIGTERM. 2007-07-27 20:30:11 +00:00
e1cd0bdc21 (add): Plug file descriptor leak. 2007-07-27 20:23:47 +00:00
f915f91b47 Update known contributors comment. 2007-07-27 20:16:19 +00:00
d4573ea180 Spelling fix. 2007-07-27 19:13:13 +00:00
83acae02be Update AUTHORS. 2007-07-27 19:12:32 +00:00
1be2d7be4c Comment. 2007-07-27 19:10:39 +00:00
0eeed1c920 (main): Initialize game_turn to one instead of zero. 2007-07-27 18:23:03 +00:00
c329f882a2 (VIS, SANCT, NORM, GOD, CAP, MONEY): Move from nat.h to player.h.
(PS_LOGIN): Unused, remove.
2007-07-27 17:50:09 +00:00
78b7f3547c Fix the previous revision. 2007-07-27 17:43:13 +00:00
3935444408 updates_disabled() moved to game.h, include it. 2007-07-27 17:29:55 +00:00
286dda725e Store update disable flag in the game table to make it visible in
xdump:
(gamestr): New member game_upd_disable.
(game_ca): Update accordingly.
(game_ctrl_update): New.
(disa, enab): Use it.
(updates_disabled): Rewrite and move to game.c
(disablefil): Remove.
2007-07-27 05:58:40 +00:00
e7e8717e86 (parse_time): Fix for arguments describing a time when DST is in
effect.
2007-07-27 04:26:20 +00:00
Ron Koenderink
812eab5427 Fix the previous revision. 2007-07-26 02:00:49 +00:00
Ron Koenderink
ce6a691126 (fmttime2822): Changed return type for strftime() to size_t.
(fmttime2822) [_WIN32]: %T is not support option for strftime in WIN32
replaced with %H:%M:%S.  Replaced %z in with +/-???? format for WIN32
as the default for WIN32 is the text description for timezone.
2007-07-26 01:59:32 +00:00
f691a07814 Fix the previous revision. 2007-07-25 19:35:09 +00:00
043015e829 (player_kill_idle): Don't kill hung player threads. That code was
flawed.  Firstly, when player_kill_idle() ran before the player thread
could react to being aborted by update or shutdown, player_kill_idle()
incorrectly diagnosed it as hung.  Secondly, terminating hung threads
leaks resources and can leave a stale play_lock behind.  It could
perhaps even corrupt game state.  It might salvage some scenarios, but
makes others worse.  Not worth it.
2007-07-25 06:10:10 +00:00
d500a7071c Remove the concept of thread priorities from empthread.h. Only LWP
supports priorities.  Update synchronization used to rely on them,
which naturally worked only with LWP (#1504036).  With that fixed, no
uses of priorities remained, but a minor bug did: players could starve
out threads with priorities below PP_PLAYER, i.e. delete_lostitems()
and player_kill_idle().  Closes #1458175:
(empth_create): Remove parameter prio.  Callers changed.  Also gets
rid of misleading comments in pthread.c and ntthread.c.
(PP_MAIN, PP_UPDATE, PP_SHUTDOWN, PP_SCHED, PP_TIMESTAMP, PP_PLAYER)
(PP_ACCEPT, PP_KILLIDLE): Remove.
(empth_init, empth_create) [EMPTH_LWP]: Pass priority 1.
2007-07-24 05:13:31 +00:00
7536a38e95 Comment. 2007-07-24 04:10:44 +00:00
8fa3ba1b60 (dispatch): Set player->command before acquiring play_lock, to make
sure the command is reliably aborted on update and shutdown.  Before,
redirection output could block while player->command was still null,
letting players delay the update or shutdown indefinitely.
2007-07-22 17:23:34 +00:00
f850968883 (dispatch): Rwlocks can hand out read locks while a write lock is
wanted.  Unfair to writers, but possible.  This lets commands run with
!player->aborted, which can then block on input and thus let players
delay the update or shutdown indefinitely.  Avoid by spinning until
the update is done.
2007-07-22 17:06:00 +00:00
Ron Koenderink
bca365c485 (set_paths) [_WIN32]: Add a comment to explain the use of _fullpath(). 2007-07-21 00:50:32 +00:00
be8e1d068e (shutdwn): Failed to set play_wrlock_wanted. This let player threads
block on output, which could delay shutdown indefinitely.
2007-07-20 19:49:42 +00:00
a9afd1efef (update_lock, play_lock, update_pending, play_wrlock_wanted): Move to
main.c and rename to better reflect their purpose.  Fix misleading
comments.
2007-07-20 19:09:34 +00:00
d4150cc2ee LWP failed to wake up threads sleeping in empth_sleep() while other
threads were runnable.  This let players with a sufficiently fast
connection starve out system threads, including the update.  Fix:
[EMPTH_LWP] (lwpWakeupSleep): External linkage.
[EMPTH_LWP] (lwpReschedule): Call it.
2007-07-20 18:12:03 +00:00
Ron Koenderink
228a545ff3 (UPDATE_TIME_LEN): New.
(update_time): Define with size to make MSVC happy.
2007-07-19 21:58:05 +00:00
032f14cf7a (main): Fix rev. 1.52. 2007-07-19 16:39:51 +00:00
Ron Koenderink
4926fbfdac (force): Remove unused local variable. 2007-07-19 01:15:15 +00:00
7dd8b8a305 New xdump updates:
(EF_UPDATES, update_ca): New.
(empfile): Add it.
(update_time): Move to src/lib/global/updtime.c.
2007-07-18 06:16:33 +00:00
e9cfbdc241 (update_running): New.
(update_run): Set it.

Replace incorrect uses of update_pending by update_running, fixing
buggy behavior while the update was trying to gain control:
(sct_do_upd_mob, shp_do_upd_mob, lnd_do_upd_mob, pln_do_upd_mob):
MOB_ACCESS mobility update was skipped.
(telegram_is_new): Fix recognition of new telegrams by timestamp.
(wu): Bulletins got misfiled as production reports.
(shp_nav): Sail path got ignored.
(setrel): Declaration of war failed silently with SLOW_WAR enabled.
Messages got suppressed.
(PR, mpr): Messages got misdirected to bulletins.
2007-07-17 06:13:14 +00:00
c1a0a42024 (util): Add empsched, belatedly. 2007-07-16 19:39:23 +00:00
448918ba7d Fix fallout from misc.h rev. 1.69. 2007-07-16 19:38:04 +00:00
6f1cc795f1 (status): Simplify conditional for the "lost your capital" message.
(player): No uses of member visitor left, remove.
2007-07-15 16:15:03 +00:00
a57645340c New command show updates:
(show): New sub-command.
(player_coms): Update its c_form.
(show_updates, fmttime2822): New.

(vers): Show game_days and game_hours.

(upda): Mark obsolete and point to show updates.
(vers): Point to show rather than update.

Rewrite much of info zdone.
2007-07-15 13:34:22 +00:00
87eeea32c9 (show): Print tech level later, when we're done prompting for
arguments.  This also prints it only for units, when it's relevant.
2007-07-15 13:22:37 +00:00
30217b1b87 Fix .SA. 2007-07-15 12:36:35 +00:00
38992e43b5 Update example to current output. 2007-07-15 12:32:48 +00:00
159cd471b8 Describe the effect on the Empire clock.
Warn against manual disable/enable and point to the schedule file.
2007-07-15 12:05:43 +00:00
c4812b0ea2 Describe the Empire clock. 2007-07-15 11:53:32 +00:00
f427e3d123 Update for the new Empire clock, i.e. don't refer to s_p_etu, which no
longer exists.

Abbreviate time unit as ETU rather than TU.

max_btus is 640, not 512.
2007-07-15 11:38:41 +00:00
315770cae5 Remove references to s_p_etu. 2007-07-15 11:02:17 +00:00
335d9d34ab Include reshuffle. 2007-07-15 10:07:48 +00:00