use of me.semx11.autotip.api.reply.impl.TipReply in project Hyperium by HyperiumClient.
the class SessionManager method tipWave.
private void tipWave() {
if (!onHypixel || !loggedIn) {
taskManager.cancelTask(TaskType.TIP_WAVE);
return;
}
lastTipWave = System.currentTimeMillis();
nextTipWave = System.currentTimeMillis() + reply.getTipWaveRate() * 1000;
TipReply r = TipRequest.of(sessionKey).execute();
if (r.isSuccess()) {
tipQueue.addAll(r.getTips());
Autotip.LOGGER.info("Current tip queue: {}", StringUtils.join(tipQueue.iterator(), ", "));
} else {
tipQueue.addAll(TipReply.getDefault().getTips());
Autotip.LOGGER.info("Failed to fetch tip queue, tipping 'all' instead.");
}
long tipCycle = reply.getTipCycleRate();
taskManager.addRepeatingTask(TaskType.TIP_CYCLE, this::tipCycle, 0, tipCycle);
}
use of me.semx11.autotip.api.reply.impl.TipReply in project Hyperium by HyperiumClient.
the class TipRequest method execute.
@Override
public TipReply execute() {
HttpUriRequest request = GetBuilder.of(this).addParameter("key", sessionKey).build();
Optional<Reply> optional = RequestHandler.getReply(this, request.getURI());
return optional.map(reply -> (TipReply) reply).orElseGet(TipReply::getDefault);
}
Aggregations