junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 23 forks source link

Can't authenticate to RiotClientUx #106

Open plonsik opened 1 year ago

plonsik commented 1 year ago

Hey, I wanted to authenticate with RiotClientUx, but after specified it in authenticate name: "RiotClientUx" im getting "league client process could not be located". I've noticed that there is no RiotClientUx process launched, only LeagueClientUx and LeagueClient with commands suggests that RiotClient is bundled into it? Im not really sure. process

plonsik commented 1 year ago

I think the issue here is that we need to change regex when we are trying to connect to Riot Client but process stays the same "LeagueClientUx.exe"

if(name != DEFAULT_NAME){
  const portRegex = /--riotclient-app-port=([0-9]+)/
  const passwordRegex = /--riotclient-remoting-auth-token=([\w-]+?)(?:\s*-{2}[\w-]|\s*$)/
} else {
  const portRegex = /--app-port=([0-9]+)/
  const passwordRegex = /--remoting-auth-token=([\w-]+?)(?:\s*-{2}[\w-]|\s*$)/
}
junlarsen commented 1 year ago

Hi, thanks for the issue!

What does the LeagueClientUx.exe command line arguments look like? league-connect will by default try the LeagueClientUx executable, not the LeagueClient one.

plonsik commented 1 year ago

Hello! LeagueClientUx command line line has also riotclient credentials, just few more arguments. What im trying to point it that line in your code:

   if (!isWindows) {
      command = `ps x -o args | grep '${name}'`
    } else if (isWindows && options?.useDeprecatedWmic === true) {
      command = `wmic process where caption='${name}.exe' get commandline`
    } else {
      command = `Get-CimInstance -Query "SELECT * from Win32_Process WHERE name LIKE '${name}.exe'" | Select-Object CommandLine | fl`
    }

from authentication.ts starting at line 123

when you set in authentication parameter name to "name: "RiotClientUx"

Hope im clear enough, if there is something you cant understand please I'll try explaining again :D or we can do quick call also

plonsik commented 1 year ago

LeagueClientUx command line: "--riotclient-auth-token=nGPcMQudo7-Ub8uSNXjcww" "--riotclient-app-port=52658" "--no-rads" "--disable-self-update" "--region=EUNE" "--locale=en_GB" "--riotgamesapi-standalone" "--riotgamesapi-settings=eyJjbGllbnQtY29uZmlnIj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6WyJlbl9HQiIsImNzX0NaIiwiZWxfR1IiLCJodV9IVSIsInBsX1BMIiwicm9fUk8iXSwiZGVmYXVsdF9sb2NhbGUiOiJlbl9HQiIsInJzbyI6eyJjbGllbnQiOiJsb2wifX19LCJyaW90Y2xpZW50Ijp7ImFwcC1wb3J0IjoiNTI2NTgiLCJhdXRoLXRva2VuIjoibkdQY01RdWRvNy1VYjh1U05YamN3dyJ9LCJyaW90Z2FtZXNhcGkiOnsicGVyc2lzdGVuY2UtcGF0aCI6IkM6L1VzZXJzL1NlYmFzdGlhbi9BcHBEYXRhL0xvY2FsL1Jpb3QgR2FtZXMvTGVhZ3VlIG9mIExlZ2VuZHMifSwicnNvX2F1dGgiOnsiYXV0aG9yaXphdGlvbi1rZXkiOiJldzBLSUNBZ0lDSmpiMlJsSWpvZ0lscFhUWGhQYkVJelUxaGtiV0pHVW1GUFZVVXdZa1JPZDJSWE9WUlpibFpDWkVaRmRXRllTa3BXTW5CeVlVVldNR1JzYUZwaFJ6UTFXVmhDVkdGRlNsSmtkejA5SWl3TkNpQWdJQ0FpWTI5a1pWOTJaWEpwWm1sbGNpSTZJQ0paWTJaZlRVZzNTRTV0Y2xoT2RVOVNXVkEyV21OaVRuaHJaWFZ3U3pCdFNXRm1aVVJSZUc1VFZ6TkVlV2xtTUVkWVdITlllR28xVGpOWWFGVmxPSEZNWmxSelJrMTVaRk4xY2s1bWRVVjBORXcwV0Zob1p5SU5DbjA9In19" "--plugins-mask=4" "--remoting-auth-token=Yp_rUuti8wtP8IuxgSR3xw" "--respawn-command=LeagueClient.exe" "--respawn-display-name=League of Legends" "--app-port=52792" "--install-directory=C:\Riot Games\League of Legends" "--app-name=LeagueClient" "--ux-name=LeagueClientUx" "--ux-helper-name=LeagueClientUxHelper" "--log-dir=LeagueClient Logs" "--crash-reporting=crashpad" "--crash-environment=EUN1" "--crash-pipe=\\.\pipe\crashpad_11952_PUOBPVTNOPYKSPOG" "--app-log-file-path=C:/Riot Games/League of Legends/Logs/LeagueClient Logs/2023-03-15T17-14-03_11952_LeagueClient.log" "--app-pid=11952" "--output-base-dir=C:\Riot Games\League of Legends" "--no-proxy-server" "--ignore-certificate-errors"

as you can see there are LeagueClient credentials and RiotClient credentials

EugeneWilson commented 1 year ago

RiotClientUx closes once you log into League unless you manually open it back up. However, when it is open it uses --remoting-auth-token just like LeagueClientUx does. Are you instead wanting to connect to the RiotClientServices process? The Riot Client doesn't have many available endpoints, so in 99.9% of cases you will want to connect to the LCU instead.

plonsik commented 1 year ago

No, I want to use RiotClientUx, just as mentioned as a feature of this library. In my case i need endpoint from that client, so that is 0.01% case apperently.

junlarsen commented 1 year ago

Does the patch from Eugene in #108 fix it? Try rc-12