Commit graph

55 commits

Author SHA1 Message Date
9b2e906ea1 Improve newcap's origin error message 2011-12-29 11:47:05 +01:00
7e2008e7f4 License upgrade to GPL version 3 or later
Why upgrade?  I'm not a lawyer, but here's my take on the differences
to version 2:

* Software patents: better protection against abuse of patents to
  prevent users from exercising the rights under the GPL.  I doubt
  we'll get hit with a patent suit, but it's a good move just on
  general principles.

* License compatibility: compatible with more free licenses, i.e. can
  "steal" more free software for use in Empire.  I don't expect to steal
  much, but it's nice to have the option.

* Definition of "source code": modernization of some details for today's
  networked world, to make it easier to distribute the software.  Not
  really relevant to us now, as we normally distribute full source code.

* Tivoization: this is about putting GPL-licensed software in hardware,
  then make the hardware refuse to run modified software.  "Neat" trick
  to effectively deny its users their rights under the GPL.  Abuse was
  "pioneered" by TiVo (popular digital video recorders).  GPLv3 forbids
  it.  Unlikely to become a problem for us.

* Internationalization: more careful wording, to harden the license
  outside the US.  The lawyers tell us it better be done that way.

* License violations: friendlier way to deal with license violations.
  This has come out of past experience enforcing the GPL.

* Additional permissions: Probably not relevant to us.

Also include myself in the list of principal authors.
2011-04-12 21:20:58 +02:00
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
6ae4eca045 Don't use 0 as null pointer constant, part 3
This part replaces E == 0 by !E, where E has pointer type.
2009-03-24 21:46:01 +01:00
6f1e669bea Remove superflous #include "tel.h" 2009-02-08 14:21:15 +01:00
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
a419904c70 Make newcap's second argument mandatory
The code to find a suitable sanctuary location is flawed: to find
space and resources around the location, it does a depth-first search
limited to 300 sectors.  Pretty useless when the limit is reached.  A
breadth-first search would work, but why bother?  This feature is
obscure and rarely (if ever) used: no conscientious deity would use it
for a real game, and for blitzes fairland does a better job.  Remove
it.
2008-03-26 22:10:29 +01:00
e1a68c721d Factor common code out of add() and new() into nat_reset()
The common nation wipe code is not quite identical, and it doesn't
wipe the nation thoroughly enough.  The new code does.

Changes to both commands:

* Wipe nat_update, nat_ann, nat_access, and nat_contact.  Bug: should
  set nat_ann to the number of announcements.

Changes to add command:

* Don't wipe for status active and god.  Before, nat_relate and
  nat_flags where wiped then.

Changes to newcap command:

* Wipe nat_hostaddr, nat_hostname, nat_userid, nat_dayno, nat_minused,
  nat_reserve, nat_last_login, nat_last_logout, nat_newstim,
  nat_annotim, nat_relate, nat_rejects, nat_flags.
2008-03-14 20:25:43 +01:00
1f4d483b78 Consider only wilderness for randomly placed sanctuaries
Before, any non-sea sector was acceptable.  Placing sanctuaries on
mountains, plains or bridges doesn't seem such a bright idea, though.
2008-02-17 09:01:29 +01:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
Ron Koenderink
4bbc3f4286 Simple POSIX I/O emulation layer to work around Windows's defective
Unix I/O:
[_WIN32] (socklen_t, accept, posix_accept, bind. posix_bind, listen)
(posix_listen, setsockopt, posix_setsockopt, shutdown, posix_shutdown)
(socket, posix_socket, close, posix_close, creat, fstat, posix_fstat)
(lseek, posix_lseek, open, posix_open, read, posix_read, write)
(posix_write, fileno, posix_fileno, fcntl, O_NONBLOCK, F_RDLCK)
(F_WRLCK, F_GETFL, F_SETFL, F_SETLK, EWOULDBLOCK, ENOTSOCK)
(flock, fsync, posix_fsync):
New.
(ef_open, io_close, io_input, io_output, io_shutdown, io_noblocking)
(player_accept): Use them to simplify.
[_WIN32] (posix_fd2socket): New.
(empth_select): Use it.
(gen_power): Use it.
2007-08-14 03:33:28 +00:00
0890911655 (new): Simplify. No functional change. 2007-07-31 05:01:46 +00:00
56de7a2151 (WORLD_SZ): New.
(isok, ef_init, bmaps_intersect, bp_init, player_accept)
(finish_sects, main): Use it.

