floh22 / LeagueBroadcast

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

[BUG] Crash on Startup #51

Closed brandonnly closed 3 years ago

brandonnly commented 3 years ago

Describe the bug App crashes on startup.

Something with the async controller I believe, but I don't know enough C# yet to understand it fully.

To Reproduce

Expected behavior App starts up.

Crash Log

--- LeagueBroadcast Crash Report --- 
Gotta fix this somehow... Up Up Down Down Left Right Left Right B A Enter... Nah, still broken

Time: 2021.07.24-11:29
Description: The type initializer for 'LeagueBroadcast.Common.Controllers.IngameController' threw an exception.

Stacktrace: 
   at LeagueBroadcast.Common.Controllers.IngameController..ctor() in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Controllers\IngameController.cs:line 42
   at LeagueBroadcast.Common.Controllers.BroadcastController.Init() in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Controllers\BroadcastController.cs:line 116
   at LeagueBroadcast.Common.Controllers.BroadcastController.<EarlyInit>b__35_0(Object s, EventArgs e) in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Controllers\BroadcastController.cs:line 72
   at LeagueBroadcast.Common.Data.Provider.DataDragon.Init() in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Data\Provider\DataDragon.cs:line 155
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

-- System Details -- 
League Broadcast Version: 1.4.55.21202
OS: Win 10 2009

Additional context

floh22 commented 3 years ago

Can you go to configs -> component and set LogLevel to 3, then post the normal log when this happens? It looks like it cannot find your League Install for some reason, though it should throw an error, not crash. Mind also sharing where your league is installed?

brandonnly commented 3 years ago

I see thats weird, my League install hasn't moved at all and it was working before.

It's installed at C:\Riot Games\League of Legends. I see that it's looking at an F: drive, but I don't even have one.

I set the log level to 3, here's the bottom half after it loads in the other config files:

[15-02-31] Config Component loaded
[15-02-31] Loading config watchers
[15-02-31] Watching PickBan.json for changes
[15-02-31] Watching Component.json for changes
[15-02-31] Watching Ingame.json for changes
[15-02-31] Log Level set to Verbose
[15-02-31] League Broadcast Version 1.4.55
[15-02-31] [Update] Checking for Updates
[15-02-31] [Update] Latest release version v1.4.55 vs. current version 1.4.55
[15-02-31] [Update] Local version up to date
[15-02-31] Using current Version
[15-02-31] Early Init Complete in 962.7647ms
[15-02-31] DataDragon Provider Init
[15-02-31] Getting latest versions from dataDragon
[15-02-31] Retrieving latest patch info
[15-02-31] Downloading https://ddragon.leagueoflegends.com/realms/euw.json
[15-02-31] https://ddragon.leagueoflegends.com/realms/euw.json downloaded
[15-02-31] Champion: 11.15.1, Item: 11.15.1, CDN: https://ddragon.leagueoflegends.com/cdn
[15-02-31] Downloading https://ddragon.leagueoflegends.com/cdn/11.15.1/data/en_US/champion.json
[15-02-32] https://ddragon.leagueoflegends.com/cdn/11.15.1/data/en_US/champion.json downloaded
[15-02-32] Loaded 156 champions
[15-02-32] Downloading https://ddragon.leagueoflegends.com/cdn/11.15.1/data/en_US/summoner.json
[15-02-32] https://ddragon.leagueoflegends.com/cdn/11.15.1/data/en_US/summoner.json downloaded
[15-02-32] Loaded 15 summoner spells
[15-02-32] Downloading https://ddragon.leagueoflegends.com/cdn/11.15.1/data/en_US/item.json
[15-02-32] https://ddragon.leagueoflegends.com/cdn/11.15.1/data/en_US/item.json downloaded
[15-02-32] Detected 222 items
[15-02-32] Loaded 117 full items
[15-02-32] Checking Local Cache
[15-02-32] Cache C:\Users\Brandon\Code\LeagueBroadcast-1.4.55/Cache/11.15.1 exists already
[15-02-32] DDragon loaded
[15-02-32] Loading PickBan Controller
[15-02-32] Loading Ingame Controller
[15-02-32] Checking League install for LiveEventsAPI
[15-02-32] Found League install location
[15-02-32] LiveEvents API found in Game config
[15-02-32] [WARNING] Could not parse game config. Replay API may not be enabled!
[15-02-32] Verifying LiveEvents list
[15-02-32] [WARNING] App Crash detected. Writing Crash report to CrashLogs\Crash-2021-07-24-15-02.log

Crash report says the exact same thing as before.

Also tried removing all other possible locations in the component.json: "LeagueInstall": ["C:\\"], is what it reads. Still happens, and still throwing F drive in the crash log.

floh22 commented 3 years ago

Ok. So it looks like its having trouble reading your game config. This shouldnt cause a crash, but I obviously overlooked something.

Can you try the following steps:

  1. Close both LB and the client
  2. Rename C:\Riot Games\League of Legends\Config\game.cfg to something like gamebackup.cfg or something of the sort.
  3. Start the client
  4. Start LB

