mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-01-14 12:40:38 +00:00
Add easy anticheat workaround
This commit is contained in:
parent
1561e1a9f6
commit
2780788f70
@ -1393,6 +1393,48 @@ preflight_check() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Deploy Easy Anti-Cheat Workaround
|
||||
eac_workaround() {
|
||||
# Get/set directory paths
|
||||
getdirs
|
||||
|
||||
# Set the EAC directory path and hosts modification
|
||||
eac_dir="$wine_prefix/drive_c/users/$USER/AppData/Roaming/EasyAntiCheat"
|
||||
eac_hosts="127.0.0.1 modules-cdn.eac-prod.on.epicgames.com"
|
||||
|
||||
# Check if EAC is installed
|
||||
if [ ! -d "$eac_dir" ]; then
|
||||
message info "Easy Anti-Cheat does not appear to be installed.\nThere is nothing to do!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Configure message variables
|
||||
eac_title="Easy Anti-Cheat Workaround"
|
||||
eac_hosts_formatted="$eac_hosts"
|
||||
eac_dir_formatted="$eac_dir"
|
||||
if [ "$use_zenity" -eq 1 ]; then
|
||||
eac_title="<b>$eac_title</b>"
|
||||
eac_hosts_formatted="<i>$eac_hosts_formatted</i>"
|
||||
eac_dir_formatted="<i>$eac_dir_formatted</i>"
|
||||
fi
|
||||
|
||||
if message question "$eac_title\n\nThe following entry will be added to /etc/hosts:\n$eac_hosts_formatted\n\nThe following directory will be deleted:\n$eac_dir_formatted\n\n\nTo revert these changes, delete the above line from\n/etc/hosts and relaunch the game\n\nDo you want to proceed?"; then
|
||||
debug_print continue "Editing hosts file..."
|
||||
|
||||
# Use pollkit's pkexec for gui with a fallback to sudo
|
||||
if [ -x "$(command -v pkexec)" ]; then
|
||||
pkexec sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||
else
|
||||
sudo sh -c "echo $eac_hosts '#Star Citizen EAC workaround' >> /etc/hosts"
|
||||
fi
|
||||
|
||||
debug_print continue "Deleting $eac_dir..."
|
||||
rm -r "$eac_dir"
|
||||
|
||||
message info "Easy Anti-Cheat workaround has been deployed!"
|
||||
fi
|
||||
}
|
||||
|
||||
# Show maintenance/troubleshooting options
|
||||
maintenance_menu() {
|
||||
# Loop the menu until the user selects quit
|
||||
@ -1611,6 +1653,7 @@ while true; do
|
||||
|
||||
# Configure the menu options
|
||||
preflight_msg="Preflight Check (System Optimization)"
|
||||
eac_msg="Deploy Easy Anti-Cheat Workaround"
|
||||
runners_msg="Manage Lutris Runners"
|
||||
dxvk_msg="Manage DXVK Versions"
|
||||
maintenance_msg="Maintenance and Troubleshooting"
|
||||
@ -1618,9 +1661,9 @@ while true; do
|
||||
quit_msg="Quit"
|
||||
|
||||
# Set the options to be displayed in the menu
|
||||
menu_options=("$preflight_msg" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg")
|
||||
menu_options=("$preflight_msg" "$eac_msg" "$runners_msg" "$dxvk_msg" "$maintenance_msg" "$randomizer_msg" "$quit_msg")
|
||||
# Set the corresponding functions to be called for each of the options
|
||||
menu_actions=("preflight_check" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit")
|
||||
menu_actions=("preflight_check" "eac_workaround" "runner_manage" "dxvk_manage" "maintenance_menu" "referral_randomizer" "quit")
|
||||
|
||||
# Calculate the total height the menu should be
|
||||
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
|
||||
|
Loading…
x
Reference in New Issue
Block a user