[Request] Specific block logger/tracker

Discussion in 'Archived: Plugin Requests' started by Nuinbot, Jun 3, 2013.

  1. Offline

    Nuinbot

    Request: I am looking for a very simple plugin to track specific blocks placed and broken (without all the other intensive database logging features).

    Reasons:
    1. I cannot prevent grief from BuildCraft's Quarry, even with areas protected using WorldGuard or Grief Prevention. Since I do not want to ban quarries and still allow their use, I want to keep track of people who place/remove quarries, as well as where and what time. This way, should a region/claim be griefed via quarry, I can at least know who placed the block as well as what time and where.
    2. This also allows me to see who is repeatedly breaking TNT, most likely using the vanilla piston-TNT-x-ray trick.
    Specifics:
    • Simply checks blocks placed and broken against a config file.
    • Should a block match the config file, it is reported and/or logged.
    • This plugin should be compatible with 1.4.7 as it will be run on a Tekkit Lite/MCPC+ server.
    • It would be helpful if block IDs higher than 4096 can be used in the loggedBlocks list, but I can work around this by re-mapping block IDs. (I will be happy to test this.)
    • There should be a plugin reload command so that the server doesn't need to be restarted.
    Sample Configuration:

    notifyGlobal: false #announces to server that a block was placed/broken
    notifyAdmin: true #announces to Admin group that a block was placed/broken
    notifyConsole: true #announces to the console that a block was placed/broken
    saveToLogFile: true #records a block placed/broken, along with the player, time/date, and x,y,z location
    loggedBlocks:
    #this would list the blocks to keep track of, all other blocks are not logged (shows TNT and BC quarry blocks below)
    - 46:*:TNT
    - 153:*:Quarry​

    Sample Log File:

    [pluginName] 06-03-13 16:34 - Playername broke TNT (46) at -35, 72, 6​
    [pluginName] 06-03-13 16:36 - Playername placed Quarry (153) at -37, 71, 9​

    Thanks for looking. Your help is very much appreciated!
     
  2. Offline

    timtower Administrator Administrator Moderator

    Nuinbot I suggest that you ask for this at the tekkit forum, we don't support mods here
     
  3. Offline

    Nuinbot

    I am not asking for a plugin to support mods. I am asking for a plugin that is supported under CraftBukkit 1.4.7.
     
  4. Offline

    timtower Administrator Administrator Moderator

    I can give it an try, does it needs to log to an file in its own folder? ( Please say no :p )
     
  5. Offline

    Nuinbot

    I would say no, just as long as the log file is separate from the server logs.
     
  6. Offline

    timtower Administrator Administrator Moderator

    That means yes :'(
    No big deal ;)
    Will make an quick start, the notify admin part will be implemented later though
     
  7. Offline

    Nuinbot

    That's fine. It is mainly in case of griefing. I have two CommandHelper commands to promote/demote myself so I can play legit on my server, so I would rarely see the reports anyways. (I was thinking for others that might value such a plugin.)
     
    timtower likes this.
  8. Offline

    timtower Administrator Administrator Moderator

    Nuinbot, the message part is done, I am just stuck with the file logger
     
  9. Offline

    Nuinbot

    Sounds good! Looking forward to testing this out.
     
  10. Offline

    timtower Administrator Administrator Moderator

    File logger is also working,
    Couple of questions, does the file logger needs to have an time prefix?
    Does the broadcast message needs to have an prefix?
     
  11. Offline

    Nuinbot

    I would like the file logging to go like this:
    [pluginName] 06-03-13 16:34 - Playername broke TNT (46) at -35, 72, 6​
    [pluginName] 06-03-13 16:36 - Playername placed Quarry (153) at -37, 71, 9​

    This way I know the time and place as well as the block name and number (pulled from the plugin's config.yml).
     
  12. Offline

    timtower Administrator Administrator Moderator

    You want the plugin name in the log file of the tracker plugin? You know that it will be an seperate log? :p
     
  13. Offline

    Nuinbot

    Haha, no it's okay. I copy-pasted that from above, it was more geared towards the in-game and console reporting. So just like this:

    06-03-13 16:34 - Playername broke TNT (46) at -35, 72, 6​
    06-03-13 16:36 - Playername placed Quarry (153) at -37, 71, 9​

    Also, please don't use the block ID's in-game name. Some of the Tekkit Lite blocks are oddly named and so I would rather name them myself in the configuration file. The star should report any block under that ID, where the damage value would only report that specific block.

    - 46:*:TNT​
    - 153:*:Quarry​
    - 194:8:Brass Block <--example using damage value​

    Thanks again!
     
  14. Offline

    timtower Administrator Administrator Moderator

    Nuinbot
    Block name will be taken from the block itself, much easier for me :p ( hope that this works for you )
    Location is looking good, added an world name,
    console won't be spammed by broadcast for the players,
    file logging has everything it needs to have
    Code:
    2013/06/05 07:55:46 timtower placed TNT at world -18, 63, 236
    2013/06/05 07:55:47 timtower placed TNT at world -18, 63, 237
    2013/06/05 07:55:48 timtower placed TNT at world -18, 63, 238
    2013/06/05 07:55:49 timtower placed TNT at world -18, 63, 239
    Console:
    Code:
    07:55:46 [INFO] [BlockTrackerLikeMe] timtower placed TNT at world -18, 63, 236
    07:55:47 [INFO] [BlockTrackerLikeMe] timtower placed TNT at world -18, 63, 237
    07:55:48 [INFO] [BlockTrackerLikeMe] timtower placed TNT at world -18, 63, 238
    07:55:49 [INFO] [BlockTrackerLikeMe] timtower placed TNT at world -18, 63, 239
    EDIT: Link removed to change stuff
     
  15. Offline

    Nuinbot

    Let me know when you get this back up. I would like to test it out.
     
  16. Offline

    AndyMcB1

    I'm going to try out a way to prevent the Vanilla TNT x-ray trick. Just something fun for me to do and learn while I go.

    Would it be of any use or should I not upload it?
     
  17. Offline

    timtower Administrator Administrator Moderator

  18. Offline

    Nuinbot

    Well, you might want to make your own thread, as this is slightly off-topic. However, now that you mention it, this is how it should go...
    • Create a block placement sequence detection
    • Sequence:
      1. piston or sticky piston
      2. TNT
      3. lever or redstone torch
    • If these three happen consecutively, give the player a one-time warning "X-ray is forbidden on this server! Stop now!" (and possibly break the TNT block at the player's head)
    • If they do it again, ban the player with the reason "Banned for using vanilla x-ray!"
    Thanks much! I will check this out tomorrow morning as I have to get up early.
     
    timtower and AndyMcB1 like this.
  19. Offline

    timtower Administrator Administrator Moderator

    Do you like the plugin? Is it working fine?
     
    Nuinbot likes this.
  20. Offline

    Nuinbot

    It is working exactly as I expected it to. Thanks much!
     
    timtower likes this.

Share This Page