diff options
author | Alex Szczuczko | 2015-06-10 19:37:32 +0100 |
---|---|---|
committer | Alex Szczuczko | 2015-06-10 19:37:32 +0100 |
commit | 546f564526a4cff9266c8c2d8a7baeac6878e3d2 (patch) | |
tree | 0ff8532ca889becfdf0dc9b869cba1dbfe23a227 /lanfix.sh | |
download | aur-546f564526a4cff9266c8c2d8a7baeac6878e3d2.tar.gz |
Initial import
Diffstat (limited to 'lanfix.sh')
-rw-r--r-- | lanfix.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lanfix.sh b/lanfix.sh new file mode 100644 index 000000000000..35742c5b8575 --- /dev/null +++ b/lanfix.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +fatal() { + echo "$@" + echo "Aborting." + exit 1 +} + +echo "This script will use a utility to randomise your game's serial number, with the " +echo "intent of allowing LAN multiplayer to operate with more than 2 players." +echo "CAUTION: This procedure involves downloading a program released by Razor 1911, a" +echo "software cracking group." +read -p "Proceed? [y/N] " -r +[[ $REPLY =~ ^[Yy]$ ]] || fatal +echo "Proceeding." + +usrdir="$HOME/.tiberiansun" +prefixdir="$usrdir/tiberiansun" +gamedir="$prefixdir/drive_c/Program Files/EA Games/Command & Conquer The First Decade/Command & Conquer(tm) Tiberian Sun(tm)/SUN" + +export WINEARCH='win32' +export WINEPREFIX="$prefixdir" + +cd gamedir || fatal "Could not cd into game dir at '$gamedir'." +mkdir -p lanfix || fatal "Could not make subdir in game dir." +cd lanfix || fatal "Could not cd into new subdir in game dir." + +utilurl='http://gf.wiretarget.com/ti/rzrtsfix.zip' +if ! [ -f rzrtsfix.zip ] +then + curl -O "$utilurl" --referer http://gf.wiretarget.com/tiberian_sun.htm --user-agent Mozilla/4.0 + [ "$?" -eq 0 ] || fatal "Could not download utility from '$utilurl'." +fi + +unzip rzrtsfix.zip || fatal "Could not unzip utility zip." + +cd .. || fatal "Could not cd back to game dir." +wine lanfix/REGSETUP.EXE || fatal "wine exited abnormally, code $?" + +echo "Complete." + +# TODO LAN UDP Fix (Excludes internet play) + +zipurl=$(curl -sL 'http://games.softpedia.com/dyn-postdownload.php?p=55923&t=4&i=1' --referer 'http://games.softpedia.com/progDownload/Command-Conquer-Tiberian-Sun-LAN-Patch-Download-55923.html' --user-agent Mozilla/5.0 | grep -m1 'click here' | sed -r -e 's,^.*If it doesn'"'"'t\, please <a href="(http://[0-9a-zA-Z-]+.softpedia.com/dl/[0-9a-z]+/[0-9a-z]+/[0-9]+/games/patch/ts_ra2_lanpatch_1_00.zip)".*$,\1,;tx;d;:x') + +curl -L -o udppatch.zip "$zipurl" --referer 'http://games.softpedia.com/dyn-postdownload.php?p=55923&t=4&i=1' --user-agent Mozilla/5.0 |