Ulysses Stuff > Suggestions

Auto-server reset script

(1/3) > >>

JerryTheStampede:
Hello, I've read a couple threads about this before but nobody really released anything. Is it possible that someone make an addon that will reset the server if no one is in it for like 5 minutes?
Our server gets Reliable Snapshot Overflows. We have simple prop protection but it doesn't clear the snapshot. If we had an auto server reset then when the server RSOs it would just reset since nobody would be in it.

Can anyone tell me if theres a script like this ulx or not? I know there was one for lua but its a year old and all the links for it are dead. I think that if this works well it should be implemented into the main ulx addon.

One more thing. Our server automatically will reset if it crashes so just having the addon execute and exit or quit command after having no one in it for a while would suffice.

jay209015:

--- Code: ---// ARestart V1.0

local RDelay = 5 // Delay in minutes

function Reset()
local playerslist = player.GetAll()
if table.Count(playerslist) == 0 then
timer.Create("ResetTimer", RDelay * 60, 1, RestartServer)
else
timer.IsTimer("ResetTimer") then
timer.Destroy("ResetTimer")
end
end
timer.Create("ResetThinkTimer", 60, 0, Reset)
function RestartServer()
game.ConsoleCommand( "quit" )
end
--- End code ---

Not tested, but should work.

Megiddo:
table.Count() shouldn't be used, use the # operator instead.

JerryTheStampede:
That script looks alright. But... how would I use # operator instead of table.Count().

JamminR:
Jerry, one extra tip... make sure to get the latest SVN of Tad2020's advanced duplicator.
I pointed him to a discussion regarding reliable snapshot errors here.
Tad2020 added a timer to adv. dupe that removes what is believed to be a major contributor to Reliable Snapshot overflows.
It's not a cure mind you... heavily prop loaded servers will/can still get it, but I've personally noticed a big difference on those servers that have upgraded to the latest SVN of Advanced duplicator.

Navigation

[0] Message Index

[#] Next page

Go to full version