watson
watson copied to clipboard
Add Insight support
I'm in the middle of writing a logging plugin which I've named Insight. I've opened this issue now to get an idea of what output or hooks you'd need for optimal Watson integration.
(In the absence of a universal logging API that adapts all logging plugins... ;-))
Watson scrapes information about edits from query and inspector tool results out of chats returned to the client. The particular things that Watson needs to see are:
- x, y and z coordinates
- block type, or old and new types if a replacement of a one block with another is reported as a single event.
- action (creation/destruction)
- player name
- world if not the current world
- time stamp
Of these, the time stamp has the most exacting requirements. It needs to have a resolution on the order of seconds in order to display meaningful information about the sequence of events - the vectors drawn between consecutive edits. Ideally, absolute time stamps make it easiest for Watson, but I have been known to take a stab at dealing with relative time ones.
Would millisecond precision benefit you at all? I currently discard the millisecond portion of all dates but it would be a trivial change to not do that.
Beyond that change, it looks like I'm in good shape. Would you be interested in adding a side-channel communication mechanism similar to what WorldEdit's CUI does, so you wouldn't have to scrape the text output?
Milliseconds would probably help a little but seconds are sufficient.
Doing a universal log API with a custom plugin channel is on my wish/todo list.
I don't see the point in milliseconds, if you do that you may as well work on worldticks.
Sauce.
?
Heh. Yeah I could have phrased that better. :)
Is there a public repo for Insight yet?
No, not yet. I hadn't planned on doing so until it was feature complete minus rollbacks, which was my alpha target. Being a systems guy, I started from the backend and am working my way forwards. All of the logging and querying has been working for a few weeks from a programmatic perspective. I'm almost done writing the grammar for the user-query parser, and then I get to do the part that you actually care about but I've been dreading the most, the UI.
I hate UI.
@ams2990 welcome to the ~~dark~~ UI side.
I apologize for leaving this open for so long. I've got the structure of the UI down. Only thing to do now is colorize it a little bit. All information is encoded in json. This allows me to make use of the client's mouse-hover event to display information without overly cluttering the chat bar.
For any lookup, the header follows the following rules:
- The first two words are
Examining changes
- If only one block was queried, the next comes
at <2, 4, -12>
- If only one world is queried, next is
in world_nether
. If two worlds are queried, it is insteadacross world and world_nether
, and if three worlds are queried it isacross world, world_nether, and world_the_end
. Obviously, if there are more than three worlds, we just keep tacking things on to the comma-seperated list. - We then get a comma, followed by the pagination information:
, page 1 of 7:
. This is displayed even if there is only 1 page.
The logs follow the following pattern.
- The line number in square brackets. Numbering starts at 1. If the query involved more than one block, hovering over this gives the location, formatted in angle brackets as above.
- The date and time, with zero padding where appropriate:
07-24 22:54:57
- The name of the entity who did the action. Normally, this is a player or creature. However, I currently also have
Fire
,Lava
, andWater
for their respective blocks as well asNature
for things like ice melting andLightning
for lightning strikes. - The action. The common verbs to see here are
broke
,placed
,inserted
, andremoved
. - This field may not exist for all actions (i.e. actions like
died
). If the action acts upon a block, the name of the block is displayed here. If the action acts upon an entity, the name of the entity is displayed here. If the action acts upon an item, the quantity and material name are displayed, and mousing over the material name gives displays the item. For instance, if the player mouses overwood
the hover text could saySpruce Wood Planks
, or forpotion
it would display the full potion information.
Let me know if you have any questions. I'm mostly doing cleanup and testing at this point, so I should have it in a repo in a few weeks.
Colorized version: http://i.imgur.com/2Nlxzbj.png
And it's on GitHub! https://github.com/MinerAp/insight-parent
Fair enough. I'll look into it.
I changed the format slightly from what I specified above. Now, if there are multiple worlds the header says "Examining changes across N worlds", and hovering above "N worlds" gives you their names.
Any update on this?
Is this still on your roadmap?