New journal event command

Redundant information, but makes the journal easier to read.  The
redundancy might help making a journal replay tool robust.

Put it in Hvy Metal II now to gather some real data.
This commit is contained in:
Markus Armbruster 2008-07-29 07:48:28 -04:00
parent 52acb4fb3c
commit 83fcc79bca
3 changed files with 11 additions and 0 deletions

View file

@ -41,6 +41,7 @@ void journal_login(void);
void journal_logout(void); void journal_logout(void);
void journal_prng(unsigned); void journal_prng(unsigned);
void journal_input(char *); void journal_input(char *);
void journal_command(char *);
void journal_update(int); void journal_update(int);
#endif #endif

View file

@ -38,6 +38,7 @@
#include "com.h" #include "com.h"
#include "empio.h" #include "empio.h"
#include "file.h" #include "file.h"
#include "journal.h"
#include "match.h" #include "match.h"
#include "misc.h" #include "misc.h"
#include "nat.h" #include "nat.h"
@ -94,6 +95,7 @@ dispatch(char *buf, char *redir)
uprnf(buf); uprnf(buf);
pr("\n"); pr("\n");
} }
journal_command(command->c_form);
switch (command->c_addr()) { switch (command->c_addr()) {
case RET_OK: case RET_OK:
player->btused += command->c_cost; player->btused += command->c_cost;

View file

@ -44,6 +44,7 @@
* prng NAME SEED * prng NAME SEED
* login CNUM HOSTADDR USER * login CNUM HOSTADDR USER
* logout CNUM * logout CNUM
* command NAME
* input INPUT * input INPUT
* update ETU * update ETU
*/ */
@ -173,6 +174,13 @@ journal_input(char *input)
journal_entry("input %s", input); 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 void
journal_update(int etu) journal_update(int etu)
{ {