Commit graph

3028 commits

Author SHA1 Message Date
e357e05115 Remove senseless casts. 2007-12-13 21:34:27 +00:00
cc791bcbe2 Remove superfluous parenthesis. 2007-12-13 21:32:34 +00:00
Ron Koenderink
799ca210ff Add -k option to the make so more than one error can be found. 2007-12-13 13:41:09 +00:00
Ron Koenderink
bcd7dac414 Update the CVSROOT to extract directly from sourceforge.net 2007-12-13 02:13:25 +00:00
Ron Koenderink
b0ba53dbd0 (play) [_WIN32]: Remove the argumennts for sysdef_stdin_init,
not needed..
2007-12-13 01:20:40 +00:00
Ron Koenderink
f082ef9fa6 (w32_getpw, w32_socket, w32_connect, w32_recv, w32_send,
w32_writev_socket, w32_close_socket, getpass, w32_openfd,
w32_openhandle, w32_readv_handle, w32_close_handle,
sysdep_init, sysdep_stdin_init, w32_select, w32_signal_handler,
sigaction, stdin_read_thread, w32_ring_from_file_to_bounce_buf)
[_WIN32]: New w32 equivalent functions for POSIX functions.
(recvline, sendcmd, tcp_connect, hostconnect, getpass,
main, intr, play, ring_to_file, ring_from_file, doexecute,
doredir) [_WIN32]: Use new WIN32 equivalent functions.
(main) [_WIN32]: Add sysdep_init() to support system dependent
initialization for equivalence functions.
(play) [_WIN32]: Add sysdef_stdin_init() to support system
dependent initialization for reading stdin.
(recv_input, play) [_WIN32]: Replace the calls to ring_to_file()
and select() with WIN32 specific enhanced versions.

Makefile.in: update dependencies with new files.
Make.mk: Add using of getopt.c and getopt.h
from src/lib/w32 directory.  Add getopt.c and getopt.h
to tar for client.
2007-12-11 22:00:25 +00:00
006c4bcce4 (check_market): Slight simplification. No functional change. 2007-12-09 17:44:25 +00:00
ddb2652b18 Doc fix. 2007-12-09 17:43:44 +00:00
17b1e03130 Document restrictions. Warn of common client bugs. 2007-12-09 17:42:12 +00:00
adfab4344e Disable nested execute. The execute protocol is flawed and cannot be
implemented correctly by asynchronous clients --- unless a client
waits for a prompt after sending the execute command and its argument,
it is prone to send more input before the C_EXECUTE arrives.  That
input overtakes the contents of the script file.  This is almost
certain to happen when the execute is in a script file.  Disabling
that is probably more useful and certainly less painful than
documenting this mess.  The client rejects nested execute since
servcmd.c rev. 1.42.
(EXEC): new.
(player_coms): Require it for execute.
(player_set_nstat): Set it in nstat.
(execute): Clear it in nstat.
2007-12-09 17:24:30 +00:00
ed8e0cd552 (execute): Clients can't reliably detect where a redirection ends
because the server doesn't send C_PROMPT.  The client simply rejects
such redirections since servcmd.c rev. 1.42.  Before it didn't, but
incorrectly extended the redirection until the end of the script, and
screwed up when there was more than one redirection in the execute.
Make the server reject such redirections as well, because that's
probably more useful and certainly less painful than documenting this
mess.
2007-12-09 17:06:03 +00:00
158f5f4b2a Add empsched, belatedly. 2007-12-09 16:04:54 +00:00
Ron Koenderink
5d512312d9 Removed EMPTARGET and ARCH from nightlybuilds,
not used with new autoconf. Replace with INSTANCE
for logs, build directory for local patches.

Use the local patches directly from the source tree instead
of all local copy.
2007-12-08 23:48:06 +00:00
Ron Koenderink
da6e711e5c (recv_input): Skip CR when creating command buffer.
This prevents mismatches between command buffer and
the response from the server during the secure check.
2007-12-08 23:09:56 +00:00
Ron Koenderink
9b87ff70be (readv, writev) [_WIN32]: Set errno to ENOMEM when
unable memory.
2007-12-08 23:00:37 +00:00
d3eec3e09d (status, init_nats): Concentrate CAP and MONEY logic in
player_set_nstat().
2007-12-08 20:53:08 +00:00
976c885dfc (dispatch, explain, status): Use player->nstat instead of
player->ncomstat for command permissions.  Side effect: status() no
longer notifies deities when they go broke or become solvent.
(dispatch): Don't distinguish between transiently and permanently
unavailable commands.  Didn't really work anyway.
(player): Remove unused member ncomstat.
2007-12-08 20:47:13 +00:00
1476e59dce (capi, caploss): Leave updating player->nstat to next status(). 2007-12-08 20:11:33 +00:00
f36aa0f89d (player): Remove member broke.
(player_set_nstat): Don't set it.
(status): Check nstat instead of broke and nat_money.
2007-12-08 20:09:35 +00:00
2b5ebf1f3f (player_set_nstat): New, factored out of init_nats().
(init_nats): Use it.  No functional change.

