[^misantropia^] little insite if you have some time.

Locked
redonkuless
Posts: 15
Joined: Mon Jan 09, 2012 11:58 pm

[^misantropia^] little insite if you have some time.

Post by redonkuless »

[^misantropia^],

You seem to know a bit about php, and development, even though this question isn't directly connected to the SDK or development for game enhancement, I was wondering if I could try to bounce some ideas off you. I'm not sure if you saw the site I'm making, but its not just for ufreeze (q3 mod) or just for quake, however I'm starting with Ufreeze(q3). In this I'm going to be archiving everything I can from dev libraries, to maps, to scripts, to mods, ect. Right now I'm starting with creating an archive of lvlworld and integrating the archive into the site, and I guess this is where the development question comes in. My question is the best approach to integration, Right now I have a script that is written in perl that reads a Directory that has the maps in it, and creates a simple 5 column table. What I'm wanting to do is create a script that unzip's the zip file to a tmp directoy, and then checks to see the content of that zip file. Most of the zip files have either one or more of the following: Img, txt, html, pk3.

So my idea is to:
Masterlist.txt

Read Dir
foreach zip{
unzip zip temp dir {
Read tempDir {
mkdir $pk3name;
if dir contains (txt, img, html) { rename(content to pk3 name)
if dir contains(txt) { open file, format to html; move html $pk3name; Print FILE $masterlist.txt "$pk3name:pk3name.html" }
if dir contains(img) { move $pk3name.img $pk3name; print file $masterlist.txt "$pk3name:pk3name.img"}
mv $Pk3namedir /mapdir/
}


Now after the masterlist.txt is full, editing the first perl script that creates that 5column table and doing a java overlib layout to display the images if the maps have images including the txt that was turned into html and or display the original html.

I'm currently using wordpress, If you have a better idea on the approach it would be appreciated.

Redonkuless -
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: [^misantropia^] little insite if you have some time.

Post by Eraser »

Sorry to be so blunt, but what exactly is your question?
redonkuless
Posts: 15
Joined: Mon Jan 09, 2012 11:58 pm

Re: [^misantropia^] little insite if you have some time.

Post by redonkuless »

ugh your right, question is, is there a better way to do this?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: [^misantropia^] little insite if you have some time.

Post by ^misantropia^ »

It's simple and if it works well for you, I wouldn't change it.

Watch out with `mkdir $pk3name`. If a hypothetical Mr. Attacker manages to sneak in arbitrary characters there, he could compromise your system. Think $pk3name == "foo; while true; do nc -l 0.0.0.0 8000 | xargs sh -c; done"
redonkuless
Posts: 15
Joined: Mon Jan 09, 2012 11:58 pm

Re: [^misantropia^] little insite if you have some time.

Post by redonkuless »

this would be a shell perl script that I would write, so its not web facing, its just going to generate the table html code.
Locked