/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
+ * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Ken Stevens, Steve McClure, Markus Armbruster
*
- * This program is free software; you can redistribute it and/or modify
+ * Empire is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ---
*
*
* Known contributors to this file:
* Steve McClure, 2000
- * Markus Armbruster, 2004-2008
- * Ron Koenderink, 2004-2007
+ * Markus Armbruster, 2004-2009
+ * Ron Koenderink, 2004-2009
*/
#include <config.h>
-#include <errno.h>
-#include <stdio.h>
#include "com.h"
#include "empio.h"
#include "empthread.h"
static int command(void);
static int status(void);
-static int print_sink(char *, size_t, void *);
struct player *player;
return;
}
natp = getnatp(player->cnum);
- if (!may_play_now(natp, player->curup, 0))
+ if (!may_play_now(natp, player->curup))
return;
if (natp->nat_stat != STAT_VIS
&& natp->nat_last_login
time_t now;
if (getcommand(player->combuf) < 0)
- return 0;
+ return player->aborted;
now = time(NULL);
update_timeused(now);
- if (!may_play_now(getnatp(player->cnum), now, 1))
+ if (!player->god && !may_play_now(getnatp(player->cnum), now))
return 0;
if (parse(player->combuf, scanspace, player->argp, player->comtail,
time(&player->curup);
update_timeused(player->curup);
- if (!may_play_now(natp, player->curup, 0))
+ if (!may_play_now(natp, player->curup))
return 0;
if (player->btused) {
natp->nat_btu -= player->btused;
return RET_OK;
}
-/*
- * Print first telegram in file FNAME.
- */
-int
-show_first_tel(char *fname)
-{
- FILE *fp;
- struct telstr tgm;
-
- if ((fp = fopen(fname, "rb")) == NULL) {
- if (errno == ENOENT)
- return 0;
- else {
- logerror("Could not open %s.\n", fname);
- return -1;
- }
- }
- if (tel_read_header(fp, fname, &tgm) < 0)
- return -1;
- if (tel_read_body(fp, fname, &tgm, print_sink, NULL) < 0)
- return -1;
- fclose(fp);
- return 0;
-}
-
-static int
-print_sink(char *chunk, size_t sz, void *arg)
-{
- uprnf(chunk);
- return 0;
-}
-
int
quit(void)
{