Commit graph

801 commits

Author SHA1 Message Date
12518b82dd Fix missing include. 2005-03-09 16:56:39 +00:00
6309973d07 Fix typos, update paths that changed since this was written. 2005-03-09 16:46:45 +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
30f2b2c4ea (player_init, player_accept): Move socket bind and listen from
player_accept() to player_init().  Acquiring resources during
initialization allows to exit unsuccessfully on errors.  Previously,
the daemon detached itself (exiting successfully), then failed in the
background.
(player_socket): New.
2005-03-08 16:51:19 +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
ab2bea5810 (service_main) [_WIN32]: Remove the command line processing.
The secondary command line processing was adding significant
complexity for minimial gain.  Now all the command line arguments
can be prequalified during the installation of the service.

(service_main) [_WIN32]: Move the initialization (init_server())
so logerror() will go to the file instead of stderr.
2005-03-06 20:58:48 +00:00
Ron Koenderink
46a11d0d93 (main) [_WIN32]: Move install_service() so the config_file
can be verified before installing.
2005-03-06 20:54:30 +00:00
Ron Koenderink
0ba025cb4b (main,service_main) [_WIN32]: Remove printf for errors
during startup, as logerror will print to stderr or to log file.
Remove logerror for successful installation and removal.
2005-03-06 20:08:52 +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
e215af5ac5 (init_files): Exit unsuccessfully when a file can't be opened. 2005-03-03 19:54:25 +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
Ron Koenderink
55e6aca9e0 (wrmakesrc,wripglob,wrgamesdef,info,apro,mobupdate,rea,turn
upda,ef_open,logerror,emp_config,match_user,show_motd,gamedown,
typed_wu,delete_old_announcements,mobility_check,mobility_init,
allocate_memory,write_newcap_script,main,files,fairland,doconfig,)
[_WIN32]: Switchback to default mode of text.
"t" (text) is not included the ISO/ANSI C standard but "b" (binary)
is included.
2005-03-02 12:47:15 +00:00
d4af51c9e2 Fix the previous rev. 2005-03-01 18:49:12 +00:00
Ron Koenderink
826c14ef79 (write_file,allocate_memory): Convert to stdio. 2005-03-01 13:50:56 +00:00
Ron Koenderink
df7dc203c4 (turn): Change to stdio.
(turn): Always close the file after attempting to write.
Fixes bug where the file is not close when there is writing
error.
2005-02-28 23:21:05 +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
b360d076d3 (ship_bomb): Clarify. Also gets rid of compiler warning. 2005-02-24 17:55:28 +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
Ron Koenderink
446d4ed394 (gamedown,show_motd): Change to stdio for reading motd and
down message.

(gamedown): Change buf's size to be MAXTELSIZE instead
of abitrary number.  Make consistent with show_motd().
2005-02-24 02:00:14 +00:00
Ron Koenderink
7afaedbfc1 (gamedown,show_motd): Change the %d to %ld for printing
tgm.tel_length as it is long.
2005-02-24 01:28:44 +00:00
Ron Koenderink
3af430ebc5 (gamedown, show_motd): Move length check to before 'buf' is written to
to prevent stack overflow on 'buf' variable.
2005-02-23 19:00:56 +00:00
9be3aa7739 Tell indent about i_packing and i_type, belatedly. 2005-02-23 15:55:58 +00:00
7e402f062c Fix bad line break / whitespace. No functional changes. 2005-02-23 15:41:22 +00:00
16407594d6 (conditions): Fix spelling mistake. 2005-02-23 15:28:24 +00:00
929b3ba412 (retr): Use RET_GROUP instead of literal 1. No functional changes. 2005-02-23 15:27:19 +00:00
4113cdab5c Fix bad line break. No functional changes. 2005-02-23 15:26:36 +00:00
39a2710482 (reco): Fix check for empty flight path. Aborting the command at the
flight path prompt now works.

(reco): Pass P_ESC to pln_arm() for consistency with call of pln_sel()
and similar code elsewhere.  Believed not to make a difference.
2005-02-23 15:17:27 +00:00
Ron Koenderink
bca00f35f5 (powe): Do not round totals for deity countries. 2005-02-22 01:28:43 +00:00
Ron Koenderink
aebdf80864 (powe): Fix the deity check to use player->god instead of
player->cnum == 0.  Partial Fix for #863419.
2005-02-21 20:35:37 +00:00
552467dc08 (nullify_objects): Simply use all of bigcity_dchr. Using only parts
is confusing.
(bigcity_dchr): Fix initializer for d_maxpop.

(dchr): The previous revision accidentally changed maximum population
of sanctuaries, plains, sea and wasteland.  Revert the former two.
The latter are not used, but the new max population of zero makes more
sense, so keep it.
2005-02-21 19:52:25 +00:00
Ron Koenderink
6e9a69241e (main): Move loginit() to after the getopt(), so the -D option will
take affect for the log file.  Otherwise the server.log will be in
default data directory compiled into the server.
2005-02-21 18:17:11 +00:00
Marc Olzheim
d0295935a4 Update patch for include/prototypes.h:1.66
src/lib/commands/mfir.c:1.21 src/lib/commands/sabo.c:1.10
 src/lib/update/human.c:1.15  No functional changes.
2005-02-21 17:17:16 +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
43d07b458d (prod): Widen column will make so that product p_sname is not
truncated.
2005-02-20 18:51:55 +00:00
c46c6cf87e (prod): Several columns were too narrow, and didn't align properly for
large values.  Remove column wkfc to make space, widen other columns.
Columns use2, use3 and max2, max3 lack separating space on the left
for large values, which don't occur in normal game configurations.
2005-02-20 18:39:59 +00:00
67ebeb674f (upd_ship): Fix the previous rev. 2005-02-20 01:46:17 +00:00
e5804f8dd8 (prod, produce, upd_ship): struct pchrstr p_nrndx refers to u_char,
not s_char.  Fix types.

(upd_ship): Catch resource underflow (should not happen).
2005-02-19 17:28:30 +00:00
d5d8028ad1 (max_population): Fix for opt_RES_POP and d_maxpop != 999. 2005-02-17 21:40:24 +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
f8b2860ec5 (prod, nati): Use max_pop() instead of hardcoded values. Before,
struct dchrstr member d_maxpop had no effect in some cases.
2005-02-13 18:25:30 +00:00
41da51e548 (newe): Fix for max_pop() > 999. 2005-02-13 18:25:14 +00:00
236c29a0c5 Break an inclusion cycle missed by yesterday's change. 2005-02-13 10:37:46 +00:00
d89fdd8e31 `make depend' attempts to make dependencies for *.c. This is plain
evil, and ought to be fixed.  In particular, it chokes on this file,
because it includes Windows specific headers.  Which is fine, as the
file is compiled only under Windows.

Quick band-aid: wrap the file contents in #ifdef _WIN32.
2005-02-12 19:45:59 +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
858839f063 (dchr_ca): New selector maxpop. 2005-02-12 17:06:21 +00:00
aa26c53e47 (multifire): If firing at a submarine with something that can't drop
depth charges, don't disclose the target is a submarine.  Old code
allowed players to find all submarine uids.
2005-02-12 16:43:08 +00:00