(bp_neighbors, bp_lbcost, pathcost): Use XYOFFSET().  No
functional change.
2007-07-28 12:12:17 +00:00
Ron Koenderink
e60f653d2d (new): Switch permissions to standard defines instead of magic numbers
to improve portability.
2007-03-10 19:23:44 +00:00
Ron Koenderink
7356da4775 (add.c, disa.c, log.c, new.c, wantupd.c, wu.c) [_WIN32,__GNUC__]:
Remove the !defined(__GNUC__) for <io.h>.
Not required for VC8.
2007-02-23 22:35:50 +00:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
Ron Koenderink
d413884a37 [_WIN32, __GNUC__]: Reorganize the include files for WIN32 to
separate the MinGW environment from the MSVC environment and
WIN32 environment.  Reorganize the order of the includes so
the system files are always loaded first to prevent with misc.h defines.
Remove system file includes from misc.h.
2006-07-13 21:14:16 +00:00
a3eb9c0d30 (init_sanct): Spread food evenly among sanctuaries, for simplicity.
Give max_pop() civilians (changes civs from 999 to 1000).
2006-07-13 18:42:34 +00:00
5fdd7546dd (init_sanct): New, factored out of new(). No functional change. 2006-07-13 18:35:17 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
2006-07-10 06:37:23 +00:00
d906fd6b99 DEFENSE_INFRA was implemented in an odd way: sct_defense was used
regardless of the option, but forced to sct_effic when disabled.  This
screws up sct_defense when you disable DEFENSE_INFRA.  Implement it
more like FALLOUT: use sct_defense if enabled, else sct_effic.  The
change should be invisible except in xdump, which shows the real
sct_defense.  Closes #804641.
(SCT_DEFENSE): New.
(dump, sinfra, sector_strength): Use it.
(eff_bomb, build_bridge, build_tower, new, buildeff, sect_damage)
(put_combat, checksect, produce_sect): Don't force sct_defense to
sct_effic when DEFENSE_INFRA is disabled.
2006-05-20 11:53:20 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
Ron Koenderink
45adbdb00e Move realms from the nation file into a new realms file:
(boundstr, realmstr): Rename, new members ef_type, r_cnum, r_uid,
r_realm, r_timestamp.
(natstr): Remove member nat_b[].
(EF_REALM, realm_ca): New.
(empfile): Add it.
(ef_open_srv, ef_close_srv, main): Deal with new file.
(getrealm, putrealm): New.
(add, new, real, list_realm, sarg_getrange): Use them.
2006-01-13 13:18:56 +00:00
35941f97eb (new): Simplify using new natargp().
(new): Use RET_OK instead of literal 0.

(new, isok, ok): s_char purge.
2006-01-06 20:36:53 +00:00
011f88fec8 (acce, flash, nati, new, rela): Don't bother to complain about bad
country argument, natarg() does that.

