Ron Koenderink [Mon, 21 Nov 2005 18:25:49 +0000 (18:25 +0000)]
(natbyname): Do not look up a non-active country.
Previously a blank country name or deleted country name would
return a pointer to non-active countries.
This creates a security problem where some one can successfully
login into the server without country or password. Closes #1219569.
(dchrstr, pchrstr, rptstr): New member d_uid, p_uid, r_uid.
(dchr, bigcity_dchr, pchr, rpt): Initialize it.
(dchr_ca, pchr_ca, rpt_ca): New selector uid for it.
(laun, launch_as, launch_missile, launch_sat): When an argument is
bad, do not loop prompting, just fail. That's what the vast majority
of commands do.
(launch_as, launch_missile, launch_sat): Don't zap the target
argument. If the target is given as argument, launch all missiles at
that target. Previously, missiles after the first prompted for
another target.
Ron Koenderink [Thu, 17 Nov 2005 03:21:32 +0000 (03:21 +0000)]
(cens, desi, dump, do_desi, doland, file_sct_init, grow_continents)
(grow_islands, set_coastal, update_coastal_flag, coast_sea_to_land)
(coast_land_to_sea): Determine sct_coastal flag when the sector type
is set. Old method only updated the sct_coastal flag when doing
cens() or a dump(). Other uses of sct_coastal could get stale values,
including selector coastal. Rework set_coastal() into NEW functions
update_coastal_flag(), coast_sea_to_land(), coast_land_to_sea() and
set_coastal(). Fix a bug where the deity designation would not
properly set the coastal flag. Fix a bug where the one sector lake
would not properly compute coastal flag. Fix a bug that makes
fairland treat the last sector it adds to an island as non-coastal.
Ron Koenderink [Mon, 14 Nov 2005 13:52:12 +0000 (13:52 +0000)]
(fuel, load, prod, max_population, shp_nav_one_sector,
nav_loadship, upd_buildeff): Identify BIG_CITY
(IS_BIG_CITY) by using packing type of UPKG instead of
opt_BIG_CITY and sector type of SCT_CAPITAL.
Ron Koenderink [Sun, 13 Nov 2005 16:39:27 +0000 (16:39 +0000)]
(opt_NO_LCMS, opt_NO_HCMS, opt_NO_OIL, Options,
buil, show_bridge, show_tower, nullify_objects):
Remove NO_LCMS, NO_HCMS, and NO_OIL options, not used.
Functionality can be emulated by modifiying the characteristics files.
Ron Koenderink [Sun, 13 Nov 2005 12:30:37 +0000 (12:30 +0000)]
(opt_NEUTRON, buil, denotate, show_nuke_capab, show_nuke_build,
Options): Remove opt_NEUTRON option. The option can be emulated
by manipulating the flags in a nuke characteristics file.
Ron Koenderink [Sun, 13 Nov 2005 12:27:02 +0000 (12:27 +0000)]
(dchr_ca, packing, empfile): Add packing symbol table.
(sect_ca, ship_ca, land_ca, plague_stages, empfile):
Add plague stages symbol table.
(treaty_ca, loan_ca, agreement_statuses, empfile):
Add agreement status symbol table.
Combine treatystatuses (TS_FREE, TS_SIGNED and TS_PENDING)
and loan statuses (LS_FREE, LS_SIGNED and LS_PENDING)
into a single agreement status.
(pchr_ca, level, empfile): Add packing symbol table.
Ron Koenderink [Sat, 12 Nov 2005 20:09:11 +0000 (20:09 +0000)]
(buil, vers, opt_NONUKES, show_nuke_build, show_nuke_capab):
Remove opt_NONUKES options. A nuke characteristics file can
be created with no entries to create the emulate the removed option.
Ron Koenderink [Sat, 12 Nov 2005 16:53:52 +0000 (16:53 +0000)]
(init_server, ef_load, xundump): Add ability to customize game
configurations. The custom game configurations are loaded via
text files in the data directory. Closes #752881.
(start_server, empth_start): Passed uninitialized sa_mask to
sigaction(). This used to broken only when SA_SIGINFO wasn't defined,
until main.c rev. 1.46 and pthread.c rev. 1.10 broke it
unconditionally.
(shp_maxno): Variable's value is well-known constant N_MAXSHIPS + 1.
Useless, remove. Users changed to check mchr's sentinel, because
that's clearer than comparing the index to N_MAXSHIPS or sizeof(mchr)
/ sizeof(*mchr).
(pln_maxno): Variable's value is well-known constant N_MAXPLANE + 1.
Useless, remove. Users changed to check plchr's sentinel, because
that's clearer than comparing the index to N_MAXPLANE or sizeof(plchr)
/ sizeof(*plchr).
(lnd_maxno): Variable's value is well-known constant N_MAXLAND + 1.
Useless, remove. Users changed to check lchr's sentinel, because
that's clearer than comparing the index to N_MAXLAND or sizeof(lchr) /
sizeof(*lchr).
(nuk_maxno): Variable's value is well-known constant N_MAXNUKE + 1.
Useless, remove. Users changed to check nchr's sentinel, because
that's clearer than comparing the index to N_MAXNUKE or sizeof(nchr) /
sizeof(*nchr).
(buil): Use typematch() to search for ship, plane, land unit and nuke
type. The old code didn't work correctly when "sbb super battleship"
came before "sb submarine" in mchr[].
(prd_maxno): Variable's value is well-known constant P_MDUST + 2.
Useless, remove. Users changed to check pchr's sentinel, because
that's clearer than comparing the index to P_MDUST or sizeof(pchr) /
sizeof(*pchr).
(pchr): Change sentinel's p_name and p_sname to NULL. Sentinel
checks changed.
(nullify_objects): Fix option NO_OIL. The attempt to remove ships
with capability M_OIL from mchr[] actually replaced them with
sentinels. Just clear the capability instead.
(ef_ptr, ef_read): Oops on bad ID. Some callers rely on these
functions to fail at the end of the table. To support that, the first
ID beyond the end is not considered bad.
(NSC_BITS): New.
(meta_flags): Update for it.
(ship_ca, mchr_ca, plane_ca, plchr_ca, land_ca, lchr_ca, nchr_ca)
treaty_ca, nat_ca, empfile_ca, mdchr_ca): Use it.
(symbol_ca): Move value selector to beginning of array.
(nullify_objects): Patch intrchr[] according to opt_NO_LCMS,
opt_NO_HCMS. This fixes output of `show se b', which used not to
reflect these options.
(improve): Simplify.
(ARRAY_CACHE): New.
(empfile): Use it to set csize of elements EF_SHIP_CHR, EF_PLANE_CHR,
EF_LAND_CHR, EF_NUKE_CHR.
(ef_init_chr): Now that empfile[]'s initializer sets csize, remove the
temporary csize initialization here. The value wasn't correct, but
better than nothing.
(coun): Last access used to report last login time.
Counter-intuitive. Report last connection time range instead.
Unfortunately, this requires a change in output format.
(coun): Report on all countries even to mortals. This used to be
done, and was most probably changed because it gave away too much
information. Carefully limit the information given to mortals, as
follows. Limit last access information to whether deities or allies
are logged on right now, no longer report connection time for deities
that are not logged on. Remove column time for mortals, rename it to
BTU for deities. Report status, but with less detail if HIDDEN is
enabled.
(buy, check_market, trad, check_trade): Remove the following virtually
undocumented feature: When a buyer didn't have enough money at the
time of the trade, the seller *automatically* granted a high-interest,
medium term loan for up to 90% of the price. This is just a silly
trap for unwary sellers and buyers alike.
(N_FIN_TROUBLE, N_CREDIT_JUNK): Unused, remove.
(rpt): Update accordingly.