History

Discussion in 'Plugin Release Discussion' started by MarioE, Jun 14, 2012.

  1. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Description:
    Logs tile history EXCEPT for liquids. This can be used to check the history of a griefed house, and can then ban the griefer. It can also be used to rollback actions done by a player.

    Permissions:
    • history.get - Allows /history.
    • history.prune - Allows /prunehist.
    • history.reenact - Allows /reenact.
    • history.rollback - Allows /rollback and /rundo.
    Commands:
    • /history - Retrieves the history of a certain tile when broken (includes what tiles were broken, placed, and when).
    • /history <player> <time> [radius] - Creates a general summary of a player's actions within the time-span and the radius. <time>is formatted in the form 0d0h0m0s.
    • /prunehist <time> - Clears any history before the specified time. <time> is formatted in the form 0d0h0m0s.
    • /reenact <player> <time> [radius] - Recreates all of a player's actions within the time-span and radius. <time> is formatted in the form 0d0h0m0s.
    • /rollback <player> <time> [radius] - Rolls back all of a player's actions within the time-span and radius. <time> is formatted in the form 0d0h0m0s.
    • /rundo - Undoes a rollback or reenact.
    Links:
     
    • Like Like x 10
  2. Argam

    Argam Level 1

    Joined:
    Jan 23, 2012
    Messages:
    8
    This is exactly what we need.
     
    • Like Like x 2
  3. Helios

    Helios Level 2

    Joined:
    Feb 10, 2012
    Messages:
    42
    If this is anything like logtile your on a roll man. Gonna start using this immediately.
     
  4. Olink

    Olink Nyx Developer, Occasional TShock Developer
    Banned

    Joined:
    Jul 21, 2011
    Messages:
    1,397
    I like, but I have to ask you the same questions that I discovered when I started logtile.
    1) Whats the performance on inserting 10k elements into the db?
    2) Whats the performance on rolling back a lot of edits due to sending one tile at a time?


    Some other nitpicky things:
    Why do you broadcast to everyone that the queue is saved? That seems to be something you want to keep to admins and peeps.
    Not all TSPlayers are instantiated, so you have a null case there if i recall correctly.


    Other than that I think this will make a great plugin.
    On a side note, I think you should have just updated/worked on logtile, as it seems you have duplicated quite a bit of work :)
     
  5. Helios

    Helios Level 2

    Joined:
    Feb 10, 2012
    Messages:
    42
    The cpu usage on my terrariaserver.exe has gone steadily up to the point of system-wide freezing twice, removed and it stays at around 10%.
     
  6. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    [​IMG]
    1) Just updated it to increase the speed, and these are the times required for 1000 tiles, sqlite (seeing as how destroying 10000 tiles is a pain in the trout to test).
    2) The performance on rolling back a lot of edits... I am not sure at all. I think just sending packet 0x11 is better, maybe, since it is one tile after all...

    Sending that message in SaveQueueCallback is removed, I had it earlier when it was possible to directly save the queue.

    This should be fixed as tile saving is much, MUCH faster now.
     
  7. Olink

    Olink Nyx Developer, Occasional TShock Developer
    Banned

    Joined:
    Jul 21, 2011
    Messages:
    1,397
    I think your scope is too small :\

    Your reasoning is sending < 100 tiles, but what if I want to revert 10000 tiles? Thats 10,000 little tiles :\

    That caused a bottleneck in performance for logtile.

    Save was ok ifi recall for logtile, but we were playing around with optimizing the queries...
     
  8. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    You're on a roll with these plugins :)
     
  9. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    • Use edit, for all things holy...
    Is there a reason that when you rollback a placed item, it turns into dirt? Or is that just me?
     
  10. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Huh, looks like I failed at copy pasting that (changed from WorldGen.KillTile()). Fixed.
     
    • Like Like x 1
  11. seth1997

    seth1997 Level 1

    Joined:
    Jul 27, 2012
    Messages:
    5
    Untitled.png update needed?
     
  12. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    Update to TShock 3.9.
     
  13. seth1997

    seth1997 Level 1

    Joined:
    Jul 27, 2012
    Messages:
    5
    I did
     
  14. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    You didn't, because it says 3.6. :\
     
    • Like Like x 1
  15. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    Replace your terrariaserver.exe, TShock API, etc. with 3.9. Download the latest version of tshock and extract all the files into your TShock folder, then replace your terrariaserver.exe.
     
  16. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    I don't understand what reenact does, it says it reenacted # actions, but it doesn't do anything visually.
     
  17. MarioE

    TShock Admin TShock Mod Plugin Developer

    Joined:
    May 26, 2012
    Messages:
    386
    It repeats history, if it can. Basically if your server crashes and the history is saved, you can repeat stuff.
     
  18. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    Oh okay, now I understand :3
     
  19. Spartan989

    Spartan989 Level 0

    Joined:
    Aug 6, 2012
    Messages:
    4
    Sometimes when I use the /history command and hit a block it will come up with a "broke this block 17h50m1s" but no name So I cant find who did it?
     
  20. Wight

    Wight Administrator
    TShock Admin TShock Mod Plugin Developer Zero Day Plugin Author

    Joined:
    May 20, 2012
    Messages:
    1,596
    Getting a glitch(?) where it says something was editted 100+ days ago... but we only installed the plugin about 10 days ago
    Edit: Says [x]d[y]m[z]s, but leaves out hours (not on everything though)