0.2.9-sty+ct_alpha_r758 --input problem

Post here if you need help setting up your server, etc.
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

hey there!

I'm running the server version: 0.2.9-sty+ct_alpha_r758 unix dedicated

Lately when I tried using --input "path/to/file", the server doesn't read the data streaming to the file.

Is this a fixable problem?
Image
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by Jip »

Do you append to the file or whipe it before writing?
It will only work if you append to the file.
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

im appending to the file... is that the problem?
Image
User avatar
Jip
Round Winner
Posts: 397
Joined: Sat Sep 26, 2009 5:32 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by Jip »

LOVER$BOY wrote:im appending to the file... is that the problem?
Jip wrote:It will only work if you append to the file.
Doublecheck your path? Sorry, can't help more.
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

ya I double checked the path but it isn't working.

The only way it is working right now is by using tail -n0 -f -s 0.01 $cmd | $tron | tee $log but I don't like to use tail because for some reason the server isn't restarting when it crashes and im thinking it's got something to do with tail being in there...
Image
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

ya I double checked the path but it isn't working.

The only way it is working right now is by using tail -n0 -f -s 0.01 $cmd | $tron | tee $log but I don't like to use tail because for some reason the server isn't restarting when it crashes and im thinking it's got something to do with tail being in there...
Image
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

ya I double checked the path but it isn't working.

The only way it is working right now is by using tail -n0 -f -s 0.01 $cmd | $tron | tee $log but I don't like to use tail because for some reason the server isn't restarting when it crashes and im thinking it's got something to do with tail being in there...
Image
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

damit ... i got laged and posted too many times :(
Image
User avatar
vov
Match Winner
Posts: 568
Joined: Thu Feb 17, 2011 8:40 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by vov »

LOVER$BOY wrote:ya I double checked the path but it isn't working.

The only way it is working right now is by using tail -n0 -f -s 0.01 $cmd | $tron | tee $log but I don't like to use tail because for some reason the server isn't restarting when it crashes and im thinking it's got something to do with tail being in there...
I didn't know about input and had made a hacky (and now lost, can't post it because of that, sorry :/) addition to that tail -n0.... script which checked like every few minutes if the server was still running, if not, it killed all the other stuff and started over. Maybe that's an idea for a workaround.

Code: Select all

-d, --daemon                 : allow the dedicated server to run as a daemon
                               (will not poll for input, unless overridden by --input)
--input <file>               : Poll for input from this file in addition to/instead of
                              (if -d is also given) stdin. Can be used multiple times.
Does it work with -d and --input? I don't think it will make any difference but don't know, maybe it's that.
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

so u want me to try

Code: Select all

$tron -d --input $file
Image
User avatar
vov
Match Winner
Posts: 568
Joined: Thu Feb 17, 2011 8:40 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by vov »

Hmm never mind, I tested --input and it works perfectly with executing server (same version as you) and parser (something that outputs a test message when i enter) via

Code: Select all

tail -n0 -f -s 0.01 $ladderlog | $parser | tee -a $foo
(exactly like here) and

Code: Select all

$tron --userconfigdir $userconfigdir --vardir $var --input $foo
with the --input, where $foo is the file the server reads from.

Maybe it has problems with $file because "file" is a console command as well.
If you're writing to the file from the parser in another way than this quick&dirty test, it's that part which fails, --input is fine.
If you basically have the same code, well, triple check the path.
I don't know if it cares for absolute/relative paths, I used the absolute path for $foo in the test (/home/username/testfile in that case).

Edit: whoops, fixed the code blocks
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

well $file was just an example but im using currently:

Code: Select all

#!/bin/bash

loc="/home/arma/loverboy/alpha2/"
tron=$loc"bin/armagetronad-dedicated"
server=$loc"server/"
vardir=$loc"var/"
log=$server"console.log"
cmd=$server"cmd.txt"         
                                 
mkdir $server"logs"
screen -S racingserver -X logtstamp on
screen -S racingserver -X logfile $server"logs/"racingserver.log
screen -S racingserver -X log on

while true; do
	tail -n0 f -s 0.01 $cmd | $tron --vardir $vardir | tee -a $log
	echo "======================== Server Restarting ========================" >> $log
	sleep 5
done
so I replace tail line with

Code: Select all

$tron --input $cmd --vardir $vardir | tee -a $log
you think that's the way to go about it?
Image
User avatar
vov
Match Winner
Posts: 568
Joined: Thu Feb 17, 2011 8:40 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by vov »

LOVER$BOY wrote: so I replace tail line with

Code: Select all

$tron --input $cmd --vardir $vardir | tee -a $log
you think that's the way to go about it?
Exactly. At least that's what worked for me.
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

right I'll see if it works now.
Image
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: 0.2.9-sty+ct_alpha_r758 --input problem

Post by LOVER$BOY »

No, it didn't work...

BTW, appending to the file as in like this?:

Code: Select all

tail -n0 -f -s 0.01 $ladderlog | php ./script.php >> $cmd
Is that the way you're talking about Jip?
Image
Post Reply