I've noticed an issue with attack logs from the api, curious if any of you have had the same issue and how you tackled it.
The Problem:
Attack IDs are generated when an attack is started, and logs are listed in order of attack ID. Logs are not posted to the API until the attack finishes and the player clicks a result button. The issues comes if player A starts an attack, then player B does but player B finishes their attack first. If the API call happens here before player A has finished their attack then there is a "hole" in the API data until that attack finishes at which point it will be inserted in its proper place.
Possible Solutions:
- If this were a database scenario then not much issue, can just grab a handful of the latest logged to the table and check against that.
- For something "live" like a discord bot where there is no place to reference the attack IDs that have been printed, you could store a list of the last handful of attacks printed and periodically remove items from the bottom of that list.