m-h-c-t / mh-helper-extension

A Chrome / Firefox browser extension that helps collect data for HitGrab's MouseHunt game
https://www.mhct.win
MIT License
14 stars 15 forks source link

map rare dust drop rate is broken #61

Open logicalup opened 5 years ago

logicalup commented 5 years ago

since we don't record when map doesn't drop anything, the rare dust drop rate is 100%

DB CLEANUP IS REQUIRED AS A PART OF THIS TICKET BEFORE THIS TICKET CAN BE CLOSED

AardWolf commented 3 years ago

We know a thing is opened but since there are no items returned we don't do anything with it.

use_convertible.php is called with item_type=treasure_map_scroll_case_convertible. With no dust I only see this in the items high level object:

  "items": {
    "treasure_map_scroll_case_convertible": {
      "item_id": "921",
      "type": "treasure_map_scroll_case_convertible",
      "class": "convertible",
      "name": "Relic Hunter Scroll Case",
      "description": "This ornate scroll case has a heavy feel to it. Who knows what untold riches the scroll inside will lead to?",
      "quantity": 1,
      "thumbnail": "https:\/\/www.mousehuntgame.com\/images\/items\/convertibles\/638ae2329960ad40fce6b3b7495b919d.gif?cv=246",
      "num_owned": 11
    }
  }

Need an example when someone gets dust.

AardWolf commented 3 years ago

Potential clues on discord - message_model will have empty items for no dust: https://discordapp.com/channels/275500976662773761/355474934601875457/765240185369264148

AardWolf commented 3 years ago

We talked about a few options. The "best" would be to submit the convertible even with an empty list of IDs. This would account for anything that can be opened and sometimes drops nothing.

The changes would been to be made in the extension to stop checking for message.messageData.items.length === 0 here on line 487 -- or at least handling that case.

In convertible_intake.php allowing empty items through and in that case inserting a row into convertible_items with a null item_id.

In the converter page's SQL to do an outer join on the item table.

The event that aggregates the data appears to be fine with a suddenly null value there. The column does need to be altered to be nullable.

AardWolf commented 3 years ago

We can address this and #62 at the same time!

When a scroll is opened (see above) we have to collect what type of map is opened. This is item 1 as a result of the convertible. It'll need an id so we need to see if one is provided or if we'll have to fudge them. (or fix intake to make up ids if one isn't provided and it's a new result). We can add map dust as item 2 when it exists as a result.

logicalup commented 3 years ago

Db cleanup of old dust data is required