brunyman / MPDB

9 stars 2 forks source link

Problem with saving bed_spawn in database. #53

Open chspans opened 3 years ago

chspans commented 3 years ago

I have a problem where bed_spawn is not updated until 2 save events have occured, there are different things that can happen between these times.

If the player logs off and logs back on everything is fine the bed_spawn is updated like normal. Although it does take 2 save events of the player being online to update.

The problem occurs if the player logs off and does not log back in before the server is restarted.

Location_of_Bed This image shows the bed_spawn as where the player use to have the bed, however the location of where the person is standing is where the new spawn was set to. This works fine if the person is online for 2 save events, then it's updated perfectly. However if the person logs off it is never updated or updates to "world#0.0#0.0#0.0#0#0" If the person logs on before a server restart they still spawn at the new location and will be updated to the new bed_spawn.

If the person were to log off for the day and a server reset occurs then dies before a data save is completed this this is seen. No_Home_Bed

If the person does not die until after 2 data saves have been completed this will be the new bed_spawn and they will always respawn at world spawn. DB_After_2nd_Save_Online

Data Saves are set for 3 minute increments, I can turn down the save increments to 1 min however I have a number of players that will set a spawn and log off. When logging off it appears the location of the person is updated in the DB but the bed_spawn is not. Same with just normal saves, the players location is updated with each save but it takes 2 saves to update the bed_spawn.

chspans commented 3 years ago

This server is running Paper version git-Paper-143 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 6855505)

MysqlPlayerDataBridge version 3.36.3

chspans commented 3 years ago

Also these are set to true.

    shareLocation: true
    shareBedSpawn: true