Prevent SendSkillList packet spam with a task.

This commit is contained in:
MobiusDev 2017-12-01 04:26:53 +00:00
parent 0c22bb6ac8
commit 825f9d8036
5 changed files with 50 additions and 5 deletions

View File

@ -731,6 +731,8 @@ public final class L2PcInstance extends L2Playable
private ScheduledFuture<?> _taskRentPet;
private ScheduledFuture<?> _taskWater;
private ScheduledFuture<?> _skillListRefreshTask;
/** Last Html Npcs, 0 = last html was not bound to an npc */
private final int[] _htmlActionOriginObjectIds = new int[HtmlActionScope.values().length];
/**
@ -9489,7 +9491,14 @@ public final class L2PcInstance extends L2Playable
public void sendSkillList()
{
sendSkillList(0);
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
}, 1000);
}
}
public void sendSkillList(int lastLearnedSkillId)

View File

@ -730,6 +730,8 @@ public final class L2PcInstance extends L2Playable
private ScheduledFuture<?> _taskRentPet;
private ScheduledFuture<?> _taskWater;
private ScheduledFuture<?> _skillListRefreshTask;
/** Last Html Npcs, 0 = last html was not bound to an npc */
private final int[] _htmlActionOriginObjectIds = new int[HtmlActionScope.values().length];
/**
@ -9490,7 +9492,14 @@ public final class L2PcInstance extends L2Playable
public void sendSkillList()
{
sendSkillList(0);
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
}, 1000);
}
}
public void sendSkillList(int lastLearnedSkillId)

View File

@ -732,6 +732,8 @@ public final class L2PcInstance extends L2Playable
private ScheduledFuture<?> _taskRentPet;
private ScheduledFuture<?> _taskWater;
private ScheduledFuture<?> _skillListRefreshTask;
/** Last Html Npcs, 0 = last html was not bound to an npc */
private final int[] _htmlActionOriginObjectIds = new int[HtmlActionScope.values().length];
/**
@ -9500,7 +9502,14 @@ public final class L2PcInstance extends L2Playable
public void sendSkillList()
{
sendSkillList(0);
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
}, 1000);
}
}
public void sendSkillList(int lastLearnedSkillId)

View File

@ -740,6 +740,8 @@ public final class L2PcInstance extends L2Playable
private ScheduledFuture<?> _taskRentPet;
private ScheduledFuture<?> _taskWater;
private ScheduledFuture<?> _skillListRefreshTask;
/** Last Html Npcs, 0 = last html was not bound to an npc */
private final int[] _htmlActionOriginObjectIds = new int[HtmlActionScope.values().length];
/**
@ -9498,7 +9500,14 @@ public final class L2PcInstance extends L2Playable
public void sendSkillList()
{
sendSkillList(0);
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
}, 1000);
}
}
public void sendSkillList(int lastLearnedSkillId)

View File

@ -728,6 +728,8 @@ public final class L2PcInstance extends L2Playable
private ScheduledFuture<?> _taskRentPet;
private ScheduledFuture<?> _taskWater;
private ScheduledFuture<?> _skillListRefreshTask;
/** Last Html Npcs, 0 = last html was not bound to an npc */
private final int[] _htmlActionOriginObjectIds = new int[HtmlActionScope.values().length];
/**
@ -9433,7 +9435,14 @@ public final class L2PcInstance extends L2Playable
public void sendSkillList()
{
sendSkillList(0);
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
}, 1000);
}
}
public void sendSkillList(int lastLearnedSkillId)