-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdofus-linux.sh.old
96 lines (80 loc) · 2.42 KB
/
dofus-linux.sh.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
dir="$PWD"
lutriswinepath="/home/$USER/.local/share/lutris/runners/wine"
# change version number to downgrade to another old build
winever="7.2"
# fsync support (only work if you have a kernel with futex sync support)
# put 0 if you want to disable fsync ()
fsync=1
# use for dxvk
dxvkver=$(curl --silent "https://api.github.com/repos/doitsujin/dxvk/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' | cut -d'v' -f2)
# check wine install
wineinstall=false
# create new script
script=$(cat <<EOF
#!/bin/sh
WINEPREFIX=$dir/.wine WINEFSYNC=$fsync $dir/lutris-$winever-x86_64/bin/wine Dofus.exe --port=\$ZAAP_PORT --gameName=\$ZAAP_GAME --gameRelease=\$ZAAP_RELEASE --instanceId=\$ZAAP_INSTANCE_ID --hash=\$ZAAP_HASH --canLogin=\$ZAAP_CAN_AUTH > /dev/null 2>&1
exit \$?
EOF
)
# user action to perform
action="$1"
case "$action" in
configure)
;;
dxvk)
;;
*)
echo "Action inconnue: $action"
echo "Usage: $0 [configure|dxvk]"
exit 1
esac
# install wine prefix
configure() {
if [ -d $lutriswinepath ]; then
if [ -d "$lutriswinepath/lutris-$winever-x86_64" ]; then
if [ ! -d "$dir/lutris-$winever-x86_64" ]; then
ln -s $lutriswinepath/lutris-$winever-x86_64 $dir
wineinstall=true
fi
echo "Wine correctement installé"
else
echo "Télécharger wine depuis Lutris, version : lutris-$winever"
echo "Puis relancer le script"
fi
else
# download lutris wine build
if [ ! -d "$winever-x86_64" ]; then
wget https://github.com/lutris/wine/releases/download/lutris-$winever/wine-lutris-$winever-x86_64.tar.xz
tar -xf wine-lutris-$winever-x86_64.tar.xz
rm wine-lutris-$winever-x86_64.tar.xz
wineinstall=true
fi
fi
if [ "$wineinstall" = true ]; then
# create wine environment
if [ ! -d ".wine" ]; then
mkdir .wine
fi
# backup current script
if [ ! -f "zaap-start.old" ]; then
cp zaap-start.sh zaap-start.old
fi
echo "$script" | tee zaap-start.sh
# add execute to script
chmod +x zaap-start.sh
./zaap-start.sh
fi
# fix game won't start after update
if [ -f ".wine/.update-timestamp" ]; then
rm .wine/.update-timestamp
fi
}
# configure dxvk
dxvk() {
wget https://github.com/doitsujin/dxvk/releases/download/v$dxvkver/dxvk-$dxvkver.tar.gz
tar -xf dxvk-$dxvkver.tar.gz
WINEPREFIX=$dir/.wine $dir/dxvk-$dxvkver/setup_dxvk.sh install
rm dxvk-$dxvkver.tar.gz
}
$action