Пример #1
0
void		monitor_graphic(t_graphic mn, t_data_serv ds, t_player p)
{
  t_iter	*it;
  t_iter	*it2;
  t_map		map;

  map = get_map(NULL);
  msz(mn, map->size_x, map->size_y);
  sgt(mn, ds->t);
  bct_all(mn, map);
  tna(mn, ds->teams);
  it = ds->player->head;
  while (it)
    {
      if ((*(t_player*)it->data)->welcome)
	  pnw(mn, (*(t_player*)it->data));
      it = it->next;
    }
  it2 = ds->egg->head;
  while (it2)
    {
      enw(mn, ((t_egg)it2->data)->id,
	  p->lvl, &((t_egg)it2->data)->fetus->pos);
      it2 = it2->next;
    }
}
Пример #2
0
static int	handle_graphic_(t_ctrl *c, t_jm_list *cli)
{
  ((t_handler*)cli->data)->t = GFX;
  ((t_handler*)cli->data)->handler = handle_gfx;
  msz(c, cli);
  sgt(c, cli);
  mct(c, cli);
  tna(c, cli);
  list_eggs_and_players(c, cli);
  return (1);
}
Пример #3
0
void			gfx_connection(t_env *e, int fd)
{
	t_iterator		iter_t;
	t_team			*t;

	e->fds[fd].type = FD_GFX_CLIENT;
	ft_lst_pushend(e->gfx_lst, gfx_new(fd));
	printf("Client #%d: Connected as GFX\n", fd);
	msz(e, fd);
	sgt(e, fd);
	mct(e, fd);
	tna(e, fd);
	iter_t = NULL;
	while ((t = (t_team *)ft_lst_iter_next_content(e->team, &iter_t)))
		notify_bot_for_connected_gfx(e, fd, t);
}