Mojira Archive
MC-84786

ban expiration date in banned-players.json isn't functional / banned-ips experation date doesn't fully work

The bug

You can use the expiration time in banned-players.json, and the message "Your ban will be removed on xxxxx" shows up fine.
The issue is, it doesn't unban when the time has passed the "expires" time

I banned myself for 1 minute to test it, and I waited about 10 minutes and it still doesn't let me in.

(Just a note, you can't use the expires in the command, only by direct editing the banned-players.json / banned-ips.json file)

banned-ips.json works fine, you can connect afterwards, but you get an error each first time you try to connect since server restart since expiration date is reached.

Client
Internal Exception: io.netty.handler.codec.DecoderException: java.io.IOException: Bad packet id 26
Server
[21:43:15] [Server thread/WARN]: Failed to handle packet for /IPBLACKEDOUT
0
java.lang.NullPointerException
        at mm.a(SourceFile:383) ~[minecraft_server.jar:?]
        at md.b(SourceFile:97) ~[minecraft_server.jar:?]
        at md.c(SourceFile:62) ~[minecraft_server.jar:?]
        at ek.a(SourceFile:232) ~[minecraft_server.jar:?]
        at ma.c(SourceFile:187) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.D(SourceFile:643) [minecraft_ser
ver.jar:?]
        at la.D(SourceFile:339) [minecraft_server.jar:?]
        at net.minecraft.server.MinecraftServer.C(SourceFile:553) [minecraft_ser
ver.jar:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:457) [minecraft_s
erver.jar:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_77]

Steps to reproduce (banned-players)

  1. Run a server
  2. /ban yourself
  3. Close server
  4. Edit the banned-players.json's expiration date to "unban" after 1 minute
  5. Start server again
  6. Wait that time and try to join

Steps to reproduce (banned-ips)

  1. Run a server
  2. /ban-ip yourself
  3. Close server
  4. Edit the banned-ip.json's expiration date to "unban" after 1 minute
  5. Start server again
  6. Wait that time and try to join, you will receive an error
  7. Try joining again, you'll get in
  8. Close and start the server again
  9. Enter the server, and see the same message again

Code analysis

See this comment.