watson icon indicating copy to clipboard operation
watson copied to clipboard

Add Insight support

Open ams2990 opened this issue 11 years ago • 16 comments

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.

ams2990 avatar Nov 24 '13 06:11 ams2990

(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.

totemo avatar Nov 24 '13 08:11 totemo

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? 

ams2990 avatar Nov 24 '13 17:11 ams2990

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.

totemo avatar Dec 03 '13 10:12 totemo

I don't see the point in milliseconds, if you do that you may as well work on worldticks.

ryantheleach avatar Dec 04 '13 14:12 ryantheleach

Sauce.

totemo avatar Feb 02 '14 04:02 totemo

?

ams2990 avatar Feb 02 '14 04:02 ams2990

Heh. Yeah I could have phrased that better. :)

Is there a public repo for Insight yet?

totemo avatar Feb 07 '14 19:02 totemo

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 avatar Feb 08 '14 08:02 ams2990

@ams2990 welcome to the ~~dark~~ UI side.

indiv0 avatar Feb 11 '14 23:02 indiv0

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 instead across world and world_nether, and if three worlds are queried it is across 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, and Water for their respective blocks as well as Nature for things like ice melting and Lightning for lightning strikes.
  • The action. The common verbs to see here are broke, placed, inserted, and removed.
  • 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 over wood the hover text could say Spruce Wood Planks, or for potion 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.

ams2990 avatar Jul 25 '14 03:07 ams2990

Colorized version: http://i.imgur.com/2Nlxzbj.png

ams2990 avatar Jul 30 '14 19:07 ams2990

And it's on GitHub! https://github.com/MinerAp/insight-parent

ams2990 avatar Aug 17 '14 01:08 ams2990

Fair enough. I'll look into it.

totemo avatar Aug 17 '14 09:08 totemo

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.

ams2990 avatar Aug 29 '14 19:08 ams2990

Any update on this?

ams2990 avatar Sep 29 '14 18:09 ams2990

Is this still on your roadmap?

ams2990 avatar May 20 '15 15:05 ams2990