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];
/**
@ -9488,8 +9490,15 @@ public final class L2PcInstance extends L2Playable
}
public void sendSkillList()
{
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];
/**
@ -9489,8 +9491,15 @@ public final class L2PcInstance extends L2Playable
}
public void sendSkillList()
{
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];
/**
@ -9499,8 +9501,15 @@ public final class L2PcInstance extends L2Playable
}
public void sendSkillList()
{
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];
/**
@ -9497,8 +9499,15 @@ public final class L2PcInstance extends L2Playable
}
public void sendSkillList()
{
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];
/**
@ -9432,8 +9434,15 @@ public final class L2PcInstance extends L2Playable
}
public void sendSkillList()
{
if (_skillListRefreshTask == null)
{
_skillListRefreshTask = ThreadPoolManager.schedule(() ->
{
sendSkillList(0);
_skillListRefreshTask = null;
}, 1000);
}
}
public void sendSkillList(int lastLearnedSkillId)