[Server] Autosaver - [Version 3.0.0] - Javascript version??!!! (tba)

Poll

Environment saving/loading?

yah
50 (98%)
naw
1 (2%)

Total Members Voted: 50

Author Topic: [Server] Autosaver - [Version 3.0.0] - Javascript version??!!! (tba)  (Read 30838 times)

Tags: Autosaver, autosave, auto saver, auto save, saver
Autosaver v3 is completely reworked than last Autosaver versions.



Features
Toggle your autosaver anytime!


Timestamps! Know when your autosaver is doing something.


Change the speed and number of bricks to save per tick of your autosaver! (NeatSaving feature can affect this)



Load bricks from the autosave folder!


Get reports in the console!


Cool centerprint progress!


Show elapsed time when nothing happens.


Save your autosaver with a name!


Auto-delete old files feature. This is capable of deleting your old autosave files. This is off by default because it may not work properly, especially on Linux and Mac because I have never tested on those with this feature. (Seems to be working though, but I recommend being careful with this) - This will only delete saves in your autosaver folder, and will only delete names starting with "Autosaver - ". If you name the autosave something else, this will avoid deleting it.


Neat saving! This is off by default because it can cause lag after hitting a number of bricks.
Why does this lag? The server creates a list and adds them, and sorts them based on their distance from the ground. This feature is only good to make your build load from the ground and up in a nice way. If you have a lot of bricks make sure you either disable this, or turn on your NeatSaveProtect preference.

Preferences
There are a total of 22 preferences. This should support a few preferences mod.

Info:
Preference name (Default value/Max amount) - Description

Enable (true) - Enables the autosaver.
Announce (true) - Announces any autosaver stuff into the chat. Console will always echo and log the time of the autosaver messages.
Announce sounds (false) - Plays sounds with some messages, must have "Announce" enabled.
Announce save name (true) - Announces what the save is being named to, must have "Announce" enabled.
Centerprint progress (false) - Centerprints progress of saving.
Report (false) - Reports how many events and brickgroups were saved, this is kind of pointless unless you want to know what is going on. This will always echo in the console.
Show time stamps (false) - Show time stamps on every autosaver message (console always shows time stamps). This could create more clutter so this is off by default.
Show time elapsed (true) - Show time elapsed on messages that do now show time (such as related saves not showing, save errors, etc). Time elapsed is also shown in centerprint (if enabled).
Interval (5/1440) - Interval to activate autosaving (minutes).
Directory (saves/Autosaver/) - Location to save the files. Make sure to always have a "/" at the end or you will mess saving up.
Ownership (true) - Save individual ownership?
Events (true) - Save events? (Brick name is included on this)
Overwrite on change (true) - Painting a brick (color and fx), changing lights/emitters/items/name/etc will trigger the autosaver to actually save the build. Changing events will not trigger this preference.
Save related brickcount (false) - Always save even though nothing has changed? I don't know why anyone would enable this but it's there in case someone wants to have multiple saves. If you are on a budget of saving storage I do not recommend enabling this.
Save after bootloading (false) - Save the bricks right after they are loaded, if this is disabled it will just schedule saving instead. Note: This may not work if you have changed the gamemode without restarting the server completely.
Load save on start (false) - Loads the last autosaved build on server start
Enable neat saving (false) - Neat saving is basically using a list and sort it by getting the distance from the ground. This makes it so when you load the autosave bricks load from bottom to top. If this is disabled it is possible have bricks loading everywhere. If you are autosaving with tons of bricks (+80,000), I suggest disabling this to reduce lag when it sorts the distance.
Neat saving auto-off (true) - Turn off neat saving if there are too many bricks to handle (detected before autosaving bricks).
Chunk saving count (4000/20000) - Autosaver introduces a chunk saver which basically saves a bunch of bricks at once at every save tick. Going over a certain amount such as 4500 can possibly lag the server, this also varies on the tick preference and what exactly is going on in the server. If you do not like chunk saving I recommend to have this preference around 1-25.
Remove unwanted tempbricks (false) - Attempt to remove any tempbricks that do not have an existing player.
Save tick MS (1/1000) - This is the amount of time in MS to run another save loop.
Max autosaves (-1/1000) (Disabled if 0 or less) - Amout of autosave files to keep - I have not tested this on a Mac or Linux, so this will be off by default.

Commands
Super Admin
/ToggleAutosaver
  /ToggleSaving
  /ToggleSaver
  /ToggleAS
  /TogAS

/AutosaveBricks (autosave name)
  /ASB

/AutoloadBricksID (bl_id) (autosave name)
  /AutoloadBricksID
  /LoadAutosaveID
  /ABID

