Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

AutoSave Improvement #707

Closed spuffin closed 9 years ago

spuffin commented 10 years ago

One of the items I have noticed is that the AutoSave function does not operate when a user is not logged in the server. Now obviously this isn't an issue if no users are on then nothing is changed and thus a save is not required but the problem occurs when a user has been building for a period of time and then logs off, that data is never saved until someone else logs in and the autosave process gets picked up.

There are a couple of options I can think of that would rectify this. 1) Save after the last user logs off of the server. 2) Save after the normal autosave time but turn the feature off until another user logs in. This would prevent a single user from logging in/out causing the server to constantly save.

stevenh commented 10 years ago

2) seems like the best idea.

On our Multiplay server we have an automatic backup system which forces a save before it backs up the world, which works around this issue.

k0rd commented 10 years ago

We would need to use 1) since we are using game updates to check the timing of autosave.

tchomphoochan commented 10 years ago

Can I ask something? If server's configuration was set to always noon, how it would save automatically? I won't rely on auto backup that much.

Olink commented 10 years ago

...what?

AxisKriel commented 10 years ago

He meant if a plugin froze time, such as essentials' (or MAC) /freezetime. With Terraria time frozen like that, the map will never auto-save afaik.

QuiCM commented 10 years ago

...Why would the save feature use Terraria time?

AxisKriel commented 10 years ago

Because it does. Don't ask me why. It saves at 4:30 AM Terraria Time.

QuiCM commented 10 years ago

It would appear that the AutoSave feature is implemented by Terraria, not TShock. If you're worried about your world not saving every x seconds/minutes/etc, use TShock's backup feature. It does not depend on game time

Olink commented 10 years ago

Suggest improvement that we do a save on the last user out, and disable autosaving until the first person joins. This may require some work in the API, but nothing too much.

QuiCM commented 10 years ago

:+1: