]> git.pond.sub.org Git - empserver/log
empserver
17 years agoClarify prerequisites. v4.3.6
Markus Armbruster [Tue, 20 Jun 2006 19:48:22 +0000 (19:48 +0000)]
Clarify prerequisites.

17 years ago4.3.6 last minute changes.
Markus Armbruster [Tue, 20 Jun 2006 18:48:15 +0000 (18:48 +0000)]
4.3.6 last minute changes.

17 years ago_exit() fails to terminate all threads on at least some versions of
Markus Armbruster [Tue, 20 Jun 2006 18:36:20 +0000 (18:36 +0000)]
_exit() fails to terminate all threads on at least some versions of
LinuxThreads, use exit() where possible:
(shutdwn): No longer a signal handler, can safely call exit().
(main, loc_NTInit): No obvious reason for not using exit().

17 years ago(player_coms): Charge no BTUs for break.
Markus Armbruster [Tue, 20 Jun 2006 06:05:35 +0000 (06:05 +0000)]
(player_coms): Charge no BTUs for break.

17 years agoUse environment variable GROFF_NO_SGR instead of option -P-c, because
Markus Armbruster [Tue, 20 Jun 2006 06:02:24 +0000 (06:02 +0000)]
Use environment variable GROFF_NO_SGR instead of option -P-c, because
older versions of groff choke on the latter.

17 years agoDoc fix.
Markus Armbruster [Mon, 19 Jun 2006 04:28:57 +0000 (04:28 +0000)]
Doc fix.

17 years agoFix the previous revision again.
Markus Armbruster [Sun, 18 Jun 2006 20:45:01 +0000 (20:45 +0000)]
Fix the previous revision again.

17 years agoFix the previous revision.
Markus Armbruster [Sun, 18 Jun 2006 20:31:41 +0000 (20:31 +0000)]
Fix the previous revision.

17 years agoDoc fix.
Markus Armbruster [Sun, 18 Jun 2006 20:22:25 +0000 (20:22 +0000)]
Doc fix.

17 years agoMore 4.3.6 changes.
Markus Armbruster [Sun, 18 Jun 2006 19:12:37 +0000 (19:12 +0000)]
More 4.3.6 changes.

17 years ago(install): Create a clean econfig.new when the one found at the
Markus Armbruster [Sun, 18 Jun 2006 19:11:49 +0000 (19:11 +0000)]
(install): Create a clean econfig.new when the one found at the
destination doesn't work.

17 years agoUpdate for recently changed land unit mobility requirements.
Markus Armbruster [Sun, 18 Jun 2006 18:55:51 +0000 (18:55 +0000)]
Update for recently changed land unit mobility requirements.

17 years agoUpdate for recent mobility cost changes. Document minimum costs and
Markus Armbruster [Sun, 18 Jun 2006 18:49:00 +0000 (18:49 +0000)]
Update for recent mobility cost changes.  Document minimum costs and
land unit penalty in newly taken sectors.  Spelling fixes.

17 years agoSpelling fixes.
Markus Armbruster [Sun, 18 Jun 2006 18:25:52 +0000 (18:25 +0000)]
Spelling fixes.

17 years agoReference Flak and mission. Don't reference subject Missions, as this
Markus Armbruster [Sun, 18 Jun 2006 18:23:26 +0000 (18:23 +0000)]
Reference Flak and mission.  Don't reference subject Missions, as this
is the only reference to it.  Spelling fixes.

17 years agoUpdate for recent code changes. Make pseudo-code match the real code.
Markus Armbruster [Sun, 18 Jun 2006 18:11:52 +0000 (18:11 +0000)]
Update for recent code changes.  Make pseudo-code match the real code.
Used to mention interception, but got it mostly wrong, removed.

17 years ago(arm): Fix trading block message.
Markus Armbruster [Sun, 18 Jun 2006 17:47:26 +0000 (17:47 +0000)]
(arm): Fix trading block message.

(disarm): Recipient must be allied.

17 years ago(arm): Permit arming allied planes.
Markus Armbruster [Sun, 18 Jun 2006 17:28:28 +0000 (17:28 +0000)]
(arm): Permit arming allied planes.

