Cuberite Forum

Full Version: AutoSave&Restart v1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(04-27-2013, 11:18 PM)tonibm19 Wrote: [ -> ]For me it's usefull, becouse sometimes server crashes after a few hours on, so I think autorestart can help.

maybe it's also smart to post the crashes on the bugtracker Wink
I don't think a self-restart would suffice for that, you'd need to shut down the server and run it again by an external tool, rather than an internal plugin.

I suppose it's the same as FS #361, then it needs more data - I need the compiled MCServer binary and the core dump for that.
UPDATED:
Now it includes autosave (MCServer has it but is not configurable).

One question, is there anyway to kick all players with a message?
I think you have to do ForEachPlayer in a ForEachWorld function and in there you do Player:GetClientHandle():Kick("message")
(04-28-2013, 04:49 AM)STR_Warrior Wrote: [ -> ]I think you have to do ForEachPlayer in a ForEachWorld function and in there you do Player:GetClientHandle():Kick("message")
I tried with this: cRoot:Get():ForEachWorld():ForEachPlayer():Player:GetClientHandle():Kick("Server is restarting")

It don't work
you have to do this:
local loopPlayers = function(Player)
    Player:GetClientHandle():Kick("Message")
end

local loopWorlds = function(World)
    World:ForEachPlayer(loopPlayers)
end

cRoot:Get():ForEachWorld(loopWorlds)
(04-28-2013, 05:01 AM)STR_Warrior Wrote: [ -> ]you have to do this:
local loopPlayers = function(Player)
    Player:GetClientHandle():Kick("Message")
end

local loopWorlds = function(World)
    World:ForEachPlayer(loopPlayers)
end

cRoot:Get():ForEachWorld(loopWorlds)
Smile Thank you very much, I'm a noob making plugins.
it took me a while to figure that trick out Smile
(04-28-2013, 05:03 AM)STR_Warrior Wrote: [ -> ]it took me a while to figure that trick out Smile
Thanks I tried it and is working very well. I think for now I can consider AutoSave&Restart done. Now I will try to make a plugin that adds command like /kill, /mute and /msg.
cool Smile good luck with thatBig Grin btw maybe add something that if the restarttime is 0 it wil only save the world or something.
Pages: 1 2 3