Commit graph

947 commits

Author SHA1 Message Date
062b50f598 Document blocking constraints. 2005-07-01 19:51:00 +00:00
8e8ffb483c (loc_GVAR): Putting file local variables into a struct serves no
useful purpose whatsoever.  Peel off the struct.
2005-06-30 19:53:03 +00:00
Ron Koenderink
dfe767e7e0 (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.
2005-06-30 16:10:42 +00:00
b239d6e3b1 (loc_Thread, loc_Sem_t): Remove typedef, use the typedef name defined
in the header instead.

Remove some superflous casts.
2005-06-30 14:25:30 +00:00
Ron Koenderink
ec5a8b31ba (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.
2005-06-26 18:31:14 +00:00
bf83673bb5 (deliver): Do not deliver friendly civilians into occupied sectors. 2005-06-26 13:32:15 +00:00
6e3442b68e Minor clarifications. 2005-06-25 17:25:50 +00:00
124ce4a398 (io_write): Use IO_NOWAIT rather than 0. No functional change. 2005-06-25 17:24:13 +00:00
6147446fc1 New doc & doc fixes. Remove s_char on the way.
(C_MOD): Turn into enumeration constant.
2005-06-25 17:22:45 +00:00
Ron Koenderink
8d284c5b4a (empth_sleep) [_WIN32]: If the sleep returns early, go back to sleep.
Short sleeps can cause double-updates and other trouble.

[_WIN32] (loc_SleepThisThread): Not used, removed.
2005-06-25 16:49:20 +00:00
f519de81d6 (create_pidfile): Silence compiler warning on printing pid_t with %d. 2005-06-25 16:41:34 +00:00
060df4ec8f Document Empire's thread abstraction. Minor cleanups:
(empth_init): Change first parameter to void **.
(empth_sleep): Change parameter to time_t.
2005-06-25 16:37:59 +00:00
89087bef17 More 4.2.21 changes. 2005-06-23 19:59:42 +00:00
2c14ca57a4 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.
2005-06-23 19:35:44 +00:00
dc21bc6d7d Doc clarification. 2005-06-23 19:21:34 +00:00
0d57181966 Remove some dead, disabled code. 2005-06-23 19:21:18 +00:00
f559a3bb69 A better than nothing joke. 2005-06-23 19:20:25 +00:00
5a25fd93c5 Rewritten in an attempt to present all the initial revision's valuable
information in a more accessible form, and then some.
2005-06-23 19:08:19 +00:00
39b3493851 Protocol, session options and traditional dumps are complete, xdump is
a stub, parsing human-readable output is missing.
2005-06-23 19:04:53 +00:00
8bfbb80804 Update for 4.2.21. 2005-06-18 17:42:01 +00:00
78e880a608 (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.
2005-06-18 16:52:17 +00:00
Marc Olzheim
e6a7d4a694 Update for src/util/fairland.c:1.25 and include/prototypes.h:1.84 2005-06-15 12:55:21 +00:00
Marc Olzheim
e1ecf7bd86 Update patch for pr.c:1.22 2005-06-15 12:47:51 +00:00
a38ffacc37 (copy_ascii_no_funny, copy_utf8_no_funny)
(copy_utf8_to_ascii_no_funny): Don't consider newline funny.  This
fixes output filtering broken in rev. 1.17.
2005-06-14 05:01:26 +00:00
2f847f874d Document use of UTF-8. 2005-06-13 19:07:00 +00:00
65b6eaeee5 (player_login): Replace pr_player() by equivalent pr_id().
(pr_player, upr_player): Internal linkage.

(pr_hilite): Unused, remove.
2005-06-13 19:05:37 +00:00
71e164ed30 Document, in particular use of UTF-8. Simplify code in a couple of
places, but no functional changes.
2005-06-13 19:02:49 +00:00
9046ff0ad2 (outid): Fix recovery from bad argument N. Simplify. 2005-06-13 18:48:54 +00:00
1bf1b5b303 (uprnf): A print function must not change its text argument! 2005-06-13 18:28:10 +00:00
b5ff7e3beb (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_commands, player_commands_index): Internal linkage.
2005-06-13 18:16:44 +00:00
7e186ed7a8 (upr_player): A print function must not change its text argument! 2005-06-13 17:27:38 +00:00
968e754447 (lrange, shoo, execute): Buffer passed to getstarg() was too small.
Player could overrun it!
2005-06-13 11:32:07 +00:00
58a0d40777 (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.
2005-06-13 09:45:32 +00:00
ac671d25e4 (parse): Support 127 arguments instead of 100, to match
player->argp[].  Assign complete argument vector.  This should make
buffer overruns blatantly obvious.

(parse): Don't bother checking SPACE argument, just crash.  It is
extremely unlikely that such a programming error wouldn't be
discovered by even them most superficial testing.
2005-06-13 09:33:54 +00:00
9ee7a02be8 (emp_config): Buffers passed to parse() were too small. econfig file
could overrun them.  Closes #899546.
2005-06-13 09:18:14 +00:00
2f35354097 (dispatch): Argument buf is user text and must be printed as such. In
error messages, print just the command name instead.
2005-06-13 08:57:39 +00:00
ddfd5c1699 (play_list): player->combuf[] is user text and must be printed as
such.
(ufindbreak, ufindpfx): Rename, move to pr.c, external linkage.
2005-06-13 08:42:27 +00:00
24672e351b (shut): Buffer passed to getstarg() was much too small. Deity could
overrun it.

(shut): Fix retrieval of second argument.

(shut): Simplify formatting of broadcast messages.
2005-06-12 15:33:53 +00:00
cb454a1f56 (rea, turn): Use a different buffer for message text. Just for
clarity.
2005-06-12 10:11:04 +00:00
ff27a2644f (typed_wu): Treat overlong message as internal error instead of just
truncating it silently.  Simplify.
2005-06-12 10:07:30 +00:00
bc8a443264 (getele): Abort telegram when uprmptrd() fails. Previously, failures
that didn't set player->aborted sent the telegram, e.g. EOF.

(getele): Fix misleading size of left[].

(getele, tilde_escape): Simplify.  tilde_escape() now returns the
escape code instead of comparing it to second argument.
2005-06-12 09:58:38 +00:00
df0bbf5bd2 (turn): Buffer passed to getele() was one too small. Deity could
overrun it by entering a message of maximum size.
2005-06-12 09:38:30 +00:00
e536b02c1c (gamedown, show_motd): Fix message buffer size. Messages of maximum
length were considered overlong and ignored.
2005-06-12 09:25:22 +00:00
8585ec930f Remove some redundant casts. 2005-06-12 08:17:13 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
ee6d72f3b8 (rea): Portability fix. 2005-06-12 05:25:28 +00:00
3a060d6056 [_WIN32] (loc_StripDels): Remove. Different behavior depending on the
platform is evil, and line editing is none of the server's business
anyway.  If your client can't deal with the delete key, well, here's a
nickel, kid, get yourself a better computer.
2005-06-11 16:44:01 +00:00
95234c8e9f (ioq_gets): Support telnet line termination "\r\n". Previously,
string input other than through parse() or getele() failed to strip
'\r', which could end up in ship names and such.
(getele): Code dealing with '\r' is now redundant, remove.  It ceased
to work in rev. 1.6 because input filtering replaces '\r' by '?'.
2005-06-11 16:38:58 +00:00
34fe99ee23 Fix markup. 2005-06-11 13:41:11 +00:00
1112cec9a7 Spelling fixes. 2005-06-11 13:38:47 +00:00