mindor/area/
mindor/data/
mindor/data/bank/
mindor/data/hometown/
mindor/log/
mindor/player/
#!/bin/tcsh

set areapath = /usr/home/mindor/game/mindor/area
set port = 4040
set wwwport = 4041

cd $areapath

# Set limits.
if ( -e shutdown.txt ) rm -f shutdown.txt

while ( 1 )
    # If you want to have logs in a different directory,
    #   change the 'set logfile' line to reflect the directory name.
    set index = 1000
    while ( 1 )
	set logfile = ../log2/$index.log
	if ( ! -e $logfile ) break
	@ index++
    end

    # Copy rot binary from bin directory.
    # after a compile, place the new binary in the bin directory,
    # this way a reboot will install the new binary, instead of
    # of having to shut down.
    rm -f ./mindortest
    cp ../src2/mindor ../area/mindortest
    # Run mindor .
    ./mindortest $port $wwwport >&! $logfile

    # Restart, giving old connections a chance to die.
    sleep 15
end