17 years ago(disarm): Give disarmed nuke to sector owner. This was forgotten in
Markus Armbruster [Sun, 18 Jun 2006 17:15:38 +0000 (17:15 +0000)]
(disarm): Give disarmed nuke to sector owner.  This was forgotten in
rev. 1.15.
(gift): Extend to nukes.

17 years ago(map): Fix misleading prompt to reflect the real choices for the player.
Ron Koenderink [Sun, 18 Jun 2006 17:08:03 +0000 (17:08 +0000)]
(map):  Fix misleading prompt to reflect the real choices for the player.

17 years ago(gift): All callers transfer ownership after calling gift(). Move
Markus Armbruster [Sun, 18 Jun 2006 17:03:19 +0000 (17:03 +0000)]
(gift): All callers transfer ownership after calling gift().  Move
that code into gift().  Callers changed.

17 years ago(bestownedpath): Back out rev. 1.22's path termination with 'h' for
Markus Armbruster [Sun, 18 Jun 2006 09:13:35 +0000 (09:13 +0000)]
(bestownedpath): Back out rev. 1.22's path termination with 'h' for
now.  Consistency with BestLandPath() is nice, but it makes navigate
behave differently, and that wasn't intended.

17 years ago(bestownedpath): Fix for impassable end sector. Broken in rev. 1.23.
Markus Armbruster [Sun, 18 Jun 2006 09:00:58 +0000 (09:00 +0000)]
(bestownedpath): Fix for impassable end sector.  Broken in rev. 1.23.

17 years ago(navi, march): Simplify convoluted logic. Old code tried path finding
Markus Armbruster [Sun, 18 Jun 2006 08:53:06 +0000 (08:53 +0000)]
(navi, march): Simplify convoluted logic.  Old code tried path finding
whenever the next direction in the path string is bad.  It then passed
the whole path string to shp_path(), which makes no sense unless we're
at the beginning of it, but luckily failed in that case.  Change to
try path finding right after prompting for new input.

17 years ago(disabled_commands): New econfig key.
Markus Armbruster [Sat, 17 Jun 2006 20:27:36 +0000 (20:27 +0000)]
(disabled_commands): New econfig key.
(disable_coms): New, implements disabled_commands.
(init_player_commands): Call it.

17 years ago(sctstr): New member sct_dterr.
Markus Armbruster [Sat, 17 Jun 2006 19:27:22 +0000 (19:27 +0000)]
(sctstr): New member sct_dterr.
(terr): Let the deity set it, and default the field argument to it.
(sect_ca): New selector dterr.

17 years ago(lnd_fortify): The previous revision could break under conditions that
Markus Armbruster [Sat, 17 Jun 2006 14:58:09 +0000 (14:58 +0000)]
(lnd_fortify): The previous revision could break under conditions that
currently don't occur.  Fix anyway.

17 years ago(ask_olist): Let land units attack as long as they have positive
Markus Armbruster [Sat, 17 Jun 2006 14:28:59 +0000 (14:28 +0000)]
(ask_olist): Let land units attack as long as they have positive
mobility, except for high-mobility terrain (mountains), where the
rules remain as they were: land units need to have all the mobility
charged for the attack, not counting combat and moving in to occupy.
Rationale: Making sure your land units reach attack positions with
enough mobility left is a pain in the neck.  Requiring only positive
mobility is friendlier, but allows rushing of mountains.

17 years ago(dchrstr): Replace int members d_mcst and d_emcst (mobility cost * 5)
Markus Armbruster [Sat, 17 Jun 2006 14:08:20 +0000 (14:08 +0000)]
(dchrstr): Replace int members d_mcst and d_emcst (mobility cost * 5)
by float d_mob0 and d_mob1 (straight costs).  Impassable terrain now
encoded as negative d_mob0 instead of zero d_mcst.  Users changed.
sect.config updated.
(dchr_ca): Replace selectors mcst and emcst by mob0 and mob1.
(show_sect_stats): Show real mobility costs.

17 years agoFix the previous revision.
Markus Armbruster [Sat, 17 Jun 2006 13:52:13 +0000 (13:52 +0000)]
Fix the previous revision.

17 years ago(chance, roundavg): Simplify. No functional change.
Markus Armbruster [Sat, 17 Jun 2006 12:40:25 +0000 (12:40 +0000)]
(chance, roundavg): Simplify.  No functional change.

