seyfahni / OnlineTime

A simple Minecraft plugin which counts the onlinetime of players
https://www.spigotmc.org/resources/onlinetime.66349/
MIT License
5 stars 4 forks source link

Invalid valune in mode config field causes NullPointerException during shutdown #16

Open seyfahni opened 4 years ago

seyfahni commented 4 years ago

Description When using the mode value combined on waterfall it displays this message during startup:

[12:26:53 ERROR] [OnlineTime]: invalid mode: combined

and then displays this exception during shutdown:

[12:27:11 ERROR]: Exception disabling plugin OnlineTime
java.lang.NullPointerException: null
    at mr.minecraft15.onlinetime.bungee.OnlineTimeBungeePlugin.onDisable(OnlineTimeBungeePlugin.java:125) ~[?:?]
    at net.md_5.bungee.BungeeCord.independentThreadStop(BungeeCord.java:474) ~[waterfall-358.jar:git:Waterfall-Bootstrap:1.16-R0.2-SNAPSHOT:9234e50:358]
    at net.md_5.bungee.BungeeCord.access$000(BungeeCord.java:101) ~[waterfall-358.jar:git:Waterfall-Bootstrap:1.16-R0.2-SNAPSHOT:9234e50:358]
    at net.md_5.bungee.BungeeCord$5.run(BungeeCord.java:414) ~[waterfall-358.jar:git:Waterfall-Bootstrap:1.16-R0.2-SNAPSHOT:9234e50:358]

The configuration:

language: 'en' # for available languages see / edit messages.yml
servername: 'this server'
messageformat: '&gray&\[[OnlineTime](dark_aqua)\] %message%' # See https://github.com/Phoenix616/MineDown#syntax
saveinterval: 30 # seconds
storage: 'database' # to use e.g. mysql set to 'database' and configure database.properties
mode: 'combined' # use 'combined' for to enable communication between server and proxy
configversion: 2 # Never manually edit this value! It is used to migrate older configurations to the current version.

How Reproduce

  1. Setup a proxy
  2. Set combined as value for mode
  3. Start up waterfall
  4. Stop waterfall
  5. See the errors

Expected behaviour As the plugin already detected a failed startup nothing should happen during shutdown or if the plugin can still work with the given configuration by using a fallback it should disable normally.

System information:

srnyx commented 2 years ago

Getting this too: [OnlineTime] invalid mode: combined Makes plugin unusable if mode is set to combined

Does it not use master and slave anymore?