Improper ban expiration timestamp processing breaks the ban expiration check

Please Note: The TotalFreedom Forum has now been put into a read-only mode. Total Freedom has now closed down and will not be returning in any way, shape or form. It has been a pleasure to lead this community and I wish you all the best for your futures.
  • Intended title: Ban system incorrectly saves and loads expiration timestamps, causing it to always think the ban is expired

    Just for the record, this is the bug that is causing bans to not load in properly. I've already informed the developers and Ryan himself about my findings and I'm hoping this gets fixed quickly.


    When the TotalFreedomMod saves a ban to the SQL database, it does not include the milliseconds value when it saves the expiration timestamp. When it tries to load this entry later on, it divides the expiration timestamp by 1,000 under the assumption that it contains the milliseconds value when in fact, it does not.

    This behavior can be observed if you modify the plugin to spew messages when the relevant functions are called, as shown here (this was from a reload):

    After the plugin loads the ban with the incorrectly-divided expiration timestamp, it then checks to see if the expiration timestamp is less than the current time. As the expiration timestamp has already been butchered, it ends up returning true every time. As a result, it removes the entry. This should be fixed as soon as possible as it is a major bug in an important part of the plugin.


    TL;DR - A bug in the banning system caused ban expiration timestamps to be 0.001% of the actual timestamp when loaded in, causing bans to be incorrectly marked as expired.

    image.png

  • Resolved under FS-130 and in the TotalFreedomMod 2021.02 Release currently on the server.

    Wild1145

    Network Owner at TotalFreedom

    Managing Director at ATLAS Media Group Ltd.

    Founder & Owner at MastodonApp.UK