mmtrt / leagueoflegends

Unofficial league of legends snap repo
https://snapcraft.io/leagueoflegends
GNU Lesser General Public License v2.1
220 stars 27 forks source link

XMPP Version error - disconnected from chat #162

Closed henricazottes closed 3 months ago

henricazottes commented 3 years ago

Hi,

I've managed to install LoL on elementary os following this guide and applying this fix. However, it seems chat is not working, similar to #146 .

In the launcher, I have a message "You've been disconnected from chat, attempting to reconnect...". And in the logs, I get:

000014.141|  ERROR|                   Remoting| HTTP Response 500 to GET '/lol-game-queues/v1/queues'
000014.551|  ERROR|                   Remoting| HTTP Response 503 to GET '/lol-chat/v1/conversations/active'
000014.569|  ERROR|                   Remoting| HTTP Response 503 to GET '/lol-chat/v1/friend-groups'
000014.572|  ERROR|                   Remoting| HTTP Response 503 to GET '/lol-chat/v1/friends'
000014.574|  ERROR|                   Remoting| HTTP Response 503 to GET '/lol-chat/v1/friend-requests'
000014.591|  ERROR|                   Remoting| HTTP Response 501 to GET '/lol-chat/v1/resources'
000014.752|  ERROR|                   Remoting| HTTP Response 503 to GET '/lol-chat/v1/me'
000014.796|  ERROR|                   Remoting| HTTP Response 503 to GET '/lol-chat/v1/blocked-players'

and

000076.931| ALWAYS|            rcp-be-lol-chat| beginning job 'lol-chat.connector.reconnect' with expected delay of seconds 2 after 7.000000 seconds
000076.933| ALWAYS|            rcp-be-lol-chat| Beginning authentication with chat server
000076.935| ALWAYS|            rcp-be-lol-chat| authenticating with the chat service...
000077.187| ALWAYS|            rcp-be-lol-chat| chat connection state change : Session closed, possibly due to error (4)
000077.188|   WARN|            rcp-be-lol-chat| closed chat session with enum 'XMPP version error'
000077.190| ALWAYS|            rcp-be-lol-chat| disconnected from the chat service because 'XMPP version error'...
000077.193|   WARN|            rcp-be-lol-chat| chat session disconnected - XMPP version error
000077.195|  ERROR|            rcp-be-lol-chat| chat server authentication failed with code 3: 'XMPP version error'

Launcher version is V10.23.343.2581.

Any idea how to fix this XMPP version error ? If you need more info/logs feel free to ask. And thanks for the job so far!

henricazottes commented 3 years ago

I've found this thread on reddit which says to change how the app is started by addind options like so:

$WINEPREFIX/drive_c/Riot Games/Riot Client/RiotClientServices.exe --launch-product=league_of_legends --launch-patchline=live

It seems it was integrated in the snap and then reverted with commit 2f8e889829c41de3f6b223091b11d8be60f0db0b.

Is it sure it's not causing chat problems ? (I'm not used to snap development, I can't try easily as file are read only)

mmtrt commented 3 years ago

That change caused issue #154, anyways I'll investigate this later today.

mmtrt commented 3 years ago

do you have old launcher or new one? chat seem to load fine here in client on fresh install.

henricazottes commented 3 years ago

I have the new one I guess, it looks like this :

image

Could you clarify your process for the fresh install? I may have done something wrong mixing how tos here and there. I tried to install it twice and had the same result in the end.

mmtrt commented 3 years ago

That's old launcher, try purge remove league snap then reinstall it.

snap remove --purge leagueoflegends

henricazottes commented 3 years ago

My process:

kill -STOP ${uxpid} timeout 5m /bin/bash -c " until openssl s_client -connect :${port} <<< Q > /dev/null 2>&1; do sleep 1 done" kill -CONT ${uxpid}

- It's silent until I run `League of Legend` shortcut again, then it outputs:

LeagueClientUx pid: 9773 Waiting for port 43335


- This time, this launcher appears:
![image](https://user-images.githubusercontent.com/5214384/99833919-15a7b080-2b63-11eb-9c1c-7a47fef7baf1.png)

- It asks to restart but waiting or clicking restart doesn't restart the launcher, so I log in and it start downloading the update:
![image](https://user-images.githubusercontent.com/5214384/99834108-5b647900-2b63-11eb-97e5-63caf859f218.png)

- Right now the chat is already broken:
![image](https://user-images.githubusercontent.com/5214384/99834155-6ddeb280-2b63-11eb-82e7-6f337adee6b0.png)

And it is like the other tries I made before : I wait for the update to finish but it doesn't fix the chat
mmtrt commented 3 years ago

This is not needed at all as new launcher works just fine and likely you are breaking it with this,

for f in RiotClientServices.exe RiotClientCrashHandler.exe; do
  sudo chmod 0 "$HOME/snap/leagueoflegends/common/.wine/drive_c/Riot Games/Riot Client/$f";
  sudo chown root:root "$HOME/snap/leagueoflegends/common/.wine/drive_c/Riot Games/Riot Client/$f";
done

Snap now ships this script and loads it as of todays update

Then run this script:

#!/bin/bash
process=LeagueClientUx.exe
uxpid=$(timeout 2m /bin/bash -c "until pidof ${process}; do sleep 1; done")
if [[ ! -n $uxpid ]]; then
  echo "Could not find process ${process}"
  exit 1
fi
echo "LeagueClientUx pid: ${uxpid}"
port=$(xargs -0 < /proc/${uxpid}/cmdline \
  | sed -n 's/.*--app-port=\([[:digit:]]*\).*/\1/p')
if [[ ! -n $port ]]; then
  echo "Could not find port"
  exit 1
fi
echo "Waiting for port ${port}"

kill -STOP ${uxpid}
timeout 5m /bin/bash -c "
until openssl s_client -connect :${port} <<< Q > /dev/null 2>&1; do
  sleep 1
done"
kill -CONT ${uxpid}
henricazottes commented 3 years ago

This was the missing information! I didn't know which launcher was the newer one, so I though I was on the right way when it was changing after running the script modifying right access.

Thanks a lot, I'm sorry it was such a dumb error. I'll do a PR to modify the readme and add a screenshot of the white launcher :)