Commit Graph
622 Commits
Author SHA1 Message Date
Mahagon a9ff27a2a0 fireball logging did not work with 1.8 2015-02-16 19:30:44 +00:00
Philip Cass c3f5ce9a5b Get the UUID column when summing by players 2015-02-16 15:25:02 +00:00
Philip Cass 7e49094699 Revert "Reduce UUID migration batch size. Fixes #576"
As per https://github.com/LogBlock/LogBlock/issues/576#issuecomment-74503498 the limit is confirmed at 100 names per request.

This reverts commit b3977d3e00.
2015-02-16 14:13:43 +00:00
Philip Cass b3977d3e00 Reduce UUID migration batch size. Fixes #576 2015-02-15 21:59:37 +00:00
Philip Cass e07038acee Missed version bump 2015-02-15 03:06:55 +00:00
Philip Cass 050a17506a UUID migrration fixes
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
2015-02-15 02:50:12 +00:00
Philip Cass 543c55e32b Merge pull request #574 from frymaster/uuid
UUID integration
2015-02-14 14:11:50 +00:00
Philip Cass e3dc430931 Identify players by UUID and migrate existing databases to include this. Fixes #538, fixes #568
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.
2015-02-14 14:01:21 +00:00
Ammar Askar 6e12d159b4 Verbose logging for PreparedStatements 2015-02-08 16:34:46 +05:00
frymaster d7f2ac5a65 Merge pull request #506 from DarkArc/1_7_2
Updated Smart Logging for 1.7.2 and resolved a bug with door logging
2014-01-20 02:16:41 -08:00
Philip Cass 05fe4f2144 Move null check in tool code one level out. This means it will guard against trying to use worldedit for querying double chests when worldedit is not loaded. Fixes #511
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.
2014-01-15 14:06:27 +00:00
frymaster 6902ffb373 Merge pull request #516 from frymaster/worldeditor-changes
Improvements to checks for inventory blocks and double inventory blocks
2014-01-14 02:56:12 -08:00
Philip Cass bbe7989878 Improvements to checks for inventory blocks and double inventory blocks
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()
2014-01-14 10:51:47 +00:00
bm01 4519c79e68 Made "trapped chest" content rollbackable 2013-12-16 14:54:40 +00:00
Dark Arc 3cffeccedb Updated Smart Logging for 1.7.2 and resolved a bug with door logging 2013-12-09 15:32:09 -05:00
Philip Cass 0c5fbd7fff Replace overlooked getByte calls with getShort for itemdata. Fixes #508 2013-12-09 09:32:47 +00:00
frymaster cb5741dd73 Merge pull request #505 from frymaster/itemdata-expansion
Allow for logging of item data greater than 256.  Fixes #96, #235
2013-12-05 02:19:34 -08:00
Philip Cass 0d5607be43 Update PR for new version number 2013-12-05 08:42:20 +00:00
Philip Cass 9e1fc1f9a1 Merge branch 'master' of https://github.com/LogBlock/LogBlock into itemdata-expansion
Conflicts:
	src/main/resources/plugin.yml
