minj / foxtrick

FoxTrick is a browser extension for the Hattrick online football manager game, currently available for Firefox, Google Chrome, as well as for Opera.
https://www.foxtrick.org
GNU General Public License v3.0
69 stars 48 forks source link

[player-stats-experience] XP computation is broken since new Hattrick icons #1723

Open dominiquelee opened 5 months ago

dominiquelee commented 5 months ago

Short description of the problem

XP data fails to load when opening a player's performance history image

Any other relevant information. Is it a regression, when it worked/broke etc.

Match type recognition comes from https://github.com/minj/foxtrick/blob/3780cd4dbfca20ba14997bbba6cf58456d2939ce/content/information-aggregation/player-stats-experience.js#L219-L223 which reads the class name of the icon of the line.

This value is then compared to module.XP: https://github.com/minj/foxtrick/blob/3780cd4dbfca20ba14997bbba6cf58456d2939ce/content/information-aggregation/player-stats-experience.js#L46-L52

However, the class name has changed and is now always match-type-svg image

A potential fix would be to extract the .svg URL, remove the version part and use that as a new key in the array. Some examples of value are

dominiquelee commented 4 months ago

I had another look, thinking we could use a simple Image --> MatchTypeClass mapping, but it's actually not that easy:

SebM668 commented 3 weeks ago

@dominiquelee I sent a message to the CHPP staff, asking if this is how it will be going forward and if they have any suggestions. Worst case they'll tell me to go away, best case...

SebM668 commented 3 weeks ago

@dominiquelee I sent a message to the CHPP staff, asking if this is how it will be going forward and if they have any suggestions. Worst case they'll tell me to go away, best case...

What a waste of time that was. Basically, we do what we want, deal with it.