/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2012, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
#include <config.h>
-#include "com.h"
#include "empio.h"
#include "empthread.h"
#include "file.h"
-#include "journal.h"
#include "misc.h"
#include "nat.h"
#include "optlist.h"
#include "player.h"
-#include "proto.h"
#include "prototypes.h"
-#include "tel.h"
static int command(void);
struct natstr *natp;
char buf[128];
- p->state = PS_PLAYING;
player = p;
time(&player->curup);
update_timeused_login(player->curup);
strcpy(natp->nat_hostaddr, player->hostaddr);
natp->nat_last_login = player->curup;
putnat(natp);
- journal_login();
if (natp->nat_flags & NF_INFORM && natp->nat_tgms > 0) {
if (natp->nat_tgms == 1)
pr("You have a new telegram waiting ...\n");
update_timeused(natp->nat_last_logout);
enforce_minimum_session_time();
pr("Bye-bye\n");
- journal_logout();
}
static int
time(&player->curup);
update_timeused(player->curup);
if (io_error(player->iop) || io_eof(player->iop)
- || player->state == PS_SHUTDOWN
|| !may_play_now(natp, player->curup))
return 0;
continue;
}
pr("\nExecute : ");
- uprnf(buf);
+ uprnf(player->combuf);
pr("\n");
if (redir) {
pr("Execute : redirection not supported\n");
failed = 1;
- } else if (dispatch(buf, NULL) < 0)
+ } else if (dispatch(player->combuf, NULL) < 0)
failed = 1;
+ /* player->aborted not reset; makes next getcommand() fail */
empth_yield();
}
if (failed) {
int
quit(void)
{
- player->state = PS_SHUTDOWN;
+ io_set_eof(player->iop);
return RET_OK;
}