Cancel and remove running henna tasks before restoring hennas.
This commit is contained in:
parent
0e258a7266
commit
d61f6f5f08
@ -7809,6 +7809,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7844,6 +7855,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7816,6 +7816,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7851,6 +7862,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7818,6 +7818,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7853,6 +7864,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7816,6 +7816,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7851,6 +7862,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7798,6 +7798,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7833,6 +7844,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7798,6 +7798,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7833,6 +7844,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7799,6 +7799,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7834,6 +7845,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7780,6 +7780,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7815,6 +7826,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7781,6 +7781,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7816,6 +7827,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7766,6 +7766,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7801,6 +7812,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7766,6 +7766,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7801,6 +7812,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
@ -7766,6 +7766,17 @@ public final class PlayerInstance extends Playable
|
||||
_henna[i - 1] = null;
|
||||
}
|
||||
|
||||
// Cancel and remove existing running tasks.
|
||||
for (Entry<Integer, ScheduledFuture<?>> entry : _hennaRemoveSchedules.entrySet())
|
||||
{
|
||||
final ScheduledFuture<?> task = entry.getValue();
|
||||
if ((task != null) && !task.isCancelled() && !task.isDone())
|
||||
{
|
||||
task.cancel(true);
|
||||
}
|
||||
_hennaRemoveSchedules.remove(entry.getKey());
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(RESTORE_CHAR_HENNAS))
|
||||
{
|
||||
@ -7801,6 +7812,8 @@ public final class PlayerInstance extends Playable
|
||||
removeHenna(slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the new task.
|
||||
_hennaRemoveSchedules.put(slot, ThreadPool.schedule(new HennaDurationTask(this, slot), System.currentTimeMillis() + remainingTime));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user