floh22 / LeagueBroadcast

League of Legends Spectate Overlay Tools
MIT License
219 stars 46 forks source link

[BUG] Could not convert string 'TalentReaperItem' to dictionary key type 'System.Int32' #196

Closed TheD4nM4n closed 1 year ago

TheD4nM4n commented 1 year ago

Describe the bug LeagueBroadcast immediately crashes upon launch with the error below: Could not convert string 'TalentReaperItem' to dictionary key type 'System.Int32'. Create a TypeConverter to convert from the string to the key type object. Path 'data.TalentReaperItem'.

To Reproduce Steps to reproduce the behavior:

  1. Launch LeagueBroadcast

Expected behavior The app would load.

Material Crash-2022-11-01-20-38.log Log-2022-11-01-20-38.log

Desktop (please complete the following information):

Nanovic30 commented 1 year ago

Hello there ! I have exactly the same issue as you, I hope it will be fixed soon because this feature seems to be incredible and I can’t wait to use it haha

Huncrysio commented 1 year ago

Same issue here

ruuffian commented 1 year ago

I read through the logs since I am having the same issue, and it looks like the program is crashing when trying to check data dragon for the latest patch. Does your log have something like this as well? image

Nanovic30 commented 1 year ago

I think we’re all having the same issue, my log is exactly the same as yours Maybe 12.21 made something wrong with the process, I thought that only offsets needed to be updated for each patch but it seems to be different there (but I can be wrong)

ruuffian commented 1 year ago

From my extremely limited experience with DataDragon, it is not very consistent. I remember reading somewhere in the Riot documentation that DataDragon can experience undocumented changes/things not working randomly- might not be a quick fix.

TheD4nM4n commented 1 year ago

I read through the logs since I am having the same issue, and it looks like the program is crashing when trying to check data dragon for the latest patch. Does your log have something like this as well? image

I linked the logs above in the original report, and those logs line up with yours. As per @ruuffian's response, it seems DataDragon may have been updated and it's structure changed. I would love to look into the structure and see what is going on.

TheD4nM4n commented 1 year ago

Upon research into the item.json file within the latest DataDragon patch, I can see the problem. TalentReaperItem is a structure within the data structure, and it does not follow the original naming convention with the rest of the items in the structure. The rest of the items have a numerical key, and this one does not. This isn't the only issue with this entry, because the name, description, colloq, and plaintext keys all have empty strings within their values.

Example: TalentReaperItem

ruuffian commented 1 year ago

Is there an easy fix to this to just ignore TalentReaperItem in the line that parses the data? I'm not familiar with c++, but the error in the crash report says the issue is here: https://github.com/floh22/LeagueBroadcast/blob/v2/LeagueBroadcast/Common/Data/Provider/DataDragon.cs Line 137

TheD4nM4n commented 1 year ago

I see two possible paths ahead. We could either force DataDragon to use last patch's ddragon, which is only a bandaid until Riot (hopefully) fixes this issue, or make LeagueBroadcast work around it like you said. I see the issue, it's pretty obvious what the issue is with the fact that C# is trying to cast "TalentReaperItem" as an integer. So I can attempt to check out what I can do to fix it. I am also by no means a C# master.

ruuffian commented 1 year ago

I fiddled around with the data dragon patch, but any patch that wasn't 12.21.1 or latest resulted in 404's for every champion's assets. You can change it by going into Config/Component.json and changing the patch value. Also, I identified this as c++ and not C# so that should tell you how much help I will be here 🤣

TheD4nM4n commented 1 year ago

I fiddled around with the data dragon patch, but any patch that wasn't 12.21.1 or latest resulted in 404's for every champion's assets. You can change it by going into Config/Component.json and changing the patch value. Also, I identified this as c++ and not C# so that should tell you how much help I will be here 🤣

Actually, after changing the patch to 12.20.1, the app works. For now I guess we wait.

ruuffian commented 1 year ago

Have you checked your log/tried to run it with a game? When I did that, the log had a bunch of 404 for all the DDragon calls and the app could not find the correct champion data.

floh22 commented 1 year ago

New build should adress this issue. Local testing on the new patch seemed to work.