]> git.pond.sub.org Git - empserver/log
empserver
15 years agoFix air defense and flak over sectors allied to the planes
Markus Armbruster [Wed, 24 Sep 2008 11:21:19 +0000 (07:21 -0400)]
Fix air defense and flak over sectors allied to the planes

Planes were not subject to air defense and flak over allied sectors.

Air defense was broken when Empire 2 changed it to happen after
spotting.

Flak was broken when 4.2.8 made ships and land units fire flak in
every sector, not just the target sector.  Although an allied sector
doesn't fire flak, it may still contain hostile ships and land units.

Also makes use of ilist[] more robust: before, if relations somehow
went sour after unfriendly[] was initialized, the sector intercept
would run with an invalid interceptor list, and crash.

15 years agoSimplify ac_encounter()'s logic for stealthy evasion
Markus Armbruster [Wed, 24 Sep 2008 02:07:52 +0000 (22:07 -0400)]
Simplify ac_encounter()'s logic for stealthy evasion

15 years agoaircombat.c isn't used for intercepting missiles, simplify
Markus Armbruster [Wed, 24 Sep 2008 01:37:38 +0000 (21:37 -0400)]
aircombat.c isn't used for intercepting missiles, simplify

Chainsaw had missiles flying missions together with planes, and to
make that work, aircombat.c got code for coping with missiles.  Since
Empire 2, missiles fly separately and don't go through aircombat.c
anymore.  The missile code there has been useless for more than a
decade.  Remove it.

This simplifies ac_encounter(), sam_intercept(), ac_intercept(),
ac_airtoair(), and gets rid of count_non_missiles(), all_missiles().

15 years agoFix making contact by spotting planes from sectors
Markus Armbruster [Wed, 24 Sep 2008 00:53:15 +0000 (20:53 -0400)]
Fix making contact by spotting planes from sectors

ac_encounter() passed MAXNOC instead of the sector owner to setcont(),
and setcont() does nothing for such an argument.  Screwed up from the
start, in commit 144c7cb5, v4.2.22.

15 years agoRefactor interception over ships and land units
Markus Armbruster [Mon, 22 Sep 2008 02:25:19 +0000 (22:25 -0400)]
Refactor interception over ships and land units

ac_encounter() lets all owners of ships and land units in the target
sector intercept, but not more than once.

Move the interception code behind reporting of both ships and land
units.  Before, it was duplicated for ships and land units.  Land
units didn't get reported when no bombers got through interception
triggered by ships.

15 years agoMake planes report non-hostile ships and lands in target sector
Markus Armbruster [Sun, 21 Sep 2008 15:02:10 +0000 (11:02 -0400)]
Make planes report non-hostile ships and lands in target sector

Before, ac_encounter() reported only ships and land units hostile to
the planes.

15 years agoPass only PM_* mission flags to ac_encounter()
Markus Armbruster [Sun, 21 Sep 2008 14:25:59 +0000 (10:25 -0400)]
Pass only PM_* mission flags to ac_encounter()

Since the previous two commits, ac_encounter() checks its
mission_flags argument only for proper mission flags PM_R and PM_S,
not for plane flags P_A, P_S, P_I.

This makes the code to put plane flags into mission flags useless.
Remove it from bomb(), drop(), fly(), para(), reco(),
perform_mission(), mission_pln_arm(), air_defense(), pln_arm().

Much of that code was useless even before: P_X and P_H since Chainsaw
3 option STEALTHV became mandatory in Empire 2, and P_MINE since
commit cc0c3e4f (v4.3.0) cleaned up mine drops.

15 years agoFix mixed ASW patrols
Markus Armbruster [Sat, 20 Sep 2008 17:21:48 +0000 (13:21 -0400)]
Fix mixed ASW patrols

A reconnaissance patrol (recon and sweep) uses sonar when ASW planes
participate.  ac_encounter() enabled sonar when P_A was in
mission_flags.  These get computed by pln_arm() and callers.  However,
they set P_A only when *all* planes were capable, including escorts.

Fix by checking actual plane capabilities instead.  Closes #1389451.

15 years agoFix recon and sweep not to spy after all spy planes are gone
Markus Armbruster [Sat, 20 Sep 2008 17:11:44 +0000 (13:11 -0400)]
Fix recon and sweep not to spy after all spy planes are gone

A reconnaissance patrol (recon and sweep) reports much more detail
when spy planes participate.  However, ac_encounter() didn't stop
doing that after all spy planes were shot down or aborted.

Fix by recalculating plane capabilities for every sector.

15 years agoReimplement max_idle without a separate thread
Ron Koenderink [Sun, 1 Feb 2009 12:22:26 +0000 (06:22 -0600)]
Reimplement max_idle without a separate thread

Remove the KillIdle thread.  Add timeout to struct iop, initialized in
io_open().  Obey it in io_input() by passing it to empth_select().  If
empth_select() times out, report that back through io_input() to
recvclient() and player_login().  If player_login() receives a timeout
indication, print a message and terminate the session.  If
recvclient() receives a timeout indication, flash a message to the
player and initiate a shut down the player's session.

