Commit graph

5403 commits

Author SHA1 Message Date
f94f81ee16 (add): Initialize nat_last_login and nat_last_logout to zero rather
than current time.  Nation addition time is irrelevant.
(natstr): Document zero nat_last_login, nat_last_login mean never
logged in/out.
(player_main): Test nat_last_login zero instead of nat_hostaddr empty.

(player_main): Assign nat_userid, nat_hostname, nat_hostaddr straight
from player.  The last connection's host is now shown as dotted quads
instead of nowhere when the name isn't known.
(natstr): Document that nat_userid, nat_hostname may be empty.

(player_main): Simplify printing last connection address: nat_hostaddr
can't be empty here; don't bother to substitute "nobody" for empty
user.
2005-10-03 13:25:54 +00:00
95d2b48ee2 (match_user, main): Use full buffer for fgets(); was off by one. 2005-10-03 10:45:00 +00:00
47d84b2479 (main): Delete some code that had no effect. 2005-10-03 10:42:10 +00:00
300876a44d (retreat_ship1, retreat_land1): Delete some code that had no effect. 2005-10-03 10:41:13 +00:00
68d7cbd273 (chan): Do not arbitrarily truncate representative to 8 characters,
use the full size of struct natstr member nat_pnam.
2005-10-03 10:40:11 +00:00
47316b593b (add): Use size of struct natstr members nat_cnam and nat_pnam instead
of literals.
2005-10-03 10:38:55 +00:00
717b8e96be (lndstr, natstr, shpstr): Fix string types from s_char[] to char[].
They were declared NSC_STRINGY in their selector descriptors, and
NSC_STRINGY is specified to represent char[].
(player): Get rid of s_char.
2005-10-03 10:35:44 +00:00
30a4437714 (babies): Factored out of grow_people(). Identical, except it doesn't
bother to `optimize' the maxpop case, and it drops the weird food
limit computation for opt_NOFOOD, which didn't limited for any
reasonable game parameters.
2005-10-02 19:10:16 +00:00
144c7cb5cd (ac_encounter): Make contact on spotting planes. Closes #857594. 2005-10-02 18:41:29 +00:00
5d207af26f (look_ship, look_land): Failed to make contact on sighting ships,
planes and land units.  Partial fix for #857594.
2005-10-02 18:09:42 +00:00
4f1ebae4b7 (natstr): Member nat_connected is inappropriate, because it is
transient server state, not persistent game state.  Remove.
(player_main, edit): Remove uses.
(coun): Use getplayer() instead of nat_connected.  Delete the message
on command being out of order.
2005-10-02 17:01:15 +00:00
ed5ba9fe3e (player_find_other): Replace by getplayer. player_find_other()
searches for a player other than US for country CNUM, which is in
state PS_PLAYING.  Since there can be at most one player in state
PS_PLAYING, and no caller pass that player as US, they can simply use
getplayer() instead.
2005-10-02 16:30:43 +00:00
f6a8a14831 (getplayer): There may be multiple players for the same country in the
list of players, but at most one in state PS_PLAYING.  getplayer()
used to get the one first in the list.  However, its callers need the
one in state PS_PLAYING.  In particular, typed_wu() notifies the
player obtained from getplayer().  If the player in state PS_PLAYING
isn't first, say because another one is trying to log in, the
notification gets lost.  Fix by making getplayer() return the player
in state PS_PLAYING.
2005-10-02 16:21:41 +00:00
687cacd887 (SNEAK_ATTACK, opt_SNEAK_ATTACK, Options, do_sneak, att_abort)
(att_fight): Remove option SNEAK_ATTACK.
2005-10-02 14:35:18 +00:00
8733aa8a1a (setrel): Relation change establishes contact like a telegram.
Partial fix for #857594.
2005-10-02 11:04:31 +00:00
ad84132688 Remove some redundant parenthesis; no functional change. 2005-10-02 10:16:19 +00:00
745bdf7fd1 (prod_land, prod_ship): Simplify. 2005-10-02 10:15:59 +00:00
c9dbe828bc (do_feed): Simplify.
(starvation): Pointless.  Inline into do_feed() and remove.

(growfood): Doc clarification.
2005-10-01 18:44:25 +00:00
0c8f779356 (att_get_combat): Fix test whether land unit exists. Closes #1034283.
(att_fight): Fix bad line break.
2005-10-01 16:39:41 +00:00
caac6e41ca (get_assembly_point): New.
(bomb, drop, fly, para, reco): Use it.
2005-10-01 14:07:35 +00:00
267a9ef424 Don't point to ftp.wolfpackempire.com, it does not work. 2005-10-01 12:52:00 +00:00
1d88b8783a (plist): Member state is used write-only, remove.
(P_OK, P_FIRED, P_DEL): Unused, remove.
2005-09-30 20:44:43 +00:00
a5b7465024 (N_FLAK, N_DISS_GOV, N_DECL_NEUT, N_RIOT, N_ASSAULT_LOSE): Unused,
remove.
(no_news): new.
(rpt): Use it for r_newsstory of unused slots.
2005-09-30 20:38:22 +00:00
ff8c7c249a (empfile): Member itemoffs is unused since file.c rev. 1.15; remove. 2005-09-30 20:02:57 +00:00
09b0b83971 (IO_CONN, io_conn, IOQ_BUFSIZE, MAXIOV, LND_NOTANY, plur)
(techfactfire, reltech, P_DISTING, PLN_MAXDEF, filetruncate, sct_init)
(nxtsctp, AN_SAILDIR, UDTIMES_MAX, BLITZTIME): Unused, remove.
2005-09-30 19:51:32 +00:00
4be9c189cb Unused. 2005-09-30 19:50:57 +00:00
03abca9258 Remove leftover declarations that should have been removed along with
the definitions.
2005-09-30 19:40:41 +00:00
0730780b64 (PP_MAIN): New.
(empth_init): Use it rather than literal.
2005-09-30 17:37:04 +00:00
85a64e9fef (getpath): Fix buffer overflow. Remote hole in commands bomb, drop,
fly, para, reco, sail, sweep.  Old code also screwed up when
getstring() failed, unless player->aborted.  Fixed code is still ugly
and cries for a rewrite.
2005-09-25 18:55:55 +00:00
72c623ee92 (getpath): Fix message when no path to destination sector can be
found.
2005-09-25 17:03:53 +00:00
269913baee (getpath): Parameter showxy makes no sense and is not used. Remove.
Get rid of s_char.  Callers changed.
2005-09-25 17:00:50 +00:00
21a39fd9dd (fly): Check for player aborting the command at the `transport what?'
prompt.  Closes #771801.
2005-09-25 16:39:44 +00:00
ca517d5a44 (pathcost): Fix the previous rev. 2005-09-25 16:03:22 +00:00
9731c24676 (deli): Diagnose invalid direction. 2005-09-25 10:05:39 +00:00
f38868d00e (retreat_ship1, retreat_land1): Used to accept DIR_VIEW, which
happened do do nothing.  Ignoring it like other invalid directions is
clearer.
2005-09-25 10:05:09 +00:00
1fe759dc1e (marc, navi, retreat_ship1, retreat_land1): Treat any negative value
of chkdir() as failure, not just -1.
2005-09-25 10:00:43 +00:00
dfa56cb0ef (diridx): New. Use instead of chkdir() where direction characters
must be valid.  Oopses on bad direction characters.
(pathtoxy, ac_encounter): Bad direction characters used to lead to bad
array subscript and potential disaster.
(pathrange, path): Stop on DIR_STOP as well as on bad direction
characters.  This is just for consistency with other code; DIR_STOP
should occur only last in a path here.
(sail_nav_fleet, nav_ship): No change except for the oops.
2005-09-25 09:49:36 +00:00
a88f12017e (dirindex): Narrow member type to signed char to save cache.
(pathcost): Catch bad direction characters (should not happen).
2005-09-25 09:15:27 +00:00
6bfdc38df1 (SELL_NOT_DELIV, getdir, chkpath): Unused, remove. 2005-09-25 09:07:31 +00:00
Ron Koenderink
6304f3b482 (doexecute) [_WIN32]: Open the exec file in text mode.
The exec file contains the user commands created by text editor.
2005-09-24 13:34:39 +00:00
1580b1f734 (listen_addr): New econfig key.
(player_init): Implement it.

