gochatai/pachi_py/pachi/distributed/protocol.c
/* Update the command history, then create a new gtp command
 * for all slaves. The slave lock is held upon entry and
 * upon return, so the command will actually be sent when the
 * lock is released. cmd is a single word; args has all
 * arguments and is empty or has a trailing \n */
Update the command history, then create a new gtp command
for all slaves. The slave lock is held upon entry and
upon return, so the command will actually be sent when the
lock is released. cmd is a single word; args has all
arguments and is empty or has a trailing \n
Update the command history then create a new gtp command for all slaves . The slave lock is held upon entry and upon return so the command will actually be sent when the lock is released . cmd is a single word ; args has all arguments and is empty or has a trailing \ n
void
new_cmd(struct board *b, char *cmd, char *args)
{
	if (!gtp_cmd || is_gamestart(cmd)) {
		gtp_cmd = gtp_cmds;
		memset(history, 0, sizeof(history));
	} else {
		int id = prevent_reply(atoi(gtp_cmd));
		int len = strspn(gtp_cmd, "0123456789");
		char buf[32];
		snprintf(buf, sizeof(buf), "%0*d", len, id);
		memcpy(gtp_cmd, buf, len);
		gtp_cmd += strlen(gtp_cmd);
	}
	update_cmd(b, cmd, args, true);
}
void new_cmd ( struct board * b , char * cmd , char * args ) { if ( ! gtp_cmd || is_gamestart ( cmd ) ) { gtp_cmd = gtp_cmds ; memset ( history , 0 , sizeof ( history ) ) ; } else { int id = prevent_reply ( atoi ( gtp_cmd ) ) ; int len = strspn ( gtp_cmd , " " ) ; char buf [ 32 ] ; snprintf ( buf , sizeof ( buf ) , " " , len , id ) ; memcpy ( gtp_cmd , buf , len ) ; gtp_cmd += strlen ( gtp_cmd ) ; } update_cmd ( b , cmd , args , true ) ; }
Update the command history, then create a new gtp command
 for all slaves.
Update the command history then create a new gtp command for all slaves .
// Clear the history when a new game starts: /* Preserve command history for new slaves.
		 * To indicate that the slave should only reply to
		 * the last command we force the id of previous
		 * commands to be just the move number. */ // Let the slave threads send the new gtp command: