Use mouse/keyboard idle state properly in IdleNotifier
- Use mouseLastPressedMillis instead of mouseIdleTicks as only mouse press events indicate that player is idle, and not mouse movements - Use also keyboard check when resetting idle when active Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -113,7 +113,8 @@ public class IdleNotifierPluginTest
|
||||
|
||||
// Mock client
|
||||
when(client.getGameState()).thenReturn(GameState.LOGGED_IN);
|
||||
when(client.getMouseIdleTicks()).thenReturn(42);
|
||||
when(client.getKeyboardIdleTicks()).thenReturn(42);
|
||||
when(client.getMouseLastPressedMillis()).thenReturn(System.currentTimeMillis() - 100_000L);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -231,7 +232,7 @@ public class IdleNotifierPluginTest
|
||||
public void checkCombatLogoutIdle()
|
||||
{
|
||||
// Player is idle
|
||||
when(client.getMouseIdleTicks()).thenReturn(282 * 50);
|
||||
when(client.getMouseLastPressedMillis()).thenReturn(System.currentTimeMillis() - 300_000L);
|
||||
|
||||
// But player is being damaged (is in combat)
|
||||
final HitsplatApplied hitsplatApplied = new HitsplatApplied();
|
||||
|
||||
Reference in New Issue
Block a user