Galarzaa90 / NabBot

Discord bot for Tibia servers
https://nabbot.xyz
Apache License 2.0
52 stars 25 forks source link

Save currently online players when NabBot is restarted (prevent lost level ups) #69

Closed Galarzaa90 closed 6 years ago

Galarzaa90 commented 6 years ago

The way NabBot is programmed to scan levels ups right now, it will only detect level ups while the character was on NabBot's online list. This was made to prevent a bunch of level ups at once if the bot was offline for a long time.

The idea is to have the online list saved to a file (pickle or json) a long with a timestamp with the time this data was saved.

When NabBot is started, it will attempt to read the file, check the timestamp, if the time difference is lower than a certain amount, it will load the online list from there.

This will prevent level ups being lost when doing quick resets, for example, to update NabBot.