Create WIN32 sys/time.h to define struct timeval.  This creates some
conflicts with WIN32 windows.h definitions.  Including windows.h in
show.c and info.c creates conflicts, so remove that.  Modify service.c
to include sys/socket.h instead of windows.h to remove the conflict
with sys/time.h.

15 years agoFix client to allow multiple to clients to run concurrently for WIN32
Ron Koenderink [Sun, 1 Feb 2009 14:58:37 +0000 (08:58 -0600)]
Fix client to allow multiple to clients to run concurrently for WIN32

Remove the names for the bounce_empty, bounce_full and ctrl_c_event
events. The named events were being shared between all clients running
on a WIN32 machine which created the affect of disconnecting a client
when an input event occurred in another client.  Broken in commit
f082ef9f (v4.3.11).

15 years agoFactor out gamehours and max minutes per day checks
Ron Koenderink [Sun, 1 Feb 2009 12:29:57 +0000 (06:29 -0600)]
Factor out gamehours and max minutes per day checks

Combine the checks from player_main(), command() and status() into
may_play_now().

15 years agoPrevent command from executing outside of game hours
Ron Koenderink [Sat, 24 Jan 2009 16:25:57 +0000 (10:25 -0600)]
Prevent command from executing outside of game hours

If a player is at a prompt when game hours restrictions start,
they can enter one more command.  Not fixed in commit 3da4030a,
v4.3.19.

15 years agoFix enforcing game hours for players already logged in
Ron Koenderink [Sat, 24 Jan 2009 16:21:19 +0000 (10:21 -0600)]
Fix enforcing game hours for players already logged in

Broken in commit 875a80d1, v4.3.19.

15 years agoSuppress the git checkout information for nightlybuilds
Ron Koenderink [Wed, 21 Jan 2009 01:50:33 +0000 (19:50 -0600)]
Suppress the git checkout information for nightlybuilds

15 years agoUpdate windows configuration for nightlybuild
Ron Koenderink [Wed, 21 Jan 2009 01:35:17 +0000 (19:35 -0600)]
Update windows configuration for nightlybuild

15 years agoSimplify the time() replacement for nightlybuilds
Ron Koenderink [Wed, 14 Jan 2009 01:20:34 +0000 (19:20 -0600)]
Simplify the time() replacement for nightlybuilds

Move the time() replacement from emptime.c.patch file
to nightlybuild.sh.

15 years agoPrevent distribution from abandoning the distribution center
Ron Koenderink [Wed, 7 Jan 2009 13:57:37 +0000 (07:57 -0600)]
Prevent distribution from abandoning the distribution center

If there are no civilians in the distribution center, distribution
could abandon the sector by distributing out all the military.

15 years agoCleaned up check_nat_name() function
Ron Koenderink [Tue, 6 Jan 2009 23:48:37 +0000 (17:48 -0600)]
Cleaned up check_nat_name() function

No functional changes.  Rename temp to p and nonb to allblank.

15 years agoAdd standard checks to the assigning of a country name
Ron Koenderink [Tue, 6 Jan 2009 23:22:26 +0000 (17:22 -0600)]
Add standard checks to the assigning of a country name

Add check to ensure a country by that name does not exist.
Ensure the length is not too long.  Note this is a change
behaviour for edit and change commands which used to silently
truncate long names.  Enforce that a country name can not have
control characters in it.  Ensure that a country name is not
blank or just spaces.

15 years agoSimplify load() and lload()
Markus Armbruster [Mon, 5 Jan 2009 14:22:13 +0000 (15:22 +0100)]
Simplify load() and lload()

Also make them more similar.  No functional change.

15 years agoMake load, unload, lload and lunload usable for deities
Markus Armbruster [Mon, 5 Jan 2009 09:12:57 +0000 (10:12 +0100)]
Make load, unload, lload and lunload usable for deities

Fix ownership tests in load(), lload(), load_plane_ship(),
load_land_ship(), load_plane_land(), load_land_land().

15 years agoCheck for unit on trading block last in load() and lload()
Markus Armbruster [Mon, 5 Jan 2009 09:07:09 +0000 (10:07 +0100)]
Check for unit on trading block last in load() and lload()

This is to make them more similar, and to get the market code out of
the way.

15 years agoFactor move_amount() out of load_comm_ship() and load_comm_land()
Markus Armbruster [Sun, 4 Jan 2009 18:00:31 +0000 (19:00 +0100)]
Factor move_amount() out of load_comm_ship() and load_comm_land()

15 years agoFix loopholes that let you load and unload foreign commodities
Markus Armbruster [Sun, 4 Jan 2009 11:00:45 +0000 (12:00 +0100)]
Fix loopholes that let you load and unload foreign commodities

The Chainsaw 3 feature to let you load/unload to a specific amount
through a negative amount argument created loopholes: it let you load
your ships in friendly sectors with the unload command, and unload
friendly ships with the load command.  Likewise for land units, with
allied instead of friendly, of course.