(acce, flash, nati, rela): natarg() ensures getnatp() succeeds, no
need to check.
2006-01-06 17:44:31 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
8b16c31223 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.
2006-01-04 22:49:42 +00:00
3db4e34ba4 (natstr): Members nat_xstart, nat_ystart are used write-only. Remove.
Users changed.
2005-12-31 10:50:24 +00:00
3bbc91876f (START_CASH, start_cash): Replace START_CASH by new econfig key
start_cash.
2005-12-23 11:16:23 +00:00
8e16ae9e43 Remove superflous #include "options.h". 2005-12-23 11:04:56 +00:00
dab1f0bc7d (START_UNITS, start_unit_type, deity_build_land, new): Remove
undocumented compile-time option START_UNITS.  It hasn't been used in
ages; writing a quick build script is easier than recompiling the
server.
2005-10-23 20:52:46 +00:00
118d63ff7e (new): Fix initialization of realms for players_at_00. 2005-10-22 10:12:18 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
256724c39f (multifire, new): Reseeding the PRNG with the current time is not a
good idea.  Letting players trigger it is an extraordinarily bad idea.
Remove.
2005-03-11 17:01:38 +00:00
Ron Koenderink
667b137216 (new) [_WIN32]: Rely on misc.h to provide BSD random functions. 2004-12-30 13:57:04 +00:00
Marc Olzheim
c6ef918f3a Cleanup #includes of (mostly a long time) unused header files.
No functional changes.
2004-12-13 16:47:13 +00:00
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
bf6f2162e8 (new): When first sanctuary is a wilderness, but second isn't, code
complained about the first one.
2004-10-05 18:45:49 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
8a0854b6b8 (mchrstr, lchrstr): Change from variable-style storage of load
capacities to straight arrays.  Users now subscript the array instead
of calling vl_find() or walking the variable data structure.
(mchr, lchr): Initializers adapted.
(vl_find): No longer used.  Remove file.
2004-08-17 14:09:04 +00:00
7d7945c3e9 Replace getvec() by direct, read-only item access in some cases where
that's obviously correct.
2004-03-05 12:05:33 +00:00
4f6e806975 [START_UNITS] (deity_build_land): Replace variable access in disabled
code missed in the previous revision.
2004-03-05 11:55:13 +00:00
eccc5cb7d7 Sectors need space for items, deliveries and distribution thresholds.
To save space, the ancients invented `variables': a collection of
key-value pairs, missing means zero value, space for `enough' keys.
This complicates the code, as assigning to a `variable' can fail for
lack of space.  Over time, `enough' increased, and for quite some time
now `variables' have been *wasting* space.  This changeset replaces
them, except in struct mchrstr, struct lchrstr and struct pchrstr,
where they are read-only, and will be replaced later.  It is only a
first step; further cleanup is required.  To simplify and minimize
this necessarily huge changeset, the new item[] arrays have an unused
slot 0, and the old variable types V_CIVIL, ... are still defined, but
must have the same values as the item types I_CIVIL, ...
2004-03-03 16:54:22 +00:00
bb811df758 (genitem, ship, plane, land): Remove unused member sell & equivalents.
(genitem_ca, ship_ca, plane_ca, land_ca): Remove selector "sell".
(comstr, trdstr): Members trd_price, com_price have no effect.  Use
them instead of trd_maxprice, com_maxprice and remove the latter.
(commodity_ca, trade_ca): Remove selector "maxprice".
2004-03-01 17:21:40 +00:00
7d12f4b841 (deity_build_land) [!START_UNITS]: Unused, don't define. 2004-03-01 14:06:23 +00:00
7c52730439 Don't cast void to void. 2004-03-01 13:56:07 +00:00
4a3f0b8146 Add some missing declarations to headers. Remove some redundant
declarations elsewhere.  Change linkage of some functions to static.
2004-02-20 10:51:03 +00:00
8cd0160176 Declare all configuration variables in optlist.h. Include that
instead of declaring them all over the place.  This uncovered type
errors:
(s_p_etu, adj_update): Defined long, sometimes declared int.  Kills
big endian machines where sizeof(long) != sizeof(int).  Change to
int.

(set_option, delete_option, optstrset, intset, floatset, doubleset,
longset, optionset, optiondel, worldxset): Change linkage to static.
2004-02-17 22:58:04 +00:00