Currently will search only using block type ie searching for prismarine_brick
will search for all prismarine blocks
Also removed pluralisation of prismarine_brick
- Print warning if the pre-existing file doesn't contain one of the new names
- Make name lookup in plugin startup to force the MaterialName static code to be run
What MySQL calls "UTF8" is actually a subset of the full unicode specification.
It doesn't accept 4-byte UTF-8 characters. Proper support is called "utf8mb4"
and is, these days, fairly common (Ubuntu 10.04LTS's bundled MySQL does not
support it, but later ones do)
Detection of utf8mb4: "SHOW CHARACTER SET WHERE charset='utf8mb4';" returns at
least one row
Conversion of pre-existing DBs: this was easy, we already had code in the
updater for this for when we started enforcing utf8. It was version-bumped and
set to update to either utf8mb4 or utf8, depending
Making it use utf8mb4 in the database connection: Actually hard. Connector/J
5.1.13 or newer should autodetect this, but in my testing it didn't
(http://dev.mysql.com/doc/relnotes/connector-j/en/news-5-1-13.html)
As such, if utf8mb4 has been detected, I've added code that should manually
execute "SET NAMES utf8mb4;" on all new connections.
If a database does not support utf8mb4 (rare these days) I've added code to
strip these characters before DB insertion; they won't be recorded correctly,
but it'll avoid the exception from issue #535
Firstly, remove incorrect unique index on playername (and UUID, just in case) columns, and add a non-unique index on the UUID column
Secondly, account for setups not logging onlinetime - in that case, try to look up ALL names, and give any not found the log_ prefix rather than the noimport_ prefix
This creates a new column in the lb-players table called UUID. If this is in the form of a UUID,
it's assumed to be a player. If not, it's assumed to be a server entity (zombie, sheep, or
WaterFlow, LavaFlow etc.). LogBlock will set the UUID of entities to "log_" plus their name
(i.e. log_zombie or log_sheep)
To assist this is a new class Actor, which wraps a name/UUID pair, with constructors that will
generate one from server entities, or SQL results. Every listener and every class in Consumer
needed to be updated to deal with this
As of yet, only the playername is displayed in results (although the queries do return UUID data).
Similarly, you can only query by name (the database stores the last name they have logged in as).
In addition, the WorldEdit hook has been disabled (is not compiled) since LB needs to be updated
to use their new API, and the LB code hook has to extract UUID information for insertion.
The UUID importer assumes any player with an onlinetime of 0 is a server-generated source, and set
the UUID as above (log_sheep etc.). For everything else, it sends 100 names at a time to Mojang's
name->UUID service, and records them if available. If no result is found, it records their UUID as
noimport_theirname. As this is more likely than other updates to be interrupted mid-way, the
importer is tolerant of e.g. the column already being added, and will resume where it left off.
Long-term, perhaps rather than using a worldedit object directly, we should use our own interface which supports similar methods and have two implementations, one which uses a worldedit selection and one which takes two corner coordinates for use in double chests. That might also allow for custom queries along those lines.
These commits replace all checks of the form type == someInventoryBlockId || type = anotherOne
with a call to getContainerBlocks().contains(Material.getMaterial(type))
This was done by searching the code for 54 which is the chest ID.
Remaining explicit mentions of id 54 are in regards to special-casing for double chests -
the code there has been expanded to also consider id 146, the trapped chest.
I didn't think it worth making a collection for double-block inventories, but if more are
added it should be considered - looking forward, this might be necessary when the mod API
comes in, assuming we have a way of figuring out what double inventories are anyway.
This fixes many blocks not having inventories logged when destroyed due to explosions,
or not being rollbackable, and tools not querying both sides of double trapped chests.
Rolling back e.g. a furnace is glitchy - the fuel, raw material and product do not get
placed in the correct slots.
- Update list of container blocks
- Make tool treat trapped chests as potential double chests
- Replace explicit id checks with a call to getContainerBlocks()
This change involves refactoring many instances of "byte" to "short and altering a few ItemStack calls to use the int,int,short form instead of int,int,0,byte
Significantly it also involves altering the MaterialName system to allow shorts instead of bytes, and altering the rawdata() function to return the durability of an ItemStack rather than the data value of its Material.
One side effect of this is that tool durability is now logged, which will make for more accurate rollbacks.
This change adds a new config option, logEnvironmentalKills. When set to true,
Logblock will record entity deaths not directly caused by another entity.
(for example, suffocation, or burning to death)
- Allow use of "both" as a query parameter. This will search for created and destroyed blocks, but not chestaccess. This is useful for situations where the query defaults to "all" e.g. rollbacks. Fixes#210, #252
- Add block negation query parameter. Like with player names, you can now precede a block name with "!" to query for all except the specified blocks. Fixes#452, #216
- Allow use of area parameter with location parameter, as long as location is specified first. Fixes#458
- Better error when asking for kill log without world specified
- Don't try to process events where the block is null. Fixes#463
- Replace problematic characters in world names with underscores when deciding on a default table name. Fixes#409
- Adjust for cocoa beans having reversed attachment direction in smart logging
- Prevent out of bounds exception if a single-word timespec ends in a number. Fixes#354
- Prevent error when specifying a killer or victim in a teleport lookup. Fixes#333
As there are more inventory types now, it is worthwhile including the inventory name in the output
e.g:
11-07 20:47:15 frymaster took 64x iron ingot from furnace
11-07 13:42:14 frymaster put 1x iron ingot into beacon
As there are more inventory types now, it is worthwhile including the inventory name in the output
e.g:
11-07 20:47:15 frymaster took 64x iron ingot from furnace
11-07 13:42:14 frymaster put 1x iron ingot into beacon
Make a decison on whether or not to return chest access data based on the
BlockChangeType (ALL or CHESTACCESS) rather than partly on the block parameter
as these are the only two query types that don't enforce type != replaced
This is helpful because the list of blocks to request chest access for was
outdated and is duplicated in 3 different places, whereas the new method
will return whatever results have been logged regardless of type.
In addition, if the query type is CHESTACCESS (but not ALL), we can use
an alternate query that is vastly more efficient. In tests (26 million
row log table, 400,000 row chest table) the query time for all chest results
was reduced from 30 seconds to 3.
Allows the chestaccess parameter to return data from the following inventory types:
- Brewing stand
- Trapped chest (fixes#483)
- Dropper
- Hopper
- Beacon
Note that this only affects lookup of logged items; the logging process has not
been touched, so #433 and similar have not been addressed
Also, update the list of valid container types, which will improve logging of
broken containers.