/LoadAutoSave (autosave name)
  /LAS
  /ALB
  /AutoloadBricks
  /AutoloadSave



Note #1: Trust your super admins as they can abuse these commands by making so many saves in your autosave folder.
Note #2: This can create a lot of saves, I recommend deleting old ones after a while. You can test the auto-delete feature.

Please report any bugs I may have missed.
Support_AutoSaver (Version 3)
« Last Edit: February 24, 2018, 10:24:51 PM by Kyuande »


« Last Edit: September 25, 2015, 11:19:44 AM by SWAT One »

I was looking for this type of add-on and even considered revisiting my old add-on folder to update my old save/loader, but then released this. You have just saved me a couple of hours of work. However, I did found some issues and missing features that I think you might like to include:

  • $Server::AS::dir is overwritten every time. I would recommend that you put it in the same place you put preferences so the host may be able to change it.
  • Make it possible to only have two save files available, that is, when you save, you first save it, remove the old one you had previously, and copy the new save and mark it as old one. Optionally make it possible to keep a number of files this way, always removing the oldest one. Could also be that you mix it, keeping one save each day and removing the rest, still keeping a history but not clogging the storage space.(Yes, you mentioned that earlier)
  • Maybe support Blockland Glass? RTB is dead and should be kept that way. No reason to beat a dead horse.
  • To save even more storage space, you might need to check if anything have been changed since last time. Some servers may have some inactivity for the next hour, so saving in that time could be a huge waste with identical save files.

Btw, thank you for using my function. However, I have no idea why I wrote it, but sure was not aware of fileCopy when I did. It could be performance reasons, but then again, I'm almost certain that the internal functionality of fileCopy is way faster than my crude one.

Please feel free to ask if you need anything.

Ah, you were the one who wrote this, I'll include the original credits. I'll apply more updates when I get back home. Thanks for posting.

I'm not sure if fileCopy is a default function. I need to check these things before I release something, for the moment the mod should be fine, but I'll work on these when I get back home.
« Last Edit: September 15, 2015, 08:09:23 AM by Kyuande »

does it also detect if any events have been changed?
and does it use the same ownership system as rtb's autosaver or normal blockland's saver?

it just iterates through all the bricks and checks their values and saves it accordingly? there's no reason it would skip over a brick's events.

ownership IIRC is applied on loading; the baseplate's ownership will take precedence over the ownership of the bricks on top of it.

it just iterates through all the bricks and checks their values and saves it accordingly? there's no reason it would skip over a brick's events.

ownership IIRC is applied on loading; the baseplate's ownership will take precedence over the ownership of the bricks on top of it.
o I read a thing wrong

well even so, I think the autosaver needs to check if there's any new bricks or any new events placed, and if not, don't autosave
maybe even have an rtb pref to toggle this

also, when blockland saves normally that happens, on some autosavers however they save bricks properly.
I have an autosaver that saves and loads bricks properly; where if you built a brick on someone elses baseplate, the brick would still be your ownership
I was wondering if this autosaver did the same thing

I shouldn't keep these kind of mods locked away in my servers.
If only everyone had this attitude.

I'm not sure if fileCopy is a default function. I need to check these things before I release something, for the moment the mod should be fine, but I'll work on these when I get back home.
It isn't. Badspot added both fileCopy and fileDelete himself. So it is safe to use it in Blockland.

it just iterates through all the bricks and checks their values and saves it accordingly? there's no reason it would skip over a brick's events.
I mentioned this earlier.
  • To save even more storage space, you might need to check if anything have been changed since last time. Some servers may have some inactivity for the next hour, so saving in that time could be a huge waste with identical save files.

Wait, I thought fileDelete is part of the default torque engine

Wait, I thought fileDelete is part of the default torque engine
I'm as surprised as you when I found out. Apparently neither of them are in the default installation, but it seem to be one of the few useful functionalities Badspot have actually added.

Do not get rid of the RTB prefs.
As long as the server sided works, it should be used.

Do not get rid of the RTB prefs.
As long as the server sided works, it should be used.
It'll keep the prefs, just basically checks if the file exists.

I am currently updating this, from what it looks like it has been broke for a while.

Edit: Updated. Also, you can now name your folder location. Default is "saves/AutoSaver/"
Added:
 - Autosave duplicates option. This will help keep space if nothing has changed.

Update fixes:
 - Autoloading should actually work now, not sure how I broke that
 - Deleting old save should no longer screw up the saving variable
« Last Edit: October 14, 2015, 10:10:44 PM by Kyuande »