From: Markus Armbruster Date: Tue, 29 Jul 2008 11:48:28 +0000 (-0400) Subject: New journal event command X-Git-Tag: hvy-plastic-1.0~11 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=1c1fa720d46b7cecd74fde50715a921f208b0135 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. --- diff --git a/include/journal.h b/include/journal.h index ed2224a30..d0cbacdc0 100644 --- a/include/journal.h +++ b/include/journal.h @@ -41,6 +41,7 @@ void journal_login(void); void journal_logout(void); void journal_prng(unsigned); void journal_input(char *); +void journal_command(char *); void journal_update(int); #endif diff --git a/src/lib/player/dispatch.c b/src/lib/player/dispatch.c index f629f5d38..50c0f43d8 100644 --- a/src/lib/player/dispatch.c +++ b/src/lib/player/dispatch.c @@ -38,6 +38,7 @@ #include "com.h" #include "empio.h" #include "file.h" +#include "journal.h" #include "match.h" #include "misc.h" #include "nat.h" @@ -102,6 +103,7 @@ dispatch(char *buf, char *redir) uprnf(buf); pr("\n"); } + journal_command(command->c_form); switch (command->c_addr()) { case RET_OK: player->btused += command->c_cost; diff --git a/src/lib/subs/journal.c b/src/lib/subs/journal.c index cd187132a..90c34a62a 100644 --- a/src/lib/subs/journal.c +++ b/src/lib/subs/journal.c @@ -44,6 +44,7 @@ * prng NAME SEED * login CNUM HOSTADDR USER * logout CNUM + * command NAME * input INPUT * update ETU */ @@ -173,6 +174,13 @@ journal_input(char *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 journal_update(int etu) {