use of mage.view.DraftClientMessage in project mage by magefree.
the class DraftSession method pickCard.
public void pickCard(int timeout) {
if (!killed) {
setupTimeout(timeout);
managerFactory.userManager().getUser(userId).ifPresent(user -> user.fireCallback(new ClientCallback(ClientCallbackMethod.DRAFT_PICK, draft.getId(), new DraftClientMessage(getDraftView(), getDraftPickView(timeout)))));
}
}
use of mage.view.DraftClientMessage in project mage by magefree.
the class DraftSession method init.
public boolean init() {
if (!killed) {
Optional<User> user = managerFactory.userManager().getUser(userId);
if (user.isPresent()) {
if (futureTimeout != null && !futureTimeout.isDone()) {
int remaining = (int) futureTimeout.getDelay(TimeUnit.SECONDS);
user.get().fireCallback(new ClientCallback(ClientCallbackMethod.DRAFT_INIT, draft.getId(), new DraftClientMessage(getDraftView(), getDraftPickView(remaining))));
}
return true;
}
}
return false;
}
Aggregations