Philip Cass 6a38708a32 Merge identically-formed db INSERT rows into a single batch statement
This increases insert speed by up to 6 times when the DB server is on the same
box as the minecraft server, and many HUNDREDS of times when it is accessed via
a network connection.

This creates a new kind of BlockRow which is a collection of many similar rows, each
of which uses the same PreparedStatement.  As such, when asked to run, it can
use the executeBatch() method.  It also adds code to BlockRow to see if they are mergeable
(it won't if they have sign or chest actions associated) and to merge two rows into one of
these new objects.  The consumer processing loop is altered to check for merges, and do so if
possible.

Also, prevent consumer race condition on shutdown

On shutdown, LogBlock invokes the consumer's run() method up to twn times on
the main thread.  However, the consumer may still be running from the last
scheduled task, and this could result in two threads running the run() code
simultaneously, resulting in inconsistent row insertion order.

Another scenario is that the consumer has just started processing the last
row in the queue.  With the queue empty, the server will terminate, but the
consumer could still not have fully executed the databse query.

To solve this, the run() method is syncronized, so it can only be run on the
object by one thread at a time, and is made to run at least once (to force LB
to wait on any already processing run)

Also, the pause between consumer runs was altered to be in ticks (50ms) rather than
in seconds, to prevent needless pauses between runs.

Fixes #580 Fixes #56
2015-03-02 20:12:49 +00:00
2012-11-02 13:30:07 +05:00
2010-12-18 14:49:45 -07:00

LogBlock

This plugin logs block changes such as breaking, placing, modifying, or burning to a MySQL Database. It can be used as an anti-griefing tool to find out who made a particular edit, or even roll back changes by certain players. Originally written by bootswithdefer, for hMod, ported to Bukkit by me, because of the inability to identfy griefers. BigBrother also did't work, so I was forced to do it myself. The honor belongs to bootswithdefer for the sourcecode, I only spent about 8 hours to transcribe. All functions except sign text logging shold work as in hMod. The use of permissions plugin is possible, but not necessary.

Questioner: http://git.io/u2MxKQ

S
Description
Logs blocks.
Readme
3.4 MiB
Languages
Java 100%