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):
[07:14:13 INFO]: [TotalFreedomMod] --- CONSTRUCTOR FOR NEW BAN CALLED ---
[07:14:13 INFO]: [TotalFreedomMod] --- FUtil.getUnixTime(Date date) CALLED ---
[07:14:13 INFO]: [TotalFreedomMod] Unix time is 1614521600
[07:14:13 INFO]: [TotalFreedomMod] When divided that is 1614521
[07:14:13 INFO]: [TotalFreedomMod] ExpiryUnix is 1614521
[07:14:13 INFO]: [TotalFreedomMod] --- FUtil.getUnixTime(Date date) CALLED ---
[07:14:13 INFO]: [TotalFreedomMod] Unix time is 1614521600
[07:14:13 INFO]: [TotalFreedomMod] When divided that is 1614521
[07:14:13 INFO]: [TotalFreedomMod] --- Ban.isExpired() CALLED ---
[07:14:13 INFO]: [TotalFreedomMod] Comparing expiration unix with current time
[07:14:13 INFO]: [TotalFreedomMod] Expiry unix is 1614521
[07:14:13 INFO]: [TotalFreedomMod] --- FUtil.getUnixTime() CALLED ---
[07:14:13 INFO]: [TotalFreedomMod] System time is 1614435253488
[07:14:13 INFO]: [TotalFreedomMod] System time when divided is 1614435253
[07:14:13 INFO]: [TotalFreedomMod] Unix time is 1614435253
[07:14:13 INFO]: [TotalFreedomMod] --- FUtil.getUnixTime() CALLED ---
[07:14:13 INFO]: [TotalFreedomMod] System time is 1614435253488
[07:14:13 INFO]: [TotalFreedomMod] System time when divided is 1614435253
[07:14:13 INFO]: [TotalFreedomMod] videogamesm12's ban is expired, therefore they should be unbanned
Display More
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.