Page 1 of 1

[Mod] Rollback [0.1] [rollback] (WTFPL)

PostPosted: Thu Mar 01, 2012 18:34
by Jeija
Hi everyone!
This mod can help lots of server admins and also player. I think this one or a similar one should be installed on every public minetest server!

Introducing... the Rollback Mod!

What this mod does
Imagine there is a griefer and several other players on your server. Unfortunately, you are not playing on the server.
You now want to repair the griefer's damage, but you don't want to destroy the other player's creations.
With this mod you can simply enter
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
/rollback PLAYERNAME

into the ingame chat console and everything that PLAYERNAME did disappears.
You can also use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
/rollbacktime PLAYERNAME TIME

This means that everything PLAYERNAME did from TIME seconds ago till now disappears (make sure you dont reboot the system between destruction and rollback in this case)

How does it work?
This mod creates a logfile in its folder, one for each player. It logs every node the player digs and places.
It does NOT log the inventory and metadata (text sign, chest inventory, furnace inventory...)
It also cannot repair unloaded chunks! So make sure all the required chunks are loaded when doing a /rollback! You can also backup the log file in the mod's folder.
This mod does not log damage caused by other mods (pistons, nukes, ...) I can add this functionality if you'd like to.

What do you think about this Mod? What should I add?

Dependencies: none
License: WTFPL

Download
V 0.1 as .zip

PostPosted: Thu Mar 01, 2012 18:37
by sfan5
Amazing! :D
But I want a download Link!!

PostPosted: Thu Mar 01, 2012 18:39
by Jeija
Download link added. Just had to wait until it finished uploading.

PostPosted: Thu Mar 01, 2012 18:42
by Jordach
jeija wrote:I can add this functionality if you'd like to.


YES!!!

PostPosted: Thu Mar 01, 2012 18:45
by sdzen
love it putting it in my client for no real reason at all maybe to undo crazy things i do

PostPosted: Thu Mar 01, 2012 19:02
by jordan4ibanez
works like a charm

PostPosted: Thu Mar 01, 2012 19:21
by Calinou
Amazing. Wow.
Every public server should have this. :P

PostPosted: Fri Mar 02, 2012 00:21
by Scott
this is absolutely amazing, immensely practical

PostPosted: Fri Mar 02, 2012 00:49
by Death Dealer
very cool feeling better about having a server running when im not around now:D

PostPosted: Fri Mar 02, 2012 04:21
by Utilisatrice
Amazing, thank you !!!

EDIT :

I just noticed a bug, if for example you do a rollback of 20 seconds and all the good contructions with more than 20 seconds and although we will be able to ever more removed

PostPosted: Fri Mar 02, 2012 07:57
by Jordach
add this to krays server! :D

PostPosted: Fri Mar 02, 2012 08:50
by redcrab
That's a very nice idea
congratz
+1

PostPosted: Fri Mar 02, 2012 11:51
by xyz
What is player X removed some node, placed another, then player Y removed X's node and placed something else. Then we rollback all X's changes... what now? I mean, that mod should handle last "owner" of node.

Also, little improvement: use break if tonumber(logtime)<os.time()-tonumber(time)

PostPosted: Fri Mar 02, 2012 16:12
by Jeija
What is player X removed some node, placed another, then player Y removed X's node and placed something else. Then we rollback all X's changes... what now? I mean, that mod should handle last "owner" of node.

That's right. Therefore: Don't repair things griefers destroyed! As minetest does not have a node owner system (without a mod), I cannot change that.

PostPosted: Fri Mar 02, 2012 19:34
by cisoun
Jordach wrote:add this to krays server! :D

It wouldn't work. It's a 0.3 server and mods aren't supported. But it was a good idea!
By the way, congratulation for this mod. It's one of the best so far.

PostPosted: Fri Mar 02, 2012 20:11
by Jordach
Lol, wish Kray moved his map.

PostPosted: Fri Mar 02, 2012 20:37
by sdzen
he might if 0.4 ever turns into a stable release :) anyone who doesnt check celerons blog or doesnt like the bleeding edge need a home too so untill then suck it up :)

PostPosted: Sat Mar 03, 2012 08:46
by xyz
Jeija wrote:
What is player X removed some node, placed another, then player Y removed X's node and placed something else. Then we rollback all X's changes... what now? I mean, that mod should handle last "owner" of node.

That's right. Therefore: Don't repair things griefers destroyed! As minetest does not have a node owner system (without a mod), I cannot change that.

You cannot stop your players from repairing their buildings that were griefed.
I think you can change it, just store player nickname who modified "that" node last. Maybe it'll be better to use sql? So you can select all "griefed" nodes with just one query.

PostPosted: Mon Mar 05, 2012 02:34
by jordan4ibanez
this mod is very helpful to making other mods :D

PostPosted: Thu Mar 08, 2012 04:40
by jordan4ibanez
Request: Admin roll back (only admins can rollback) maybe make an admin file that you can add in admins names and they can rollback griefers horrible changes

PostPosted: Thu Mar 08, 2012 05:08
by Jeija
jordan4ibanez wrote:Request: Admin roll back (only admins can rollback) maybe make an admin file that you can add in admins names and they can rollback griefers horrible changes

This only works for admins already (At least I think so)
You have to have the "privs" priviledge to rollback. Normally only admins have that.

PostPosted: Thu Mar 08, 2012 12:24
by jordan4ibanez
alrighty thanks for the help

PostPosted: Fri Mar 09, 2012 14:31
by jordan4ibanez
another request! /rollbackclear "playername"
clears the players log!

&

so that it clears it after a couple days!

PostPosted: Fri Mar 09, 2012 16:13
by sfan5
+1 for this Request/Idea

PostPosted: Sat Apr 21, 2012 20:48
by cosarara97
This mod saved my world from griefers more than once, and I'm very happy with it, but now it's making my server crash every time an user logs in. It gives the following error:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
22:32:51: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaError: error running function 'on_step': .../minetest/games/minetest_game/mods/rollback/init.lua:8: attempt to index local 'player' (a nil value)
22:32:51: ERROR[main]: stack traceback:

In thread 7f3e79941740:
/build/buildd/minetestc55-201204161538/src/main.cpp:1726: int main(int, char**): Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 7f3e79941740:
#0  int main(int, char**)
(Leftover data: #1  Dedicated server branch)
(Leftover data: #2  virtual void ServerMap::save(ModifiedState))
(Leftover data: #3  virtual void ServerMap::saveBlock(MapBlock*))
(Leftover data: #4  void ItemStack::serialize(std::ostream&) const)
Avortat

("Avortat" means aborted)

PostPosted: Sun Apr 22, 2012 12:47
by Lelix
very functional and useful. very good. But I have a doubt: if you create a file does not increase the player's memory and slows down the game?

PostPosted: Sun Jul 01, 2012 16:16
by whiskers75
Please log metadata and DEFINETLY OTHER MODS. Also add chest items, if possible.
Oh and store logs IN THE WORLD FOLDER! Otherwise /rollback on other maps will pop up a lot of blocks in random places (!)

PostPosted: Sun Jul 01, 2012 21:21
by jpenguin
..and make it so you can right-click a block with a stick and see it's history