Empire 4.0.0 fixed that for the case of loading a land unit from an
allied sector.  Get rid of that check, and fix it for good in
load_comm_ok().

15 years agoFix load, unload, lload, lunload not to give away civilians
Markus Armbruster [Sun, 4 Jan 2009 10:59:10 +0000 (11:59 +0100)]
Fix load, unload, lload, lunload not to give away civilians

The game generally doesn't let you give away civilians.  But the check
in load_comm_ok() for that compared the sector old owner to the player
instead of the ship's or land unit's owner, which is incorrect for
foreign ships or land units.  Fix that.

Also make fix the message there not to assume that the civilians are
owned by the player.  This can't currently happen, but will when these
commands support use by deities properly.

15 years agoFactor load_comm_ok() out of load_comm_ship() and load_comm_land()
Markus Armbruster [Sun, 4 Jan 2009 10:57:26 +0000 (11:57 +0100)]
Factor load_comm_ok() out of load_comm_ship() and load_comm_land()

Functional change: attempting to load or unload foreign civilians no
longer fails command.

15 years agoMake lload require own sector and lunload own land unit
Markus Armbruster [Mon, 5 Jan 2009 14:02:21 +0000 (15:02 +0100)]
Make lload require own sector and lunload own land unit

This is for consistency with load and unload.

Before, you could use lunload for allied land units and lload in
allied sectors, but the command failed when stuff was loaded in allied
sectors.  Doing that with lload no longer fails the command, because
the check that does that in load_comm_land() is now masked by the new
checks in lload().  Note that loading with lunload still fails the
command; that inconsistency will be removed in a later commit.

load_plane_land() already refused to load planes from foreign sectors.
This commit makes that check redundant, so remove it.  Functional
change: lload now refuses to load foreign planes silently, unless both
land unit and plane were named by number.  This is consistent with
load.

15 years agoMake lload and lunload work on foreign lands only when named
Markus Armbruster [Mon, 5 Jan 2009 12:50:20 +0000 (13:50 +0100)]
Make lload and lunload work on foreign lands only when named

load and unload work on foreign ships only when their argument
explicitely names them, i.e. you have to ask for them by number.  When
any other syntax is used, load() ignores foreign ships.  This makes
sense.  Change lload() to work just like that.

15 years agoFix relation checks in load, unload, lload, lunload
Markus Armbruster [Sun, 4 Jan 2009 09:49:17 +0000 (10:49 +0100)]
Fix relation checks in load, unload, lload, lunload

The check for ship owner's relations to the player was backward: it
checked the player's relations to the ship's owner instead.  Abusable:
you could load and unload any ship by declaring friendly to its owner.
Broken since Chainsaw let you load and unload friendly ships.

The check for land unit owner's relations to the player was similarly
backward, similarly abusable, and also broken since day one.

lload and lunload checked sector owner's relations to the land unit's
owner instead of to the player.  Harmless, because the two must be the
same to reach the check.

15 years agoDon't warn deities about capital redesignation
Markus Armbruster [Fri, 2 Jan 2009 08:09:09 +0000 (09:09 +0100)]
Don't warn deities about capital redesignation

15 years agoChange info not to prepend a header line to the info page
Markus Armbruster [Sun, 28 Dec 2008 18:54:16 +0000 (19:54 +0100)]
Change info not to prepend a header line to the info page

The contents of the line was partly useless (repetition of the command
argument) and partly misleading (modification time of the formatted
info file, ifndef _WIN32).

15 years agoFix line break accident
Markus Armbruster [Sun, 28 Dec 2008 16:59:26 +0000 (17:59 +0100)]
Fix line break accident

15 years agoMake the "You lost your capital" message point to info capital
Markus Armbruster [Sun, 28 Dec 2008 16:49:21 +0000 (17:49 +0100)]
Make the "You lost your capital" message point to info capital

New players appear to be unable to figure out how to set a new
capital, in particular a mountain capital.  Hope this helps.

15 years agoMake sure land units with maximum mobility can attack mountains
Markus Armbruster [Sun, 28 Dec 2008 16:28:28 +0000 (17:28 +0100)]
Make sure land units with maximum mobility can attack mountains

Before, land units could not attack a high-mobility terrain sector at
all when the mobility cost to enter it exceeded maximum mobilty.

15 years agoFix land unit attack mobility cost
Markus Armbruster [Sun, 28 Dec 2008 13:01:15 +0000 (14:01 +0100)]
Fix land unit attack mobility cost

Land units were erroneously charged the much lower raw path cost,
except when attacking high-mobility terrain (mountains).  Broken in
commit 2673a258, v4.3.6.

15 years agoFold nstr_resolve_sel() into only remaining caller
Markus Armbruster [Sun, 28 Dec 2008 17:26:42 +0000 (18:26 +0100)]
Fold nstr_resolve_sel() into only remaining caller

