New journal event "command"
Redundant information. Allows making sense of input without context. The redundancy could help making a journal replay tool more robust.
This commit is contained in:
parent
9be4f57ad5
commit
72d051310c
3 changed files with 14 additions and 3 deletions
|
@ -27,7 +27,7 @@
|
|||
* journal.h: Log a journal of events to a file
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2004-2008
|
||||
* Markus Armbruster, 2004-2011
|
||||
*/
|
||||
|
||||
#ifndef JOURNAL_H
|
||||
|
@ -40,6 +40,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
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* Known contributors to this file:
|
||||
* Dave Pare, 1994
|
||||
* Steve McClure, 1998
|
||||
* Markus Armbruster, 2007-2009
|
||||
* Markus Armbruster, 2007-2011
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
@ -37,6 +37,7 @@
|
|||
#include "com.h"
|
||||
#include "empio.h"
|
||||
#include "file.h"
|
||||
#include "journal.h"
|
||||
#include "match.h"
|
||||
#include "misc.h"
|
||||
#include "nat.h"
|
||||
|
@ -93,6 +94,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;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* journal.c: Log a journal of events to a file
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2004-2008
|
||||
* Markus Armbruster, 2004-2011
|
||||
* Ron Koenderink, 2008
|
||||
*/
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue