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 30889 times)

fix pref saving (use prefs with format $pref::) and dont set a limit/set a much higher limit to the autosaver time interval
The current autosaver is already using this, I can't use a higher interval because then the schedule breaks, I'll have to edit it to schedule a minute per tick if I want to increase the save limit (why would you want to autosave every hour or more anyway?), I may not increase the limit but I'll make it fix the limit if it somehow breaks, I'm not sure how your limit is going too high/low. Chances are the schedule is never started due to loading an autosave, which is what I've fixed in this coming update.

I don't have any issues with prefs because I don't use RTB or oRBS. Whatever you're using is most likely screwing up how it works, and I don't know a way around this right now.

include a command to cancel the current autosave schedule
I can do this

make sure that autoloadbricks on server start pref saves between server reset
This should already happen, if your server crashes or you don't do quit(); this isn't handled by me (anything with $Pref::Server will also break so it's not just this mod)
« Last Edit: April 23, 2016, 11:16:11 PM by Kyuande »

er, well, all prefs prefixed with $pref::server are automatically saved into prefs.cs.

part of the reason for wanting a higher interval is cause there was no prior way to cancel the autosave loop. with that it should be fine i guess.

This should already happen, if your server crashes or you don't do quit(); this isn't handled by me (anything with $Pref::Server will also break so it's not just this mod)
Looking into the code, you check the wrong $global pref when determinig whether or not to autoload the save. I'm surprised you didn't catch this since this is pretty obvious :o




the rest seem to save fine so yeah, it was just that.

It isn't obvious, I've seen a couple mods do the same, I'll find a different way then

I can't use a higher interval because then the schedule breaks

Replace

$Pref::Server::AS::Interval * 60 * 1000

With

(($Pref::Server::AS::Interval | 0) * 60000 | 0)

Can you explain to me how that works? I've never seen that before.

Makes it use uints instead of floats so you dont end up with 1.8e006 garbage

Since my computer always decides to crash after many hours of building on my server, this will actually be quite useful.

Bump.

  • Created a different look to the autosave messages.
  • Fixed "Auto-load autosave on start" value not being used at all
  • You can now save names using /autoSaveBricks name here, leaving it bank will just use the date and time
  • Most wrench events will now trigger the autosaver to not claim it as a 'duplicate'
  • Added an option to load someone's build based on their BL_ID (command is below); CAUTION: This only works on an autosaver because it saves every brick with a BL_ID!
  • /LoadAutoSaveID BL_ID save name (can use "last" to get the last saved build)
  • Used Zeblote's interval method
  • Using a list system to save bricks, they get sorted, which makes bricks load from bottom to top (also helps not lag with high brickcount)

The auto-updater will also ask you to update too, you can use the current link in OP if you don't feel like waiting.
« Last Edit: June 03, 2016, 07:27:38 PM by Kyuande »

I'm still trying to see who the original author is, please PM me when you can to claim the original (Kalphiter is trying to claim it)

Of what?

The autosaver. Looks like I didn't explain in the OP that this wasn't originally mine. (Although the description does give credit to the unknown author, just didn't explain it on the OP)
« Last Edit: June 03, 2016, 05:33:38 PM by Kyuande »

kalph claimed it on my server too

he was a decent modder so i wouldn't put it past him to have actually made the original, but proof should be provided.

thanks for the long-needed update.
« Last Edit: June 03, 2016, 07:19:50 PM by Conan »

No problem, anyway he's been proving me that he originally made it (links given):
http://pastebin.com/juXVPeh8 - Original
https://forum.blockland.us/index.php?topic=275978.msg8218387#msg8218387
https://forum.blockland.us/index.php?topic=235175.msg6689752#msg6689752
https://forum.blockland.us/index.php?topic=139637.msg6339083#msg6339083

Going to now close my "whois" on the original author.

Another edit, Kalphiter recently notified me that he didn't just make it, other people did. Credits:
Kalphiter: Non-blocking autosaver (Privately used on Kaphost)
Zack0wack0: Blocking autosaver
Randy: Basic saving function

I updated the file to add those credits
« Last Edit: June 03, 2016, 07:42:23 PM by Kyuande »

With Blockland Glass I have the prefs showing up but the interval won't let me type anything but zeroes and dots in the text field
This is still a problem This now works using the Blockland Glass server preferences 6/28/16, so to change how often it autosaves, do I change this?

EDIT: Also, is there a way to limit the amount of saves it creates before replacing the oldest one yet?
« Last Edit: June 29, 2016, 03:37:37 PM by lren »

This is still a problem, so to change how often it autosaves, do I change this?
Please refer to the RTB pref "Interval" ($Pref::Server::AS::Interval = minutes;), $Server::AS::Init basically makes sure it doesn't re-register the prefs if the mod was reloaded for some reason.

EDIT: Also, is there a way to limit the amount of saves it creates before replacing the oldest one yet?
I have not added this, wasn't sure if this should be a feature yet. You'll just have to moderate your save folder so it doesn't end up eating your storage.

Bump, some of my emitters aren't loading direction properly, I'm really not sure what's going on. I'll upload a console.log in a bit.
« Last Edit: August 04, 2016, 09:40:24 PM by Wesley Williams »