Commit graph

726 commits

Author SHA1 Message Date
8329b8884a (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.
2006-01-04 19:12:44 +00:00
b69173eea4 (orig): Allow moving origin to another country's origin. This is a
superset of the offset command.
(offs): Redundant, underdocumented, remove.

(orig): Allow deities to reset origin to absolute 0,0.
2006-01-04 14:36:21 +00:00
c13a592bf5 (STAT_ABS): Only set by files program for country #0. Prevents offset
and origin commands from working.  Remove.
2006-01-04 14:27:10 +00:00
Ron Koenderink
8f3f239839 (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().
2006-01-01 20:02:09 +00:00
Ron Koenderink
5aba44f5f2 (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.
2006-01-01 16:02:48 +00:00
c3900f8424 (empfile, fileinit, lnd_init, lnd_postread, lnd_prewrite, nuk_init)
(nuk_postread, nuk_prewrite, pln_init, pln_postread, pln_prewrite)
(sct_postread, sct_prewrite, shp_init, shp_postread, shp_prewrite)
(ef_extend): Use void * for generic pointer parameter.
2005-12-31 12:52:18 +00:00
3db4e34ba4 (natstr): Members nat_xstart, nat_ystart are used write-only. Remove.
Users changed.
2005-12-31 10:50:24 +00:00
028a1bf3d8 (EF_RESOURCES, resources): New.
(empfile): Add it.
(pchr_ca): Use it.
2005-12-31 10:29:32 +00:00
498d9fbfaa (M_SPY): Unused, remove. 2005-12-30 17:22:03 +00:00
a5b8249e98 (mkdir): Parenthesize macro parameter in expansion. 2005-12-30 17:21:42 +00:00
1969a3890a (opt_UPDATESCHED): Remove nooption UPDATESCHED. It had no effect on
the actual update, only on the update command.  Believed to be broken
since Empire2.
2005-12-29 13:38:57 +00:00
fb768e844c Fix spelling of The_Scum's name. 2005-12-29 10:26:41 +00:00
fa52e6944d Normalize inclusion guards: use NAME_H for name.h. Some headers
lacked them, others used reserved identifiers.
2005-12-29 10:16:01 +00:00
b316861e9d Autoconfigure whether char is unsigned. 2005-12-28 23:10:26 +00:00
686eadad37 (att_mode, xyas, ownxy, prbuf): Get rid of s_char. Users changed.
(ATTRIBUTE): Don't disable use of gcc __attribute__ when s_char is
signed char.  All format strings are now char *.
2005-12-28 22:30:52 +00:00
6fdbf215d0 Remove superflous includes. 2005-12-28 21:26:30 +00:00
0d267e0b24 There's no reason to include <time.h> in empio.h, except it's missing
in a couple of other files.  Include it where it's needed.
2005-12-28 21:25:39 +00:00
3b90d0cb81 (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.
2005-12-28 21:21:15 +00:00
0dc0b29a92 Update for 4.3.0. 2005-12-28 19:21:09 +00:00
19d88af312 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.
2005-12-28 18:50:08 +00:00
69150d10fc (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.
2005-12-28 14:27:15 +00:00
b921d3c262 (MAXNOC): Move to config.h. Remove empty options.h. 2005-12-28 13:08:26 +00:00
Ron Koenderink
233181c50d (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.
2005-12-26 03:53:21 +00:00
Ron Koenderink
9dfbf74785 [_WIN32]: Add #ifndef __GNUC__ around the pragma as pragma is not
supported by gcc.
2005-12-26 02:53:23 +00:00
ae24898e50 (opt_ALL_BLEED, opt_BIG_CITY, opt_BLITZ, opt_BRIDGETOWERS)
(opt_DEFENSE_INFRA, opt_DEMANDUPDATE, opt_DRNUKE, opt_EASY_BRIDGES)
(opt_FALLOUT, opt_FUEL, opt_GODNEWS, opt_GO_RENEW, opt_GUINEA_PIGS)
(opt_HIDDEN, opt_INTERDICT_ATT, opt_LANDSPIES, opt_LOANS)
(opt_LOSE_CONTACT, opt_MARKET, opt_MOB_ACCESS, opt_NOFOOD)
(opt_NOMOBCOST, opt_NO_FORT_FIRE, opt_NO_PLAGUE, opt_PINPOINTMISSILE)
(opt_RES_POP, opt_SAIL, opt_SHOWPLANE, opt_SLOW_WAR, opt_SUPER_BARS)
(opt_TECH_POP, opt_TRADESHIPS, opt_TREATIES, opt_UPDATESCHED):
Remove conditional initialization.  Values unchanged.
(ALL_BLEED, BIG_CITY, BLITZ, BRIDGETOWERS, DEFENSE_INFRA)
(DEMANDUPDATE, DRNUKE, EASY_BRIDGES, FALLOUT, FUEL, GODNEWS, GO_RENEW)
(GUINEA_PIGS, HIDDEN, INTERDICT_ATT, LANDSPIES, LOANS, LOSE_CONTACT)
(MARKET, MOB_ACCESS, NOFOOD, NOMOBCOST, NO_FORT_FIRE, NO_PLAGUE)
(PINPOINTMISSILE, RES_POP, SAIL, SHOWPLANE, SLOW_WAR, SUPER_BARS)
(TECH_POP, TRADESHIPS, TREATIES, UPDATESCHED): Unused, remove.
2005-12-25 14:53:29 +00:00
ade510f787 Turn options into ordinary econfig keys:
(configkeys): Add options.
(KM_OPTION): New.
(vers): Find options in configkeys[] instead of Options[].
(xdump): Remove xdump opt syntax.
(xdopt): Remove.
(emp_config, print_config): Remove option special case.
(option_list, Options, setoption): Remove.
2005-12-25 10:32:50 +00:00
Ron Koenderink
373a08a0e0 (min, max) [_WIN32]: Change WIN32 to use windef.h.
It is present in both MSVC and MinGW environments.

(F_OK, W_OK, R_OK) [_WIN32]: Add #ifndef to allow
to operation in both MSVC and MinGW environments.
2005-12-25 00:59:57 +00:00
3bbc91876f (START_CASH, start_cash): Replace START_CASH by new econfig key
start_cash.
2005-12-23 11:16:23 +00:00
641879abc7 Should have been removed in yesterday's build process commit. 2005-12-22 08:44:27 +00:00
a98626df2d 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.
2005-12-20 20:25:35 +00:00
Ron Koenderink
9217e75761 (shp_nav_one_sector, mchr[], ship_chr_flags[], Ship-types, Sector-types):
Add M_CANAL flag to indicate which ships can navigate a canal
in a big city.  Remove the hard code values for canal from
shp_nav_one_sector() for which ships can navigate a canal.
Set M_CANAL flag in ship_chr_flags[] to match the hard
coding in shp_nav_one_sector().
Update Ship-types.t with new canal flag.
Update Sector-types.t to indicate that cities have canals.
2005-12-18 15:16:52 +00:00
Ron Koenderink
5ffef496ea (coun_list, repo_list, nati): Replace in-flux determination code with influx().
(influx): New.
2005-12-17 20:18:54 +00:00
bb33660672 Clean up the move of lwpProc (lwpint.h rev. 1.11, lwp.h rev. 1.8). 2005-12-10 15:00:35 +00:00
aab54fcd54 (lwpProc, lwpSem): Declare as incomplete type in include/lwp.h. Move
complete declaration to src/lib/lwp/lwpint.h.
(lwpQueue): Move to src/lib/lwp/lwpint.h.
(empth_main, empth_flags): New.
(empth_init): Initialize them.
(empth_create, empth_exit): Use them instead of lwpProc members.
2005-12-07 19:15:37 +00:00
5a248c0d4e Doc fix. 2005-12-05 22:28:52 +00:00
320322cda9 (oops): Move declaration to misc.h, to make CANT_HAPPEN() usable
with just misc.h included.
2005-12-05 22:13:35 +00:00
38c55314f2 Doc fix. 2005-12-03 20:59:07 +00:00
Ron Koenderink
40c821d28b (ef_init_srv): Add a call ef_verify() to verify game data and game
configuration consistency.

(ef_verify): New.  Verifies game data and game
configuration consistency.
2005-11-30 19:17:58 +00:00
Ron Koenderink
0511565c11 (ship_chr_flags[]): Remove internal flags (M_XLIGHT, M_NCHOPPERS)
from ship_chr_flags[] so they do not appear in the show output.

(missions[]): Add MI_NONE to missions[] table.
2005-11-30 18:57:53 +00:00
Ron Koenderink
e89fb0bb17 (close_files, finish_server, panic):
Rename close_files() to ef_close_srv() and move to fileinit.c.
Replace calls to close_files() with ef_fin_srv().
Call ef_close_srv() from ef_fin_srv().

(ef_close_srv, ef_fin_srv): New.

(init_files, init_server, ef_init_srv):
Rename init_files() to ef_open_srv() and move to fileinit.c.
Remove call to init_files() from init_server() and replace
with a call to ef_open_srv() from ef_init_srv().

(ef_open_srv): New.

(ef_load, init_server, ef_init_srv):
Move the call to ef_load() from init_server() to ef_init_srv().

(global_init, init_server, ef_init_srv):
Move the call to global_init() from init_server() to ef_init_srv().

(nullify_objects, global_init, init_server):
Split nullify_objects() into init_lchr() and init_dchr().
Locate init_lchr() and init_dchr() in init.c.
Add calls to init_lchr() and to init_dchr() from global_init().

(init_lchr(), init_dchr()): New.
2005-11-29 03:57:44 +00:00
Ron Koenderink
e47465570a (mchr[],m_flags,m_nland): Remove M_UNIT from m_flags in mchr[].
It is not used.
2005-11-22 23:19:59 +00:00
Ron Koenderink
d4f52f6ca2 (lookup): Rename lookup() to symbol_by_value(), make it public
and move it to nstr.c.
2005-11-22 22:57:06 +00:00
fdec6a8aae (dchrstr, pchrstr, rptstr): New member d_uid, p_uid, r_uid.
(dchr, bigcity_dchr, pchr, rpt): Initialize it.
(dchr_ca, pchr_ca, rpt_ca): New selector uid for it.
2005-11-19 17:37:43 +00:00
Ron Koenderink
3fd64ccb48 (getcontact,putcontact): Generalize the interface back to an int.
Add range checks to prevent unexpected results.
2005-11-19 14:55:03 +00:00
cea58c40b0 The previous revision accidentally deleted commented out code.
Restore.
2005-11-19 09:53:22 +00:00
Ron Koenderink
762d39d905 (getcontact, putcontact, nat_contact): Change nat_contact
to unsigned char to reduce the space required for natstr.
2005-11-18 23:40:30 +00:00
Ron Koenderink
7b94794365 (cens, desi, dump, do_desi, doland, file_sct_init, grow_continents)
(grow_islands, set_coastal, update_coastal_flag, coast_sea_to_land)
(coast_land_to_sea): Determine sct_coastal flag when the sector type
is set.  Old method only updated the sct_coastal flag when doing
cens() or a dump().  Other uses of sct_coastal could get stale values,
including selector coastal.  Rework set_coastal() into NEW functions
update_coastal_flag(), coast_sea_to_land(), coast_land_to_sea() and
set_coastal().  Fix a bug where the deity designation would not
properly set the coastal flag.  Fix a bug where the one sector lake
would not properly compute coastal flag.  Fix a bug that makes
fairland treat the last sector it adds to an island as non-coastal.
2005-11-17 03:21:32 +00:00
Ron Koenderink
a2798857cf (fuel, load, prod, max_population, shp_nav_one_sector,
nav_loadship, upd_buildeff): Identify BIG_CITY
(IS_BIG_CITY) by using packing type of UPKG instead of
opt_BIG_CITY and sector type of SCT_CAPITAL.
2005-11-14 13:52:12 +00:00
Ron Koenderink
d581485d32 (plurize): Fix the strncat() len parameter to prevent an overflow of buf.
(numstr, esplur, splur, iesplur, plurize): Move the prototype defintions from
misc.h to prototypes.h.  Remove unneccessary headers in plur.c.
2005-11-13 23:18:37 +00:00
Ron Koenderink
fdcbb5912d (budg): Create the capital/city name from the d_name field instead of
hard coding the strings.

(plurize): New.
2005-11-13 21:23:44 +00:00