Commit graph

1234 commits

Author SHA1 Message Date
Ron Koenderink
6484e52678 (stre): Fix to make it match what happens in attack sequence: land
units do not react to a mountain.

(stre): Add an empth_yield() per sector to make the server responsive
to other players as this command is CPU intensive.
2005-07-23 13:44:47 +00:00
Ron Koenderink
e332ff5fcc (launch_sat): Incorrectly assumed that plane_mob_max is 127 when
calculating when the satellite will be ready for use.
2005-07-18 23:52:30 +00:00
0d57181966 Remove some dead, disabled code. 2005-06-23 19:21:18 +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
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
968e754447 (lrange, shoo, execute): Buffer passed to getstarg() was too small.
Player could overrun it!
2005-06-13 11:32:07 +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
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
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
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
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
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
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
baf416652a Login options.
(player): New member flags.
(PF_UTF8, NF_UTF8): New PF_UTF8 replaces NF_UTF8.  Users changed.
(options_cmd): New.
(login_coms): New command `options'.
(toggle): Revert to the previous rev.
2005-05-27 16:31:19 +00:00
Ron Koenderink
2cc44bb182 Support UTF-8 encoded Unicode for user communications.
(NF_UTF8, togg): New client flag.
(flash, wall): User text input filtering.
(parse, prmptrd): Normal text input filtering.
(uprmptrd, ugetstring): New, to get user text.
(getele, flash, wall): Use them.
(getele): No need to filter out funny characters; input filtering
takes care of them.
(sendmessage, ufindbreak): Work on user text.
(uprnf): New, to print user text.
(rea, gamedown, show_motd): Use it.
(prnf): Unused, remove.
(pr, upr_player): Normal text output filtering (with highlighting).
(pr_flash): User text output filtering.
2005-05-26 01:58:48 +00:00
Ron Koenderink
dcd0794104 (build_bridge,build_tower,retreat_ship1): Mark "X" on sector
where mines were found when retreating.  Remove "X" when the
bridge span or tower is built.  Closes #1149809.
The bmap is now updated when the bridge span or tower is built.
A bulletin was added for when mines were swept when
retreating.
2005-05-08 18:39:09 +00:00
Ron Koenderink
9f27f5b02a (ship_grow_scale, plane_grow_scale, land_grow_scale): Change from int
to float.  This allows more control of the max. efficiency gain, and
makes it similiar to ship_mob_scale etc.  Closes #1025600.
2005-04-05 03:00:35 +00:00
44d59b5d17 (prod): All sectors produce when efficiency >=60%, not only enlistment
centers.
2005-04-04 18:54:14 +00:00
Ron Koenderink
953e5f6dc7 (xdprval): Only use of prnf() that is not for telegram text.
Replace by pr() in preparation of output conversion of telegram text
for the UTF-8 option.
2005-03-26 17:21:23 +00:00
Marc Olzheim
73a94a3591 (turn): Check whether fclose() succeeds. 2005-03-25 23:59:48 +00:00
Ron Koenderink
92ac36ec56 (rea): Set parameters for read to [yes|no|<CNUM/CNAME>].
Add parameters for read in the command list and the info pages.
Closes #1010010.
2005-03-25 21:04:39 +00:00
1c3eead016 Fix the previous rev. 2005-03-21 19:31:46 +00:00
b0e0c1b321 (prod): New column avail'. Narrow column will make' (amount and
short product name) to `make' (amount and, if product is an item,
product mnemonic).
2005-03-16 22:12:31 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
6b68f73ca8 Doc fix. 2005-03-12 18:06:31 +00:00
0595ff4d4e Indentation fixes. 2005-03-12 15:05:23 +00:00
256724c39f (multifire, new): Reseeding the PRNG with the current time is not a
good idea.  Letting players trigger it is an extraordinarily bad idea.
Remove.
2005-03-11 17:01:38 +00:00
Ron Koenderink
6fb90fb62c (newe): Remove wforce, not used anymore. 2005-03-10 22:25:58 +00:00
7f000ce9cc Fix ugly line breaks. 2005-03-10 19:17:15 +00:00
Ron Koenderink
0b172c6553 (NS_ALL) [_WIN32]: Change NS_EVERYTHING back to NS_ALL, #undef NS_ALL to prevent conflict with winsock2.h 2005-03-08 00:04:43 +00:00
Ron Koenderink
55e6aca9e0 (wrmakesrc,wripglob,wrgamesdef,info,apro,mobupdate,rea,turn
upda,ef_open,logerror,emp_config,match_user,show_motd,gamedown,
typed_wu,delete_old_announcements,mobility_check,mobility_init,
allocate_memory,write_newcap_script,main,files,fairland,doconfig,)
[_WIN32]: Switchback to default mode of text.
"t" (text) is not included the ISO/ANSI C standard but "b" (binary)
is included.
2005-03-02 12:47:15 +00:00
Ron Koenderink
df7dc203c4 (turn): Change to stdio.
(turn): Always close the file after attempting to write.
Fixes bug where the file is not close when there is writing
error.
2005-02-28 23:21:05 +00:00
0aaf0084aa (as_extend, as_costcomp, gen_power, powcmp): Fix non-portable function
cast.
(qsort_func_t): Unused, remove.
2005-02-24 18:47:26 +00:00
b360d076d3 (ship_bomb): Clarify. Also gets rid of compiler warning. 2005-02-24 17:55:28 +00:00
58512e4813 First step towards generalizing NSC_TYPEID to arbitrary dictionaries.
(nsc_cat) New category NSC_ID.
(nstr_comp): Resolve identifiers instead of relying on nstr_comp_val()
and nstr_coerce_val().
(valstr, nstr_coerce_val): Remove valstr member val_as_type.
(nstr_parse_val, nstr_match_ca, nstr_match_val, nstr_resolve_id)
(nstr_resolve_sel, nstr_mkselval): New.
(nstr_comp_val): Rewrite using the above.
2005-02-24 16:14:53 +00:00
929b3ba412 (retr): Use RET_GROUP instead of literal 1. No functional changes. 2005-02-23 15:27:19 +00:00
4113cdab5c Fix bad line break. No functional changes. 2005-02-23 15:26:36 +00:00
39a2710482 (reco): Fix check for empty flight path. Aborting the command at the
flight path prompt now works.

(reco): Pass P_ESC to pln_arm() for consistency with call of pln_sel()
and similar code elsewhere.  Believed not to make a difference.
2005-02-23 15:17:27 +00:00
Ron Koenderink
bca00f35f5 (powe): Do not round totals for deity countries. 2005-02-22 01:28:43 +00:00
Ron Koenderink
aebdf80864 (powe): Fix the deity check to use player->god instead of
player->cnum == 0.  Partial Fix for #863419.
2005-02-21 20:35:37 +00:00
5ba8cab9b5 (total_work): Remove redundant conversion to int.
(total_work): New parameter maxpop.  Callers changed.
(newe, prod): Use total_work().  Old code failed to limit military
workers, thus didn't match the update.
(do_feed): Simplify.
2005-02-20 19:36:41 +00:00
43d07b458d (prod): Widen column will make so that product p_sname is not
truncated.
2005-02-20 18:51:55 +00:00