Closed Bloodiko closed 10 months ago
If we are going to add additional features to the "in client" case, Then we should atleast have the following in place
Should the pypresence update also happen inside the separate thread ? - or keeping updating to main thread only, passing data back to main when requested in the 10 sec interval
marking this as draft, until i made the necessary changes.
i have adjusted most of the points.
Adjustability would be for a later update - I guess this should be configureable inside a config file, as not to have 1 million config flags for each option ?
Custom games & Practice tool does not change RPC.
rpc showing that you are creating a custom/practice tool game.
rpc not updating.
discord rpc not updating to "In Client" after game finishes.
Discord rich presence to show that i am in the league client.
discord rich presence still showing that i am in a practice tool game.
Bug 1
fixed
Bug 2
also fixed
I tested it locally now and honestly, good job! It feels good and seems to work well.
However there are a few key points i would like to be fixed.
Do you think it makes sense to have a command line argument for "--no-icon or --no-summoners-icon" to let people opt out of showing their ingame summoners icon.. (It should then default back to the original league images that we have)?
Do you think it makes sense to have a command line argument for "--no-icon or --no-summoners-icon" to let people opt out of showing their ingame summoners icon.. (It should then default back to the original league images that we have)?
I'd suggest an config file. Then when running with command line arg --set config.stuff=value or similar - this will require an additional help page, and some more work though.
I've implemented your comments. - Idle --> Online, typehints, ...
Issue is, i'm unable to get rid of the Error when using the class approach.
it worked when not using classes. - Not sure where the issue exactly is. PYTHONDEBUGASYNCIO=1 is also really vage about whats happening.
Sometimes its in the rpc library - sometimes inside the lcu_driver library.
But the Update on the RPC side still happens - so even though i really dont like it, maybe we just ignore it until someone fixes asyncio / nested-asyncio?
Maybe its a weird interaction between nest_asyncio and self inside classes ? - this whole asyncio lib feels somehow unfinished. you need to await any async function inside an async function unless you schedule it with asyncio.run yourself, but thats not what we need. - is that really the purpose of async ? - that seems weird.
(leaving the error here, for google search references eventually. )
Exception in callback _SelectorSocketTransport._read_ready()
handle: <Handle _SelectorSocketTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
self._context.run(self._callback, *self._args)
RuntimeError: cannot enter context: <_contextvars.Context object at 0x7f16400229c0> is already entered
I'd suggest rolling back to the non-classes approach. And see from there. As this does not work at all. Tons of error I don't know where they come from.
Yea i am not an expert in asyncio or event loops but something does not seem to go hand in hand together.. Not sure if that is because of how we use it. Or if we are going with the wrong approach.. If you believe we should stick with the old version (without classes) then let's do that. We have tried classes and it clearly gives more problems than it was expected to solve.
I can help out with type hinting. and some of the other details i commented on
Please rollback/revert the class change and go back to the commit where it was working as expected. and let's continue from there.
Updated PR.
Thank you for your pull request @Bloodiko !
Adds Lobby details to RPC
Queue Name Current Player Count Max Player Count
curious if we manage to add a Join Lobby button. kekw - should be possible with the api maybe.