use of fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_post_universe_names in project JCELechat by guiguilechat.
the class Universe method names.
public R_post_universe_names[] names(int... ids) {
if (ids == null || ids.length == 0) {
return new R_post_universe_names[0];
}
synchronized (cachedNames) {
IntStream.of(ids).filter(i -> !cachedNames.containsKey(i));
// have to work with long, because CCP bug.
int[] missingIds = IntStream.of(ids).filter(i -> !cachedNames.containsKey(i)).toArray();
int[] fullbuffer = new int[MAXLONGIDPERREQUEST];
for (int start = 0; start < missingIds.length; start += MAXLONGIDPERREQUEST) {
if (start + MAXLONGIDPERREQUEST >= missingIds.length) {
fullbuffer = new int[missingIds.length - start];
}
System.arraycopy(missingIds, start, fullbuffer, 0, fullbuffer.length);
Requested<R_post_universe_names[]> newreq;
do {
newreq = ESIStatic.INSTANCE.post_universe_names(fullbuffer, null);
} while (newreq == null || newreq.isServerError());
if (newreq.isOk()) {
for (R_post_universe_names n : newreq.getOK()) {
cachedNames.put(n.id, n);
}
} else {
log.error("could not load names for ids" + IntStream.of(ids).mapToObj(i -> i).collect(Collectors.toList()) + " resp=" + newreq.getResponseCode() + " err=" + newreq.getError());
}
}
return IntStream.of(ids).mapToObj(cachedNames::get).toArray(R_post_universe_names[]::new);
}
}
Aggregations