Log in handler is not being disabled for Jagex accounts
Summary
- AIO Farming uses breaking while crops grow to minimize in game time during runtime. Users with Jagex accounts are reporting that their accounts are being insta logged in after breaking is initialized. -Many people have reported this
https://discord.com/channels/111463304332845056/1230815155747557386/1230815155747557386 https://discord.com/channels/111463304332845056/1021494879131533402/1244583743168053280 https://discord.com/channels/111463304332845056/1021494879131533402/1244311462294327321 https://discord.com/channels/111463304332845056/1021494879131533402/1244137538009038932
Steps to reproduce
- Run AIO Farming on a Jagex account
- Wait for it to finish the selected tasks, it will then initiate breaking and log out
- Apparently it will auto log in instantly after logging out
Example Code
`public class Break { private boolean taken = false;
public <T extends BreakingLoopBot & Breaking> void process(T bot) {
switch (bot.onBreakRequested(this)) {
case LOG_OUT:
prepare(bot);
log.warn("Status: LOGIN_HANDLER " + GameEvents.Universal.LOGIN_HANDLER.isEnabled());
log.warn("Status: LOBBY_HANDLER " + GameEvents.Universal.LOBBY_HANDLER.isEnabled());
if (logout()) {
execute(bot);
}
finish(bot);
break;
}
}
public void prepare(BreakingLoopBot bot) {
GameEvents.Universal.LOGIN_HANDLER.disable(bot);
GameEvents.Universal.LOBBY_HANDLER.disable(bot);
}
public void execute(BreakingLoopBot bot) {
bot.pause();
taken = true;
Execution.delayUntil(() -> !bot.isPaused());
}
public void finish(BreakingLoopBot bot) {
DefaultUI.setStatus("Coming back from our break");
taken = false;
GameEvents.Universal.LOGIN_HANDLER.enable(bot);
GameEvents.Universal.LOBBY_HANDLER.enable(bot);
if (bot.isPaused()) {
bot.resume();
}
Execution.delay(800);
if (!GameEvents.Universal.LOBBY_HANDLER.isEnabled(bot) || !GameEvents.Universal.LOGIN_HANDLER.isEnabled(bot)) {
log.warn("Failed to enable login handler or lobby handler, retrying");
finish(bot);
}
}
private boolean logout() {
for (int i = 1; i <= 10; i++) {
log.info("Attempt {}", i);
if (RuneScape.logout()) {
return Execution.delayUntil(() -> !RuneScape.isLoggedIn(), 5000, 6000);
}
Execution.delay(800);
}
return false;
}
public enum Behavior {
LOG_OUT
}
}`
What is the current behavior?
GameEvents.Universal.LOGIN_HANDLER.disable(bot); is not disabling the log in handler for Jagex accounts
What is the expected correct behavior?
Disabled log in handler for Jagex accounts when GameEvents.Universal.LOGIN_HANDLER.disable(bot); is called
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as it's very hard to read otherwise.)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)