Commit graph

950 commits

Author SHA1 Message Date
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
bce14d5702 Fix the previous revision. 2005-06-11 13:38:42 +00:00
e6ef2545bd (sendmessage): Skip players not in state PS_PLAYING. Flashes to them
get ignored, hence telling the player that the flash was sent is
wrong.  Skipping fixes that.
2005-06-09 22:28:54 +00:00
c051c5f58d (mobupdate): Don't print '\r' after '\n'. 2005-06-09 22:22:53 +00:00
aaf19dd6ab (play): Simplify counting of players. 2005-06-09 22:21:54 +00:00
5a8a66746a (options_cmd): List options only if none are set.
(list_cmd, login_coms): Login command list is obscure and redundant;
remove.

(login-coms): Improve doc strings.
2005-06-09 22:18:32 +00:00
db9098042d (nstr_string_ok): New.
(nstr_comp): Use it to fix oops on `des='.  Reported by Doug Wescott.
2005-06-09 22:12:32 +00:00
fbf9f15bbb (getsose): Port from obsolete termcap to terminfo. The old code
manually stripped off padding, which is evil.  The new code does
nothing when the stdout is not connected to a terminal.
(SO, smso, SE, rmso): Rename, static linkage.
(putso, putse): New.
(screen): Use it.
2005-06-04 13:03:16 +00:00
Ron Koenderink
c3915edb54 (hidd,peek): Rename hidden command to peek.
This prevents a conflict in the info files with
HIDDEN option.
2005-06-01 12:26:22 +00:00
Marc Olzheim
d405e17c42 Update for src/util/fairland.c:1.23 and src/server/main.c:1.62 2005-05-31 09:02:33 +00:00
3c58b1ae83 (program_name, help): New.
(main): New option -h.  Terminate unsuccessfully on invalid option.
(usage, parse_args): Factored usage() out of parse_args().
(parse_args): More useful diagnostics.
2005-05-30 15:15:33 +00:00
63769b0342 (prod_plane): Remove redundant initialization. 2005-05-30 15:07:34 +00:00
c8d49deb4c (sarg_type): Simplify, no functional change. 2005-05-30 15:06:31 +00:00
1ec5767d5f Doc & formatting fixes. 2005-05-30 15:03:24 +00:00
18ee9a2f35 (flee, army, wing): Print how many new members were added.
Previously, it printed how many were selected, which can include old
members of the group.

(flee, army): The rather obscure feature to assign the fleet's /
army's retreat orders to members was broken.  It ignored ownership,
and thus could copy some other player's retreat orders.  Abusable.
Copying the first member's retreat orders is less than useful, in
particular for group ~.  The code now chooses the first one in the
same sector with RET_GROUP set.  RET_GROUP is never set for group ~.
2005-05-30 14:56:02 +00:00
03c2f9e302 Updated from man/emp_client.6 rev. 1.9. 2005-05-30 05:18:33 +00:00
Ron Koenderink
05a4eae605 (output,screen): In ASCII mode, remove standout bit if the client
does not support standout mode.
In UTF8 mode, remove SO/SI characters if the client does not support
standout mode.
2005-05-29 16:22:14 +00:00
326ac671ba (EFF_OWNER): The assertion that EFF_OWNER implies ef_read() sets
player->owner is no longer used.  Use it to indicate that owner can be
accessed through struct genitem, similar to EFF_XY and EFF_GROUP.
(xdump): Fix ownership checking.  Old version worked only when
nxtitem() set player->owner.

(empfile): Set EFF_OWNER for EF_LOST.  This fixes `xdump lost'
disclosing other countries' losses.
(loststr): Document implications of EFF_OWNER.

(empfile): Set EFF_OWNER for EF_NATION.
(natstr): Rearrange members for EFF_OWNER, document.
(nat_ca): Unused so far.  Clean it up, add most missing selectors.
(fileinit): Use it.  This implements `xdump nation'.

(fileinit): Simplify setting map file size.
2005-05-29 14:14:33 +00:00
b111abc2c5 (nxtitem): Skipped unowned sectors (could not occur), ships, planes,
land units and nukes for selection type NS_LIST.  Thus, unowned items
explicitly selected by item number are skipped, while the same items
selected implicitely by group, area or whatever are not.  This makes
no sense.  Some callers break the nstr_item abstraction to prevent the
skipping, so they get all items regardless of how they were selected.
All other callers filter out unowned items.  This skipping misfeature
dates back to the very oldest known versions of Empire.  Remove it.
Also remove skipping prevention hacks from callers.

(tend_nxtitem): Now identical to nxtitem(), except it lacks some extra
normalization of item coordinates, which should have no effect.
Replace by nxtitem().
2005-05-29 13:15:56 +00:00
15448392f3 (findlost): Static linkage. 2005-05-28 16:04:08 +00:00
ec086428e5 (LIBS, NTLIBS): Remove libsubs.a. 2005-05-28 16:02:46 +00:00
61cca23d29 (main): Fix checking of ef_open()'s value. Fixes program exit status
when files can't be opened.

(logerror): The version from libcommon.a does the right thing since
log.c rev. 1.17.  Use it, remove local version.

(log_last_commands): No longer referenced by library code, remove.
2005-05-28 15:57:17 +00:00
a127869da2 (ef_write): Don't call log_last_commands() directly, use oops(). If
it's worth logging commands, then it's worth dumping core.
2005-05-28 15:52:29 +00:00
980c3ca8c6 (debug): Move to log.c, so other programs don't have to define debug
themselves just to use logerror().
2005-05-28 15:34:21 +00:00