/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
+ * See files README, COPYING and CREDITS in the root of the source
+ * tree for related information and legal notices. It is expected
+ * that future projects/authors will amend these files as needed.
*
* ---
*
*
* Known contributors to this file:
* Steve McClure, 2000
- *
*/
-#include <stdarg.h>
-#include "misc.h"
+#include <config.h>
+
+#if defined(_WIN32) && !defined(__GNUC__)
+#include <io.h>
+#endif
#include <fcntl.h>
+#include <stdarg.h>
+#include <stdlib.h>
#if !defined(_WIN32)
+#include <unistd.h>
#include <sys/uio.h>
#endif
-#include "nat.h"
-#include "tel.h"
#include "file.h"
-#include "player.h"
-#include "server.h"
+#include "misc.h"
+#include "nat.h"
#include "optlist.h"
+#include "player.h"
#include "prototypes.h"
+#include "server.h"
+#include "tel.h"
static struct telstr last_tel[MAXNOC];
np = getnatp(from);
if (update_pending)
return typed_wu(from, to, buf, TEL_UPDATE);
- else if (np->nat_stat & STAT_GOD)
+ else if (np->nat_stat == STAT_GOD)
return typed_wu(from, to, buf, TEL_BULLETIN);
else
return typed_wu(from, to, buf, TEL_NORM);
mailbox(box, to);
if (type != TEL_ANNOUNCE)
- if ((np = getnatp(to)) == 0 ||
- ((np->nat_stat & STAT_NORM) == 0 &&
- (np->nat_stat & STAT_SANCT) == 0)) {
+ if ((np = getnatp(to)) == 0 || np->nat_stat < STAT_SANCT)
return -1;
- }
#if !defined(_WIN32)
if ((fd = open(box, O_WRONLY | O_APPEND, 0)) < 0) {
#else
logerror("telegram 'write' to #%d failed to close.", to);
} else if (write_ok && type == TEL_ANNOUNCE) {
for (to = 0; NULL != (np = getnatp(to)); to++) {
- if (!(np->nat_stat & STAT_NORM) &&
- !(np->nat_stat & STAT_SANCT))
+ if (np->nat_stat < STAT_SANCT)
continue;
if (!player->god && (getrejects(from, np) & REJ_ANNO))
continue;