1package com.osroyale.game.task.impl;
3import com.osroyale.content.activity.Activity;
4import com.osroyale.content.activity.impl.duelarena.DuelArenaActivity;
5import com.osroyale.content.combat.cannon.CannonManager;
6import com.osroyale.game.task.TickableTask;
7import com.osroyale.game.world.entity.mob.player.Player;
8import com.osroyale.game.world.entity.mob.player.persist.PlayerSerializer;
9import com.osroyale.util.Stopwatch;
11import java.util.concurrent.TimeUnit;
37public class PlayerRemovalTask
extends TickableTask {
39 private final Player player;
41 private final boolean force;
44 public PlayerRemovalTask(
Player player,
boolean force) {
51 protected void tick() {
54 if (player.isDead()) {
59 if (player.getCombat().isUnderAttack() && stopwatch.elapsedTime(TimeUnit.SECONDS) < 60) {
64 if (
Activity.evaluate(player, it -> !it.canLogout(player)) && (
Activity.search(player,
DuelArenaActivity.class).isPresent() || stopwatch.elapsedTime(TimeUnit.SECONDS) < 60)) {
77 if (player.saved.get()) {
synchronized final void cancel()
void onCancel(boolean logout)