Commit graph

2686 commits

Author SHA1 Message Date
a1646c8aa7 (gamedir): Not all programs treat relative names the same. Document
the lossage.
2007-08-03 04:44:54 +00:00
f1094fbdc6 Doc fix. 2007-08-03 04:06:18 +00:00
1999751782 (bmaps_intersect): Simplify. No functional change. 2007-08-03 04:05:04 +00:00
Ron Koenderink
2270ea73d8 (fmttime2822) [_WIN32]: Replace localtime_s() with localtime().
Replace _snprintf_s() with _snprintf().  These secure functions are
not supported by MinGW yet.
2007-08-03 01:47:02 +00:00
5545eb4b0a (main): Use the same initial anchor as the server.
(main): Exit unsuccessfully when read_schedule() fails.
2007-08-01 18:23:51 +00:00
f2d96f466a Fix include missing since misc.h rev. 1.69. 2007-08-01 05:30:37 +00:00
e1926d9ce9 (ef_open): Leaked file descriptor when fcntl() failed. 2007-07-31 05:03:25 +00:00
0890911655 (new): Simplify. No functional change. 2007-07-31 05:01:46 +00:00
23aa13b2c7 Doc fix. 2007-07-31 04:57:07 +00:00
Ron Koenderink
4fdebd205e (upda): Remove unused local variable fp. 2007-07-29 16:57:36 +00:00
990eb46b91 (fl_sct_init, write_sects, file_sct_init, main): Do not initialize
sector and realm timestamps to current time.  It's not useful, and it
facilitates attacks against the PRNG.  This backs out fairland.c
rev. 1.27 and files.c rev. 1.31 and partly backs out files.c
rev. 1.38.
2007-07-29 13:40:47 +00:00
2c9b1ee80b (subst.in): Polish substitution of @configure_input@. 2007-07-28 19:33:35 +00:00
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