Sleep percentage doesn’t update when a player leaves the server

ArchivesProblems & bugs → Sleep percentage doesn’t update when a player leaves the server

SOLVED

(Not a big issue btw)

What did you expect?

I expected that when players left the server the sleep percentage would be recalculated.

What actually happened? The sleep percentage doesn’t get recalculated. I’m assuming it only gets calculated when a new player enters or leaves a bed.

Maybe have it calculate every time someone leaves.

Do you see any sort of error message? No

How can we reproduce this problem? Go on survival, have less than 50% of people start sleeping in a bed, have enough people leave so that the amount of players sleeping is greater than 50%. The time won’t turn day until another person goes in the bed

Interesting, I’ll check it out. As the code stands right now, there’s three event handlers, one for a player teleport (joining the server, entering/leaving the bed, changing worlds,ect.), one for when a player leaves, and one when someone changes gamemode, and these were tested before deployment. I’ll definitely look into it in roughly 30 min, but to make sure, can you re-test this on the server? Keep in mind that you won’t get another actionbar message if the % doesn’t change. So if it was 0% before they left, a message won’t appear.
I have seen this happen many times on there, can’t test it now but I can in a few hours. We will be just siting in a bed and someone has to leave the bed and go back in it after a player leaves before it’s updated and turns to day
Here’s an example: there are 5 players on. 2 people are sleeping. The percentage is at 40%. Someone then leaves so now their are 2 player sleeping and 2 players not. The time doesn’t get updated until someone else sleeps or someone in a bed already leaves their bed and goes back in. I hope this made sense