LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 03-11-2006, 04:21 AM   #1
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Cache convertor script fpr UT/UT2004


Just written this after having problems with my old one. It converts downloaded maps and other files in cache to the proper files so you don't need to redownload every time.

As you can see it is for UT99 but can easily be converted to UT2004.

Code:
#!/bin/bash  
function moveit() {
        echo $(mv $cachename$ext $utdir$1$realname 2>/dev/null ) 1>/dev/null 2>&1
        if [ ! -f $utdir$1$realname ]; then echo $realname" move failed!"; echo "";fi
}

function close() {
        rm cache.ini *.uxx 2>/dev/null
        if [ -f $utdir"System/De.u" ]; then rm $utdir"System/De.u" ;fi # optional
        if [ -f $utdir"System/de.u" ]; then rm $utdir"System/de.u" ;fi # optional
        exit 0
}

# Need to change these 2 lines:
cachedir=$HOME/.loki/ut/Cache # change to your cache dir
utdir=/mnt/str1/ut/ # change to your UT dir, or where you want to move files to

ext=".uxx"
cd $cachedir
if [ ! -f cache.ini ]; then close; fi

for line in `cat cache.ini | sed '/\[Cache\]/d'`
do
realname=${line:33:${#line}-34}
cachename=${line:0:32}
if echo "$line" | grep .unr; then moveit "Maps/"
elif echo "$line" | grep .utx; then moveit "Textures/"
elif echo "$line" | grep .uax; then moveit "Sounds/"
elif echo "$line" | grep .umx; then moveit "Music/"
elif echo "$line" | grep .u; then moveit "System/"
else close
fi
done
close

Last edited by dive; 03-16-2006 at 12:50 PM.
 
Old 03-11-2006, 04:55 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Original Poster
Rep: Reputation: Disabled
UT2004 version:

Code:
#!/bin/bash 
function moveit() {
        echo $(mv $cachename$ext $utdir$1$realname 2>/dev/null) 1>/dev/null 2>&1
        if [ ! -f $utdir$1$realname ]; then echo $realname" move failed!"; echo "";fi
}

function close() {
        rm cache.ini *.uxx 2>/dev/null
        if [ -f $utdir"System/den_p1p0-Hack.u" ]; then rm $utdir"System/den_p1p0-Hack.u" ;fi
        exit 0
}

# Need to change this line:
utdir=/mnt/str4/ut2004/ # change to your UT dir, or where you want to save files

cachedir=$HOME/.ut2004/Cache
ext=".uxx"
cd $cachedir
if [ ! -f cache.ini ]; then close; fi

for line in `cat cache.ini | sed '/\[Cache\]/d'`
do
realname=${line:35:${#line}-34}
cachename=${line:0:34}
if echo "$line" | grep .ut2; then moveit "Maps/"
elif echo "$line" | grep .utx; then moveit "Textures/"
elif echo "$line" | grep .uax; then moveit "Sounds/"
elif echo "$line" | grep .ogg; then moveit "Music/"
elif echo "$line" | grep .usx; then moveit "StaticMeshes/"
elif echo "$line" | grep .ukx; then moveit "Animations/"
elif echo "$line" | grep .u; then moveit "System/"
else close
fi
done
close

Last edited by dive; 03-16-2006 at 12:51 PM.
 
Old 03-16-2006, 12:37 PM   #3
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Original Poster
Rep: Reputation: Disabled
Small update to both these - had an occasional looping problem
 
Old 04-14-2006, 07:48 PM   #4
awood123456
LQ Newbie
 
Registered: Sep 2004
Location: Waterloo, Ontario, Canada
Distribution: Fedora Core
Posts: 3

Rep: Reputation: 0
Cache Cleaner

Looks good. Once I get my UT up and running (my first linux client, I've set up two linux servers, working on third), I'll give this a try. Most of the clients are Windoze, and the Cache Cleaner 3.0 (from SourceForge, I think) works well for moving downloaded Maps (et al) to their perspective directories.

Thanks.

... Woody
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ram wiht suse, cache Disk cache??? fadelhomsi Linux - Newbie 2 02-05-2006 11:29 PM
Install script errors when installing UT2004 xnomad Linux - Software 4 08-01-2005 07:21 AM
unreal tournament cache cleaner script dive Linux - Games 0 07-25-2005 05:38 PM
unreal tournament cache cleaner script dive Linux - Software 1 07-25-2005 05:35 PM
Error: Caching enabled and local cache: //var/cache/yum/base/primary.xml.gz does... dr_zayus69 Linux - Software 2 07-06-2005 04:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration