gochatai/pachi_py/pachi/distributed/protocol.c
/* Return the command sent after that with the given gtp id,
 * or gtp_cmds if the id wasn't used in this game. If a play command
 * has overwritten a genmoves command, return the play command.
 * slave_lock is held on both entry and exit of this function. */
Return the command sent after that with the given gtp id,
or gtp_cmds if the id wasn't used in this game. If a play command
has overwritten a genmoves command, return the play command.
slave_lock is held on both entry and exit of this function.
Return the command sent after that with the given gtp id or gtp_cmds if the id wasn ' t used in this game . If a play command has overwritten a genmoves command return the play command . slave_lock is held on both entry and exit of this function .
static char *
next_command(int cmd_id)
{
	if (cmd_id == -1) return gtp_cmds;
	int last_id = atoi(gtp_cmd);
	int reply_move = move_number(cmd_id);
	if (reply_move > move_number(last_id)) return gtp_cmds;
	int slot;
	for (slot = 0; slot < MAX_CMDS_PER_MOVE; slot++) {
		if (cmd_id == history[reply_move][slot].gtp_id) break;
	}
	if (slot == MAX_CMDS_PER_MOVE) return gtp_cmds;
	char *next = history[reply_move][slot].next_cmd;
	assert(next);
	return next;
}
static char * next_command ( int cmd_id ) { if ( cmd_id == -1 ) return gtp_cmds ; int last_id = atoi ( gtp_cmd ) ; int reply_move = move_number ( cmd_id ) ; if ( reply_move > move_number ( last_id ) ) return gtp_cmds ; int slot ; for ( slot = 0 ; slot < MAX_CMDS_PER_MOVE ; slot ++ ) { if ( cmd_id == history [ reply_move ] [ slot ] . gtp_id ) break ; } if ( slot == MAX_CMDS_PER_MOVE ) return gtp_cmds ; char * next = history [ reply_move ] [ slot ] . next_cmd ; assert ( next ) ; return next ; }
Return the command sent after that with the given gtp id,
 or gtp_cmds if the id wasn't used in this game.
Return the command sent after that with the given gtp id or gtp_cmds if the id wasn ' t used in this game .