]> git.pond.sub.org Git - empserver/commitdiff
New journal event command
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 29 Jul 2008 11:48:28 +0000 (07:48 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 30 Jul 2008 00:24:04 +0000 (20:24 -0400)
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.

include/journal.h
src/lib/player/dispatch.c
src/lib/subs/journal.c

index bd35399fbf05885d4d01c8386fc793b0f9bd2c28..eed66ff253f24622c2cffd70120ef7a99113263c 100644 (file)
@@ -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
index 10d16c17c229f80c0d6413fd0e0bd70b833a02e4..edf503710feda7521bf6a383afb82f370658ce4b 100644 (file)
@@ -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;
index bfb1e9ecad735a91e66f955580fd94db7b7b81b5..20d325681035b2f6bf8434d366e60693a6fe2aca 100644 (file)
@@ -43,6 +43,7 @@
  *     prng NAME SEED
  *     login CNUM HOSTADDR USER
  *     logout CNUM
+ *     command NAME
  *     input INPUT
  *     update ETU
  */
@@ -172,6 +173,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)
 {