LogBlock - Find and Backroll those Damn Griefers
Description:
LogLock logs block changes into a MySQL database. Block changes can be placed or destroyed block, explosions, burned blocks, sign text changes, chest access, leaves decay etc.
It can be used as griefer identification tool, to find out who build a particular building, or even roll back changes by certain players. Other purposes can be r.g. undoing of forest fires
All additional features are optional, to keep the database as short as possible. Nearly all database actions run in their own threads to avoid server lags.
The use of
permissions plugin (or any clone) is possible, but not necessary.
Originally written by
bootswithdefer for hMod
Video tuorial for old hMod LogBlock on Youtube
MySQL tuorial
LogBlock installation tutorial (Ger)
Commands:
Parameters in brackets [] are required, the ones in <> are optional.
/lb |
Displays players and number of blocks they've modified within default-distance blocks around you |
/lb world |
Displays global block count for all players. Actually an alias for "/lb area 32767". |
/lb area [radius] |
Like "/lb" but displays within [radius] distance instead of default-distance |
/lb player [name] <radius> |
Displays count of blocks for one player within radius or default-distance blocks around you |
/lb block [type] <radius> |
Displays players who chaged type (may be number or name) blocks within radius or default-distance blocks around you |
/lb rollback player [name] <time> <minutes|hours|days> |
Rolls back a player's edits |
/lb rollback area [radius] <time> <minutes|hours|days> |
Rolls back all changes within radius for the specified time |
/lb rollback playerarea [name] [radius] <time> <minutes|hours|days> |
Rolls back a player's edits within radius |
/lb rollback selection <time> <minutes|hours|days> |
Rolls back all changes in a WorldEdit selection. This requires WorldEdit. |
/lb me |
Displays your block created/destroyed counts. Actually an alias for "/lb player yourname". |
/lb writelogfile [player] |
Write all action from player into a log file to "/plugins/LogBlock/log". The layout is similar to the message from the wood pickaxe. If no results were found, the og file will be empty |
Configuration:
In "/LogBlock/config.yml":
driver |
Database driver |
url |
JDBC url for database |
username |
Database username |
password |
Database password |
delay |
Maximum time between transaction runs (seconds) |
tool-id |
Right click with this tool to check block history (default wood pick) |
tool-block-id |
Place this block to check block history (default adminium) |
tool-block-remove |
Automatically remove the tool block on use (default true) |
default-distance |
Default distance used in /lb commands |
default-time |
Default time used in /lb rollback commands |
usePermissions |
Toggles if LogBlock uses the Permission Plugin |
keepLogDays |
Deletes log on each serverstart that is older than days to shrink the db. -1 to disable. |
worldNames |
Names of the worlds you want to log. Seperate with ",", brackets are neccessary. First world usually names "world". Example: "worldNames : [world, nether]" |
worldTables |
Tables, where you want to have the log. Seperate with ",", brackets are neccessary. Must specify a table for each world listed under worldNames. You can use the same table for each, but this doestnt make much sense. |
logSignTexts |
Toggle logging of sign texts. (without |
logExplosion |
Toggles logging of tnt and creeper explosions. Currently logged as player "environment". |
logFire |
Toggle logging of burned blocks. Currently logged as player "environment". |
logChestAccess |
Toggle logging of chest access. Currently logs only who opened a chest. |
logLeavesDecay |
Toggle logging of leaves decay. Works only with standart leaves decay. Currently logged as player "environment". |
logTNTExplosionsAs, logCreeperExplosionsAs, logFireAs, logLeavesDecayAs |
The names, environment actions are logged as. To use the old behavoir set them all to "Environment". The names can be changed, this won't break the log. |
In "/Permissions/config.yml" (Permissions v2.0) resp. "/Permissions/%worldname%.yml" (Permissions 2.1):
'logblock.lookup' |
Lookup block history with woodpickaxe or bedrock block |
'logblock.me' |
Access to "/lb me" command |
'logblock.area' |
Access to "/lb area", "/lb player", "/lb block" and similar commands |
'logblock.rollback' |
Access to "/lb rollback" and "/lb writelogfile" commands |
Installation:
- Make sure you have a MySQL server. 1 data base is enough.
- Download the mysql-connector-java-bin.jar at place it in the same folder as craftbukkit.jar.
- Know the names of the worlds you want to know. The first world is normally called "world".
- Download the config and place it at "/plugins/LogBlock/", open with an editor and enter the path to your MySQL db (localhost in most cases), the name of the db, user and pass. Change the world name(s) if needed, and table name(s) if wanted. Don't use exotic characters.
- Enable the additional features for logging explosions, burned blocks, sign texts or chest access, if wanted. Enabling results in a larger db.
- Download the plugin itself and put it in the plugins folder.
- Restart your server.
How to Find a Griefer:
-
Someone destroyed your house:
Grab a woodpickaxe or a bedrock block (whatever you have available) and either place the bedrock instad of one of the griefed blocks or place an block there and clock it eith the woodpickaxe and you know who grefed your house.
-
Someone burned down your house:
Go inside, type "/lb block fire" and you get a list with all player that tried to light your house.
-
Someone blowed up your house:
Go inside, type "/lb block tnt" and you know whou placed it there.
Changelog/Downloads:
Source code at GitHub
When you are updating over multiple versions, you have to run the SQl tables update for each version.
mysql-connector-java-bin.jar Required, put this in the same folder as craftbukkit.jar
SQL tables Only in case that you have troubles with auto table creation
BB -> LB converter (broken) In case you are switching from BB to LB and want to keep you log
Default config In case you dont want to restart you server for auto config cretation.
-
LogBlock v0.9d (Mar. 26, 2011)
Works with CraftBukkit recommended build #556 and WorldEdit 4.2
- Removed command "/lb rollback cuboid"
- Removed command "/lb setpos"
- Added command "/lb rollback selection", wich uses WorldEdit selections
- Fixed rollback crashes (finally!)
-
LogBlock v0.9c (Mar. 18, 2011)
Works with CraftBukkit recommended build #556
- Fixed rollback for destroyed air blocks
- Fixed block history showing too many blocks
-
LogBlock v0.9b (Mar. 17, 2011)
Works with CraftBukkit recommended build #556
- Added command "/lb writelogfile"
- Fixed rollback crash during large rollbacks
-
LogBlock v0.9 (Mar. 17, 2011)
Works with CraftBukkit recommended build #531
- Added command "/lb me"
- Added permission "logblock.me"
- Rewrote queries for "/lb area" and "/lb player". The result is now ordered properly and not containing 0 where they don't belong.
- "/lb area" executes four times faster
- Splitted up the pseudo player environment to 4 renameable subsets
-
LogBlock v0.8 (Mar. 13, 2011)
Works with CraftBukkit recommended build #531
- Fixed player rollback
- Moved clearlog to an own thread (faster start-up)
- Added playerarea rollback
- Added leaves decay logging
-
LogBlock v0.7c (Mar. 12, 2011)
Works with CraftBukkit recommended build #527
- Fixed table auto creation
- Fixed log cleaning (-chest and -sign tables are also cleaned now)
-
LogBlock v0.7b (Mar. 11, 2011)
Works with CraftBukkit recommended build #527
SQL tables update
- Renamed table playres to lb-players to avoid conflicts
-
LogBlock v0.7 (Mar. 11, 2011)
Works with CraftBukkit recommended build #527
SQL tables update
- Shortend database (reduced by a half or even 2 thirds)
- Added chest logging
- Added option "logChestAccess" to config.
- Added option "logSignTexts" to config.
-
LogBlock v0.6 (Mar. 11, 2011)
Works with CraftBukkit recommended build #493
- Added "/lb rollback cuboid"
- Added "/lb setpos" to set the corners for an cuboid
- Made the time parameter for rollbacks optional
- Added a config entry for default rollback time (default 30 min)
- Added logging for soil, seeds and empty buckets
- Readded auto config creation
- Fixed displayed time format in block history (was 12h, now 24h)
- Fixed woodpickaxe permission
- Fixed a nullpointer exeption on startup, which could lead to "/reload" break
-
LogBlock v0.5d (Feb. 28, 2011)
Works with Bukkit build #465
- Fixed commands to work after Craftbukkit #454
- Renamed "/rollback" commands to "/lb rollback"
-
LogBlock v0.5c (Feb. 25, 2011)
Works with Bukkit build #432
- Rollback replaces fire now
- Fixed permission "logblock.area"
- Added a delay to rollbacks, so they don't overcharge the server
-
LogBlock v0.5b (Feb. 22, 2011)
Requires Bukkit build #53
- Added optional fire logging (and backroll)
-
LogBlock v0.5 (Feb. 22, 2011)
Requires Bukkit build #53 (who imagine these version numbers?)
- Added area rollback
- Optimized rollback performance
- Added optional explosion logging (and backroll)
-
LogBlock v0.4b (Feb. 20, 2011)
Requires Bukkit (Tested with 326)
-
LogBlock v0.4 (Feb. 19, 2011)
SQL tables update
Requires Bukkit (Tested with 326)
- Added added multiworld support
- Each world in a seperate table (update your config and tables)
- Added optional radius to "/lb player" and "/lb block"
-
LogBlock v0.3 (Feb. 17, 2011)
Requires Bukkit (Tested with 326)
- Added sign logging
- Added flint and steel logging (still no fire spread logging)
- Rollback can now replace water and lava
- Added garbage collector for old logs (keepLogDays in config)
-
LogBlock v0.2 (Feb. 16, 2011)
SQL tables update
Requires Bukkit (Tested with 326)
- Fixed multiworld mix up, but still no multiworld support
- Added block data, so woolcolor, log types, torch position, wheat growing status, lever staus etc are now also backrolled
-
LogBlock v0.1 (Feb. 16, 2011)
Requires Bukkit (Tested with 304 and 326)
FAQ:
I got an error: "[LogBlock] SQL exception [...]: Unknown database '[...]'". What should I do?
Either change the url in the config to an existing db or create a new one called like the unknown in error message.
I got an error: "[LogBlock] Exception while creation database connection java.lang.ClassNotFoundException: com.mysql.jdbc.Driver". What should I do?
Either you didn't place the mysql-connector-java-bin.jar properly or you changed the driver config entry badly.
Try redownloading the mysql-connector-java-bin.jar and place it in the same directory as craftbukkit.jar.
If this doesn't solve the issue, open the config and delete the whole line with driver.
I got an error: "[LogBlock] SQL exception [...]: Communications link failure Last packet sent to the server was 0 ms ago.". What should I do?
LogBlock can't create a connection to the database. Check your config.
I got an error: "Could not load plugins/mysql-connector-java-bin.jar in plugins: null". What should I do?
Make sure you placed the mysql-connector-java-bin.jar not in the plugins folder, it should be placed in the same directory as the craftbukkit.jar
I got an error: "java.sql.SQLException: near "AUTO_INCREMENT"". What sould I do?
This is the same error like Unkown database. See above.
Is it possible to log action from a editor like WorldEdit?
No. These editor change the world right in the server without firing the hooks.
LogBlock doesn't log what someone took from a chest, only "player looked inside"!
This feature is planned, but bukkit doesn't provide the hooks at the moment.
Future:
Undo rollback
Griefer detection
Known Bugs:
Doesn't runs well with BB at the same time for some reason
Can cause server crash when logging a huge tnt explosion. Disable explosion logging to avoid.
Screenshots:
none
Special Thanks:
to bootswithdefer for the original LogBlock source code
to skilinium for testing and bug reports
to Edward Hand for giving the solution to the rollback crashs