MyPet
MyPet copied to clipboard
Add option to decrement respawn time if pet is stored.
I've setup a configuration where pets can have hours until they respawn to encourage caring about your pet's life, so my players were complaining that they could not use other pets when a pet dies because then the respawn timer for their dead pets would not decrement.
So I added this option to my server
Just thought to share it here in case you want to add it as well.
This is a great idea!
Ways to achieve this feature
-
The way you suggested. (Update only when we load/display)
-
Load all pets for online players in RAM and we access it through the API using PlayerManager or MyPetManager, then save it to the database periodically. (Maybe this can be too much RAM usage for big servers with many pets per player idk)
-
Use the same code I posted but increase the update interval from 5 seconds to maybe 1-5 minutes.
I guess option 2 would be the only way to have it consistend and don't do frequent updates 🤷♂️
I hope this will be optional to turn on. I'm not so sure I like the idea of pets having their count-downs progress when they aren't the ones in focus. Kind of defeats the purpose if you ask me, but that's my opinion.
It will be opt in only