Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mass mapinfo updates
08-08-2009, 11:14 AM
Post: #1
Mass mapinfo updates
With the recent separation in the Race gamemode, (Race and CTS), the mapinfos need to be updated. Being a ninja, there was no way I was going to do this manually, so I whipped up some quick and dirty scripts to ease the transition, I thought I'd document some of the process for other admins to get an idea of how this can be achieved.

mapinfos in your ~/.nexuiz/data/maps/ folder will override ones in a pk3, so this means we don't _really_ need to update and redistribute packages, which at this point might cause more harm than good. I'm using the NST framework so my mapinfos go in a slightly different place but the process for updating them is the same

Step one, isolate your maps and extract the mapinfos. I do it to a clean directory called 'mapinfos'
Code:
mkdir mapinfos
for file in $(ls *.pk3); do mapinfo=$(unzip -l $file |grep mapinfo |awk '{ print $4 }'); unzip -d mapinfos $file $mapinfo; done

this will put all the mapinfos in >> mapinfos/maps

Step two update the game type in the mapinfo, our friend sed will help us out with this.
Code:
cd mapinfos/maps
for file in *.mapinfo; do sed -i 's/type race/type cts/' $file; done

This updates all race mapinfos to cts.

Now just place these in the correct directory and restart the server.
Inspire your neighbor, they'll inspire you back.

[url=http://maps.nexuizninjaz.com]maps.nn[/url] | [url=http://pics.nexuizninjaz.com]pics.nn[/url] | [url=http://chat.nexuizninjaz.com]chat.nn[/url] | [url=http://toolz.nexuizninjaz.com/cvar]2.5 cvar browser[/url]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


Contact Us | Nexuiz Ninjaz Home | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication