aov: add apl2022 click script
This commit is contained in:
54
games/lol/linux/README.md
Normal file
54
games/lol/linux/README.md
Normal file
@ -0,0 +1,54 @@
|
||||
# leagueoflinux scripts
|
||||
## `sulaunchhelper2.sh`
|
||||
This script is a wrapper for `sulaunchhelper2.py` for use with Lutris pre-game launch script.
|
||||
### Installation
|
||||
> This script no longer wraps `syscall_check.sh`, if you need to execute that script alongside this one, I recommend you to take a look at [preloader.sh](../../../apps/Lutris#preloadersh)
|
||||
|
||||
+ To install you must have `sulaunchhelper2.py` present, if not you can execute these to quickly download them (to current directory):
|
||||
```sh
|
||||
curl -OL https://raw.githubusercontent.com/CakeTheLiar/launchhelper/master/sulaunchhelper2.py
|
||||
chmod +x sulaunchhelper2.py
|
||||
```
|
||||
+ Then to download `sulaunchhelper2.sh` itself:
|
||||
```sh
|
||||
curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/games/LoL/linux/sulaunchhelper2.sh
|
||||
chmod +x sulaunchhelper2.sh
|
||||
```
|
||||
+ After that, copy all these files to the game prefix you want to use, then in Lutris:
|
||||
- Set pre-launch script in Lutris to where `sulaunchhelper2.sh` is located.
|
||||
- Disable **Wait for pre-launch script completion**
|
||||
- Enable **Disable Lutris Runtime**
|
||||
> Failure to do above steps will result in Zenity can't show necessary messages dialog so LoL UI can't launch properly.
|
||||
+ Enjoy your LoL experience :P
|
||||
## `garena_wrapper.sh`
|
||||
This script automates the launching of [lol.py](https://github.com/nhubaotruong/league-of-legends-linux-garena-script) (LoL in Garena client) so you don't have to manually do it ;)
|
||||
### Installation
|
||||
> This script no longer wraps `syscall_check.sh`, if you need to execute that script alongside this one, I recommend you to take a look at [`preloader.sh`](../../../apps/Lutris#preloadersh)
|
||||
If you plan to use `preloader.sh` then I **highly recommend you** to **disable logging**, because **lol.py and `preloader.sh` will log your token to ./preloader/preloader_garena_wrapper.sh.log if you keep it enabled**, hence your account may get compromised.
|
||||
|
||||
You need to follow steps in `lol.py` repository to properly config your LoL prefix.
|
||||
+ To install you must have `lol.py` present, if not you can execute these to quickly download them (to current directory):
|
||||
```sh
|
||||
curl -OL https://raw.githubusercontent.com/nhubaotruong/league-of-legends-linux-garena-script/main/lol.py
|
||||
chmod +x lol.py
|
||||
```
|
||||
+ Then to download `garena_wrapper.sh` itself:
|
||||
```sh
|
||||
curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/games/LoL/linux/garena_wrapper.sh
|
||||
chmod +x garena_wrapper.sh
|
||||
```
|
||||
+ After that, copy all these files to the game prefix you want to use, then in Lutris:
|
||||
- Set pre-launch script in Lutris to where `garena_wrapper.sh` is located.
|
||||
- Disable **Wait for pre-launch script completion**
|
||||
- Enable **Disable Lutris Runtime**
|
||||
> Failure to do above steps will result in Zenity can't show necessary messages dialog so LoL UI may not launch properly (it'll still launch if you use `sulaunchhelper2.sh` and have installed it correctly).
|
||||
+ Enjoy your Garena LoL experience :P
|
||||
|
||||
## [`discord_rpc.sh`](../../../apps/Lutris#discord_rpcsh)
|
||||
+ This script will bridge Discord RPC from LoL prefix to your linux Discord.
|
||||
> Note: The script in current directory [`discord_rpc.sh`](./discord_rpc.sh) is modified from the script mentioned above to work properly with `sulaunchhelper2.sh`,
|
||||
the installation is the same **except** when installing the script itself, execute this instead:
|
||||
```sh
|
||||
curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/games/LoL/linux/discord_rpc.sh
|
||||
chmod +x discord_rpc.sh
|
||||
```
|
||||
16
games/lol/linux/discord_rpc.sh
Executable file
16
games/lol/linux/discord_rpc.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Launch winediscordipcbridge.exe automatically.
|
||||
|
||||
# debug wine version and prefix"
|
||||
echo "wine: $WINE"
|
||||
echo "prefix: $WINEPREFIX"
|
||||
|
||||
echo "Waiting for LeagueClientUx.exe to start..."
|
||||
until _=$(pidof LeagueClientUx.exe)
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Launching bridge..."
|
||||
$WINE ./winediscordipcbridge.exe
|
||||
echo "Bridge closed."
|
||||
52
games/lol/linux/garena_wrapper.sh
Executable file
52
games/lol/linux/garena_wrapper.sh
Executable file
@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
# This script is a wrapper for nhubaotruong/league-of-legends-linux-garena-script and syscall_check.sh
|
||||
# It automatically execute lol.py to start LoL lutris game from Garena.
|
||||
# You need lol.py and syscall_check.sh present in game prefix root directory.
|
||||
|
||||
LOL_PY='lol.py'
|
||||
|
||||
own_dir="$(realpath .)"
|
||||
echo "Waiting for Garena to start..."
|
||||
until _=$(pidof Garena.exe)
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
trap final EXIT
|
||||
|
||||
echo "Entering loop..."
|
||||
noGarena=0
|
||||
lolPyPid=""
|
||||
|
||||
final() {
|
||||
echo "Exiting..."
|
||||
if [[ -z $(kill -0 $lolPyPid) ]]; then
|
||||
echo "Closing lol.py..."
|
||||
kill -15 $lolPyPid
|
||||
fi
|
||||
}
|
||||
|
||||
trap final EXIT
|
||||
|
||||
while :
|
||||
do
|
||||
if [[ -z $(pidof Garena.exe) ]]; then
|
||||
exit
|
||||
fi
|
||||
noGarena=0
|
||||
if [[ $lolPyPid ]]; then
|
||||
kill -0 $lolPyPid
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Clearing old exited lol.py PID."
|
||||
lolPyPid=""
|
||||
fi
|
||||
fi
|
||||
if [[ -z $(pidof RiotClientServices.exe) ]] && [[ -z $lolPyPid ]]; then
|
||||
echo "Launching lol.py"
|
||||
python3 "${own_dir}/${LOL_PY}" &
|
||||
lolPyPid=$!
|
||||
fi
|
||||
sleep .5
|
||||
done
|
||||
exit
|
||||
|
||||
50
games/lol/linux/sulaunchhelper2.sh
Executable file
50
games/lol/linux/sulaunchhelper2.sh
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# This script is a wrapper for sulaunchhelper2.py and somewhat based on syscall_check.sh for kernel.yama.ptrace_scope wrapper
|
||||
# Because this is for Lutris pre-launch script, you're required to have both sulaunchhelper2.py and syscall_check.sh
|
||||
# present in the game' wineprefix
|
||||
|
||||
SULH_PY='sulaunchhelper2.py'
|
||||
|
||||
dialog() {
|
||||
zenity "$@" --icon-name='lutris' --width="400" --title="League of Legends launch helper (root version)"
|
||||
}
|
||||
|
||||
own_dir="$(realpath .)"
|
||||
|
||||
echo "Trying to check for Frida kernel argument..."
|
||||
if [ "$(cat /proc/sys/kernel/yama/ptrace_scope)" -ne 0 ]; then
|
||||
once="Change setting until next reboot"
|
||||
persist="Change setting and persist after reboot"
|
||||
manual="Show me the commands; I'll handle it myself"
|
||||
|
||||
if dialog --question --text="League of Legends' client UI launch much faster with some modification to your system. but as far as this script can detect, the setting has not been changed yet.\n\nWould you like to change the setting now?"
|
||||
then
|
||||
# I tried to embed the command in the dialog and run the output, but
|
||||
# parsing variables with embedded quotes is an excercise in frustration.
|
||||
RESULT=$(dialog --list --radiolist --height="200" \
|
||||
--column="" --column="Command" \
|
||||
"TRUE" "$once" \
|
||||
"FALSE" "$persist" \
|
||||
"FALSE" "$manual")
|
||||
|
||||
case "$RESULT" in
|
||||
"$once")
|
||||
pkexec sysctl -w kernel.yama.ptrace_scope=0
|
||||
;;
|
||||
"$persist")
|
||||
pkexec sh -c 'echo "kernel.yama.ptrace_scope=0" >> /etc/sysctl.conf && sysctl -p'
|
||||
;;
|
||||
"$manual")
|
||||
dialog --info --no-wrap --text="To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w kernel.yama.ptrace_scope=0'\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"kernel.yama.ptrace_scope=0\" >> /etc/sysctl.conf && sysctl -p'\nChange the setting then press OK or script will NOT work."
|
||||
;;
|
||||
*)
|
||||
echo "Dialog canceled or unknown option selected: $RESULT"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
|
||||
echo "Launching sulaunchhelper2.py"
|
||||
python3 "${own_dir}/${SULH_PY}"
|
||||
58
games/lol/linux/syscall_check.sh
Executable file
58
games/lol/linux/syscall_check.sh
Executable file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# If abi.vsyscall32=0 is already set, no need to do anything
|
||||
if [ "$(cat /proc/sys/abi/vsyscall32)" -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
dialog() {
|
||||
zenity "$@" --icon-name='lutris' --width="400" --title="League of Legends anticheat compatibility check"
|
||||
}
|
||||
|
||||
final_check() {
|
||||
if [ "$(cat /proc/sys/abi/vsyscall32)" -ne 0 ]; then
|
||||
dialog --warning --text="As far as this script can detect, your system is not configured to work with League's anticheat. Please verify that you can get into the practice too before playing a multiplayer game."
|
||||
fi
|
||||
}
|
||||
|
||||
trap final_check EXIT
|
||||
|
||||
if grep -E -x -q "abi.vsyscall32( )?=( )?0" /etc/sysctl.conf; then
|
||||
if dialog --question --text="It looks like you already configured your system to work with League anticheat, and saved the setting to persist across reboots. However, for some reason the persistence part did not work.\n\nFor now, would you like to enable the setting again until the next reboot?"
|
||||
then
|
||||
pkexec sh -c 'sysctl -w abi.vsyscall32=0'
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
once="Change setting until next reboot"
|
||||
persist="Change setting and persist after reboot"
|
||||
manual="Show me the commands; I'll handle it myself"
|
||||
|
||||
if dialog --question --text="League of Legends' anticheat requires using a modified version of wine and changing a system setting. Otherwise, the game will crash after champion select. Wine-lol comes with the Lutris installer, but as far as this script can detect, the setting has not been changed yet.\nNote: The setting (abi.vsyscall32=0) may reduce the performance of some 32 bit applications.\n\nWould you like to change the setting now?"
|
||||
then
|
||||
# I tried to embed the command in the dialog and run the output, but
|
||||
# parsing variables with embedded quotes is an excercise in frustration.
|
||||
RESULT=$(dialog --list --radiolist --height="200" \
|
||||
--column="" --column="Command" \
|
||||
"TRUE" "$once" \
|
||||
"FALSE" "$persist" \
|
||||
"FALSE" "$manual")
|
||||
|
||||
case "$RESULT" in
|
||||
"$once")
|
||||
pkexec sh -c 'sysctl -w abi.vsyscall32=0'
|
||||
;;
|
||||
"$persist")
|
||||
pkexec sh -c 'echo "abi.vsyscall32 = 0" >> /etc/sysctl.conf && sysctl -p'
|
||||
;;
|
||||
"$manual")
|
||||
dialog --info --no-wrap --text="To change the setting (a kernel parameter) until next boot, run:\n\nsudo sh -c 'sysctl -w abi.vsyscall32=0'\n\nTo persist the setting between reboots, run:\n\nsudo sh -c 'echo \"abi.vsyscall32 = 0\" >> /etc/sysctl.conf && sysctl -p'"
|
||||
# Anyone who wants to do it manually doesn't need another warning
|
||||
trap - EXIT
|
||||
;;
|
||||
*)
|
||||
echo "Dialog canceled or unknown option selected: $RESULT"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
Reference in New Issue
Block a user