Commit graph

1174 commits

Author SHA1 Message Date
2508364945 (lnd_support): New parameter defending, to report defensive support in
the news correctly, like dd() and sd() do.  Reported by Doug Wescott.
2005-05-24 18:38:36 +00:00
Ron Koenderink
276a99841f (MINES_MAX): Change to 32767. MINES_MAX was not adjusted from 65535
when sct_mines was changed from unsigned short to short in rev. 1.15.
2005-05-07 19:49:04 +00:00
Ron Koenderink
9f27f5b02a (ship_grow_scale, plane_grow_scale, land_grow_scale): Change from int
to float.  This allows more control of the max. efficiency gain, and
makes it similiar to ship_mob_scale etc.  Closes #1025600.
2005-04-05 03:00:35 +00:00
7775f41186 Update for 4.2.21. 2005-03-26 05:29:27 +00:00
Marc Olzheim
e15b045713 (wu,typed_wu): close() a sent telegram before waking up other threads.
Remove s_char and register on the way.
2005-03-26 00:23:25 +00:00
19a80f13c4 (shp_nav_one_sector): When shp_interdict() removed the second ship in
a sector, interdiction loop followed dangling pointer and crashed.
Simplify & fix.
(mlist): Member done no longer used, remove.
2005-03-21 21:05:08 +00:00
df476395fb Update for 4.2.20. 2005-03-17 21:49:59 +00:00
b1f973faed Indentation fix. 2005-03-17 21:47:42 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
147cf97224 (main): Rev. 1.43 broke option -D. Its meaning in presence of -e is
unclear.  Other programs only support -e.  Remove -D.
(install_service): Remove argument datadir_set.

(main): New option -v.

(main): Exit successfully after -h.

(main): Don't print usage on unknown options, just point to -h.

(print_usage): Rewrite.  Deprecate use of non-option arguments.
2005-03-16 20:53:27 +00:00
Ron Koenderink
9227a314c5 (service_stoppped,stop_service,loc_Ctrl_C_Handler,
empth_request_shutdown,loc_BlockMainThread,empth_init,
service_ctrl_handler) [_WIN32]: Remove the Windows Build UI and
replace with Ctrl-c signal trap.  The shutdown event that was used for
STOPPING the service is now used for both foreground and background
(service) modes of operation. Also move the shutdown event from service
code to empth_t library.
2005-03-15 18:19:07 +00:00
Ron Koenderink
1f9b34dfdd (log_error) [_WIN32]: Remove ; from the #define for vsnprintf.
This part of the for changes to logerror().
2005-03-12 19:33:18 +00:00
Ron Koenderink
157395fcb2 (log_error) [_WIN32]: Add #define for vsnprintf to pick up
_vsnprintf from the WIN32 library for changes to logerror().

(main) [_WIN32]: Add typedef for pid_t to match WIN32 definition
for getpid().  This is required for the create_pidfile() changes.
2005-03-12 17:52:29 +00:00
7d71984932 (pre_update_hook): New configuration key.
(update_wait): Implement it.
(run_hook): New.
2005-03-12 17:24:57 +00:00
3f472fc729 (finish_server): New, factored out of termination code. Fixes two
places in service_main() that lacked close_files().
(close_files, loc_NTTerm): Static linkage.
2005-03-12 16:28:28 +00:00
09b481b30a [!POSIXSIGNALS]: Thoroughly obsolete, remove. This also gets rid of
an odd case where signals were not catched when debugging.

