Commit graph

2398 commits

Author SHA1 Message Date
2de92d99d8 Clarify. Improve .SA. 2007-07-10 20:54:15 +00:00
fea01b7dd8 Fix for N_WELCH_DEAL, N_LND_LOSE, N_BOARD_LAND. 2007-07-10 20:49:07 +00:00
ba1c7e3267 (EMPCFONLYC, EMPCFBOTH): Rename parameter num to flags. 2007-07-10 18:27:24 +00:00
1fa61af843 (natstr): Simplify encoding of member nat_update. Users changed.
(WUPD_WANT): Unused, remove.
2007-07-10 17:48:57 +00:00
bd16520e7c (zdon): Simplify. Also gets rid of a compiler warning. 2007-07-10 17:28:23 +00:00
32f20dc511 Fix the previous revision. 2007-07-10 16:44:57 +00:00
6ca5e47f69 (opt_DEMANDUPDATE): Remove. Deities can use update_demandpolicy to
control demand updates.
2007-07-08 15:26:23 +00:00
d0e2834ca9 (prnat): Show nat_missed even when opt_DEMANDUPDATE is off, because
docountry() lets you edit it even then.
2007-07-08 11:46:49 +00:00
1fb03c5662 (journal_entry): Silence compiler warning in previous revision. 2007-05-27 14:00:59 +00:00
b9324da31d (player): Remove unused member blitz_time. 2007-05-27 13:36:14 +00:00
1cfeeb6e0c (show_nuke_build, show_nuke_capab): Fix rounding of research.
Reported by Doug Wescott.
2007-05-13 14:39:42 +00:00
06f61d1a4e Spelling fixes. 2007-04-09 09:36:28 +00:00
2e3ca36369 (powe): Don't tell user to run power new when it is disabled by
AUTO_POWER.
2007-03-24 17:31:36 +00:00
Ron Koenderink
2cdfec6a3a (journal_entry): Print unprintable characters in octal instead of a question mark. 2007-03-13 13:48:11 +00:00
Ron Koenderink
568ef6048d (S_IRUSR, S_IWUSR, S_IEUSR, S_IRWXU,
S_IRGRP, S_IWGRP, S_IEGRP, S_IRWXG,
S_IROTH, S_IWOTH, S_IEOTH, S_IRWXO) [_WIN32]:
Add #ifndef for standard defines as the the MinGW environment has the
user defines already created.  Correct EXEC permision to use S_IEXEC.
Set the group and other permssions to 0 as they do not exist in WIN32.
2007-03-11 21:29:37 +00:00
Ron Koenderink
e60f653d2d (new): Switch permissions to standard defines instead of magic numbers
to improve portability.
2007-03-10 19:23:44 +00:00
Ron Koenderink
856dcb7c5c (journal_entry): Add unsigned char cast to isprint() call.
(parse): Add unsigned char cast to isspace() call.
Portability bug fix for WIN32.
2007-03-10 18:12:29 +00:00
Ron Koenderink
c97d79c0ee (add, disa, ef_open, logerror, main): Switch permissions to
standard defines instead of magic numbers to improve portability.
Also define WIN32 equivalents to the standard defines.
2007-03-10 16:29:51 +00:00
Ron Koenderink
32d62797d2 (main): Enable group file permissions.
Makes the group file permissions consist with the rest of the server.
2007-03-05 13:31:56 +00:00
Ron Koenderink
d640c8cc4e (main.c) [_WIN32,WIN32]: Remove the define WIN32.
Not required for VC8.
2007-03-05 02:43:28 +00:00
Ron Koenderink
c2d0528178 (init_server): Move log_init() before the mobility_init() so its errors are logged
to the server log.
2007-03-05 02:40:18 +00:00
Ron Koenderink
ead51d369e (main): Remove the resetting of file permissions.
This will be prevent some file permissions being changed
unexpectly when running the files command.
2007-03-05 02:03:33 +00:00
Ron Koenderink
d4759f0dbb (logerror): Remove the permissions for others to view the game log file. 2007-03-05 01:58:54 +00:00
Ron Koenderink
3afb3925a2 (logerror): Ensure that logerror() only writes to the log file after log_init()
has been called
2007-03-03 15:23:32 +00:00
Ron Koenderink
8babf97d81 (nuk_on_plane): Ignore destroyed nukes when searching for the nuke that
belongs to a particular plane.
2007-03-03 15:12:57 +00:00
Ron Koenderink
2437a7a551 (kaboom): Print at least one set of "O O "s. 2007-03-03 15:09:43 +00:00
Ron Koenderink
e19229ad98 (empth_create) [_WIN32]: Fix the error return code check for
the call to _beginthread() to check for 1L instead of -1.
2007-02-24 14:05:21 +00:00
Ron Koenderink
91504142c3 [_WIN32,WIN32]: Remove the define WIN32.
Not required for VC8.
2007-02-24 13:39:07 +00:00
Ron Koenderink
0978c0c4fc (accept.c, io.c, nthread.c, tcp_listen.c) [_WIN32,WIN32]:
Remove the define WIN32.
Not required for VC8.
2007-02-23 22:51:30 +00:00
Ron Koenderink
7356da4775 (add.c, disa.c, log.c, new.c, wantupd.c, wu.c) [_WIN32,__GNUC__]:
Remove the !defined(__GNUC__) for <io.h>.
Not required for VC8.
2007-02-23 22:35:50 +00:00
Ron Koenderink
d7780fdcda (shut): Remove unused local variables. 2007-02-22 21:48:23 +00:00
c69cf0d1fd Semaphores are no longer used, remove:
(empth_sem_t, empth_sem_create, empth_sem_signal, empth_sem_wait):
Remove.
[EMPTH_LWP] (lwpSem, lwpCreateSem, lwpSignal, lwpWait): Remove.
[EMPTH_W32] (loc_sem): Remove.
2007-02-08 12:29:16 +00:00
c1eb1bd5d2 Rewrite how updates are triggered (closes #1504036):
(update_init, update_sched, update_run, update_wait): Don't create a
separate UpdateSched thread, run update_sched() in the Update thread.
Run the update by calling update_run() instead of by signalling its
thread.  update_run() replaces update_wait(); it just runs the update
and returns instead of waiting for the signal to update in a loop.
Move initialization of the Update thread's *player to its new thread
entry point.
(update_sem, update_init): Remove update_sem.
(update_thread): New.
(update_init): Initialize it.
(update_forced): New.
(update_trigger, update_force): Wake up update_thread with
update_force set.
(update_sched): Reset it before sleep, test it after sleep so that
schedule checking is only done for scheduled updates, not forced
updates.

(update_sched, update_init): Move sanity test of s_p_etu to
update_init().
2007-02-08 11:54:31 +00:00
cea39829af Make empth_wakeup() and empth_terminate() wake up empth_sleep(), and
empth_sleep() return whether that happened:
[EMPTH_LWP] (lwpWakeupSleep): New, factored out of lwpSelect().
[EMPTH_LWP] (lwpSelect): Use it.
[EMPTH_LWP] (lwpWakeup): New.  Call lwpWakeupFd() if sleeping in
lwpSleepFd(), lwpWakeupSleep() if sleeping in lwpSleepUntil().
[EMPTH_LWP] (lwpTerminate, empth_wakeup): Use it rather than
lwpWakeupFd().
[EMPTH_LWP] (lwpWakeupFd): Internal linkage.
[EMPTH_LWP] (lwpSleepUntil): Reset member runtime, so that lwpWakeup()
can test it reliably.  Return how sleep woke up.
[EMPTH_LWP] (empth_sleep): Return value of lwpSleepUntil().
[EMPTH_POSIX] (EMPTH_INTR): New.
[EMPTH_POSIX] (empth_wakeup): Set state to it.
[EMPTH_POSIX] (empth_restorectx): Clear state.
[EMPTH_POSIX] (empth_sleep): Don't re-seleep when state is not clear,
i.e. thread was woken up prematurely.  Return how sleep woke up.
[EMPTH_W32] (empth_sleep): Implement by waiting on hThreadEvent with a
timeout rather than a straight Sleep().  Return how sleep woke up.
2007-02-08 11:26:43 +00:00
fe2de3d743 Simplify. Should also be more efficient.
(LwpSigCheck): New.
(lwpCatchAwaitedSig): Set it.
(lwpSigWait): Clear it.
(lwpSigWakeup): Test it.
(lwpSigWakeup): Unblock LwpSigWaiter without testing LwpSigCatched.
(lwpSigWait): Test LwpSigCatched after wakeup.
(LwpSigAwaited, LwpSigPtr): Remove.
2007-01-31 20:23:07 +00:00
3788676530 Clean up after removal of wait command:
(player_wakeup_all, player_wakeup): Remove.  Callers changed.
(player): Remove member waiting.
2007-01-31 06:08:39 +00:00
fcef921437 Rev. 1.16 included time.h to get time_t. Change to sys/types.h. 2007-01-28 17:22:43 +00:00
3340fdf7f5 (lwp_rwlock_destroy): Plug memory leak. 2007-01-28 17:02:46 +00:00
3db0e2eb15 (empth_exit, empth_rwlock_destroy): Plug memory leaks. 2007-01-28 16:59:15 +00:00
d0ab92b944 (lwpSetDesc): Unused, remove.
[EMPTH_LWP] (lwpProc): Remove member desc.
[EMPTH_LWP] (lwpCreate, lwpDestroy): Don't initialize / finalize it.

[EMPTH_POSIX] (empth_t): Remove member desc.
[EMPTH_POSIX] (empth_init, empth_create): Don't initialize it.

[EMPTH_W32] (loc_Thread): Remove member szDesc.
[EMPTH_W32] (empth_init, empth_create): Don't initialize it.

(empth_create, lwpCreate): Remove parameter desc.  Callers changed.
2007-01-28 16:40:27 +00:00
ee46f55e6e (lwpCreate): Initialize members runtime and fd. Initializing fd is
necessary to make lwpWakeupFd() work reliably.  Initializing runtime
isn't strictly necessary, as it is used only while the thread is on
LwpDelayq, and putting it there sets runtime.
2007-01-28 14:34:34 +00:00
e501656b4a (lwpProc): Change type of member runtime to time_t.
(lwpSleepUntil): Change type of parameter to time_t.
2007-01-28 14:14:40 +00:00
8e6300b620 (LWP_CHECKMARK): Change to int. Should have been done in rev. 1.14. 2007-01-28 10:17:35 +00:00
Ron Koenderink
fb49865a42 (unit_path): Replace mpr() with pr() as unit_path() is only called
from navigate or march command.
2007-01-27 02:31:08 +00:00
Ron Koenderink
2b79442a82 (unit_view): Replace mpr() with pr() as unit_view() is only called
from navigate or march command.
2007-01-27 02:20:30 +00:00
Ron Koenderink
7434da679e (unit_view): New, create by expanding shp_view() to work for
land_unit as well.
(do_unit_move): Add view option for land units using unit_view().
Combine ship and land viewing using the unit_view().
(shp_view): Remove, not used any more, replaced by unit_view().
2007-01-27 02:04:27 +00:00
Ron Koenderink
aee2bc78e2 (unit_path): New, create by combining shp_path() and lnd_path().
(do_unit_move): Replace shp_path() and lnd_path() with unit_path().
(shp_path, lnd_path): Remove shp_path() and lnd_path(),
not used any more.
2007-01-24 23:24:37 +00:00
Ron Koenderink
d94d269769 (unit_put): New, create by combining shp_put() and lnd_put().
(sail_nav_fleet, shp_nav_one_sector): Replace shp_put() with unit_put().
(lnd_mar_one_sector, att_fight, move_in_land): Replace lnd_put() with unit_put().
(shp_put, lnd_put): Remove.
2007-01-23 23:51:02 +00:00
Ron Koenderink
038cc74d4e (unit_list): New, create by combining shp_list() and lnd_list().
(do_unit_move): Replace call to shp_list() and lnd_list() with unit_list().
(shp_list, lnd_list): Remove, not needed, replaced by unit_list().
2007-01-23 01:41:37 +00:00
Ron Koenderink
99e30073f2 (do_unit_move): Rename unit_list parameter to ulist
to prevent a future conflict with unit_list().
2007-01-21 23:11:59 +00:00