No functional change.

15 years agoSmarter identifier resolution in conditions involving strings
Markus Armbruster [Sat, 27 Dec 2008 14:29:54 +0000 (15:29 +0100)]
Smarter identifier resolution in conditions involving strings

Conditions comparing strings behaved rather erratically: while wing=m
was smartly interpreted as wing='m' (because m is ambiguous as plane
selector), wing=e was not so smartly interpreted as wing=effic
(because e unambiguously identifies effic; this was then rejected due
to incompatible types), and wing=g was even less smartly interpreted
as wing=group.

Address this by a redesign of the identifier resolution rules in
nstr_comp(): If the condition contains just one identifier, it names a
selector.  If it contains two, try to intepret either as selector or,
if the other can be interpreted as selector, as value for that.
String selectors accept any identifier as value, numeric selectors
only the ones listed in their table.

Interpret both identifiers as selectors only if their types are
compatible (makes rpath=gu work for ships) and their tables, if any,
match (makes type=spy work for land units).

If more than one interpretation makes sense, drop any value
interpretations of identifiers that are unabbreviated selector names,
and selector interpretations of those that are not (makes wing=w work
for planes).

Change nstr_match_val() to accept any identifier as value for a string
selector.  Replace nstr_mkselval() by nstr_resolve_val(), to resolve
string values in addition to symbolic ones.  Remove resolution to
string from nstr_resolve_id(), drop its last parameter.  Remove unused
nstr_string_ok().  New nstr_is_name_of_ca(), nstr_ca_comparable().

Examples for conditions that are now interpreted differently:

    condition    old interpretation  new interpretation
    wing=g       wing=group          wing='g'
    w=g          wing=group          rejected as ambiguous (1)
    w=e          wing=effic (2)      wing='e'

(1) because both wing='g' and 'w'=group make sense
(2) rejected as incomparable later on

15 years agoSimplify type coercion in condition evaluation
Markus Armbruster [Sat, 27 Dec 2008 15:59:53 +0000 (16:59 +0100)]
Simplify type coercion in condition evaluation

Change nstr_mkselval() to generate values with promoted types only,
and replace nstr_coerce_val() by new and simpler nstr_optype() in
nstr_comp().

Replace the only remaining use of nstr_coerce_val() in surv() by
nstr_promote(), and remove nstr_coerce_val().

This loses one half of the unimplemented sketch of coercions to
NSC_STRING.  Drop the other half from nstr_exec_val().

15 years agoFix reporting of shot spies in news
Markus Armbruster [Thu, 25 Dec 2008 12:55:33 +0000 (13:55 +0100)]
Fix reporting of shot spies in news

Broken in commit 89e33f62, v4.3.16.

15 years agoLand units with zero reaction radius can't go on reserve mission
Markus Armbruster [Sun, 14 Dec 2008 21:49:18 +0000 (16:49 -0500)]
Land units with zero reaction radius can't go on reserve mission

15 years agoRemove econfig key mission_mob_cost
Markus Armbruster [Sun, 14 Dec 2008 21:04:47 +0000 (16:04 -0500)]
Remove econfig key mission_mob_cost

Questionable feature, and hasn't been used in a long time.

15 years agoRemove oprange()'s mission parameter
Markus Armbruster [Sun, 14 Dec 2008 19:05:40 +0000 (14:05 -0500)]
Remove oprange()'s mission parameter

Use the current mission instead.  Make mission() set it before calling
oprange(), and clean up somewhat.

15 years agoCheck capabilities required for mission before range
Markus Armbruster [Sun, 14 Dec 2008 18:40:32 +0000 (13:40 -0500)]
Check capabilities required for mission before range

Checking range first could complain about range when the mission
couldn't work regardless of range.  Not helpful.

15 years agoDrop checks whether we can get the op-sector from mission()
Markus Armbruster [Sun, 14 Dec 2008 18:20:49 +0000 (13:20 -0500)]
Drop checks whether we can get the op-sector from mission()

getsect() can fail here only when the coordinates are invalid.  The
first check uses coordinates from a successful sarg_xy(), so they
can't be invalid.  The second check uses coordinates of an object to
be put on the mission.  If these are invalid, game state is corrupt,
and failing the mission command doesn't improve the situation a bit.

15 years agoSimplify mission() by separating off clear_mission()
Markus Armbruster [Sat, 22 Nov 2008 20:15:03 +0000 (15:15 -0500)]
Simplify mission() by separating off clear_mission()

15 years agoStreamline signature of show_mission()
Markus Armbruster [Sat, 22 Nov 2008 20:04:15 +0000 (15:04 -0500)]
Streamline signature of show_mission()

Remove unused parameter, and return status.

15 years agoMove show_mission() to sole caller, give it internal linkage
Markus Armbruster [Sat, 22 Nov 2008 20:02:18 +0000 (15:02 -0500)]
Move show_mission() to sole caller, give it internal linkage

