File indexing completed on 2024-04-21 04:01:55

0001 #!/bin/sh
0002 
0003 # this is a simple test script setting up a situation where 4 human players
0004 # may or may not start a game.
0005 
0006 # it expects players wrmain, wr1, wr2, wr3 to already exist.
0007 
0008 serverDebug=deferredBlock # ,deferredBlock # traffic,connections,process,deferredBlock
0009 clientDebug=process # ,traffic # ,connections,traffic,process
0010 
0011 current=$(pwd)
0012 killkajongg() {
0013         for signal in 15 9
0014         do
0015                 ps axf | grep -e p[y]thon | grep -e k[a]$1 | grep -v $0 | grep -v -w vi | grep -v pylint | while read line
0016                 do
0017                         set - $line
0018                         echo killing $line
0019                         kill -$signal $1
0020                 done
0021         done
0022 }
0023 
0024 killkajongg jongg.py
0025 killkajongg jonggserver.py
0026 sleep 2
0027 
0028 ./kajonggserver.py  --debug=$serverDebug &
0029 sleep 1
0030 
0031 ./kajongg.py --host=localhost --player=wrmain --table=43 --ruleset='Classical Chinese DMJL'  --debug=$clientDebug &
0032 sleep 1
0033 
0034 for other in wr1 wr2
0035 do
0036         ./kajongg.py --host=localhost --player=$other --join=43  --debug=$clientDebug &
0037 done
0038 {
0039         cd ~/home1
0040         export HOME=$(pwd)
0041         "$current"/kajongg.py --host=localhost --player=wr3 --join=43  --debug=$clientDebug &
0042 }
0043 #sleep 2
0044 #./kajongg.py --host=localhost --player=wr99 --table=43 --debug=$clientDebug &
0045 
0046 sleep 50000
0047 killclient