Change nation status from bits to a simple enum:
(nat_status, STAT_UNUSED, STAT_VIS, STAT_ACTIVE): New.
(STAT_NEW, STAT_SANCT, STAT_GOD): Change into nat_status members.
(STAT_INUSE, STAT_NORM): Remove.
(natstr): Use new nat_status for nat_stat.
New value Old value
STAT_UNUSED 0
STAT_NEW STAT_INUSE | STAT_NEW
STAT_VIS STAT_INUSE
STAT_SANCT STAT_INUSE | STAT_SANCT
STAT_ACTIVE STAT_INUSE | STAT_NORM
STAT_GOD STAT_INUSE | STAT_NORM | STAT_GOD
Users changed.
(docountry): Telex country on nat_reserve editing unconditionally.
The condition was never true due to a coding mistake. Other edits
don't have such conditions.
(comtch): Parameter god permitted execution of any command, even when
com->c_permit disagreed. Doesn't make sense and is inconsistent with
output of list. Remove parameter. The only command affected is
break.
Ron Koenderink [Sun, 1 Jan 2006 20:02:09 +0000 (20:02 +0000)]
(ioq_makebuf, ioq_makeiov) [_WIN32]: Remove the external for
ioq_makeiov() for WIN32 case so it matches source for the
ioq_makeiov(). Reorganize ioq_makebuf() to make it obvious that
ioq_makebuf() is used for WIN32 and everybody uses ioq_makeiov().
Ron Koenderink [Sun, 1 Jan 2006 19:47:46 +0000 (19:47 +0000)]
(info, apro) [_WIN32]: Correct parameter order for calls
to logerror() where GetLastError() is used.
Change the format to "lu" for printing GetLastError().
Ron Koenderink [Sun, 1 Jan 2006 16:02:48 +0000 (16:02 +0000)]
(min, max) [_WIN32, __GNUC__]: Add min and max macros for
mingw/gcc compile environment. min/max are not included
in stdlib.h in mingw/gcc environment.
Ron Koenderink [Sat, 31 Dec 2005 22:37:51 +0000 (22:37 +0000)]
(ac_flak_dam): Fix FLAK_MAX to be last element of the array.
This fixes >8 case which was accessing one past the last element
of the array and getting an invalid value for flak max.
Broken in rev. 1.18
(opt_UPDATESCHED): Remove nooption UPDATESCHED. It had no effect on
the actual update, only on the update command. Believed to be broken
since Empire2.
(PP_MAIN, PP_UPDATE, PP_SHUTDOWN, PP_SCHED, PP_TIMESTAMP, PP_PLAYER)
(PP_ACCEPT, PP_KILLIDLE): Move from player.h to empthread.h and turn
into enumeration constants.
Support for IPv6:
(tcp_listen, player_addrlen): New. IPv4-only code factored out of
player_init().
(player_init): Use them.
(player_accept): Address family independence.
(tcp_connect): New.
(main): Use it.
(hostaddr, hostconnect, hostport): Internal linkage.
(EMPTH_LWP, EMPTH_POSIX, EMPTH_W32): Define in config.h instead of
compiler command line. Don't bother to conditionalize code in .c
files that are only compiled when their thread package is used.
(_EMPTH_LWP, EMPTH_LWP, _EMPTH_POSIX, EMPTH_POSIX, _EMPTH_WIN32)
(EMPTH_W32): Identifiers beginning with an underscore and an uppercase
letter are reserved for any use. Rename.
(lwpInitSelect): The code to query the system's limit on file
descriptors was not portable. Simply use FD_SETSIZE instead. The
lower of the two applies, so this wastes storage if the system's limit
is significantly below FD_SETSIZE. Not an issue, as FD_SETSIZE is
fairly small.
(lwpSleepFd): Return if fd is too large. Returning isn't nice,
but better than the buffer overruns in the old code.
(lwpSelect): Member nfile unused, remove.
Ron Koenderink [Mon, 26 Dec 2005 03:53:21 +0000 (03:53 +0000)]
(player_new, player_accept, update_wait, market_update) [_WIN32]:
Move assignment of hostaddr and hostname from player_new() to
player_accept(). This solves the necessary of adding the socket include
file to prototypes.h for player_new(). The socket include file creates
a namespace conflict for WIN32.
(drop): A mining mission targeting land called pln_dropoff() instead
of pln_mine(). pln_dropoff() happens to do pretty much the right
thing, but...
(pln_mine): Refuse to mine land.
Flatten info directory. This undoes the move to one subdirectory per
chapter, which was done during Empire 2. The structure doesn't buy us
much, as the info name space is flat, and it complicates makefiles.
Overhaul info.pl:
- It now wants to run in the root of the build tree.
- Information on source files and subjects is now stored in makefiles,
thus info.pl no longer picks up random junk from the file system.
- Clean up Perl anachronisms, in particular use subroutine arguments and
results rather than global variables where convenient.
- Change format of diagnostics to the common format used by GNU tools,
so that Emacs and the like can parse it.
- Catch missing .SA.
- When creating a new subject file, cowardly refuse to overwrite an
existing file.
- Subject files contain topics sorted by chapter, then by name. The
order of chapters used to depend on how Perl sorts hash keys. Fix
it.
Replace the build process. The new one requires GNU Make, Autoconf
and Autoconf macros that come with Automake. It supports multiple
separate builds of the same source tree, and updates dependencies
automatically. Targets info, html, install, install-html, uninstall
and dist are not yet implemented.
System configuration is now automatic. Previously, you had to choose
one of several canned system configurations, defined in Make.sysdefs.
Currently, system configuration always uses UCONTEXT for LWP, and
chooses LWP only if its requirements are met.
Feature configuration changed: instead of editing build.conf (further
processed by doconfig), you pass arguments to configure. Note that
build.conf settings that can be overridden in econfig have no
configure equivalent; just edit econfig instead.
Because generated headers complicate makefiles, fold gamesdef.h into
its users: path.c and ipglob.c become path.c.in and ipglob.c.in,
constants.c, vers.c, options.h simply hardcode defaults (most of them
are run-time configurable).
Call the client empire instead of emp_client. This matches what the
old standalone build did.