X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=roguelike;h=b00272187288eed4be40d1bb8df26872623ae831;hb=c94c0575b191d0162d8a1cbbbe4e59cca2e40324;hp=dadab3cb2c776725c4b496a9e623115cb08d869a;hpb=1c7e780b3486f025aed46957328cba88983c34b1;p=plomrogue
diff --git a/roguelike b/roguelike
index dadab3c..b002721 100755
--- a/roguelike
+++ b/roguelike
@@ -1,27 +1,12 @@
#!/bin/sh
-# Abort the script on error.
-set -e
-
-# Use the shell script's arguments to the server's arguments.
-./roguelike-server $@ &
-
-# Give server some time to start up and exit on error.
-sleep 0.01
-
-# The client should not start if the server is not running. (If the server was
-# running in the foreround, any error exit of it so far would be caught by "set
-# -e" above. But "set -e" is blind to error codes generated in the background.)
-kill -0 $! 2> /dev/null
-
-# Give server some time (max. 10 seconds) to generate its out file.
-i=0
-while [ ! -e server/out ] && [ $i -le 10000 ]
-do
- sleep 0.01
- i=`expr $i + 1`
-done
-kill -0 $! 2> /dev/null
-
-# Only start the interface when everything else went well.
-./roguelike-client
+# Wrapper to the script so that its suppressed server messages get read on exit.
+./start_server_client_union.sh "$@"
+
+# For some reason, mere sync won't ensure a log is written out, so wait a while.
+sync
+sleep 0.5
+if [ -e ./log ]
+then
+ cat log
+fi