Fixed serious infinite loop issues coming from cubics.
Contributed by Sahar.
This commit is contained in:
@@ -74,7 +74,6 @@ public class CubicInstance
|
|||||||
protected int _matk;
|
protected int _matk;
|
||||||
protected int _activationtime;
|
protected int _activationtime;
|
||||||
protected int _activationchance;
|
protected int _activationchance;
|
||||||
protected boolean _active;
|
|
||||||
private final boolean _givenByOther;
|
private final boolean _givenByOther;
|
||||||
protected List<Skill> _skills = new ArrayList<>();
|
protected List<Skill> _skills = new ArrayList<>();
|
||||||
private Future<?> _disappearTask;
|
private Future<?> _disappearTask;
|
||||||
@@ -98,7 +97,6 @@ public class CubicInstance
|
|||||||
_matk = mAtk;
|
_matk = mAtk;
|
||||||
_activationtime = activationtime * 1000;
|
_activationtime = activationtime * 1000;
|
||||||
_activationchance = activationchance;
|
_activationchance = activationchance;
|
||||||
_active = false;
|
|
||||||
_givenByOther = givenByOther;
|
_givenByOther = givenByOther;
|
||||||
|
|
||||||
switch (_id)
|
switch (_id)
|
||||||
@@ -241,40 +239,40 @@ public class CubicInstance
|
|||||||
_disappearTask = ThreadPool.schedule(new Disappear(), totallifetime); // disappear
|
_disappearTask = ThreadPool.schedule(new Disappear(), totallifetime); // disappear
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void doAction()
|
||||||
* Do action.
|
|
||||||
*/
|
|
||||||
public synchronized void doAction()
|
|
||||||
{
|
{
|
||||||
if (_active)
|
if (_actionTask == null)
|
||||||
{
|
{
|
||||||
return;
|
synchronized (this)
|
||||||
}
|
|
||||||
_active = true;
|
|
||||||
|
|
||||||
switch (_id)
|
|
||||||
{
|
|
||||||
case AQUA_CUBIC:
|
|
||||||
case BINDING_CUBIC:
|
|
||||||
case SPARK_CUBIC:
|
|
||||||
case STORM_CUBIC:
|
|
||||||
case POLTERGEIST_CUBIC:
|
|
||||||
case VAMPIRIC_CUBIC:
|
|
||||||
case VIPER_CUBIC:
|
|
||||||
case ATTRACT_CUBIC:
|
|
||||||
case SMART_CUBIC_ARCANALORD:
|
|
||||||
case SMART_CUBIC_ELEMENTALMASTER:
|
|
||||||
case SMART_CUBIC_SPECTRALMASTER:
|
|
||||||
case SMART_CUBIC_EVATEMPLAR:
|
|
||||||
case SMART_CUBIC_SHILLIENTEMPLAR:
|
|
||||||
{
|
{
|
||||||
_actionTask = ThreadPool.scheduleAtFixedRate(new Action(_activationchance), 0, _activationtime);
|
if (_actionTask == null)
|
||||||
break;
|
{
|
||||||
}
|
switch (_id)
|
||||||
case LIFE_CUBIC:
|
{
|
||||||
{
|
case AQUA_CUBIC:
|
||||||
_actionTask = ThreadPool.scheduleAtFixedRate(new Heal(), 0, _activationtime);
|
case BINDING_CUBIC:
|
||||||
break;
|
case SPARK_CUBIC:
|
||||||
|
case STORM_CUBIC:
|
||||||
|
case POLTERGEIST_CUBIC:
|
||||||
|
case VAMPIRIC_CUBIC:
|
||||||
|
case VIPER_CUBIC:
|
||||||
|
case ATTRACT_CUBIC:
|
||||||
|
case SMART_CUBIC_ARCANALORD:
|
||||||
|
case SMART_CUBIC_ELEMENTALMASTER:
|
||||||
|
case SMART_CUBIC_SPECTRALMASTER:
|
||||||
|
case SMART_CUBIC_EVATEMPLAR:
|
||||||
|
case SMART_CUBIC_SHILLIENTEMPLAR:
|
||||||
|
{
|
||||||
|
_actionTask = ThreadPool.scheduleAtFixedRate(new Action(_activationchance), 0, _activationtime);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LIFE_CUBIC:
|
||||||
|
{
|
||||||
|
_actionTask = ThreadPool.scheduleAtFixedRate(new Heal(), 0, _activationtime);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,7 +330,6 @@ public class CubicInstance
|
|||||||
}
|
}
|
||||||
_actionTask = null;
|
_actionTask = null;
|
||||||
}
|
}
|
||||||
_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -81,7 +81,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
private final int _cubicDelay;
|
private final int _cubicDelay;
|
||||||
private final int _cubicSkillChance;
|
private final int _cubicSkillChance;
|
||||||
private final int _cubicMaxCount;
|
private final int _cubicMaxCount;
|
||||||
private boolean _active;
|
|
||||||
private final boolean _givenByOther;
|
private final boolean _givenByOther;
|
||||||
|
|
||||||
private final List<Skill> _skills = new ArrayList<>();
|
private final List<Skill> _skills = new ArrayList<>();
|
||||||
@@ -97,7 +96,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_cubicDelay = cubicDelay * 1000;
|
_cubicDelay = cubicDelay * 1000;
|
||||||
_cubicSkillChance = cubicSkillChance;
|
_cubicSkillChance = cubicSkillChance;
|
||||||
_cubicMaxCount = cubicMaxCount;
|
_cubicMaxCount = cubicMaxCount;
|
||||||
_active = false;
|
|
||||||
_givenByOther = givenByOther;
|
_givenByOther = givenByOther;
|
||||||
|
|
||||||
switch (_cubicId)
|
switch (_cubicId)
|
||||||
@@ -185,37 +183,40 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void doAction()
|
public void doAction()
|
||||||
{
|
{
|
||||||
if (_active)
|
if (_actionTask == null)
|
||||||
{
|
{
|
||||||
return;
|
synchronized (this)
|
||||||
}
|
|
||||||
_active = true;
|
|
||||||
|
|
||||||
switch (_cubicId)
|
|
||||||
{
|
|
||||||
case AQUA_CUBIC:
|
|
||||||
case BINDING_CUBIC:
|
|
||||||
case SPARK_CUBIC:
|
|
||||||
case STORM_CUBIC:
|
|
||||||
case POLTERGEIST_CUBIC:
|
|
||||||
case VAMPIRIC_CUBIC:
|
|
||||||
case VIPER_CUBIC:
|
|
||||||
case ATTRACT_CUBIC:
|
|
||||||
case SMART_CUBIC_ARCANALORD:
|
|
||||||
case SMART_CUBIC_ELEMENTALMASTER:
|
|
||||||
case SMART_CUBIC_SPECTRALMASTER:
|
|
||||||
case SMART_CUBIC_EVATEMPLAR:
|
|
||||||
case SMART_CUBIC_SHILLIENTEMPLAR:
|
|
||||||
{
|
{
|
||||||
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicAction(this, _cubicSkillChance), 0, _cubicDelay);
|
if (_actionTask == null)
|
||||||
break;
|
{
|
||||||
}
|
switch (_cubicId)
|
||||||
case LIFE_CUBIC:
|
{
|
||||||
{
|
case AQUA_CUBIC:
|
||||||
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicHeal(this), 0, _cubicDelay);
|
case BINDING_CUBIC:
|
||||||
break;
|
case SPARK_CUBIC:
|
||||||
|
case STORM_CUBIC:
|
||||||
|
case POLTERGEIST_CUBIC:
|
||||||
|
case VAMPIRIC_CUBIC:
|
||||||
|
case VIPER_CUBIC:
|
||||||
|
case ATTRACT_CUBIC:
|
||||||
|
case SMART_CUBIC_ARCANALORD:
|
||||||
|
case SMART_CUBIC_ELEMENTALMASTER:
|
||||||
|
case SMART_CUBIC_SPECTRALMASTER:
|
||||||
|
case SMART_CUBIC_EVATEMPLAR:
|
||||||
|
case SMART_CUBIC_SHILLIENTEMPLAR:
|
||||||
|
{
|
||||||
|
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicAction(this, _cubicSkillChance), 0, _cubicDelay);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LIFE_CUBIC:
|
||||||
|
{
|
||||||
|
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicHeal(this), 0, _cubicDelay);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -264,7 +265,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_actionTask.cancel(true);
|
_actionTask.cancel(true);
|
||||||
_actionTask = null;
|
_actionTask = null;
|
||||||
}
|
}
|
||||||
_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelDisappear()
|
public void cancelDisappear()
|
||||||
|
@@ -81,7 +81,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
private final int _cubicDelay;
|
private final int _cubicDelay;
|
||||||
private final int _cubicSkillChance;
|
private final int _cubicSkillChance;
|
||||||
private final int _cubicMaxCount;
|
private final int _cubicMaxCount;
|
||||||
private boolean _active;
|
|
||||||
private final boolean _givenByOther;
|
private final boolean _givenByOther;
|
||||||
|
|
||||||
private final List<Skill> _skills = new ArrayList<>();
|
private final List<Skill> _skills = new ArrayList<>();
|
||||||
@@ -97,7 +96,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_cubicDelay = cubicDelay * 1000;
|
_cubicDelay = cubicDelay * 1000;
|
||||||
_cubicSkillChance = cubicSkillChance;
|
_cubicSkillChance = cubicSkillChance;
|
||||||
_cubicMaxCount = cubicMaxCount;
|
_cubicMaxCount = cubicMaxCount;
|
||||||
_active = false;
|
|
||||||
_givenByOther = givenByOther;
|
_givenByOther = givenByOther;
|
||||||
|
|
||||||
switch (_cubicId)
|
switch (_cubicId)
|
||||||
@@ -185,37 +183,40 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
_disappearTask = ThreadPool.schedule(new CubicDisappear(this), cubicDuration * 1000); // disappear
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void doAction()
|
public void doAction()
|
||||||
{
|
{
|
||||||
if (_active)
|
if (_actionTask == null)
|
||||||
{
|
{
|
||||||
return;
|
synchronized (this)
|
||||||
}
|
|
||||||
_active = true;
|
|
||||||
|
|
||||||
switch (_cubicId)
|
|
||||||
{
|
|
||||||
case AQUA_CUBIC:
|
|
||||||
case BINDING_CUBIC:
|
|
||||||
case SPARK_CUBIC:
|
|
||||||
case STORM_CUBIC:
|
|
||||||
case POLTERGEIST_CUBIC:
|
|
||||||
case VAMPIRIC_CUBIC:
|
|
||||||
case VIPER_CUBIC:
|
|
||||||
case ATTRACT_CUBIC:
|
|
||||||
case SMART_CUBIC_ARCANALORD:
|
|
||||||
case SMART_CUBIC_ELEMENTALMASTER:
|
|
||||||
case SMART_CUBIC_SPECTRALMASTER:
|
|
||||||
case SMART_CUBIC_EVATEMPLAR:
|
|
||||||
case SMART_CUBIC_SHILLIENTEMPLAR:
|
|
||||||
{
|
{
|
||||||
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicAction(this, _cubicSkillChance), 0, _cubicDelay);
|
if (_actionTask == null)
|
||||||
break;
|
{
|
||||||
}
|
switch (_cubicId)
|
||||||
case LIFE_CUBIC:
|
{
|
||||||
{
|
case AQUA_CUBIC:
|
||||||
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicHeal(this), 0, _cubicDelay);
|
case BINDING_CUBIC:
|
||||||
break;
|
case SPARK_CUBIC:
|
||||||
|
case STORM_CUBIC:
|
||||||
|
case POLTERGEIST_CUBIC:
|
||||||
|
case VAMPIRIC_CUBIC:
|
||||||
|
case VIPER_CUBIC:
|
||||||
|
case ATTRACT_CUBIC:
|
||||||
|
case SMART_CUBIC_ARCANALORD:
|
||||||
|
case SMART_CUBIC_ELEMENTALMASTER:
|
||||||
|
case SMART_CUBIC_SPECTRALMASTER:
|
||||||
|
case SMART_CUBIC_EVATEMPLAR:
|
||||||
|
case SMART_CUBIC_SHILLIENTEMPLAR:
|
||||||
|
{
|
||||||
|
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicAction(this, _cubicSkillChance), 0, _cubicDelay);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LIFE_CUBIC:
|
||||||
|
{
|
||||||
|
_actionTask = ThreadPool.scheduleAtFixedRate(new CubicHeal(this), 0, _cubicDelay);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -264,7 +265,6 @@ public class CubicInstance implements IIdentifiable
|
|||||||
_actionTask.cancel(true);
|
_actionTask.cancel(true);
|
||||||
_actionTask = null;
|
_actionTask = null;
|
||||||
}
|
}
|
||||||
_active = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelDisappear()
|
public void cancelDisappear()
|
||||||
|
Reference in New Issue
Block a user