NiklasEi / gamebox

Minecraft plugin with a vast selection of inventory games
http://gamebox.nikl.me
GNU General Public License v3.0
17 stars 12 forks source link

Do you save onPlayerQuit as well? #12

Closed RoboMWM closed 7 years ago

RoboMWM commented 7 years ago

Can't test at the moment, but someone who was disconnected via a network issue lost all the cookies they produced for that session (they had it open). I don't think InventoryCloseEvent fires when a player disconnects - is this where you're solely saving data?

NiklasEi commented 7 years ago

is this where you're solely saving data?

Yes it is.

I'll add a listener for PlayerQuitEvent which should also be called when the player crashes or has connection issues.

NiklasEi commented 7 years ago

I just got a temporarily free server to test my fix and didn't even run into the problem with the old version.

I made some cookies and pulled my networkcable to simulate network issues ;) When I reconnected I still had the cookies.

NiklasEi commented 7 years ago

I still wasn't able to replicate this problem, but I added some code in my playerquit event that handles players who are still in a GUI or game when the event runs. So your problem shouldn't show up again.

In the beginnings of gamebox i tested whether InventoryCloseEvent fires when disconnecting and for normal cases it does. The inventory is closed and the event is called bevore removing the player.