17 years ago(lnd_fortify): Round mobility fractions up always, not just to 1.
Markus Armbruster [Sat, 17 Jun 2006 08:42:23 +0000 (08:42 +0000)]
(lnd_fortify): Round mobility fractions up always, not just to 1.
Simplify.

(fort): Don't claim land unit can't be fortified when amount argument
is zero.

17 years ago(sector_mcost, bp_neighbors, lnd_mar_one_sector): Deal with disabled
Markus Armbruster [Fri, 16 Jun 2006 21:11:25 +0000 (21:11 +0000)]
(sector_mcost, bp_neighbors, lnd_mar_one_sector): Deal with disabled
road/rail infrastructure.

17 years ago(info.ps): New. Adapt TROFF.MAC. Result isn't exactly a readable
Markus Armbruster [Fri, 16 Jun 2006 20:51:40 +0000 (20:51 +0000)]
(info.ps): New.  Adapt TROFF.MAC.  Result isn't exactly a readable
book.

17 years ago(mission): Nicer diagnostics.
Markus Armbruster [Fri, 16 Jun 2006 20:44:23 +0000 (20:44 +0000)]
(mission): Nicer diagnostics.

17 years agoChe cannot target #0:
Markus Armbruster [Fri, 16 Jun 2006 20:01:30 +0000 (20:01 +0000)]
Che cannot target #0:
(guerrilla): Oops on it.
(doland, takeover): Clear them when che_target becomes 0.

(doland): Fix bogus message.

(guerrilla): Remove silly sanity check.

17 years ago(sctintrins): New member in_enable. Update infra.config. Use it
Markus Armbruster [Fri, 16 Jun 2006 18:39:35 +0000 (18:39 +0000)]
(sctintrins): New member in_enable.  Update infra.config.  Use it
instead of opt_DEFENSE_INFRA.
(improve): Test for it.
(show_sect_build): Show only enabled infrastructure.
(opt_DEFENSE_INFRA): Remove.  Deities can edit infra.config instead.

(improve): Dumb down prompt.

17 years agoFix the previous revision.
Markus Armbruster [Fri, 16 Jun 2006 17:16:42 +0000 (17:16 +0000)]
Fix the previous revision.

17 years agoUpdate copyright. Add `Preface to the Wolfpack Edition'. Spelling
Markus Armbruster [Fri, 16 Jun 2006 17:15:13 +0000 (17:15 +0000)]
Update copyright.  Add `Preface to the Wolfpack Edition'.  Spelling
fixes.  Change is authorized by Geoff Cashman.

17 years agoRevert the previous revision, it doesn't make sense.
Markus Armbruster [Fri, 16 Jun 2006 05:42:52 +0000 (05:42 +0000)]
Revert the previous revision, it doesn't make sense.