This should reset your cfg and will probably reset some ingame settings, which is why you wanna keep the backup. If this works, mind sharing your game.cfg? It would interest me what changed which causes this issue

brandonnly commented 3 years ago

Have to do something now, so I will update tonight on if that fixes it. But if you think its the game.cfg

I only made two manual modifications which were for broadcast:

I added: EnableReplayApi=1 under [General] And I added [Spectator] eSportsNeutralTimers=1.

Here's the full file:

[General]
CursorOverride=1
EnableReplayApi=1
CfgVersion=11.15.388.2387
SystemMouseSpeed=0
WindowMode=2
Height=1080
Width=1920
WaitForVerticalSync=0
ShowGodray=1
MinimizeCameraMotion=0
BindSysKeys=0
HideEyeCandy=0
EnableLightFx=0
EnableCustomAnnouncer=1
AlwaysShowExtendedTooltip=0

[Spectator]
eSportsNeutralTimers=1

[Performance]
ShadowQuality=4
FrameCapType=2
EnvironmentQuality=4
EffectsQuality=4
CharacterQuality=4
EnableGrassSwaying=1
EnableFXAA=1
CharacterInking=1

[MapSkinOptions]
MapSkinOptionDisableWorlds=0
MapSkinOptionDisableURF=0
MapSkinOptionDisableStarGuardian=0
MapSkinOptionDisableSnowdown=0
MapSkinOptionDisableProject=0
MapSkinOptionDisablePopstar=0
MapSkinOptionDisablePoolParty=0
MapSkinOptionDisableOdyssey=0
MapSkinOptionDisableMSI=0
MapSkinOptionDisableLunarRevel=0
MapSkinOptionDisableArcade=0

[Replay]
EnableDirectedCamera=1

[Mobile]
LastTickerTime=
AppRegion=
SelectedQueue=0
OfferedTutorial=0
iOSMetalRendererEnabled=0

[Highlights]
VideoQuality=0
VideoFrameRate=60
ScaleVideo=720
AudioQuality=1

[Voice]
InputDevice=Default System Device
InputVolume=0.5000
ActivationSensitivity=0.6500
InputMode=0

[ItemShop]
BootsPanelPinned=1
ConsumablesPanelPinned=1
NativeOffsetY=-0.0167
NativeOffsetX=0.1120
CurrentTab=0

[HUD]
MinimapScale=0.8100
SmartCastOnKeyRelease=1
ShowFPSAndLatency=1

[ColorPalette]
ColorPalette=0

[Volume]
MasterVolume=0.1400

[LiveEvents]
Enable=1
Port=34243

By the way, thanks for a quick response, this is an absolute game-changer for my broadcasts and I will be looking into this project more to see where I can help out 😄

brandonnly commented 3 years ago

Just reset my game.cfg, the issue still persists.

floh22 commented 3 years ago

The next step would be to delete LiveEvents.ini from the same folder and see if that helps, though I doubt it. What is the file type and line ending type for game.cfg and LiveEvents.ini? Check to make sure they are UTF-8 and have Windows (CR LF) line endings, Notepad++ or similar should tell you. Other formats should in theory work, though I havent tested that yet.

You can also try again using the newest build. It should have more logging so I can better tell whats going wrong

brandonnly commented 3 years ago

The newest build works so far thanks! I will update if the issue persists again after a day. The last one randomly popped up after a day.

mpsb commented 3 years ago

Describe the bug @floh22 Hello, League Broadcast is also crashing for me after opening League Client. I have a different error though.

To Reproduce

  1. Launch LeagueBroadcast.exe
  2. Launch League Client.
  3. Login to League. (Crash happens here)

Expected behavior App stays running after login.

Crash Log

--- LeagueBroadcast Crash Report --- 
Everything went according to plan. Seriously, this is the best case scenario.

Time: 2021.07.31-09:01
Description: Object reference not set to an instance of an object.

Stacktrace: 
   at LeagueBroadcast.Common.Controllers.AppStateController.GetLocalGameVersion(String rawPatch) in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Controllers\AppStateController.cs:line 240
   at LeagueBroadcast.Common.Controllers.AppStateController.ConnectToClient() in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Controllers\AppStateController.cs:line 138
   at LeagueBroadcast.Common.Controllers.AppStateController.InitConnection() in F:\Repos\LeagueOfLegends\LeagueBroadcast\LeagueBroadcast\Common\Controllers\AppStateController.cs:line 107
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

-- System Details -- 
League Broadcast Version: 1.4.65.21207
OS: Win 10 2009

Additional context

It's working great on my Intel CPU laptop, but this error occurs on my AMD CPU laptop.

floh22 commented 3 years ago

This seems to be an unrelated issue. Please open a separate issue. Though im guessing your issue should probably be resolved with a PC restart. If its not the case, open a separate issue

floh22 commented 3 years ago

Closed due to inactivity and issue being seemingly resolved