idlenotifier: Correctly warn about AFK kicking
This commit is contained in:
@@ -231,8 +231,8 @@ public class IdleNotifierPluginTest
|
||||
@Test
|
||||
public void checkCombatLogoutIdle()
|
||||
{
|
||||
// Player is idle
|
||||
when(client.getMouseLastPressedMillis()).thenReturn(System.currentTimeMillis() - 300_000L);
|
||||
// Player is idle
|
||||
when(client.getMouseIdleTicks()).thenReturn(80_000);
|
||||
|
||||
// But player is being damaged (is in combat)
|
||||
final HitsplatApplied hitsplatApplied = new HitsplatApplied();
|
||||
@@ -242,4 +242,18 @@ public class IdleNotifierPluginTest
|
||||
plugin.onGameTick(new GameTick());
|
||||
verify(notifier, times(0)).notify(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doubleNotifyOnMouseReset()
|
||||
{
|
||||
// Player is idle, but in combat so the idle packet is getting set repeatedly
|
||||
// make sure we are not notifying
|
||||
|
||||
when(client.getKeyboardIdleTicks()).thenReturn(80_000);
|
||||
when(client.getMouseIdleTicks()).thenReturn(14_500);
|
||||
|
||||
plugin.onGameTick(new GameTick());
|
||||
plugin.onGameTick(new GameTick());
|
||||
verify(notifier, times(1)).notify(any());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user