Ron Koenderink [Sun, 21 Aug 2005 17:17:38 +0000 (17:17 +0000)]
(io_output_all,update_main,update_wait): Do not block on writing when
aborting commands for an update. Move update_pending to the start of
the update sequence where the commands are aborted.
(sorde): Output messed up for ships with sail path. Fix and
simplify. Remove inappropriate ship sanity check, should be done
elsewhere, and differently.
(qorde): Output messed up for ships with sail path. Fix and
simplify. Remove inappropriate ship sanity check, should be done
elsewhere, and differently.
(checksect, give_back_cap, guerrilla): No longer change capital to
agribusiness. That was done when the occupier abandons the old-owners
capital or it revolts, to prevent players from sacking the same
capital many timers. The server has a much better way to prevent that
since 4.2.7, so this weird hack is no longer useful. Thanks to Pat
Loney for pointing this out.
(player_init) [LISTENMAXCONN]: Comment seems to claim Linux doesn't
have SOMAXCONN, but has LISTENMAXCONN. In fact, it has SOMAXCONN, and
LISTENMAXCONN doesn't exist anywhere in /usr/include or the Internet.
Remove the special case.
[_DECTHREADS_] Drop support for DECthreads d4, a.k.a. DCE threads,
which are obsolete since at least 1997.
(empth_terminate, empth_wakeup) [__ppc__]: Ancient versions of OS X
lacked pthread_kill(). As a work-around, its use was disabled here
for all versions of OS X. The work-around could lead to hangs.
Remove it and drop support for ancient versions of OS X.
(empth_create) [__linux__]: Linux has supported thread attribute
stacksize for ages. Remove the special case.
Ron Koenderink [Sat, 23 Jul 2005 13:58:11 +0000 (13:58 +0000)]
Fix lrangeedit to lrange. Fix rangeedit to range. Fix attack to Attacking.
Add html links for info references. Remove inconsistent periods.
Add missing closing brackets. Change info to information to improve
readability. Improve the readability for range/lrange sentence.
Ron Koenderink [Sat, 23 Jul 2005 13:43:35 +0000 (13:43 +0000)]
(player_init) [_WIN32,__linux__ && __alpha__]: Remove the
SO_REUSEADDR socket option as it is not required for WIN32.
In WIN32, there is no waiting time when a port is closed before
it can be reused so SO_REUSEADDR is not required for WIN32.
Leave the option has a undesirable effect of allowing a second
server instance to start without an error and leaving both
instances running. ALPHA and LINUX do support SO_REUSEADDR.
Ron Koenderink [Sat, 23 Jul 2005 13:37:36 +0000 (13:37 +0000)]
(player_main): Add empth_yield() in the command processing loop to ensure
after every command, other players gets a chance to execute a command.
This prevents denial of service attack that monopolizing the active server
thread by continuing feeding data to the server from a client.
Ron Koenderink [Thu, 7 Jul 2005 21:57:15 +0000 (21:57 +0000)]
(show_sect_capab, mission_pln_equip, pln_equip): Change i_type
references to use I_NONE instead of zero. Zero has been invalid since
item.h rev. 1.12, and was questionable style before.
Ron Koenderink [Mon, 4 Jul 2005 14:07:31 +0000 (14:07 +0000)]
(pr_player, upr_player): Blocking I/O on another player's struct iop *
is unsafe! By the time the blocked thread wakes up, that player may
be gone, along with its struct iop *, and io_write() follows a
dangling pointer. Moreover, at most one thread may use empth_select()
on the same file descriptor. Violations of that restriction cause
threads to hang under Windows since ntthread.c rev. 1.15. Make all
output to another player non-blocking for now. Historically, player
threads sent output only to their socket, though their own iop. This
was broken by flash and asynchronous telegram notification a long time
ago.
Ron Koenderink [Thu, 30 Jun 2005 16:10:42 +0000 (16:10 +0000)]
(main) [_WIN32]: Windows putchar() screws up when printing multibyte
strings bytewise unless the stream is buffered. Switch stdout to
line-buffered mode.
(login): Explicitly flush stdout, because Windows doesn't implement
line-buffering faithfully.
Ron Koenderink [Sun, 26 Jun 2005 18:31:14 +0000 (18:31 +0000)]
(loc_Sem_t, empth_sem_t) [_WIN32]: empthread.h defines empth_sem_t as
incomplete type struct loc_Sem_t. Instead of completing it here, the
code defined an unrelated type loc_Sem_t as (complete) type struct
empth_sem_t. The resulting type errors were swept under the carpet
with casts. Obvious fix.
Based on a page Doug Wescott created for his Petting Zoo. I restored
the ASCII art to the original, gave credit to its creator, quoted from
WordNet (free) instead of American Heritage Dictionary, omitted parts
that might be illegal to distribute in certain countries, and improved
see also.
(att_move_in_off): When boarding from a sector, mil entering the ship
less one were not removed from the sector. The problem is putsect()
overwriting data from prior put_combat() with old data. Broken in
rev. 1.17. Change lunchbox code to match that of 1.16. Closes
#1219918, reported by Doug Wescott.
(copy_ascii_no_funny, copy_utf8_no_funny)
(copy_utf8_to_ascii_no_funny): New.
(flash, wall, prmptrd, uprmptrd, getcommand): Use them to filter
input.
(uprnf, pr_flash): Use them to filter output.
(prtoascii): No longer used, remove.
(player_login, player_main): Move the C_INIT that terminates the login
phase to player_login(). No functional change.
(showvers): Trivial, used just once. Inline, remove.