15 years agoAll missions now have op areas, simplify mission()
Markus Armbruster [Sat, 22 Nov 2008 20:19:27 +0000 (15:19 -0500)]
All missions now have op areas, simplify mission()

15 years agoMake escort mission obey op-area
Markus Armbruster [Sat, 22 Nov 2008 19:52:20 +0000 (14:52 -0500)]
Make escort mission obey op-area

Before, the escort mission didn't support an op-area, and planes on
escort mission escorted anywhere.  Change mission() to define the
op-area for escort missions as well.  Show it in mission() and
show_mission().  Check it in find_escorts().

15 years agoRemove non-mission land unit reaction
Markus Armbruster [Tue, 25 Nov 2008 01:31:22 +0000 (20:31 -0500)]
Remove non-mission land unit reaction

Land unit reactions are overly complex because we have two different
concepts controlling them: reaction radius (set with lrange) and
reserve mission (set with mission).  You need to deal with both to set
up or query reactions.

Commit 8d0e1af5 "fixed" this by making reserve missions meaningless.

The previous commit made reserve missions meaningful again: they
support an op-area now.  This brought back the problem of having to
deal with two separate commands to accomplish one thing.

Fix this for good by removing non-mission land unit reaction
alltogether.  The only feature we lose by that is the ability to order
land units to react until the order is explicitely cancelled.  That's
because missions are implicitely cleared by many commands and events,
while non-mission reaction wasn't.  Closes #858121 and #858122.

Remove the non-mission reaction case from att_reacting_units().

Don't limit reserve missions to the land unit's reaction radius: make
lnd_reaction_range() return the type's maximum radius instead of
lnd_rad_max.

The reaction radius is now useless.  Remove the lrange command, and
struct lndstr member lnd_rad_max along with its selector react.
Remove land command's column rd.  Make ldump show column react as
zero.  Deprecate edit key 'P' in dounit(), and don't show it in
pr_land().

15 years agoMake land units on reserve mission react within op-area
Markus Armbruster [Sat, 22 Nov 2008 19:40:37 +0000 (14:40 -0500)]
Make land units on reserve mission react within op-area

Before, they always reacted to their maximum range, and the op-area
was unused.  Change mission() to define the op-area for reserve
missions as well.  Remove the special-case for showing reserve
missions from mission() and show_mission().  New lnd_reaction_range()
factored out of att_reacting_units().  Use it in oprange() to cover
reserve missions.  Pass the mission as separate parameter to oprange()
for now, because miss() doesn't set it in the object until later.

15 years agoNew in_oparea(), factored out of build_mission_list_type()
Markus Armbruster [Sat, 22 Nov 2008 17:06:54 +0000 (12:06 -0500)]
New in_oparea(), factored out of build_mission_list_type()

15 years agoDon't reduce mission op area when range shrinks
Markus Armbruster [Fri, 21 Nov 2008 13:05:24 +0000 (08:05 -0500)]
Don't reduce mission op area when range shrinks

The mission command limits op area radius to the possible range.
That's okay, as it doesn't actually restrict possible op areas.  When
the mission is executed, it was limited again.  Don't do that; remove
the limiting code from build_mission_list_type() and show_mission().

The removed limiting had no effect, except when the range shrunk.
Then limiting reduced the op area more than necessary.  For instance,
consider an object O with initial range 3 on a mission around M with
range 3:

    - - - y - - -
     - - z y - -
    - - z x y - -
     - O x x M -
    - - z x y - -
     - - z y - -
    - - - y - - -

Initially, all sectors not marked - are in range and in the op area.
If the range drops to two, sectors marked O, x and z are still in
range of O.  But only the x are still in range of M.  The O and z got
excluded.

Range can currently shrink when plane range is reduced (range
command), or a ship, plane or land unit somehow loses tech (deity
intervention).

15 years agoRemove reserve mission's reaction radius bonus
Markus Armbruster [Mon, 17 Nov 2008 00:57:45 +0000 (19:57 -0500)]
Remove reserve mission's reaction radius bonus

Reserve missions are now useless.  They'll become useful again in a
later commit.

15 years agoUse #if 0 to disable code, not comments
Markus Armbruster [Mon, 17 Nov 2008 02:19:37 +0000 (21:19 -0500)]
Use #if 0 to disable code, not comments

15 years agoClean up removal of reserve mission mobility bonus
Markus Armbruster [Mon, 17 Nov 2008 02:18:17 +0000 (21:18 -0500)]
Clean up removal of reserve mission mobility bonus

Land units on reserve missions used to pay only half the usual
mobility for combat.  This bonus was commented out in the code in
4.0.0, but not in info.  Remove it from both.

15 years agoRemove commented out logerror() calls
Markus Armbruster [Mon, 17 Nov 2008 02:13:36 +0000 (21:13 -0500)]
Remove commented out logerror() calls

Probably ancient debug cruft.

15 years agoBump version to 4.3.20
Markus Armbruster [Sun, 14 Dec 2008 15:44:02 +0000 (10:44 -0500)]
Bump version to 4.3.20

