1.8.8 Data saving

Discussion in 'Spigot Plugin Development' started by thoe, Jun 22, 2021.


read post

  1. onKick

    1 vote(s)
  2. onDisable

    2 vote(s)
Thread Status:
Not open for further replies.
  1. Say the server stopping and kicking all players, would you save profiles to database using the onKickEvent or create a for-loop to save all loaded profiles using onDisable?
  2. Just save the data when the data changes...
    • Agree Agree x 1
  3. From my experience, plugin can disable before players being kicked out. So definitely onDisable.
  4. A lot more optimized to massupdate then make 1000 small requests whenever it changes.
    DB saving can take be quite heavy if you have 100x little things needing to be saved every second.
    Seems pretty reasonable, ill keep this in mind.
  5. when the server shuts down, plugins always disable before disconnecting users.

    definitely needs onDisable, no discussion

    but there’s still nothing wrong with saving when players disconnect, that way their data doesn’t have to be stored in the memory all the way until disabling
  6. Yeah, I already save onKick and onQuit, but I was debating whether or not I should exclude kick reasons containing "stopped" from onKick and just save onDisable.
  7. lol, it’s not like it’s gonna be able to listen for that kind of kick anyway as the plugin will be disabled already
    • Winner Winner x 1
  8. I've settled on saving it on disable. Thanks for the insight guys.
Thread Status:
Not open for further replies.