Commit graph

2026 commits

Author SHA1 Message Date
1ca0b5cb2b 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.
2006-06-08 20:11:26 +00:00
ff2a162587 (LwpContextPtr, lwpInitSystem): Use void ** for pointer to generic
pointer.  Users changed.
2006-06-08 05:38:06 +00:00
5c7e97c522 (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.
2006-06-07 21:45:46 +00:00
8562a40136 Fix the previous revision. 2006-06-07 21:39:01 +00:00
7183516d91 (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().
2006-06-07 21:01:16 +00:00
f51769659c (lwpDestroy): Internal linkage.
(lwpSelect, lwpStatus): Declare in lwpint.h instead of lwp.h.
2006-06-07 06:01:29 +00:00
0f2e12d3aa (lwpEntryPoint): Don't set *LwpContextPtr, that's just been done by
lwpReschedule().
2006-06-06 21:01:28 +00:00
24b56b9365 (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.
2006-06-06 20:57:03 +00:00
5df2ae0da7 Reorder table entries for clarity. Document. 2006-06-06 19:27:11 +00:00
d0ecb9b7ee (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.
2006-06-06 17:57:30 +00:00
bd7b0fea5d (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.
2006-06-06 17:53:59 +00:00
f284b0beab (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.
2006-06-05 17:44:25 +00:00
08937006d7 (prprod): New, factored out of prod().
(prod): Separate enlistment code from production code.  Simplifies
control flow, and thus gets rid of several compiler warnings.
2006-06-05 15:29:28 +00:00
32e4fbd284 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.
2006-06-05 08:51:02 +00:00
1479673302 Missed a use of MOB_ROAD. 2006-06-05 07:05:43 +00:00
5ad86bc7ce 4.0.2 made land unit mobility costs differ significantly from normal
move costs, but failed to make A* use these costs.  This broke land
unit path finding.  Fix:
(MOB_ROAD, MOB_MOVE, MOB_MARCH): Split MOB_ROAD into MOB_MOVE and
MOB_MARCH.  Users changed.
(lnd_mobcost, sector_mcost): Move minimum mobcost logic to
sector_mcost(), where it is visible to A*.  Also fixes unit reaction
path cost.

(lnd_path): Fix confusing message: don't claim there's no path when
all we really know is that there's no railway.
2006-06-04 17:41:12 +00:00
6ab05ae8a1 Path finding for trains never worked; it ignored the need for rail:
(sector_mcost, bp_neighbors): Fix for MOB_RAIL and sct_rail == 0.
Closes #781528.
2006-06-04 17:27:17 +00:00
20c02295a6 (BestDistPath): All callers pass MOB_ROAD to parameter mob_type,
remove it.  Callers changed.
2006-06-04 16:49:24 +00:00
0ea38208d1 (P_WALKING): Unused, remove.
(getpath): Remove P_WALKING case.
2006-06-04 16:42:36 +00:00
44318648bf Explain why not to edit configs in-place. 2006-06-04 12:27:10 +00:00
3aea20e1de (ichr, pchr, dchr, intrchr): Move initializer to new builtin config
files item.config, product.config, sect.config, infra.config.
(empfile): Declare the new config files.  Reorder table entries so
that read_builtin_tables() reads the config files in the right order.

(bigcity_dchr, opt_BIG_CITY, init_dchr): Remove.  Deities can edit
sect.config instead.
2006-06-04 09:34:39 +00:00
a835a4b4d3 Fix the previous revision. 2006-06-04 09:01:51 +00:00
8fa0dcbe17 Don't check values for immutable fields match when initializing an
empty table:
(initialized): New.
(xundump): Set it.
(fldval_must_match): Ignore NSC_CONST when it's clear.
2006-06-04 08:37:37 +00:00
b7922c9bd8 Fix rev. 1.11. 2006-06-04 08:33:03 +00:00
33e9b773ad Fix the revision before previous. 2006-06-04 08:26:12 +00:00
0b1f561e97 Comments, whitespace. 2006-06-02 05:49:29 +00:00
f70445af2b Fix the previous revision. 2006-06-02 05:43:31 +00:00
da88d91899 (pchrstr, pchr_ca, pchr, sctstr, dchr_ca, dchr): Replace pchrstr
member p_effic by sctstr member d_peffic.  Tables updated.
(show_sect_capab): Adapted.
(prod_eff): Adapted; requires changing first parameter to sector type.
Callers changed.
(P_MDUST): Remove, because pchr[P_MDUST] now identical to
pchr[P_DUST].
2006-06-02 05:35:54 +00:00
568b9d6639 Allow symbolic references not just to symbol tables:
(xunsymbol1): Use ef_elt_byname().
(setsym): Accept any table reference, not just to symbol table.
(symval): New.
(setsym, add2symset): Use it.
(mtsymset): Last remaining user of getsymtab(); inline and simplify.
(getsymtab): Remove.

(xunsymbol1, xunsymbol): Rename.
2006-06-01 19:15:30 +00:00
a1546476bf (xunsymbol1): Fix diagnostics. 2006-06-01 19:06:56 +00:00
401e072824 Fix the previous revision. 2006-06-01 18:57:42 +00:00
6fadcf6e8e (buil): Use ef_elt_byname() instead of typematch().
(typematch): Unused, remove.
2006-06-01 18:57:03 +00:00
c432e3107d Symbolic names for table entries in conditionals, closes #928376:
(ef_elt_byname): New.
(nstr_match_val): Use it to generalize to arbitrary table with
uniquely named elements.  Use ca_type to find table, remove parameter
type.  Callers changed.
(nstr_mkselval): Adapt sanity check accordingly.
(NSC_TYPEID): No longer needed, remove, users changed to use
appropriate integer type instead.  This fixes signedness of sector
selectors des and newdes.
(meta_type): Remove entry for NSC_TYPEID.
(nstr_coerce_val): Can't detect typeid - integer mismatch anymore.
Was nice to have; perhaps revive it later.
2006-06-01 18:48:42 +00:00
15635c25ae (getid): Restrict identifier syntax: outlaw conditional operators <>=#
and meta-character ".
2006-06-01 18:09:40 +00:00
2faa68c6e3 (xufld, setstr): Improve diagnostics. 2006-06-01 18:06:03 +00:00
565b6630a2 (prexpense, budg): Printing brackets around expenses that won't
actually be paid in full didn't take the update sequence into account,
and wasn't implemented for sector building, military payroll and
capital maintenance.  Remove the feature, as fixing is hardly worth
the trouble.  This renders prexpense() trivial; inline and remove.
2006-06-01 17:42:59 +00:00
967299a375 (update_main): Change update sequence to repair ships, planes and land
units after sectors produce.  This makes repairs use new avail instead
of old.
2006-06-01 16:54:00 +00:00
016249c9e5 (land, nuke, plan, shi): Change stop prefix to `!'. Explain it in the
footer when actually present.
2006-06-01 16:29:54 +00:00
b8825e962c (lnd_support): Let land units on missions support, just like ships. 2006-05-31 19:58:16 +00:00
01ed071af4 (att_reacting_units): Don't let units loaded on a train react. 2006-05-31 19:56:02 +00:00
039907d306 Update known contributors comment. 2006-05-29 21:23:33 +00:00
85c8d7bd82 Fix the previous revision. 2006-05-29 21:20:09 +00:00
eb1512d75f Let players stop/start units:
(genitem, lndstr, nukstr, plnstr, shpstr): New members off, lnd_off,
nuk_off, pln_off, shp_off.
(NSC_GENITEM): New selector off.
(land, nuke, plan, shi): Display efficiency prefixed by `=' when off.
(start, stop, player_coms): Rewrite, new syntax.  Print only objects
that actually change.
(start_hdr, stop_hdr, start_stop_hdr): Consolidate.
(item_u, start_stop, start_stop_sector, proff, start_stop_unit)
(start_stop_unit_hdr, unit_type_name): New.
(upd_land, upd_plane, planerepair, upd_ship): Obey and clear stoppage.
2006-05-29 21:11:14 +00:00
520446ef39 Remove budget priorities:
(budg, player_coms): Remove command arguments.
(PRI_SMAINT, PRI_PMAINT, PRI_LMAINT, PRI_SBUILD, PRI_PBUILD)
(PRI_LBUILD, PRI_MAX): Remove.
(natstr): Remove member nat_priorities.
(add, main): Remove its initialization.
(budg, cal_call, prexpense, prod, update_main, upd_land, upd_plane)
(upd_buildeff, produce_sect, upd_ship): Simplify.
(produce_sect): Last parameter now superflous, remove & simplify.
(change_prio, do_prod): Unused, remove.

(budg): Move land units output down, to match update sequence.
2006-05-29 20:43:30 +00:00
26110320c0 Update for current code, and edited for clarity. 2006-05-29 20:06:34 +00:00
2b57a13d94 Change set with nuke.h rev. 1.21 was incomplete (harmless because the
missing bits were consistent):
(build_nuke): Assign 0 instead of space.
(nuke): Update printing of group.
2006-05-29 19:29:29 +00:00
d5f8c32342 (plan): Condense columns LSB and nuke into column special. Rename
column s/l to carry.
2006-05-29 19:11:24 +00:00
9a6016aecc (land): Show carrier number with a type suffix instead of a prefix,
for consistency with nuke and plane commands.
2006-05-29 18:49:14 +00:00
3f02f51469 Bump version to 4.3.6. 2006-05-29 18:39:46 +00:00
bd0bf9fdd3 Update for 4.3.5. 2006-05-28 07:54:10 +00:00