rotation script
rotation script
Hi again,
I'm trying to make a race server with the map changing every 3 rounds, but i cant get the script to work.
I did exactly what was said in the wiki here: http://wiki.armagetronad.org/index.php/ ... u_Computer
I hope anyone can help me.
thx in advance,
$NAK3
I'm trying to make a race server with the map changing every 3 rounds, but i cant get the script to work.
I did exactly what was said in the wiki here: http://wiki.armagetronad.org/index.php/ ... u_Computer
I hope anyone can help me.
thx in advance,
$NAK3
- kyle
- Reverse Outside Corner Grinder
- Posts: 1876
- Joined: Thu Jun 08, 2006 3:33 pm
- Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
- Contact:
Re: rotation script
need a more detailed description of the problem
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
Re: rotation script
E.g., error messages, the exact steps you have taken, what happens instead of what you expect. (Does it change after 4 rounds, 2 rounds, every round, etc.?)
Re: rotation script
Snake, youve aready asked me on tron… you probley just aren't using my advice correctly.
Last edited by nelg on Wed May 02, 2012 10:05 pm, edited 1 time in total.
Re: rotation script
He said the script doesn't do ANYTHING... he didn't say it didn't not work INCORRECTLYTank Program wrote:E.g., error messages, the exact steps you have taken, what happens instead of what you expect. (Does it change after 4 rounds, 2 rounds, every round, etc.?)
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
Re: rotation script
All I see is he can't get the script to work. If he said it elsewhere, why are you battering Tank Program?nelg wrote:He said the script doesn't do ANYTHING...
Did this really just happen? What you're saying is he didn't deny that the script works correctly.nelg wrote:he didn't say it didn't not work INCORRECTLY
Anyway, this stuff isn't my forte so I can't be too specific, but more information is definitely needed. Those instructions presumably work for many people; if it simply "doesn't work" for you, all people can say to that is "works for me." The best way to start if you're clueless is to state exactly what you've done. Don't skip anything that seems obvious to you, because others do do things differently, and this sort of miscommunication is precisely what makes problems hard to solve.
ˌɑrməˈɡɛˌtrɑn
- kyle
- Reverse Outside Corner Grinder
- Posts: 1876
- Joined: Thu Jun 08, 2006 3:33 pm
- Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
- Contact:
Re: rotation script
well what does the screen with say?
Code: Select all
./start_race_parser.sh
- Phytotron
- Formerly Oscilloscope
- Posts: 5041
- Joined: Thu Jun 09, 2005 10:06 pm
- Location: A site or situation, especially considered in regard to its surroundings.
- Contact:
Re: rotation script
That did not just happen!Jonathan wrote:Did this really just happen?nelg wrote:he didn't say it didn't not work INCORRECTLY
Laughed equally hard at both. Or, I didn't not say I didn't not laugh unequally soft at neither.
Re: rotation script
LOL! ''What you're saying is he didn't deny that the script works correctly.''
Thx for the movie: ''weeee.....THAT DID NOT JUST HAPPEN''
Thx for the movie: ''weeee.....THAT DID NOT JUST HAPPEN''
Re: rotation script
Ill try to explain exactly what i did:
I setup a ubuntu vps and installed armagetron. I made multiple servers by that same wiki by making a start.sh script and different folders for the different gametypes/servers. All of that works and here are the 2 files that i use to start a normal server:
Command:
start.sh:
I assume this file redirrects to a second file i created called srv.sh:
I have mado those executable to .
Now i have tried to make a racing server with a script that should rotate the map every 3 rounds (1 match). I made 3 files for this: race_rotation.php race_srv.sh and race_start.sh.
Again i use to start the server
race_start.sh:
And again i assume it redirrects to race_srv.sh
race_srv.sh:
I assume race_srv.sh should include race_rotation.php
race_rotation.php:
I made all the files displayed above executable.
When i start the server just nothing hapens, no error, no map change totaly nothing. Its almost ass if i used the start.sh instead of race_start.sh
And a spoiler mod on this forum would be realy grat
I hope this gives you enough information and i would be rlly thankfull to any sugestions.
P.S. oh and my username is dodedodo
I setup a ubuntu vps and installed armagetron. I made multiple servers by that same wiki by making a start.sh script and different folders for the different gametypes/servers. All of that works and here are the 2 files that i use to start a normal server:
Command:
Code: Select all
./start.sh [server name]
Code: Select all
#!/bin/bash
loc="/home/dodedodo/armagetronad"
# If you run the script with a parameter (server name), only that server will be start. Otherwise, all servers in
# the /home/<your_username>/armagetrnad/servers directory will be started
if [ "$1" != "" ]; then
screen -S $1 -X quit # Kill the window if it exists already, avoiding to run the same server twice
screen -dmS $1 $loc/scripts/srv.sh $1 # start a GNU screen window with the specified server inside
else
for f in $(ls $loc/scripts/servers/.) # start a loop running the following command for any existing folders in the
#/home/<your_username>/armagetronad/servers folder
do
screen -S $f -X quit # Kill the window if it exists already, avoiding to run the same server twice
screen -dmS $f $loc/scripts/srv.sh $f # start a GNU screen window with the server inside for each server folder
done # ends the loop
fi
Code: Select all
!/bin/bash
loc="/home/dodedodo/armagetronad"
tron=$loc"/bin/armagetronad-dedicated"
vardir=$loc"/servers/"$1"/var"
userconfigdir=$loc"/servers/"$1"/settings"
resourcedir=$loc"/servers/"$1"/resource/"
datapath=$loc"/servers/"$1"/var"
mkdir $loc"/servers/"$1"/logs"
screen -S $1 -X logtstamp on # print timestamps in log file
screen -S $1 -X logfile $loc"/servers/"$1"/logs/"$1_%m-%d-%Y-%c.log # create a logfile in the logs subf
screen -S $1 -X log on # Turn on logging for the server window
while true; do # start a loop to allow server restart if it crashes
#Runs the actual server. By default, the binary is called armagetronad-dedicated and is located in the prefix/bin directory. In this example, it is
# in /home/vertrex/armagetronad/bin directory.
$tron --vardir $vardir
$tron --resourcedir $resourcedir --userconfigdir $userconfigdir --vardir $vardir
# Shows the errors and indicates that the server has crashed, and then, waits 5 seconds before restarting the server, allowing you to quit with CTRL-C
echo "Server has crashed. It will restart immediately..., press CTRL-C to cancel"
sleep 5
done # end the loop
Now i have tried to make a racing server with a script that should rotate the map every 3 rounds (1 match). I made 3 files for this: race_rotation.php race_srv.sh and race_start.sh.
Again i use
Code: Select all
race_start.sh [server name]
race_start.sh:
Code: Select all
#!/bin/bash
loc="/home/dodedodo/armagetronad"
# If you run the script with a parameter (server name), only that server will be start. Otherwise, all servers in the /home/<your_username>/armagetrnad-0.2.8/servers di$
# will be started
if [ "$1" != "" ]; then
screen -S $1 -X quit # Kill the window if it exists already, avoiding to run the same server twice
screen -dmS $1 $loc/scripts/race_srv.sh $1 # start a GNU screen window with the specified server inside
else
for f in $(ls $loc/scripts/servers/.) # start a loop running the following command for any existing folders in the
# /home/<your_username>/armagetronad/servers folder
do
screen -S $f -X quit # Kill the window if it exists already, avoiding to run the same server twice
screen -dmS $f $loc/scripts/race_srv.sh $f # start a GNU screen window with the server inside for each server folder
done # ends the loop
fi
race_srv.sh:
Code: Select all
#!/bin/bash
loc="/home/dodedodo/armagetronad"
tron=$loc"/bin/armagetronad-dedicated"
vardir=$loc"/servers/"$1"/var/"
log=$var"console_log.txt"
userconfigdir=$loc"/servers/"$1"/settings/"
resourcedir=$loc"/servers/"$1"/resource"
parser=$loc"/scripts/race_rotation.php"
ladderlog=$var"ladderlog.txt"
cmd=$loc"/scripts/cmd.txt"
mkdir $loc"/servers/"$1"/logs"
screen -S $1 -X logtstamp on # print timestamps in log file
screen -S $1 -X logfile $loc"/servers/"$1"/logs/"$1_%m-%d-%Y-%c.log # create a logfile in the logs subf
screen -S $1 -X log on # Turn on logging for the server window
while true; do # start a loop to allow server restart if it crashes
#Runs the actual server. By default, the binary is called armagetronad-dedicated and is located in the prefix/bin directory. In this example, it is
# in /home/vertrex/armagetronad/bin directory.
tail -f $ladderlog | $parser | $tron --resourcedir $resourcedir --userconfigdir $userconfigdir --vardir $vardir | tee -a $log
#$tron --help
# Shows the errors and indicates that the server has crashed, and then, waits 5 seconds before restarting the server, allowing you to quit with CTRL-C
echo "Server has crashed. It will restart immediately..., press CTRL-C to cancel"
sleep 5
done # end the loop
race_rotation.php:
Code: Select all
#!/usr/bin/php
<?php
$maps=array("turtle/adventure/chasm_f-0.0.2.aamap.xml","turtle/adventure/island_f-0.0.2.aamap.xml");
while (1) {
$line = rtrim(fgets(STDIN, 1024));
if ( preg_match( "/^ROUND_COMMENCING/", $line ) ){
$keywords = preg_split("/ /", $line);
$map=rand (0 , count($maps )-1);
echo "MAP_FILE ".$maps[$map]."\n";
echo "WAIT_FOR_EXTERNAL_SCRIPT 0\n";
sleep(6);
echo "WAIT_FOR_EXTERNAL_SCRIPT 1\n";
}
}
?>
When i start the server just nothing hapens, no error, no map change totaly nothing. Its almost ass if i used the start.sh instead of race_start.sh
And a spoiler mod on this forum would be realy grat
I hope this gives you enough information and i would be rlly thankfull to any sugestions.
P.S. oh and my username is dodedodo
Re: rotation script
Try using
in the server.
With that I'm sure you can use your start.sh like the other servers, but I don't know that much about race servers... but the start and srv files looked about the same...
Code: Select all
SPAWN_SCRIPT race_rotation.php
With that I'm sure you can use your start.sh like the other servers, but I don't know that much about race servers... but the start and srv files looked about the same...
- kyle
- Reverse Outside Corner Grinder
- Posts: 1876
- Joined: Thu Jun 08, 2006 3:33 pm
- Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
- Contact:
Re: rotation script
do you have
set in your server config
Code: Select all
ladderlog_write_ROUND_COMMENCING 1
Re: rotation script
ok ill try that
and they are not totaly the same, srv.sh doesnt have race_srv.sh does
and they are not totaly the same, srv.sh doesnt have
Code: Select all
parser=$loc"/scripts/race_rotation.php"
Last edited by snake on Thu May 03, 2012 7:02 pm, edited 2 times in total.
Re: rotation script
I added ladderlog_write_ROUND_COMMENCING 1 in the server cfg and it loaded correctly. Only it didnt make a difference Im still not getting anything from the script.