package fr.titionfire.ffsaf.net2.request; import fr.titionfire.ffsaf.net2.Client_Thread; import fr.titionfire.ffsaf.net2.data.SimpleCompet; import fr.titionfire.ffsaf.utils.JsonConsumer; import java.util.ArrayList; import java.util.HashMap; import java.util.concurrent.CompletableFuture; public class SReqCompet { public static void sendUpdate(ArrayList client_Thread, SimpleCompet compet) { for (Client_Thread client : client_Thread) { client.sendNotify(compet, "sendConfig"); } } public static void getConfig(ArrayList client_Thread, long id_compet, CompletableFuture future) { if (client_Thread.isEmpty()) return; client_Thread.get(0).sendReq(id_compet, "getConfig", new JsonConsumer<>(SimpleCompet.class, future::complete)); } public static void getAllHaveAccess(ArrayList client_Thread, String userId, CompletableFuture> future) { if (client_Thread.isEmpty()) return; client_Thread.get(0).sendReq(userId, "getAllHaveAccess", new JsonConsumer<>(HashMap.class, future::complete)); } public static void rmCompet(ArrayList client_Thread, long id_compet) { for (Client_Thread client : client_Thread) { client.sendNotify(id_compet, "rmCompet"); } } }