SuperEvilMegacorp / vainglory-assets

Community provided art, schemas, and other assets that make using the Vainglory API easier
https://developer.vainglorygame.com
MIT License
54 stars 40 forks source link

Bug: HealTarget payload IsHero is sometimes -1, sometimes 0 #316

Closed schneefux closed 6 years ago

schneefux commented 6 years ago

needs documentation

  {
    "time": "2017-10-11T18:19:59+0000",
    "type": "HealTarget",
    "payload": {
      "Team": "Right",
      "Actor": "*JungleMinion_TreeEnt*",
      "TargetActor": "*Blackfeather*",
      "TargetTeam": "Right",
      "Source": "Buff_JungleMinion_TreeEnt_Restore",
      "Heal": 31,
      "Healed": 31,
      "IsHero": 0,
      "TargetIsHero": 1
    }
  },
    "time": "2017-10-11T18:20:01+0000",
    "type": "HealTarget",
    "payload": {
      "Team": "Unknown",
      "Actor": "Unknown",
      "TargetActor": "*Blackfeather*",
      "TargetTeam": "Right",
      "Source": "Buff_JungleMinion_TreeEnt_Restore",
      "Heal": 31,
      "Healed": 31,
      "IsHero": -1,
      "TargetIsHero": 1
    }
PierreAndreis commented 6 years ago

https://github.com/gamelocker/vainglory-assets/pull/308

PierreAndreis commented 6 years ago

To be more clear: This is INDEED a bug. But it was the reason heal target has been blocked for so long. Work around was to set isHero as -1 for all unknown targets. The best fix to that requires refactor of some code that it won't be happening anytime soon

schneefux commented 6 years ago

Why isn't it 0 like in every other event?

Why doesn't the api shim this data? A find/replace is what I have to do in my code now, it should happen on a higher level though

PierreAndreis commented 6 years ago

Because the actor is unknown. Other events you have the actor which is clearly not a hero, while on this one you don't know

schneefux commented 6 years ago

It's clearly not a hero. If it was a hero, the actor was a hero. A boolean only has two states, and if the source is not a hero, the source is not a hero. 🤔 😄

So any overtime heal has the source unknown / IsHero-1?

schneefux commented 6 years ago

It's clear to me that it's from a minion — as you can see in the source — so IMHO this should be patched at MadGlory's level if it is not possible to do so at SEMC's. Because otherwise I have to do it, and it's not an API client's responsibility to parse data source bugs.

PierreAndreis commented 6 years ago

on SEMC side, isHero is not a boolean. The name is maybe misleading. Its an integer