17 years ago(show_sect_stats): Display mobility cost of inaccessible sectors as
Markus Armbruster [Thu, 15 Jun 2006 21:27:45 +0000 (21:27 +0000)]
(show_sect_stats): Display mobility cost of inaccessible sectors as
`no way' instead of obscure magic numbers.

17 years ago(sector_strength): Back out rev. 1.53's oopses, because their
Markus Armbruster [Thu, 15 Jun 2006 21:19:03 +0000 (21:19 +0000)]
(sector_strength): Back out rev. 1.53's oopses, because their
conditions can happen.

17 years ago(map): Fix crash on empty argument introduced in rev. 1.18.
Markus Armbruster [Thu, 15 Jun 2006 21:17:37 +0000 (21:17 +0000)]
(map): Fix crash on empty argument introduced in rev. 1.18.

17 years ago(sector_mcost): New, simpler sector mobility cost formula. The cost
Markus Armbruster [Thu, 15 Jun 2006 21:12:53 +0000 (21:12 +0000)]
(sector_mcost): New, simpler sector mobility cost formula.  The cost
is a linear function of sector efficiency, with cost at 0% given by
dchstr member d_mcst and cost at 100% given by d_emcst.  The latter
used to be d_mcst - 1.  Mountain cost is no longer a special case.
Road infrastructure now reduces cost up to 90%, linear in road
efficiency (used to be close to that, but non-linear).  Same for rail
infrastructure, but 99%.  Double land unit minimum cost to 0.02.
Change land unit cost penalty in newly taken land to an extra 0.2
instead of a minimum of 0.2.
(dchrstr): New member d_emcst.  sector.config updated, with some
changes: cost of mountain now ranges from 2.4 to 1.2 instead of 2.174
to 1.304, wildernes 0.4 instead of 0.6 to 0.4, highway, bridge head,
bridge span and tower from 0.4 to 0.001 instead of 0.2 to 0.001.
While I'm at it, make bridge head match highway stats (dstr and value
reduced).
(show_sect_stats): Show d_emcst.
(dchr_ca): New selector emcst for d_emcst.

17 years ago(prmobcost): New.
Markus Armbruster [Thu, 15 Jun 2006 19:46:27 +0000 (19:46 +0000)]
(prmobcost): New.
(sinfra): Use it to display inaccessible sectors sensibly.
Inaccessible occurs for rail since src/lib/common/move.c rev. 1.12.

17 years ago(attack_val, defense_val): These functions overestimate unit strength,
Markus Armbruster [Thu, 15 Jun 2006 19:05:17 +0000 (19:05 +0000)]
(attack_val, defense_val): These functions overestimate unit strength,
because they ignore three facts.  Firstly, mil casualties decrease
strength linearly, while unit casualties decrease it quadratically
(unit strength scales with mil * eff).  Secondly, casualties decrease
strength proportional to the combat multiplier, hence twice as much
mil are more powerful than double multiplier.  Thirdly, units break
and retreat.  Change the estimate from mil * mult to mil * sqrt(mult).
Improves things in simulations, hope it works out in practice as well.
Closes #682571.

17 years ago(lnd_hit_mine): Remove silly use of double. Rounds fractional damage
Markus Armbruster [Thu, 15 Jun 2006 18:58:47 +0000 (18:58 +0000)]
(lnd_hit_mine): Remove silly use of double.  Rounds fractional damage
to engineers down instead of up.

(retreat_land1): Failed to reduce mine damage to engineers.

17 years ago(att_reacting_units, attack_val, defense_val, intelligence_report):
Markus Armbruster [Thu, 15 Jun 2006 18:55:15 +0000 (18:55 +0000)]
(att_reacting_units, attack_val, defense_val, intelligence_report):
Return double.  Callers changed.

(att_reacting_units): Remove silly truncation to int.

(get_dlist): Return void, simplify.

17 years ago(tcp_listen): Don't print null host.
Markus Armbruster [Thu, 15 Jun 2006 18:34:46 +0000 (18:34 +0000)]
(tcp_listen): Don't print null host.

17 years ago(as_search) [DEBUG]: Fix crash bug. We don't normally define DEBUG.
Markus Armbruster [Thu, 15 Jun 2006 17:53:55 +0000 (17:53 +0000)]
(as_search) [DEBUG]: Fix crash bug.  We don't normally define DEBUG.

17 years agoUpdate for 4.3.6.
Markus Armbruster [Wed, 14 Jun 2006 18:22:28 +0000 (18:22 +0000)]
Update for 4.3.6.

17 years agoDoc fix.
Markus Armbruster [Wed, 14 Jun 2006 18:14:40 +0000 (18:14 +0000)]
Doc fix.

17 years ago(options_cmd): login_opts[] lacked sentinel. Potential crash-bug.
Markus Armbruster [Wed, 14 Jun 2006 18:07:37 +0000 (18:07 +0000)]
(options_cmd): login_opts[] lacked sentinel.  Potential crash-bug.
Simplify.

17 years agoDocument signal use. Since Windows lacks real signals, it is only
Markus Armbruster [Wed, 14 Jun 2006 18:05:16 +0000 (18:05 +0000)]
Document signal use.  Since Windows lacks real signals, it is only
included if number register w is zero.

17 years agoUpdate for current code. Minor edits.
Markus Armbruster [Wed, 14 Jun 2006 18:02:20 +0000 (18:02 +0000)]
Update for current code.  Minor edits.

17 years ago(satmap, satdisp_units): Don't show landspies.
Markus Armbruster [Wed, 14 Jun 2006 17:56:26 +0000 (17:56 +0000)]
(satmap, satdisp_units): Don't show landspies.

(satdisp_units): Don't show land units loaded on ships or land units.

(satdisp_units): Align table header with body.

17 years ago(satdisp, satdisp_sect, satdisp_units): Split satdisp() into
Markus Armbruster [Wed, 14 Jun 2006 17:38:16 +0000 (17:38 +0000)]
(satdisp, satdisp_sect, satdisp_units): Split satdisp() into
satdisp_sect() and satdisp_units().
(satmap): Call only satdisp_sect().  No functional change.
(aircombat): Call both, and call satdisp_units() even over sea.  This
lets spy planes spot surface ships at sea.  Closes #906035.

17 years ago(MIN_MOBCOST, LND_MINMOBCOST): Just one use, inline and remove.
Markus Armbruster [Tue, 13 Jun 2006 21:21:02 +0000 (21:21 +0000)]
(MIN_MOBCOST, LND_MINMOBCOST): Just one use, inline and remove.

17 years ago(lnd_mobtype): New.
Markus Armbruster [Tue, 13 Jun 2006 21:07:44 +0000 (21:07 +0000)]
(lnd_mobtype): New.
(lnd_path): Use it.
(lnd_mobcost): Use it, remove last parameter.  Callers changed.  This
fixes mobility use of trains when retreating, both for retreat orders
and for failed morale checks.
(retreat_land1): Fix test for impassable terrain.  Before, trains
could retreat off rail.
(lnd_take_casualty): Test for impassable terrain.  Before, trains
could retreat off rail.

17 years agoMake land unit attack mobility cost consistent with march cost:
Markus Armbruster [Tue, 13 Jun 2006 20:29:47 +0000 (20:29 +0000)]
Make land unit attack mobility cost consistent with march cost:
(att_mobcost): New.
(ask_olist, take_move_in_mob): Use it.  Attacking land units can now
use roads and suffer the newly taken penalty.  No difference in most
cases, because the penalty commonly cancels the road bonus.
(get_mob_support, calc_mobcost, ask_move_in_off): Use it.  No
functional change now; ensures that military's attack mobility cost
will stay consistent with move cost.
(MOB_NONE): Unused, remove.
(sector_mcost): Simplify.

17 years ago(att_fight): Don't charge the defending sector any mobility when it's
Markus Armbruster [Tue, 13 Jun 2006 18:35:49 +0000 (18:35 +0000)]
(att_fight): Don't charge the defending sector any mobility when it's
already negative.  Used to charge proportional to its absolute value,
which makes no sense.

(att_fight): Oops when attacker's mobility is negative rather than
charging negative mobility.

Remove superflous casts and parenthesis.

17 years agoChange maximum population to 100 for plains (was 49), mountains (was
Markus Armbruster [Tue, 13 Jun 2006 17:52:46 +0000 (17:52 +0000)]
Change maximum population to 100 for plains (was 49), mountains (was
99), bridge spans and bridge towers (was 999), and to 1000 for the
other habitable sector types (was 999).

17 years ago(max_population): Deal gracefully with big city 10 * d_maxpop >
Markus Armbruster [Tue, 13 Jun 2006 17:46:04 +0000 (17:46 +0000)]
(max_population): Deal gracefully with big city 10 * d_maxpop >
ITEM_MAX: let value grow linearly from d_maxpop at 0% to the minimum
of 10 * d_maxpop and ITEM_MAX at 100%.

17 years agoReplace incorrect sea mine hit chance by reference to info Hitchance.
Markus Armbruster [Sun, 11 Jun 2006 19:30:19 +0000 (19:30 +0000)]
Replace incorrect sea mine hit chance by reference to info Hitchance.

17 years agoUpdate for changed plane abort chance.
Markus Armbruster [Sun, 11 Jun 2006 19:27:07 +0000 (19:27 +0000)]
Update for changed plane abort chance.

17 years ago(shp_sweep): New parameter takemob. Charge mobility only if it's
Markus Armbruster [Sun, 11 Jun 2006 18:09:09 +0000 (18:09 +0000)]
(shp_sweep): New parameter takemob.  Charge mobility only if it's
true.
(shp_nav_one_sector): Pass false.  This lets minesweepers move at the
speed their stats indicate.  Closes #1498801.
(navi): Pass true.  This ensures sweeping without moving still costs
mobility.

17 years ago(ac_planedamage): Planes may abort when damaged below 80% efficiency.
Markus Armbruster [Sun, 11 Jun 2006 16:02:13 +0000 (16:02 +0000)]
(ac_planedamage): Planes may abort when damaged below 80% efficiency.
Reduce abort chance from 100-eff to 80-eff.  This should make it
easier to punch through air defense, flak in particular, and increase
the risk of getting shot down.

17 years ago(ac_shipflak, ac_landflak): Reduce flak proportional to efficiency.
Markus Armbruster [Sun, 11 Jun 2006 05:12:47 +0000 (05:12 +0000)]
(ac_shipflak, ac_landflak): Reduce flak proportional to efficiency.
Rename some auto variables.  Closes #759402.

17 years ago(FLAK_GUN_MAX): New.
Markus Armbruster [Sat, 10 Jun 2006 18:26:57 +0000 (18:26 +0000)]
(FLAK_GUN_MAX): New.
(ac_doflak, ac_shipflak, ac_landflak): Use it.
(ac_shipflak, ac_landflak): Tally flak for all ships / units, then
limit to FLAK_GUN_MAX guns of average tech.  Used to limit to
FLAK_GUN_MAX guns *after* ship / land unit tech factor was applied by
exiting the loop early, then reduce *again* for nation tech of whoever
owns the last ship visited.  Makes no sense.  Exiting the loop early
is no good, because it can skip plane spotting.  This change and the
one below make low-tech ship and land unit flak more powerful;
rebalancing might be needed.

(ac_doflak, ac_landflak, ac_shipflak): Round flak randomly instead of
down.  This simplifies things.  In particular, you no longer have to
calculate how many low-tech ships to bunch together to get any flak.

17 years ago(ac_fireflak): Remove parameter other, all callers pass 0. Callers
Markus Armbruster [Sat, 10 Jun 2006 17:53:24 +0000 (17:53 +0000)]
(ac_fireflak): Remove parameter other, all callers pass 0.  Callers
changed.

17 years ago(calc_all): Match the real update sequence. Until removal of budget
Markus Armbruster [Sat, 10 Jun 2006 16:20:31 +0000 (16:20 +0000)]
(calc_all): Match the real update sequence.  Until removal of budget
priorities (rev. 1.25), calc_all() tried to match the real sequence,
but didn't quire succeed to cope with all variations.  Then it matched
until the update sequence change in src/lib/update/main.c rev. 1.25.
This is required but not sufficient for closing #1310407.

17 years ago(service_main) [_WIN32]: Added the missing empth_wait_for_signal() and
Ron Koenderink [Sat, 10 Jun 2006 04:11:16 +0000 (04:11 +0000)]
(service_main) [_WIN32]: Added the missing empth_wait_for_signal() and
shutdown() for when the server is running at WIN32 service.  This fix
incorporates the changes that where done to the main thread.

17 years ago(empth_wait_for_signal) [_WIN32]: Add thread block for the main thread,
Ron Koenderink [Sat, 10 Jun 2006 03:57:50 +0000 (03:57 +0000)]
(empth_wait_for_signal) [_WIN32]: Add thread block for the main thread,
otherwise the main thread blocks all others.

17 years ago(update_main): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:43:33 +0000 (00:43 +0000)]
(update_main): Remove unused local variables.

17 years ago(journal_entry): Remove unused local variable.
Ron Koenderink [Fri, 9 Jun 2006 00:41:51 +0000 (00:41 +0000)]
(journal_entry): Remove unused local variable.

17 years ago(mtsymset, add2symset): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:26:59 +0000 (00:26 +0000)]
(mtsymset, add2symset): Remove unused local variables.

17 years ago(starv_units): Remove unused local variable.
Ron Koenderink [Fri, 9 Jun 2006 00:25:39 +0000 (00:25 +0000)]
(starv_units): Remove unused local variable.

17 years ago(getpath): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:24:06 +0000 (00:24 +0000)]
(getpath): Remove unused local variables.

17 years ago(feed_land): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:17:44 +0000 (00:17 +0000)]
(feed_land): Remove unused local variables.

17 years ago(budg,calc_all): Remove unused local variables.
Ron Koenderink [Fri, 9 Jun 2006 00:16:48 +0000 (00:16 +0000)]
(budg,calc_all): Remove unused local variables.

17 years ago(cant_listen): Supply missing newline.
Markus Armbruster [Thu, 8 Jun 2006 20:55:17 +0000 (20:55 +0000)]
(cant_listen): Supply missing newline.

17 years ago(lnd_pathcost): New, factored out of lnd_mobcost().
Markus Armbruster [Thu, 8 Jun 2006 20:43:13 +0000 (20:43 +0000)]
(lnd_pathcost): New, factored out of lnd_mobcost().
(att_reacting_units): Use it.  Fixes overcharging of inefficient
units.  Broken when Empire3 changed land unit mobility use not to
depend on efficiency, except for supply units.
(lnd_sweep): Use it.  No functional change.

(speed_factor): New, factored out of lnd_pathcost() and shp_mobcost().

17 years ago(ef_verify): Check pchr[].p_level matches pchr[].p_type.
Markus Armbruster [Thu, 8 Jun 2006 20:22:58 +0000 (20:22 +0000)]
(ef_verify): Check pchr[].p_level matches pchr[].p_type.

17 years ago(teldir, motdfil, downfil, disablefil, telfil, annfil, timestampfil):
Markus Armbruster [Thu, 8 Jun 2006 20:22:11 +0000 (20:22 +0000)]
(teldir, motdfil, downfil, disablefil, telfil, annfil, timestampfil):
Change to arrays.

17 years ago(shutdwn) [_WIN32]: Not supposed to return, so don't.
Markus Armbruster [Thu, 8 Jun 2006 20:20:02 +0000 (20:20 +0000)]
(shutdwn) [_WIN32]: Not supposed to return, so don't.

17 years agoFinally merge the journal patch:
Markus Armbruster [Thu, 8 Jun 2006 20:11:26 +0000 (20:11 +0000)]
Finally merge the journal patch:
(keep_journal): New econfig key.
(player_main): Log player login and logout.
(recvclient): Log player input.
(ef_open_srv, ef_close_srv): Log startup and shutdown.
(update_main): Log update.

Support the common SIGHUP log rotation idiom:
(empth_wait_for_shutdown, empth_wait_for_signal): Rename.
[EMPTH_LWP, EMPTH_POSIX] (empth_init, empth_wait_for_signal): Wait for
SIGHUP as well.
(main) [SIGHUP]: Reopen journal when empth_wait_for_signal() returns
SIGHUP.

17 years ago(LwpContextPtr, lwpInitSystem): Use void ** for pointer to generic
Markus Armbruster [Thu, 8 Jun 2006 05:38:06 +0000 (05:38 +0000)]
(LwpContextPtr, lwpInitSystem): Use void ** for pointer to generic
pointer.  Users changed.

17 years ago(shutdwn): No longer a signal handler, no need to avoid sleeping.
Markus Armbruster [Wed, 7 Jun 2006 21:45:46 +0000 (21:45 +0000)]
(shutdwn): No longer a signal handler, no need to avoid sleeping.
This lets player threads send C_EXIT properly even when the server
shuts down on a signal.

17 years agoFix the previous revision.
Markus Armbruster [Wed, 7 Jun 2006 21:39:01 +0000 (21:39 +0000)]
Fix the previous revision.

17 years ago(empth_init_signals): Don't catch SIGINT and SIGTERM.
Markus Armbruster [Wed, 7 Jun 2006 21:01:16 +0000 (21:01 +0000)]
(empth_init_signals): Don't catch SIGINT and SIGTERM.
(empth_wait_for_shutdown): New.
(main): Use it to wait for shutdown signal, then shut down.  Closes
#770492.
(empth_exit): Remove the weird special case for main thread.

Implement empth_wait_for_shutdown() for EMPTH_LWP:
[EMPTH_LWP] (lwpInitSigWait, lwpSigWait, lwpSigWakeup): New.
Declaration of lwpSigWait was accidentally committed in the previous
revision of lwp.h.
[EMPTH_LWP] (lwpInitSystem): New parameter waitset, pass it on to
lwpInitSigWait().
[EMPTH_LWP] (lwpReschedule): Call lwpSigWakeup().
[EMPTH_LWP] (empth_init): Declare signals needed by
empth_wait_for_shutdown().
(empth_wait_for_shutdown): Implement on top of lwpSigWait().

Implement empth_wait_for_shutdown() for EMPTH_POSIX:
[EMPTH_POSIX] (empth_init): Block signals, so that
empth_wait_for_shutdown() can use sigwait() safely.
(empth_wait_for_shutdown): Implement on top of sigwait().

Implement empth_wait_for_shutdown() for EMPTH_W32:
(empth_wait_for_shutdown): Implement on top of loc_BlockMainThread().

17 years ago(lwpDestroy): Internal linkage.
Markus Armbruster [Wed, 7 Jun 2006 06:01:29 +0000 (06:01 +0000)]
(lwpDestroy): Internal linkage.
(lwpSelect, lwpStatus): Declare in lwpint.h instead of lwp.h.

17 years ago(lwpEntryPoint): Don't set *LwpContextPtr, that's just been done by
Markus Armbruster [Tue, 6 Jun 2006 21:01:28 +0000 (21:01 +0000)]
(lwpEntryPoint): Don't set *LwpContextPtr, that's just been done by
lwpReschedule().

17 years ago(lwpReschedule): Remove code permitting SIGALRM to be catched safely,
Markus Armbruster [Tue, 6 Jun 2006 20:57:03 +0000 (20:57 +0000)]
(lwpReschedule): Remove code permitting SIGALRM to be catched safely,
because there's no handler for it.
(LCOUNT, oldmask): Remove.
(lwpEntryPoint): Don't initialize oldmask.  Should have been done in
lwpInitSystem() anyway.

17 years agoReorder table entries for clarity. Document.
Markus Armbruster [Tue, 6 Jun 2006 19:27:11 +0000 (19:27 +0000)]
Reorder table entries for clarity.  Document.

17 years ago(P_MAX): New.
Markus Armbruster [Tue, 6 Jun 2006 17:57:30 +0000 (17:57 +0000)]
(P_MAX): New.
(pchr): Use it rather than P_URAN.
(P_SHELL, P_GUN, P_PETROL, P_IRON, P_DUST, P_BAR, P_FOOD, P_OIL)
(P_LCM, P_HCM, P_TLEV, P_RLEV, P_ELEV, P_HLEV, P_URAN): Unused,
remove.

17 years ago(grin): Grind up whatever banks produce instead of P_BAR. This is in
Markus Armbruster [Tue, 6 Jun 2006 17:53:59 +0000 (17:53 +0000)]
(grin): Grind up whatever banks produce instead of P_BAR.  This is in
preparation of getting rid of P_BAR & friends.

(grin): Avail use was wrong when amount was reduced due to the space
limit.

17 years ago(P_SHELL, P_GUN, P_PETROL, P_IRON, P_DUST, P_BAR, P_FOOD, P_OIL)
Markus Armbruster [Mon, 5 Jun 2006 17:44:25 +0000 (17:44 +0000)]
(P_SHELL, P_GUN, P_PETROL, P_IRON, P_DUST, P_BAR, P_FOOD, P_OIL)
(P_LCM, P_HCM, P_TLEV, P_RLEV, P_ELEV, P_HLEV, P_URAN): Use -1 instead
of 0 for `no product', shift down product indexes and update
product.config and sector.config accordingly.
(budg, prod, show_sect_capab, produce, produce_sect): Adapt test for
no product.
(ef_elt_byname): Remove the hack to hide pchr[0].
(prod_eff): Oops on no product.

17 years ago(prprod): New, factored out of prod().
Markus Armbruster [Mon, 5 Jun 2006 15:29:28 +0000 (15:29 +0000)]
(prprod): New, factored out of prod().

(prod): Separate enlistment code from production code.  Simplifies
control flow, and thus gets rid of several compiler warnings.

17 years agoMove signal stuff into src/lib/empthread/, no functional change:
Markus Armbruster [Mon, 5 Jun 2006 08:51:02 +0000 (08:51 +0000)]
Move signal stuff into src/lib/empthread/, no functional change:
(empth_init_signals): New, factored out of start_server().  Call from
empth_init().
(panic): Move to posix.c, internal linkage.
(empth_obj): Add new posix.o

(empth_start, empth_alarm) [EMPTH_POSIX]: Clean up pointless messing
with signal handlers.
(empth_init, empth_wakeup) [EMPTH_POSIX]: Clean up a bit.

17 years agoMissed a use of MOB_ROAD.
Markus Armbruster [Mon, 5 Jun 2006 07:05:43 +0000 (07:05 +0000)]
Missed a use of MOB_ROAD.