Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Added support for Deceive #220

Merged
merged 18 commits into from
Nov 25, 2023
Merged

Conversation

TriOCuBe
Copy link

What is Deceive?

Deceive is a program used to mask a player's online status while playing Riot games. It's decently popular and I use it myself, which is why I wrote this pull request.

Additions

I've added two new settings to the config: use_deceive and install_location_deceive.

In tft.py, I've changed restart_league_client() to take these configs into consideration and it now runs the new function launch_league_client(), which does most of the job.

If no path to deceive is given, the bot will run determine_deceive_install_location(). This function first searches the Downloads folder, then looks through a specific registry key I've found to contain paths of .exe files.
Something to note is that these entries don't get deleted, meaning if a file gets moved, the old entry for that file still exists despite becoming obsolete. Therefore the function finds all matches and then iterates through them until it finds a path pointing to an existing file.

If this still doesn't work, the config gets updated through update_deceive_config() to False and the bot won't try to open deceive again until restarted.

I've added logging and documentation to the places where it was needed.

@TriOCuBe
Copy link
Author

I've now added Deceive.exe to processes in CONSTANTS so it gets terminated too in restart_league_client() Not sure if this is necessary, since Deceive should stop running when League closes, but this just makes sure of it.

Pylint is for some reason not ignoring those two line-too-long errors in tft.py Line 129 & 132, which are two logger messages. IMO those say exactly what needs to be said, so I don't want to change them up. Otherwise I'd say the integration is finished.

@Kyrluckechuck
Copy link
Owner

Fantastic, thanks for the PR!

Apologies for the delay, but I do plan on reviewing this, and am not against necessarily adding this, but want to be cautious when adding additional programs to the flow (even if optional), especially ones which emulate/change the client API!

As long as @akshualy doesn't have additional concerns / approves, I'll likely go ahead and merge this once I'm done reviewing 😃

@akshualy
Copy link
Collaborator

I haven't cross-checked this with a second client, but there is an endpoint in LCU as well.
PUT /lol-chat/v1/me with a body of

{
  "availability": "offline"
}

Overall I have nothing against an additional integration with Deceive though.

@Kyrluckechuck
Copy link
Owner

I haven't cross-checked this with a second client, but there is an endpoint in LCU as well. PUT /lol-chat/v1/me with a body of

Interesting, would potentially be worth exploring us adding this directly in if it's as simple as that to toggle it off!

@akshualy
Copy link
Collaborator

If you have a few minutes, I can create an account in your region and could add you to test.

tft.py Outdated Show resolved Hide resolved
Comment on lines +260 to +262
# Search registry now
key_to_read = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store"
k = winreg.OpenKey(winreg.HKEY_CURRENT_USER, key_to_read, 0, winreg.KEY_READ)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is checking the "recent apps" registry entries, I'd argue it might be worth commenting this since it isn't guaranteed to be in here if the user hasn't run it yet and/or it's not there

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By commenting, do you mean commenting it out (i.e. removing) or just documenting it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding a comment! 😄

tft.py Outdated Show resolved Hide resolved
@akshualy
Copy link
Collaborator

akshualy commented Nov 23, 2023

I haven't cross-checked this with a second client, but there is an endpoint in LCU as well. PUT /lol-chat/v1/me with a body of

{
  "availability": "offline"
}

Overall I have nothing against an additional integration with Deceive though.

I had time to test this with a friend of mine, this does work and is shown on the other side as offline as well.
However, it does still show that you are creating a normal game. To bypass that, you have to additionally send

{
  "availability": "offline",
  "lol": {
    "gameStatus": "outOfGame"
  }
}

after every action you take (creating lobby, going into queue, being in-game).

@TriOCuBe
Copy link
Author

If you manage to replicate the effect of Deceive, I'm perfectly fine with using that instead of my code if you'd like - the real goal of my PR was just to add the functionality of masking your online status, after all 😄

@Kyrluckechuck
Copy link
Owner

I had time to test this with a friend of mine, this does work and is shown on the other side as offline as well. However, it does still show that you are creating a normal game. To bypass that, you have to additionally send

{
  "availability": "offline",
  "lol": {
    "gameStatus": "outOfGame"
  }
}

after every action you take (creating lobby, going into queue, being in-game).

@akshualy and/or @TriOCuBe did either of you feel up to implementing that in a PR directly, as opposed to adding this support and then removing it in the future if that were to be added to the client?

If not, I'm happy to go ahead with this as we had mentioned 😄

@akshualy
Copy link
Collaborator

Let's add both, Deceive achieves its goal by setting up a Proxy which inherently prevents any updates and thus is probably smoother at displaying the Offline status, but it'd be nice to have this feature in-built as a back-up as well :) But that should be done in a separate MR.

@Kyrluckechuck Kyrluckechuck merged commit 97ab791 into Kyrluckechuck:main Nov 25, 2023
2 checks passed
@TriOCuBe TriOCuBe deleted the contrib branch December 8, 2023 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants