/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* journal.c: Log a journal of events to a file
- *
+ *
* Known contributors to this file:
* Markus Armbruster, 2004-2008
* Ron Koenderink, 2008
* prng NAME SEED
* login CNUM HOSTADDR USER
* logout CNUM
+ * command NAME
* input INPUT
* update ETU
*/
time(&now);
fprintf(journal, "%.24s %10.10s ",
ctime(&now), empth_name(empth_self()));
-
+
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
va_end(ap);
journal_entry("input %s", input);
}
+void
+journal_command(char *cmd)
+{
+ char *eptr = strchr(cmd, ' ');
+ journal_entry("command %.*s", eptr ? (int)(eptr - cmd) : -1, cmd);
+}
+
void
journal_update(int etu)
{