(main, empth_start): Using sa_handler with SA_SIGINFO is wrong.
Simply don't set SA_SIGINFO; the additional signal information is not
used anyway.
2005-03-12 12:20:50 +00:00
ed7adb7cf6 (loginit): Working directory is the data directory; simplify.
(loginit, logerror): Use plain char * instead of s_char *.
2005-03-10 19:33:12 +00:00
5b57f4c222 Merge pre-4-2-20-invasive. Summary of changes:
* Acquire resources before daemonizing, fail in foreground
* Initialize threads and signals after daemonizing
* Make most file names relative to data directory
* emp_server and files make it their working directory
* emp_config() no longer screws up some file names
* Missing or incorrect econfig is now fatal
* Don't log to default log file when econfig changes it
2005-03-10 18:35:27 +00:00
d20fb6ba39 (init_server, start_server): Move signal and thread initialization
from init_server() to start_server(), and service startup next to its
Unix equivalent disassoc().  This way, threading is always initialized
after daemonizing, which is simpler and more portable.
2005-03-09 19:37:48 +00:00
29da4b6cf4 (empfile, teldir, motdfil, downfil, disablefil, telfil, annfil)
(banfil, authfil, timestampfil): Make file names relative to DATADIR.
(main): emp_server and files change to the data directory.  fairland
has to write newcap_script to the initial current directory, so it
keeps it and makes file names relative to DATADIR absolute.
(fixup_files): Nothing to do, remove.  This fixes the following bug:
fixup_files() formed file names by appending ep->name instead of the
base name of ep->file to datadir.  Thus, fixup_files() changed file
names even when datadir had the compiled-in value.  When emp_config()
couldn't open econfig, it failed to call fixup_files(), and different
file names got used.  Note that with this revision the file names
revert to the names used before fixup_files() was introduced.  Closes
#1146080.
(print_config): Printing file names as comments is not really useful,
remove.
(otherfiles, ofiles): Unused, remove.
(emp_config, main): Previously, pconfig had to call emp_config() even
when it didn't want to read econfig, just to run fixup_files().  This
is no longer necessary.  Simplify.
2005-03-09 18:44:50 +00:00
1583d0c6a2 (dflt_econfig): New.
(emp_config): Use it when argument is NULL.  This simplifies callers
except pconfig's main(), which now has to suppress reading the default
file.  Also fix callers to check the return value.  Previously, a typo
could easily start a grossly misconfigured program, with potentially
disastrous results.
2005-03-09 17:11:58 +00:00
12518b82dd Fix missing include. 2005-03-09 16:56:39 +00:00
84b8189c13 (daemon, daemonize): Rename to avoid name clash with BSD's daemon().
(daemonize): Supply missing declaration.
2005-03-09 14:45:41 +00:00
Ron Koenderink
0b172c6553 (NS_ALL) [_WIN32]: Change NS_EVERYTHING back to NS_ALL, #undef NS_ALL to prevent conflict with winsock2.h 2005-03-08 00:04:43 +00:00
Ron Koenderink
d1d7028fc7 (main,service_main) [_WIN32]: Fix config_file for WIN32.
(main,service_main,empth_exit) [_WIN32]: Add daemon flag.
Separate the debug_flag into two separate flags, one for
debugging (debug) and controlling the daemon processing
(daemon).
2005-03-06 19:53:14 +00:00
830c171dd2 (start_server, main, service_main): Call emp_config() earlier.
(main): Call loginit() later, after emp_config().  Previously, the
program logged to the default datadir until emp_config().
(init_server, start_sever): Split start_server() into initialization
and actual startup.  Move initialization before disassoc().
(main, init_server): Log server startup only after initialization is
complete.
2005-03-05 20:38:01 +00:00
Ron Koenderink
85150431ed (delete_old_news,init_nreport): Add void for extern prototypes. 2005-03-03 00:23:49 +00:00
Ron Koenderink
3d3d6755aa (nreport, filereport, ncache, addfree, findfree, delete_old_news)
(init_nreport, update_main, start_server): Switch news to be sorted
list with all new news items added at the end of the list.  The
removal of expired news items is done at update time.  Closes #766755.
2005-03-02 23:53:10 +00:00
0aaf0084aa (as_extend, as_costcomp, gen_power, powcmp): Fix non-portable function
cast.
(qsort_func_t): Unused, remove.
2005-02-24 18:47:26 +00:00
8bb79caa87 global.h does nothing but include prototypes.h, remove. 2005-02-24 17:54:14 +00:00
2f4a825348 Doc fix. 2005-02-24 17:52:10 +00:00
58512e4813 First step towards generalizing NSC_TYPEID to arbitrary dictionaries.
(nsc_cat) New category NSC_ID.
(nstr_comp): Resolve identifiers instead of relying on nstr_comp_val()
and nstr_coerce_val().
(valstr, nstr_coerce_val): Remove valstr member val_as_type.
(nstr_parse_val, nstr_match_ca, nstr_match_val, nstr_resolve_id)
(nstr_resolve_sel, nstr_mkselval): New.
(nstr_comp_val): Rewrite using the above.
2005-02-24 16:14:53 +00:00
5ba8cab9b5 (total_work): Remove redundant conversion to int.
(total_work): New parameter maxpop.  Callers changed.
(newe, prod): Use total_work().  Old code failed to limit military
workers, thus didn't match the update.
(do_feed): Simplify.
2005-02-20 19:36:41 +00:00
ff67d93711 (max_population): New, factored out of max_pop().
(max_pop): Use it.  Don't support null argument anymore.
(nati, gen_power): Use max_population() instead of max_pop() with null
argument.
(show_sect_stats): Use max_population() to simplify the code.
(prod, upd_buildeff): Use max_population() to get correct new maximum
population for limiting work when tearing down a big city.
Previously, this was broken in upd_buildeff().  In prod(), it was
broken when the new designation had odd maximum population, which
should not occur.
2005-02-17 21:04:08 +00:00
236c29a0c5 Break an inclusion cycle missed by yesterday's change. 2005-02-13 10:37:46 +00:00
afa65c8f27 Break inclusion cycles. To simplify the change, move a few
declarations to other, no less sensible places.
2005-02-12 19:26:59 +00:00
153527a3eb From Ray Hyatt:
(dchrstr): New member d_maxpop.
(dchr): Initialize it.
(max_pop): Use it.  Use dchr[SCT_MINE].d_maxpop when called with null
argument.  RES_POP now affects mountains and plains as well.
2005-02-12 16:17:57 +00:00
Ron Koenderink
c99a5b4f43 (tend_nxtitem,nxtitem,sarg_type,snxtitem,snxtitem_all,snxtsct,nxtitemp):
change NS_ALL to NS_EVERYTHING in ns_seltype because of a
conflict with winsock2.h which is used in the WIN32 build.
2004-12-31 20:14:10 +00:00
Ron Koenderink
b3ec8c14da The previous rev. was committed accidentally, revert. 2004-12-30 02:51:12 +00:00
Ron Koenderink
70fcb70707 (main,install_service,remove_service,service_main) [_WIN32]:
Add the ability to specify the service name, to install
multiple services and to set -D and -e options during install.
2004-12-30 02:19:44 +00:00
d2ae708dea Update for 4.2.19. 2004-12-23 20:42:39 +00:00
Ron Koenderink
e342a73130 (main,close_files,loc_NT_Term,empth_exit):
Add Windows Service to the server.
This includes adding install service and remove service option.
Move the start code from main to separate function.
Make close_files() and loc_NT_Term() global.
Move disassoc() to be earlier in the startup sequence.
2004-12-21 03:10:30 +00:00
Ron Koenderink
99ad950d9c switch comments from // format to /* */ format. 2004-12-21 02:20:26 +00:00
8f74995e99 (NUKEFAILDETONATE, opt_NUKEFAILDETONATE, Options, msl_hit): Remove
option NUKEFAILDETONATE.
2004-12-17 19:45:33 +00:00
46608d6c83 (ORBIT, opt_ORBIT, Options, launch_sat, pdump, plan, prod_plane):
Remove nooption ORBIT.
2004-12-17 19:29:36 +00:00
Marc Olzheim
a2284aac8d "(turn): Fix comparing the output of write() to an unsigned sizeof by
casting the sizeof to write's most used return-type (ssize_t). Introduce
a typedef for ssize_t for _WIN32 in include/misc.h."
2004-12-17 15:44:57 +00:00
5686a080ce Belatedly remove ROLLOVER_AVAIL. 2004-12-16 23:13:06 +00:00
83645f8533 (GUINEA_PIGS, opt_GUINEA_PIGS, Options): New option GUINEA_PIGS. 2004-12-16 23:11:59 +00:00
bebf6a7de0 (GUINEA_PIGS, opt_GUINEA_PIGS, Options): New option GUINEA_PIGS. 2004-12-16 22:01:30 +00:00
Ron Koenderink
2c4b89e2d1 (ac_calc_flak,ac_fireflak,pinflak_planedamage): New ac_calc_flak().
Move common flak damage code from ac_fireflak() and
pinflak_planedamage() to ac_calc_flak().
2004-12-16 19:40:06 +00:00