player can send whatever he wants. Banning IPs is better done with a
packet filter. That leaves restricting deity IPs.
(privip): New econfig key to restrict deity IPs.
(may_play): Implement it.
(match_user): Unused, remove.
(subst.in): Substitute it. Fix prerequisites.
(read_builtin_tables): New.
(main): Call it. This doesn't do anything, because no builtin tables
have been defined.
(config_tables): New econfig key.
(read_config_tables): New, implements config_tables.
(main): Call it. Need to call ef_init() and chdir(configdir) first.
(ef_init_srv): Don't call ef_init(), since main() did it already.
Remove old way to do the same:
(ef_load): Remove, along with calls.
(empfile): Set configuration tables' member file back to NULL.
(shp_check_nav, sail_nav_fleet, bigcity_dchr[], sector_navigation[])
(d_navigation): Add a NEW d_navigation enum NAV_CANAL to
indicate that a sector has canal capability. Add canal determination
logic to shp_check_nav(). Update sector_navigation[] with new
canal navigation enum. Use shp_check_nav() to determine the
sector can be navigated.
(ltend, multifire, quite_bigdef, mine, landmine)
(do_loan, prod, printdiff, sell, sona, stre)
(tend, fire_dchrg, vers, work, ac_planedamage)
(ac_shipflak, ask_off, get_mine_dsupport, att_fight)
(ask_move_in_off, detonate, sd, land_gun)
(land_unitgun, lnd_fort_interdiction, lnd_fortify)
(perform_mission, pln_mine, pln_mobcost)
(retreat_ship1, retreat_land1, shp_sweep)
(shp_fort_interdiction, shp_missle_defense)
(new_work, growfood, upd_land, land_repair)
(get_materials, do_mob_ship, do_mob_land)
(load_it, unload_it, prod_plane, produce)
(guerrilla, upd_buildeff, spread_fallout)
(upd_ship, ship_repair, min, dmin, MIN):
Remove min() and dmin() functions and replace
with a MIN macro in misc.h. Remove local MIN
macros and use the new one in misc.h. This
change removes the need for the special
case for _WIN32.
(fuel, look_ship, multifire, mission, sona)
(plane_sona, ef_open, player_accept, player_main)
(ac_dog, att_get_combat, calc_mobcost)
(ask_move_in_off, intelligence_report)
(build_mission_list_type, perform_mission)
(show_mission, use_supply, dodistribute)
(allocate_memory, max, dmax, MAX):
Remove max() and dmax() functions and replace
with a MAX macro in misc.h. Remove local MAX
macros and use the new one in misc.h. This
change removes the need for the special
case for _WIN32.
(tcp_listen, player_addrlen): New. IPv4-only code factored out of
player_init().
(player_init): Use them.
(player_accept): Address family independence.
(tcp_connect): New.
(main): Use it.
(hostaddr, hostconnect, hostport): Internal linkage.
Move assignment of hostaddr and hostname from player_new() to
player_accept(). This solves the necessary of adding the socket include
file to prototypes.h for player_new(). The socket include file creates
a namespace conflict for WIN32.
Rename close_files() to ef_close_srv() and move to fileinit.c.
Replace calls to close_files() with ef_fin_srv().
Call ef_close_srv() from ef_fin_srv().
(ef_close_srv, ef_fin_srv): New.
(init_files, init_server, ef_init_srv):
Rename init_files() to ef_open_srv() and move to fileinit.c.
Remove call to init_files() from init_server() and replace
with a call to ef_open_srv() from ef_init_srv().
(ef_open_srv): New.
(ef_load, init_server, ef_init_srv):
Move the call to ef_load() from init_server() to ef_init_srv().
(global_init, init_server, ef_init_srv):
Move the call to global_init() from init_server() to ef_init_srv().
(nullify_objects, global_init, init_server):
Split nullify_objects() into init_lchr() and init_dchr().
Locate init_lchr() and init_dchr() in init.c.
Add calls to init_lchr() and to init_dchr() from global_init().
(init_lchr(), init_dchr()): New.
(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.
of laziness. The assumption is true on any sane machine, due to
alignment constraints. But the function doesn't provide enough value
to make me fix or document this. Remove it.
(lookup): Replace it.
Problems with the old code:
* Insufficient error checking.
* It used TIOCNOTTY (obsolete BSDism) to get rid of the controlling
tty, except for hpux || Rel4, where it attempted to use the POSIX
way, but screwed up.
* It left file descriptors 0, 1, 2 in a somewhat weird state.
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.
(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.
player->argp[]. Assign complete argument vector. This should make
buffer overruns blatantly obvious.
(parse): Don't bother checking SPACE argument, just crash. It is
extremely unlikely that such a programming error wouldn't be
discovered by even them most superficial testing.
(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.