15 years agoUpdate change log again for 4.3.19 v4.3.19
Markus Armbruster [Sun, 7 Dec 2008 23:15:19 +0000 (18:15 -0500)]
Update change log again for 4.3.19

15 years agoFix make dist in a separate build directory without git
Markus Armbruster [Sun, 7 Dec 2008 23:13:38 +0000 (18:13 -0500)]
Fix make dist in a separate build directory without git

In that case, make copied the sources.mk from $srcdir, but unless it
existed already, the peculiar workings of VPATH did us in: make
searched for the target, found it in $srcdir, and the dependency
became circular.

Fix by keeping sources.mk in $srcdir always.  We can build it there,
because its contents depends only on git state, not on anything in the
build tree.  This avoids the need to copy sources.mk alltogether.

15 years agoLWP doesn't work with Darwin due to OS bugs, avoid it for now
Markus Armbruster [Sun, 7 Dec 2008 22:25:35 +0000 (17:25 -0500)]
LWP doesn't work with Darwin due to OS bugs, avoid it for now

Darwin's getcontext() overruns its argument buffer.

15 years agoDon't let ships double-retreat first on 'i' and then on 'h'
Markus Armbruster [Sun, 7 Dec 2008 14:23:30 +0000 (09:23 -0500)]
Don't let ships double-retreat first on 'i' and then on 'h'

When a ship is shelled, retreat condition 'i' (injured) applies.  When
there's no return fire, 'h' (helpless) applies as well.  Ships
retreated twice in that case.  Fix that.

15 years agoUpdate change log for 4.3.19
Markus Armbruster [Sun, 7 Dec 2008 01:12:18 +0000 (20:12 -0500)]
Update change log for 4.3.19

15 years agoReplace other occurences of git-FOO by git FOO
Markus Armbruster [Wed, 3 Dec 2008 12:57:14 +0000 (07:57 -0500)]
Replace other occurences of git-FOO by git FOO

15 years agoUse 'git ls-files' instead of deprecated 'git-ls-files'
Gerd Flaig [Sat, 29 Nov 2008 21:30:11 +0000 (22:30 +0100)]
Use 'git ls-files' instead of deprecated 'git-ls-files'

15 years agoFix shp_prewrite() to print the sunk message
Markus Armbruster [Tue, 25 Nov 2008 00:08:16 +0000 (19:08 -0500)]
Fix shp_prewrite() to print the sunk message

Broken in commit 861a66625, v4.3.17.

15 years agoLog out player when time per day is exceeded
Ron Koenderink [Sun, 16 Nov 2008 14:42:42 +0000 (08:42 -0600)]
Log out player when time per day is exceeded

Commit 3da4030 already changed player_main() to log out the player
when m_m_p_d was exceeded in command().  This crept in accidentally.
Complete the job by changing status() to log out the player instead of
downgrading him to visitor status.

Also, change player_main(), command() and status() to apply the time
limit to countries in sanctuary in addition to active countries.
Leave visitors alone, because those are shared logins.  Make the
disconnect message to a player consistent for all situations.

Note that commit 875a80d1 already changed player_main() to apply the
time limit only to active countries instead of all, just like status()
does, but neglected to document that.

15 years agoFix nat_timeused calculation on login
Ron Koenderink [Sun, 16 Nov 2008 02:46:52 +0000 (20:46 -0600)]
Fix nat_timeused calculation on login

Broken in commit 875a80d.

15 years agoPrevent command from execute after game restrictions
Ron Koenderink [Sat, 15 Nov 2008 22:50:44 +0000 (16:50 -0600)]
Prevent command from execute after game restrictions

If a player is at a prompt when either game hours
restrictions starts or logged in time limit is exceeded
the player is allow to enter one command.

15 years agoCapital obliteration failed to charge money and report news
Markus Armbruster [Sat, 15 Nov 2008 21:43:13 +0000 (16:43 -0500)]
Capital obliteration failed to charge money and report news

Commit 221e88f1 (v4.3.15) made caploss() expect the new owner in
sct_own, so it can distinguish between sack and obliteration.  Commit
0d139ee1 (v4.3.17) broke that in sct_prewrite(): it moved zapping the
sector owner after caploss(), and passed 0 instead of the old owner to
caploss().  Because of that, obliterating a capital didn't make the
news and didn't cost the victim money.  Fix that.

15 years agoUpdate emptime.c.patch for commit cb0a373
Ron Koenderink [Sat, 15 Nov 2008 22:21:02 +0000 (16:21 -0600)]
Update emptime.c.patch for commit cb0a373

15 years agoDon't call time() for nat_last_login, use player->curup
Markus Armbruster [Sat, 15 Nov 2008 20:58:28 +0000 (15:58 -0500)]
Don't call time() for nat_last_login, use player->curup

15 years agoFix coding style and simplify seconds_since_midnight() a bit
Markus Armbruster [Sat, 15 Nov 2008 20:48:17 +0000 (15:48 -0500)]
Fix coding style and simplify seconds_since_midnight() a bit

