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 | |
download | aur-546f564526a4cff9266c8c2d8a7baeac6878e3d2.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | PKGBUILD | 67 | ||||
-rw-r--r-- | README | 32 | ||||
-rw-r--r-- | lanfix.sh | 46 | ||||
-rw-r--r-- | launch-tiberiansun.sh | 108 | ||||
-rw-r--r-- | tiberiansun.desktop | 13 | ||||
-rw-r--r-- | tiberiansun.install | 10 |
8 files changed, 306 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6476bddfa002 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = tiberiansun + pkgdesc = Freeware release of Westwood's classic C&C: Tiberian Sun, with Firestorm Expansion (uses Wine) + pkgver = 2.03 + pkgrel = 1 + url = http://web.archive.org/web/20000302013458/http://www.westwood.com/games/ccuniverse/tiberiansun/index.html + install = tiberiansun.install + arch = any + license = custom:freeware + makedepends = unrar + depends = wine + depends = winetricks + noextract = OfficialCnCTiberianSun.rar + options = !strip + source = tiberiansun.desktop + source = launch-tiberiansun.sh + source = README + source = http://pub.zoneofgames.ru/demos/fullgames/OfficialCnCTiberianSun.rar + sha256sums = ce9c09f9338c989d005bd8c9c425b930ad591a7ee135c5f6c4ccbce513c4199e + sha256sums = 413b214f75ed15007d7ee5a71a2c89ef04e1892237d1e59c6fa2535bc4ba67ad + sha256sums = 739ada7ac1b6b7614ad386bdd74f472a36902110daaba12cd2c7dd3d527e7e61 + sha256sums = b04219e715511de9baa2feb9827013c8e106f8d6b9b563936b8a2f650305dec5 + +pkgname = tiberiansun + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..4f743bab0959 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/pkg/ +/src/ +/extracttemp/ +*.rar +*.tar +*.swp diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9c4715ca4d7f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,67 @@ +# Maintainer: Alex Szczuczko <alex at szc dot ca> + +pkgname=tiberiansun +pkgver=2.03 +pkgrel=1 +pkgdesc="Freeware release of Westwood's classic C&C: Tiberian Sun, with Firestorm Expansion (uses Wine)" +url='http://web.archive.org/web/20000302013458/http://www.westwood.com/games/ccuniverse/tiberiansun/index.html' +arch=('any') +license=('custom:freeware') +depends=('wine' + 'winetricks') +makedepends=('unrar') +options=(!strip) +install='tiberiansun.install' +source=('tiberiansun.desktop' + 'launch-tiberiansun.sh' + 'README' + 'http://pub.zoneofgames.ru/demos/fullgames/OfficialCnCTiberianSun.rar') +noextract=('OfficialCnCTiberianSun.rar') +sha256sums=('ce9c09f9338c989d005bd8c9c425b930ad591a7ee135c5f6c4ccbce513c4199e' + '413b214f75ed15007d7ee5a71a2c89ef04e1892237d1e59c6fa2535bc4ba67ad' + '739ada7ac1b6b7614ad386bdd74f472a36902110daaba12cd2c7dd3d527e7e61' + 'b04219e715511de9baa2feb9827013c8e106f8d6b9b563936b8a2f650305dec5') + +# Disable compression of the package +PKGEXT='.tar' + +build() { + cd "$srcdir" + unrar x -o- OfficialCnCTiberianSun.rar + find "EA Games/" -type f -exec chmod 644 "{}" \; + find "EA Games/" -type d -exec chmod 755 "{}" \; +} + +package() { + cd "$srcdir" + + mkdir -p "$pkgdir/opt/$pkgname/" + + # Main files and License + pushd 'EA Games/Command & Conquer The First Decade/Command & Conquer(tm) Tiberian Sun(tm)' >/dev/null + cp -R "SUN" "$pkgdir/opt/$pkgname/" + install -Dm644 SUN/LICENSE.DOC "$pkgdir/usr/share/licenses/$pkgname/LICENSE.DOC" + popd >/dev/null + + # Online fixes + pushd 'EA Games/Command & Conquer The First Decade' >/dev/null + cp -R "Internet" "$pkgdir/opt/$pkgname/" + install -Dm644 "TiberianSun_OnlinePlayInstructions.txt" "$pkgdir/opt/$pkgname/Internet/TiberianSun_OnlinePlayInstructions.txt" + install -Dm644 "tibsun_regadd.reg" "$pkgdir/opt/$pkgname/Internet/tibsun_regadd.reg" + popd >/dev/null + + # Launcher + install -Dm755 "launch-$pkgname.sh" "$pkgdir/opt/$pkgname/launch-$pkgname.sh" + mkdir -p "$pkgdir/usr/bin/" + ln -s -T "/opt/$pkgname/launch-$pkgname.sh" "$pkgdir/usr/bin/$pkgname" + + # Icon + mkdir -p "$pkgdir/usr/share/icons/" + ln -s -T "/opt/$pkgname/SUN/SUN.ICO" "$pkgdir/usr/share/icons/$pkgname.ico" + + # .desktop File + install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" + + # Docs + install -Dm644 "README" "$pkgdir/opt/$pkgname/README" +} diff --git a/README b/README new file mode 100644 index 000000000000..99b6dd7ebf45 --- /dev/null +++ b/README @@ -0,0 +1,32 @@ +ONLINE MULTIPLAYER + +To play online multiplayer (EA passed support of this service to XWIS): + 1. Run the game + 2. At the Main Menu click Internet. After a series of messages you will be + at the username creation screen. + 3. XWIS allows you to ignore the 'New Account' button. Enter any username, + and a password 8 characters long. + 4. Select your country location and desired server, then hit OK. You + should be taken to the main online lobby where you can join/create games + if users are online. +For more information visit http://xwis.net/forums/index.php/topic/168665-tiberian-sun-readme-first/ + + +LAN MULTIPLAYER + +Tiberian Sun's LAN Multiplayer natively uses IPX. To replace this with UDP, a replacement binary is required. Download ts_ra2_lanpatch_1_00.zip and place wsock32.dll in the game's SUN/ directory (under $HOME/.tiberiansun/). Note that this patch will break online multiplayer, but it can simply be removed to restore that functionality. + +One potential source of the patch zip: http://digiex.net/downloads/download-center-2-0/games/3423-tiberian-sun-red-alert-2-lan-patch.html + + +GAME SERIALS + +An unfortunate oversight of EA, when they released the game as freeware, was forgetting about the multiplayer mode's check on game serials. When more than two people join a game, they have to have unique serial numbers. Fortunately, there is a way around this, however it requires downloading a utility released by a software cracking group. + +Razor 1911 released rzrtsfix.zip in 1999. This zip contains an executable that will set a random serial number for your game. Read the NFO file in the zip for more information. + +One potential source of the serial zip (caution, this is not the safest site on the internet): http://gf.wiretarget.com/tiberian_sun.htm +Scroll to the bottom and download the link labelled "Serial Changer Done by Razor 1911" + +To execute the utility properly, extract the executable somewhere, cd into the SUN/ directory (under $HOME/.tiberiansun/), and run the following: +WINEPREFIX="$HOME/.tiberiansun/tiberiansun" WINEARCH="win32" wine $pathToUtility 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 diff --git a/launch-tiberiansun.sh b/launch-tiberiansun.sh new file mode 100644 index 000000000000..a34e34f9687c --- /dev/null +++ b/launch-tiberiansun.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +# Assuming the script is under this dir +DIR="/opt/tiberiansun" + +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" + +launchgame() { + cd "$gamedir" + if ! [ "$?" -eq 0 ] + then + echo "ERROR: Couldn't cd into game working directory." + echo "Examine '$gamedir'." + echo "Delete '$usrdir' and re-execute this script to recreate it." + return 1 + fi + + # Running explorer is a small hack to get windowed mode working correctly + # without having to change the X11 screen colour depth. The resolution can + # be adjusted in-game, and sticks for future runs. Running the game + # non-windowed causes a variety of graphical glitches. + WINEDEBUG='-all' wine explorer /desktop=tiberiansun,800x600 ./SUN.EXE + exitcode="$?" + + if ! [ "$exitcode" -eq 0 ] + then + echo "wine exited abnormally. It's possible that the WINEPREFIX needs to be recreated." + echo "Delete '$usrdir' and re-execute this script to recreate the WINEPREFIX dir." + echo "Make sure to backup any saved games that directory contains before deleting it." + return $exitcode + fi + return 0 +} + + +createprefix() { + # Set up basic stuff with wineboot + echo ">>> wineboot" + mkdir "$usrdir" + wineboot + if ! [ "$?" -eq 0 ] + then + echo "wineboot exited abnormally. Can't create the wineprefix at '$prefixdir'." + return 1 + fi + + # Prepare copies/symlinks of files required by the game + mkdir -p "$gamedir" + + respath="$DIR/SUN" + + echo ">>> Game files" + # Files that are written to + cp "$respath/SUN.INI" "$gamedir/" + cp "$respath/Woldata.key" "$gamedir/" + + # Files/subdirs that are only ever read + readonlyFiles=$(ls -1 "$respath/" | grep -vE 'SUN\.INI|Woldata\.key') + for file in $readonlyFiles + do + ln -s -T "$respath/$file" "$gamedir/$file" + done + + echo ">>> MS Components" + # Install DirectX (minimum version is 6) + winetricks d3dx9 + + echo ">>> Multiplayer" + # Multiplayer setup + mkdir -p "$gamedir/Internet/" + cp "$DIR/Internet/NL.CFG" "$gamedir/Internet/" + cp "$DIR/Internet/WOLAPI.INI" "$gamedir/Internet/" + readonlyFiles=$(ls -1 "$DIR/Internet" | grep -vE 'NL\.CFG|WOLAPI\.INI') + for file in $readonlyFiles + do + ln -s -T "$DIR/Internet/$file" "$gamedir/Internet/$file" + done + + wine regedit "$gamedir/Internet/tibsun_regadd.reg" || echo "regedit failed" + pushd "$gamedir/Internet" >/dev/null + wine regsvr32 WOLAPI.dll + wine regsvr32 WOLBrowser.dll + popd >/dev/null + + # Resolution + echo ">>> Enable high resolution screen support" + sed -i -e 's/\[Video\]/[Video]\r\nAllowHiResModes=true/' "$gamedir/SUN.INI" + + # TODO Speed decrease? +} + + +# Create the directory if it does not exist, then run the game. +if ! [ -d $usrdir ] +then + echo "Creating wineprefix for the game. This only needs to be done once, future runs will skip this step." + # Don't continue if there's an error when creating the prefix + createprefix || exit $? + echo "Wineprefix creation complete, running the game." +fi + +launchgame +exit $? diff --git a/tiberiansun.desktop b/tiberiansun.desktop new file mode 100644 index 000000000000..7446106f7aef --- /dev/null +++ b/tiberiansun.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Icon=/usr/share/icons/tiberiansun.ico +Exec=/usr/bin/tiberiansun +Terminal=false +StartupNotify=false + +Name=Tiberan Sun +Comment=GDI and NOD battle in a future Earth seeded with the extraterrestrial substance Tiberium. + +Categories=Game; + diff --git a/tiberiansun.install b/tiberiansun.install new file mode 100644 index 000000000000..7b7c8b0fa09f --- /dev/null +++ b/tiberiansun.install @@ -0,0 +1,10 @@ +post_install() { + if [[ "$(uname -m)" =~ "64" ]] + then + echo "If you are using 64-bit architecture, don't forget to install a 32-bit graphics driver." + fi +} + +post_remove() { + echo "To completely clean all files generated from this package, delete ~/.tiberiansun" +} |