(player_init): Support service name in econfig key loginport.  Service
empire no longer takes precedence over econfig.  Closes #797096.
2005-09-23 18:41:24 +00:00
d253e1266f (hostaddr, hostconnect): Leave printing messages to caller.
(main): Clarify messages.

(hostport) [_WIN32]: Remove useless conditional code.

(main): Fall back to compiled-in host only if environment doesn't
supply one, not if it can't be resolved.  Same for port.
2005-09-23 17:55:24 +00:00
5357aa15b9 (deli): Break the loop if player->aborted. Without that, it can
prompt for more input, violating the client protocol.
2005-09-23 17:37:28 +00:00
fee8ac9d8f (prmptrd, uprmptrd): Should not be called while player->aborted. Check. 2005-09-23 17:35:14 +00:00
Ron Koenderink
5100e522fe Change info pages to reflect the code change that sets the build reaction
radius to zero for land-units.
2005-09-20 00:00:23 +00:00
3e01ab0a1d (upd_ship): Limit oil production to what's actually in the ground. 2005-09-18 12:17:18 +00:00
57332088a5 (io_output): Remove a redundant check. 2005-08-30 18:27:49 +00:00
681a803ef6 (move): test command checked start sector for space and some other
things instead of end sector.

(move): test command now skips code dealing with return of goods to
start sector.

(want_to_abandon): Simplify.
2005-08-30 18:26:58 +00:00
a508a4c6e7 (do_conv): Use maximum population instead of 999 to limit number of
new uw.
2005-08-30 17:49:43 +00:00
41c67326bb (shoo): Remove the arbitrary limit of 999 people to be shot. 2005-08-30 17:47:40 +00:00