15 years agoClean up unused variable in status()
Markus Armbruster [Sat, 15 Nov 2008 20:54:29 +0000 (15:54 -0500)]
Clean up unused variable in status()

Unused since commit 875a80d1.

15 years agoRewrite accounting of play time
Ron Koenderink [Sat, 15 Nov 2008 19:08:19 +0000 (13:08 -0600)]
Rewrite accounting of play time

Replace daychange() and gettimeleft() by update_timeused_login(),
update_timeused() and enforce_minimum_session_time().  The new
code doesn't assume the day is always 24 hours long which can
occur when transitioning into or out of DST and such.  Logging
in after more a multiple of 128 days now resets nat_timeused
properly.

Fix nat_timeused calculation on midnight rollover to include
the time since midnight.

struct natstr member nat_dayno and struct player member timeleft
are now unused, remove them.

15 years agoFix initialization of nat_last_logout
Ron Koenderink [Mon, 10 Nov 2008 00:17:46 +0000 (18:17 -0600)]
Fix initialization of nat_last_logout

Broken in f94f81ee, v4.2.22.

15 years agoFix parsing of 24:00 in game_hours and update_demandtimes
Ron Koenderink [Mon, 10 Nov 2008 00:06:51 +0000 (18:06 -0600)]
Fix parsing of 24:00 in game_hours and update_demandtimes

daytime() rejects 24:00 as invalid.  This makes daytime_range()
fail, is_daytime_allowed() ignore this and later ranges silently.
Broken in commit acdee1e3, v4.2.15.

15 years agoNew option RAILWAYS
Markus Armbruster [Sun, 26 Oct 2008 17:24:41 +0000 (13:24 -0400)]
New option RAILWAYS

With RAILWAYS, highway-like sectors double as rail.  They need to be
at least 5% efficient to be operational, and then they additionally
extend rail into adjacent sectors that are at least 60% efficient.

New opt_RAILWAYS, SCT_HAS_RAIL(), sct_rail_track().  Update
sector_mcost(), bp_neighbors(), lnd_mar_one_sector() for RAILWAYS
mobility rules.  Update sinfra(), spyline(), satdisp_sect() to show
rail track instead of rail infrastructure for RAILWAYS.

New virtual sector selector track, implemented by nsc_sct_track().

15 years agoAge che just like reserves (1% per 24 ETUs)
Markus Armbruster [Sun, 26 Oct 2008 17:08:01 +0000 (13:08 -0400)]
Age che just like reserves (1% per 24 ETUs)

Factor aging out of age_levels() into new age_people().  Use it in
do_feed() to age che.

15 years agoPermit ships to assault the sector they're in
Markus Armbruster [Thu, 24 Apr 2008 18:38:57 +0000 (20:38 +0200)]
Permit ships to assault the sector they're in

Ships still have to be in a sea sector to assault an adjacent sector.

15 years agoDon't produce food without work
Markus Armbruster [Tue, 1 Apr 2008 18:17:52 +0000 (20:17 +0200)]
Don't produce food without work

We don't want to starve tiny populations, because that would require
players to move trivial amounts of food after explore and such.
growfood() used to simply grow at least 1f when a sector was about to
starve.  That food is almost never eaten by a tiny population, so we
effectively got some production without work.  Fix by taking away that
free food after people ate, in do_feed().

15 years agoNew concept sector terrain
Markus Armbruster [Wed, 13 Feb 2008 19:54:08 +0000 (20:54 +0100)]
New concept sector terrain

A sector type's terrain (struct dchrstr member d_terrain) is the
sector type of its underlying terrain.  Sector types occuring in
d_terrain are terrain types, and must have their own type in
d_terrain.  Players can change sector types only to those with the
same terrain.

The builtin configuration defines terrain types sea, mountain,
wasteland, wilderness and plains.  It gives bridge span and tower
terrain sea, and everything else terrain wilderness.  Hence, the stock
game remains unchanged.

Deities can use terrain to create sector types that can be developed
only in limited ways.

15 years agoExplicitly specify dependency output file with gcc -MF
Markus Armbruster [Tue, 28 Oct 2008 23:27:23 +0000 (19:27 -0400)]
Explicitly specify dependency output file with gcc -MF

Used to work without that, but somehow no longer does.

15 years agoRepresent logged in time in seconds rather than minutes
Ron Koenderink [Tue, 28 Oct 2008 14:48:25 +0000 (08:48 -0600)]
Represent logged in time in seconds rather than minutes

This simplifies things.  In particular, it gets rid of random rounding
in getcommand(), which created a variation in the nightly build
depending on whether the update starts before or after the deity logs
out.

Replace struct natstr member nat_minused by nat_timeused, and update
cou_ca[] accordingly (this affects xdump nat).  Replace player member
minleft by timeleft, and getminleft() by gettimeleft().  Update
getcommand(), daychange(), player_main(), status() accordingly, taking
care not to change player output.  Change edit country key 'u' to work
in seconds.

