How to change 2 maps on the fly? I got an server for my ISP clients, tho is not very populated.
I need to change between maze1 and maze2. How would I do this in PHP?
Q:Why PHP?
A:Because I learned it and liked it
how to change 2 maps on the fly?
- wrtlprnft
- Reverse Outside Corner Grinder
- Posts: 1679
- Joined: Wed Jan 04, 2006 4:42 am
- Location: 0x08048000
- Contact:
That script is intended for automatically generated maps, not for existing ones. You can basically use the same script, but instead of calling yet another script to generate the map it would have to select a random one, that's it
Here's an untested version I just hacked together:
Here's an untested version I just hacked together:
Code: Select all
#!/bin/sh
# URL for the webserver.
REMOTE_URI=http://example.com/arma/
# name for the map files. The number and the extension
# .xml get attached to it.
MAP_FILE_NAME=yourusername/fancymaze
# wow many maps you have, numbered from 0 to the number -1
NUMBER_OF_MAPS=4
# name of your everytime.cfg
EVERYTIME_CFG=$HOME/tronsrv/etc/games/armagetronad-dedicated/everytime.cfg
# In the above sample configuration you would have to make the maps
# reachable under the following adresses:
# - http://example.com/arma/yourusername/fancymaze0.xml
# - http://example.com/arma/yourusername/fancymaze1.xml
# - http://example.com/arma/yourusername/fancymaze2.xml
# - http://example.com/arma/yourusername/fancymaze3.xml
# test if the number file exist, if not, create it
while true
do
# read the next line from STDIN
read line
# if it isn't the message we're hoping for wait for
# the next one
test "$line" == "New Round" || continue
# increment our counter variable and store it
r=$RANDOM
num=`expr $r % $NUMBER_OF_MAPS`
# Output a status message
echo new map number $num
# inform the arma server to load the script
echo "MAP_FILE ""$MAP_FILE_NAME$num.xml ($REMOTE_URI$MAP_FILE_NAME$num.xml)" > "$EVERYTIME_CFG"
done