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.
(nullify_objects): Simply use all of bigcity_dchr. Using only parts
is confusing.
(bigcity_dchr): Fix initializer for d_maxpop.
(dchr): The previous revision accidentally changed maximum population
of sanctuaries, plains, sea and wasteland. Revert the former two.
The latter are not used, but the new max population of zero makes more
sense, so keep it.
Ron Koenderink [Mon, 21 Feb 2005 18:17:11 +0000 (18:17 +0000)]
(main): Move loginit() to after the getopt(), so the -D option will
take affect for the log file. Otherwise the server.log will be in
default data directory compiled into the server.
Marc Olzheim [Mon, 21 Feb 2005 17:17:16 +0000 (17:17 +0000)]
Update patch for include/prototypes.h:1.66
src/lib/commands/mfir.c:1.21 src/lib/commands/sabo.c:1.10
src/lib/update/human.c:1.15 No functional changes.
(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.
(prod): Several columns were too narrow, and didn't align properly for
large values. Remove column wkfc to make space, widen other columns.
Columns use2, use3 and max2, max3 lack separating space on the left
for large values, which don't occur in normal game configurations.
(max_population): New, factored out of max_pop().
(max_pop): Use it. Don't support null argument anymore.
(nati, gen_power): Use max_population() instead of max_pop() with null
argument.
(show_sect_stats): Use max_population() to simplify the code.
(prod, upd_buildeff): Use max_population() to get correct new maximum
population for limiting work when tearing down a big city.
Previously, this was broken in upd_buildeff(). In prod(), it was
broken when the new designation had odd maximum population, which
should not occur.
`make depend' attempts to make dependencies for *.c. This is plain
evil, and ought to be fixed. In particular, it chokes on this file,
because it includes Windows specific headers. Which is fine, as the
file is compiled only under Windows.
Quick band-aid: wrap the file contents in #ifdef _WIN32.
(multifire): If firing at a submarine with something that can't drop
depth charges, don't disclose the target is a submarine. Old code
allowed players to find all submarine uids.
From Ray Hyatt:
(dchrstr): New member d_maxpop.
(dchr): Initialize it.
(max_pop): Use it. Use dchr[SCT_MINE].d_maxpop when called with null
argument. RES_POP now affects mountains and plains as well.
Ron Koenderink [Fri, 31 Dec 2004 20:14:10 +0000 (20:14 +0000)]
(tend_nxtitem,nxtitem,sarg_type,snxtitem,snxtitem_all,snxtsct,nxtitemp):
change NS_ALL to NS_EVERYTHING in ns_seltype because of a
conflict with winsock2.h which is used in the WIN32 build.
Ron Koenderink [Thu, 30 Dec 2004 13:53:46 +0000 (13:53 +0000)]
(multifire) [_WIN32]: Rely on misc.h to provide BSD random functions.
(multifire): switch the random seeding with the current random
value to seeding with the current time. Seeding with the
current random value does not actually improve the randomness.
Ron Koenderink [Thu, 30 Dec 2004 02:19:44 +0000 (02:19 +0000)]
(main,install_service,remove_service,service_main) [_WIN32]:
Add the ability to specify the service name, to install
multiple services and to set -D and -e options during install.
Ron Koenderink [Thu, 30 Dec 2004 01:31:03 +0000 (01:31 +0000)]
(main,mobility_check,upda,turn,rea,mobupdate,ef_open,logerror,
emp_config,gamedown,show_motd,match_user,typed_wu,
delete_old_announcements) [_WIN32]: switch the default file mode to
binary to match POSIX. Remove the now unneccessary ifdef for
the open/fopen. Add text mode for user files (econfig/auth).
Ron Koenderink [Tue, 21 Dec 2004 03:10:30 +0000 (03:10 +0000)]
(main,close_files,loc_NT_Term,empth_exit):
Add Windows Service to the server.
This includes adding install service and remove service option.
Move the start code from main to separate function.
Make close_files() and loc_NT_Term() global.
Move disassoc() to be earlier in the startup sequence.
Marc Olzheim [Fri, 17 Dec 2004 15:44:57 +0000 (15:44 +0000)]
"(turn): Fix comparing the output of write() to an unsigned sizeof by
casting the sizeof to write's most used return-type (ssize_t). Introduce
a typedef for ssize_t for _WIN32 in include/misc.h."
Marc Olzheim [Fri, 17 Dec 2004 15:39:28 +0000 (15:39 +0000)]
"(turn): Fix comparing the output of write() to an unsigned sizeof by
casting the sizeof to write's most used return-type (ssize_t). Introduce
a typedef for ssize_t for WIN32."
Ron Koenderink [Thu, 16 Dec 2004 19:40:06 +0000 (19:40 +0000)]
(ac_calc_flak,ac_fireflak,pinflak_planedamage): New ac_calc_flak().
Move common flak damage code from ac_fireflak() and
pinflak_planedamage() to ac_calc_flak().
Ron Koenderink [Thu, 16 Dec 2004 19:28:17 +0000 (19:28 +0000)]
(ac_calc_flak,ac_fireflak,pinflak_planedamage): New ac_calc_flak().
Move common flak damage code from ac_fireflak() and
pinflak_planedamage() to ac_calc_flak().
Marc Olzheim [Thu, 16 Dec 2004 14:17:08 +0000 (14:17 +0000)]
(turn): Change the command to allow for both an MOTD and a no-login
message. Clean 'register' and 's_char' remnants on the way.
Circumvents bug #813167.