15 years agoCorrect the emptime.c.patch for player.c
Ron Koenderink [Mon, 27 Oct 2008 03:12:10 +0000 (21:12 -0600)]
Correct the emptime.c.patch for player.c

Broken in commit 122171b.

15 years agoAdd a time base for nightly builds
Ron Koenderink [Sun, 26 Oct 2008 21:59:43 +0000 (15:59 -0600)]
Add a time base for nightly builds

Increment the time base at the each update.
Remove the unnecessary patches that overrode
the timestamp printouts.

15 years agoAdd more tests to nightly builds
Ron Koenderink [Sun, 26 Oct 2008 21:56:04 +0000 (15:56 -0600)]
Add more tests to nightly builds

Add Player 02 as an ally for Player 01.
Add tests for telegrams, wall, announce, relationships,
land units, wire, fire, attack, planes, autofish and autooil.

15 years agoBump version to 4.3.19
Markus Armbruster [Sun, 19 Oct 2008 18:41:55 +0000 (14:41 -0400)]
Bump version to 4.3.19

15 years agoUpdate change log for 4.3.18 v4.3.18
Markus Armbruster [Sat, 18 Oct 2008 18:40:27 +0000 (14:40 -0400)]
Update change log for 4.3.18

15 years agoOops when unit_carrier_change() arguments OLD or NEW are invalid
Markus Armbruster [Sat, 18 Oct 2008 18:21:45 +0000 (14:21 -0400)]
Oops when unit_carrier_change() arguments OLD or NEW are invalid

15 years agoAdd scrap and scuttle tests to nightly builds
Ron Koenderink [Fri, 10 Oct 2008 03:49:07 +0000 (21:49 -0600)]
Add scrap and scuttle tests to nightly builds

Also general improvements to economy for player 08.

15 years agoAdd land units tests to nightly builds and improve economy
Ron Koenderink [Wed, 8 Oct 2008 13:52:10 +0000 (07:52 -0600)]
Add land units tests to nightly builds and improve economy

Up the bar production.  Start education and tech for player 08
Improve the general economy for player 08.  Add land units building
tests to player 01, including ensuring the tech is high to build.

15 years agoFix initialization of new elements in plane, land and nuke tables
Ron Koenderink [Mon, 6 Oct 2008 23:58:59 +0000 (17:58 -0600)]
Fix initialization of new elements in plane, land and nuke tables

ef_init_srv() neglected to set struct empfile callback oninit.  This
made unit_carrier_change() crash or oops on freshly initialized
planes, land units and nukes, i.e. when build used an uid that hadn't
been used before.  Oops recovery worked.

Broken in commit 64a53c90, v4.3.17.

15 years agoAdd xdump tests to nightly builds
Ron Koenderink [Sun, 28 Sep 2008 15:03:50 +0000 (09:03 -0600)]
Add xdump tests to nightly builds

Add xdump meta test to Turn 00 Player 02 to verify player visibility.
Add xdump test to Turn 99 Player 00 to verify xdump output.
Add xdump test to Turn 99 Player 01 to player's version of xdump
output.

15 years agoAdd xdump meta and table accessible tests to nightly builds
Ron Koenderink [Sat, 27 Sep 2008 23:41:06 +0000 (17:41 -0600)]
Add xdump meta and table accessible tests to nightly builds

15 years agoMove test scripts from nightlybuild.sh to separate files
Ron Koenderink [Sat, 27 Sep 2008 01:47:16 +0000 (19:47 -0600)]
Move test scripts from nightlybuild.sh to separate files

The test scripts are now in nightly/tests/TURN/PLAYER.  For each turn,
the update script is executed first (except for turn 00), and then all
the player scripts in the appropriate turn directory.  This runs
runfeed() in different directories; change it to accomodate for that.

The update script runs "report *" on all updates.  Before, it ran only
on some of them.

15 years agoAdd missing cd to patch step for nightlybuild.sh
Ron Koenderink [Fri, 26 Sep 2008 23:33:11 +0000 (17:33 -0600)]
Add missing cd to patch step for nightlybuild.sh

If the patch step is ran without the preceeding step, the cwd
is incorrect.

15 years agoCorrection for Ubuntu Conversion
Ron Koenderink [Fri, 26 Sep 2008 03:12:24 +0000 (21:12 -0600)]
Correction for Ubuntu Conversion

Change nightlybuild.sh to allow the setting of the pthread
option for ./configure.  Remove the incorrectly added xml
header line from the ubuntu-pthread.i386.config file.

15 years agoSwitch Linux nightly builds to Ubuntu and add pthread build.
Ron Koenderink [Thu, 25 Sep 2008 02:18:27 +0000 (20:18 -0600)]
Switch Linux nightly builds to Ubuntu and add pthread build.

Remove the cron file for SuSE.  Add cron file for Ubuntu.
Remove LWP config file for SuSE.  Add LWP and pthread config
files for Ubuntu.