wise-old-man / wiseoldman-runelite-plugin

The RuneLite plugin for the Wise Old Man project.
BSD 2-Clause "Simplified" License
3 stars 7 forks source link

Advise players to logout when nearing the end of a competition #32

Open psikoi opened 9 months ago

psikoi commented 9 months ago

If in the final X minutes of an ongoing competition and the player has some gains in it, the plugin should recommend them to logout BEFORE it ends.

This message should be sent 30 mins before the end, and also 60 seconds before the end.

Note: This "time left" should be offset by 10 seconds, aka, if it ends in 70 seconds, tell them it ends in 60 seconds in case they decide to wait for the last second to logout, their update request would still have time to go through before the end.

rorro commented 9 months ago

This is almost already done. We currently update the player and send out a notification telling the user to log out before the competition ends. We just don't check if the player has any gains, we just update them.

https://github.com/wise-old-man/wiseoldman-runelite-plugin/blob/0721f24c6f301180537c5092ee4107a6668319a3/src/main/java/net/wiseoldman/WomUtilsPlugin.java#L1117

psikoi commented 9 months ago

The endpoint the plugin uses for "player competitions" already includes info about their gains and ranking in the competition, so we could use that to determine if they're actually participating and it's worth telling them to logout