Beispiel #1
0
/**
 * connect all registered bots
 */
void connect_bots(void) {
	bot *b = botlist;
	while(b) {
		connect_bot(b->name);
		b = b->next;
	}
}
Beispiel #2
0
static t_bot	*get_connected_bot(t_env *e, int fd, char *team_name)
{
	t_team		*team;
	t_bot		*bot;

	if ((team = get_team_by_name(e, team_name)) == NULL)
	{
		printf("Client #%d: Invalid request (team doesn't exists)\n", fd);
		return (NULL);
	}
	else if ((bot = connect_bot(e, team)) == NULL)
	{
		printf("Client #%d: Cannot connect to any BOT\n", fd);
		return (NULL);
	}
	return (bot);
}