openplanet-MXRandom
openplanet-MXRandom copied to clipboard
Add date interval as searching parameter
fixes #128
Adds new Searching parameter to allow filtering maps inside a date interval. This is useful to be able to play maps only before an important game patch or update, for example. This setting is only used if CustomRules setting is also set to true, to prevent these runs getting into the official leaderboard.
Date parsing from a string is done using this suggestion by @misfitmaid
Some concerns I have:
- The smaller the date interval is, the lower the possibilities of the mapsearch endpoint returning a valid map are. If you set a 1 day interval it will just keep sending requests to the API. Maybe would be nice to set a minimum interval, or a retries limit, thoughts?
- Right now a warning is sent like when the map length is not valid according to the chosen max length. This can result in a spam or warnings in the screen if the map preload has to be retried many times. Consider not giving any visible warning?