2013-12-05 08:40:42 +00:00
md-5 28b4c2f60c Bump to release 1.80 2013-12-05 13:26:03 +11:00
Philip Cass 38e1c6059f NBT (and Java) shorts are signed 2013-12-04 11:52:00 +00:00
Philip Cass 2ff6da183b Use modern column widths if upgrading from very old version 2013-12-04 11:34:25 +00:00
Philip Cass c0b983e8e8 Allow for logging of item data greater than 256. Fixes #96, #235
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.
2013-12-04 11:29:02 +00:00
Philip Cass d50c48f79d Check sign text is being logged before attempting to update table 2013-12-04 09:45:38 +00:00
Philip Cass d055d2af86 Increase width of kill table coordinate fields to mirror the block table increase 2013-12-04 09:32:36 +00:00
frymaster 8d820783a1 Merge pull request #499 from frymaster/nonentity-kill-logging
Implement logging for environmental (non-entity) kills
2013-11-19 05:50:06 -08:00
Philip Cass fa9a86a3b9 Implement logging for environmental (non-entity) kills, such as suffocation. Adds #80
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)
2013-11-13 14:28:42 +00:00
Philip Cass ab53755eaf Typo in config error message 2013-11-13 12:00:22 +00:00
Philip Cass 459a95fd1e Merge remote branch 'origin/master' 2013-11-12 13:23:05 +00:00
Philip Cass eb84fd1380 Various minor improvements to querying and logging
- 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
2013-11-12 13:08:52 +00:00
Philip Cass 8c9f78a985 Enchance inventory access log output message
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
2013-11-11 16:03:16 +00:00
Philip Cass 6992a4ffa8 Enchance inventory access log output message
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
2013-11-08 10:32:13 +00:00
frymaster b403e49168 Merge pull request #495 from frymaster/chest-access
Expand chestaccess querying
2013-11-08 01:00:59 -08:00
Philip Cass 6025469dfa Expand chestaccess querying
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.
2013-11-07 13:51:02 +00:00
frymaster d7862e4fa6 Merge pull request #493 from frymaster/set-text-type
Minor database change and query change
2013-11-07 01:40:05 -08:00
Philip Cass 7ac35e4698 Alter INSERT IGNORE queries to workaround innodb auto increment behaviour
An INSERT IGNORE query will still increment when using innodb, even if no row is inserted.  We can work around this by using a slightly convoluted query, but this only works if the table is non-empty, so also check for that on startup and create a dummy record if necessary.
2013-11-06 10:45:13 +00:00
Philip Cass c117bcd854 Minor database change
- Text fields should be UTF-8. Fixes #491
2013-11-06 09:27:00 +00:00
md-5 97be730fa8 Maven deploy 2013-10-18 07:36:21 +11:00
md-5 05916798cf Merge pull request #487 from afistofirony/patch-1
More specific information when no params/args specified
2013-10-10 16:25:23 -07:00
Sahir 3c75ed1cbb More specific information when no params/args specified
This commit adds the ArrayIndexOutOfBoundsException to onCommand's exception-catcher. This is so the user gets more specific information than "Error, check server.log" when they don't give any arguments.
2013-10-10 19:19:39 -04:00
md-5 e4a42dcc1b Merge pull request #484 from socram8888/master
Added logging of Locked Chest decay
2013-09-26 05:17:59 -07:00
Marcos Vives Del Sol aa09891f21 Added logging of Locked Chest decay 2013-09-26 13:16:22 +02:00
Ammar Askar 044863bc3d Merge pull request #428 from frymaster/death-event
Use alternate method of logging deaths. Fixes #350
2013-08-21 06:39:36 -07:00
Ammar Askar b7398bfde1 Re-organize task to be run onEnable, should fix #468 2013-08-08 19:10:09 +05:00
Ammar Askar aa78a2958c Merge branch 'master' of github.com:LogBlock/LogBlock 2013-08-08 18:47:28 +05:00
frymaster ac82d8848b Use alternate method of logging deaths. Fixes #350 2013-08-06 00:05:56 +01:00
Ammar Askar 10cbb51cb1 Merge pull request #378 from DerFlash/fixPlayerMax
Fix SMALLINT only allowing 65535 players to log
2013-08-05 12:44:19 -07:00
Ammar Askar f9052e0afc Merge pull request #440 from DarkArc/1_6_1
Updated Smart Logging for MC 1.6.1
2013-07-02 15:26:57 -07:00
Dark Arc 13d8498709 Moved a check to ensure players could still place the TB in a world which isn't logged 2013-07-02 17:29:39 -04:00
Dark Arc 2a2079c1a3 Updated Smart Logging for MC 1.6.1 2013-07-02 17:24:27 -04:00