Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[.NET6] Webscoekts issue #16

Open
Ponita0 opened this issue May 30, 2022 · 2 comments
Open

[.NET6] Webscoekts issue #16

Ponita0 opened this issue May 30, 2022 · 2 comments
Assignees
Labels
bug Something isn't working .NET6 Is related to .NET6

Comments

@Ponita0
Copy link
Owner

Ponita0 commented May 30, 2022

When using on .NET6 It does stack overflow exception when league client opens or closes when the app is opened.

Possible fixes

  • I tried to remove the line which connects to the websocket socketConnection.Send($"[5, \"OnJsonApiEvent\"]"); and it worked but no websockets support then.

  • Another possible fix is by waiting till the client is fully open and then send the subscribe string and send unsubscribe before the app closes

@Ponita0 Ponita0 added bug Something isn't working .NET6 Is related to .NET6 labels May 30, 2022
@Ponita0 Ponita0 self-assigned this May 30, 2022
@mikaeldui
Copy link
Contributor

mikaeldui commented May 31, 2022

Listening for process startups requires admin privilege, see https://stackoverflow.com/a/972067/1275774.

@MingweiSamuel implemented a watcher for the lock file, which I don't think requires any special privileges: https://github.com/MingweiSamuel/Camille/blob/release/3.x.x/src/Camille.Lcu/src/AutomaticLockfileProvider.cs

Another alternative is checking the lock file and port every 5 seconds or so, waiting for the client to start.

I've not implemented anything like that in my lib as it's subscribing to the individual events instead of the entire OnJsonApiEvent and would have to re-subscribe everything. It'd also have to handle account changes somehow. I do have an event for when the client process exits.

@Ponita0
Copy link
Owner Author

Ponita0 commented May 31, 2022

The problem exists only when
Subscribed to events and running on .NET6 and
client opens/closes
Other than that it works.
Tried to comment out the socketConnection.send line and it worked decently.
When i uncommented it and ran the app
If league is already on, everything is ok
If its not on, it'll listen for it, after it's on the lib detects that it's on and starts listening to the events, then it stack overflows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET6 Is related to .NET6
Projects
None yet
Development

No branches or pull requests

2 participants