From: H.G. Muller Date: Tue, 4 Sep 2012 09:16:11 +0000 (+0200) Subject: add code to keep log of user input X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ba3ffb7d49d122559afbc591d56dc14074b841e6;p=capablanca.git add code to keep log of user input --- diff --git a/lasker-2.2.3/src/command.c b/lasker-2.2.3/src/command.c index 7d440c5..2286cd6 100644 --- a/lasker-2.2.3/src/command.c +++ b/lasker-2.2.3/src/command.c @@ -695,12 +695,17 @@ static int process_password(int p, char *password) return 0; } +FILE *comlog = NULL; + static int process_prompt(int p, char *command) { struct player *pp = &player_globals.parray[p]; int retval; char *cmd = ""; + if(comlog == NULL) comlog = fopen("command.log", "a"); + if(comlog) fprintf(comlog, "p%d: '%s'\n", p, command), fflush(comlog); + command = eattailwhite(eatwhite(command)); if (!*command) { send_prompt(p); diff --git a/lasker-2.2.3/src/seekproc.c b/lasker-2.2.3/src/seekproc.c index 43ffe66..94960c4 100644 --- a/lasker-2.2.3/src/seekproc.c +++ b/lasker-2.2.3/src/seekproc.c @@ -207,6 +207,8 @@ int com_play(int p, param_list param) return 0; } +extern FILE *comlog; + int com_sought(int p, param_list param) { int i; @@ -214,6 +216,7 @@ int com_sought(int p, param_list param) for (i = 0; i < seek_globals.max_ads; i++) { if (seek_globals.ads[i].status == SEEKCLOSED) { char *msgtxt = form_ad(&seek_globals.ads[i], i); +if(comlog) fprintf(comlog, "msgtext = %s\n", msgtxt), fflush(comlog); pprintf(p, "%s", msgtxt); free(msgtxt); } @@ -296,6 +299,7 @@ static char *form_ad(struct pending * ad, int i) rating = player_globals.parray[ad->whofrom].b_stats.rating; } +if(comlog) fprintf(comlog, "seek %d type = %d\n", i, type), fflush(comlog); if(ad->category[0]) { // [HGM] print category with seek ad sprintf(buf, " %s", ad->category); if(ad->board_type[0] && strcmp(ad->board_type, "0"))