(status): Use it.  This sets player->nstat from scratch, not just
MONEY and CAP.
(brea): Don't bother to update player->nstat, status() will.
2007-12-08 19:27:41 +00:00
96b20c90b2 (xdump): Fix test whether to deny access to game state. Rev. 1.72
added that test to make xdump available before break, and faithfully
denied access exactly when xdump wasn't available before.  This denied
access when maximum minutes per day were exceeded.  Don't.
2007-12-08 18:05:51 +00:00
707e4fda95 (caploss): Simplify. No functional change. 2007-12-08 17:53:04 +00:00
a46c7656d2 (servercmd): Fix telegram info prompt. Broken in rev. 1.37. 2007-12-08 17:42:16 +00:00
7e61dff2da (caploss): Sacked capital isn't moved since rev. 1.7. Don't tell the
victim it is.
2007-12-08 17:28:38 +00:00
09a842c1a0 Consistently consider a nation bankrupt when its treasury is
negative.  Some places considered $0 as bankrupt, some didn't.  Fix
the ones that did:
(repo_list): report command misreported countries with $0 as broke.
(init_nats): If you had $0, logging out and back in bankrupted you.
(produce_sect, upd_ship): Failed to build sectors and produce stuff
for countries with $0.
2007-12-08 14:46:40 +00:00
a71ec1459d (status): Round money before checking solvency, and consistently treat
$0 as solvent.  Before, you became bankrupt / solvent when your money
went below / above zero before rounding, but not when you hit zero
exactly.
2007-12-08 14:36:54 +00:00
ab368ce23b (servcmd): Fix recognition of empty C_INFORM broken in rev. 1.37. 2007-12-08 14:27:35 +00:00
4b715e9267 (check_market): Fix missing putnat(). Belatedly clean up after the
removal of automatic loans in rev. 1.18.
2007-12-08 14:17:03 +00:00
d475256cf1 (check_trade): Fix bug that made your money evaporate when you didn't
have enough to pay.  This was aggravated by the removal of automatic
loans in rev. 1.15.  Clean up after that revision, belatedly.
2007-12-08 14:14:31 +00:00
30458959e6 (check_trade): Fix the price quoted to the buyer when he deal falls
through because he can't afford it.
2007-12-08 09:11:11 +00:00
c96761ecee (status): Simplify. No functional change. 2007-12-08 07:33:45 +00:00
3d11b5ecfd (army, fleet, wing): Fix printing of new group broken in rev. 1.13. 2007-12-02 18:33:28 +00:00
98dc6dd0ec Belatedly update section BUGS: relations work since 4.3.0, reject
since 4.3.4, and budget priorities are gone since 4.3.6.

Fix markup.
2007-12-02 17:17:46 +00:00
3b906d099c Fix not to show $ signs in route output. These were last seen in
actual source code as of version 1.0.3, dated May 1989.
2007-12-02 17:01:46 +00:00
e0c9a56eb6 Trim .SA. 2007-12-02 16:49:04 +00:00
321a7219f4 Add route to .SA. 2007-12-02 16:47:54 +00:00
8fe6d37e4a Remove claim that ships and units on missions will not fire support.
It's always been wrong for ships, and land units were changed to match
ships in lndsub.c rev. 1.49.
2007-12-02 16:45:27 +00:00
aa38b1f31b Spelling fixes. 2007-12-02 16:22:15 +00:00
c09d449204 Reject unexpected redirections:
(redir_authorized): New parameter expected, reject when zero.
(doredir): Pass !redir_fp, do not close it.  Before, an unexpected
redirection silently replaced the existing one.
(dopipe): Pass !redir_fp.  Before, an unexpected redirection silently
replaced the existing one, leaking its FILE.
(doexecute): Pass 1.
2007-11-29 06:04:30 +00:00
a29a8f43ab Refactor redirection data structure, no functional change:
(redir_is_pipe): New.
(doredir, dopipe): Set it.
(pipe_fp): Remove.  Users changed to use redir_fp and redir_is_pipe.
2007-11-29 05:31:55 +00:00
bde3d0c17d (prompt, servercmd): Move C_PROMPT code from prompt() to the only call
site that passes C_PROMPT.  No functional change.
2007-11-29 05:17:54 +00:00
e6882c1e7f (servercmd, prompt, doexecute): Refactor: collect control of
executing, input_fd and send_eof in servercmd().  No functional
change.
2007-11-28 07:17:20 +00:00
2dbc45eff7 Flaws in the Empire protocol make redirections within execute next to
impossible to implement correctly, and nested execute practically
useless (#116377).  Catch and refuse those:
(executing): New.
(doexecute, prompt): Set and clear it.
(redir_authorized): Reject if set.
(doexecute, play): Don't signal doexecute() failure through input_fd,
because that screws up up when we're executing already.  Increment
send_eof in doexecute() instead.
(send_eof): External linkage.
2007-11-28 07:10:27 +00:00
51846ec38f (play): Increment send_eof instead of setting it, decrement it instead
of clearing it.  Fixes a race condition: when we got EOF on input_fd
and a failed doexecute() in the same iteration of the loop, only one
EOF cookie was sent, leaving the client hung.
2007-11-28 06:34:33 +00:00
0b058415a1 (play): Close input_fd when execute's done. Broken in rev. 1.1. 2007-11-27 19:55:34 +00:00
Ron Koenderink
90a53439b2 (loc_Exit_Handler, empth_init) [_WIN32]: Correct the function declaration
for loc_Exit_Handler().  Remove unnecessary cast.
2007-11-27 03:29:35 +00:00
Ron Koenderink
1fb8b9af73 New. Support for nightlybuild for SuSE. 2007-11-25 17:35:24 +00:00
a34a5fd23c (chat): New, factored out of flash() and wall().
(flash, wall): Use it.
2007-11-25 14:34:50 +00:00
566223c36b (flash, wall): Use player->comtail[] to find the raw message. The old
hack to find worked only when there were no spaces in flash's first
argument.  Closes #941740.
2007-11-25 14:31:09 +00:00
8b0c965a38 (flash, wall): Remove rev 1.11's bogus input filtering. 2007-11-25 14:28:42 +00:00