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; } }
char *grp_fork_end(t_player *player, t_eggs *egg) { char *msg; msg = enw(NULL, player->player_id, egg); return (msg); }
static void notify_bot_for_connected_gfx(t_env *e, int fd, t_team *t) { t_iterator iter_b; t_bot *b; iter_b = NULL; while ((b = (t_bot *)ft_lst_iter_next_content(t->connected, &iter_b))) { pnw(e, fd, b); if (b->life_unit <= 0) pdi(e, fd, b); } iter_b = NULL; while ((b = (t_bot *)ft_lst_iter_next_content(t->queue, &iter_b))) { pnw(e, fd, b); if (b->life_unit <= 0) pdi(e, fd, b); } iter_b = NULL; while ((b = (t_bot *)ft_lst_iter_next_content(t->egg, &iter_b))) { enw(e, fd, b->parent, b); if (b->life_unit <= 0) edi(e, fd, b); } }
void cmd_fork(t_server *serv, int actual, char *buff) { int i; (void)buff; i = cmd_fork_loop(serv, actual); if (serv->gfx.sock) enw(serv->gfx.sock, &serv->teams[i], serv->teams[i].eggs - 1, serv->clients[actual].sock); write_client(serv->clients[actual].sock, "ok"); }