2024-10-10 22:31:07 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-10-14 21:06:58 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
if ! [ -d ".git" ]; then
|
|
|
|
echo "Run in the project root"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-11-14 21:21:36 +00:00
|
|
|
OPTIND=1
|
|
|
|
|
|
|
|
server_args=""
|
|
|
|
client1_args=""
|
|
|
|
client2_args=""
|
|
|
|
client3_args=""
|
|
|
|
|
|
|
|
while getopts "d:1:2:3:" opt; do
|
|
|
|
case "${opt}" in
|
|
|
|
d) server_args="${OPTARG}" ;;
|
|
|
|
1) client1_args="${OPTARG}" ;;
|
|
|
|
2) client2_args="${OPTARG}" ;;
|
|
|
|
3) client3_args="${OPTARG}" ;;
|
|
|
|
*) echo "Invalid flag"; exit 1
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift $((OPTIND - 1))
|
|
|
|
[ "${1:-}" = "--" ] && shift
|
|
|
|
|
2024-10-14 21:06:58 +00:00
|
|
|
./scripts/build.sh
|
2024-10-10 22:31:07 +00:00
|
|
|
|
|
|
|
echo "### DAEMON ###"
|
2024-11-14 21:21:36 +00:00
|
|
|
./build/server/simworld-daemon ${server_args} &
|
2024-10-10 22:31:07 +00:00
|
|
|
sleep 1
|
|
|
|
|
|
|
|
echo "### CLIENT 1 ###"
|
2024-11-14 21:21:36 +00:00
|
|
|
./build/client/simworld-client ${client1_args}
|
2024-10-10 22:31:07 +00:00
|
|
|
|
|
|
|
echo "### CLIENT 2 ###"
|
2024-11-14 21:21:36 +00:00
|
|
|
./build/client/simworld-client ${client2_args}
|
2024-10-10 22:31:07 +00:00
|
|
|
|
2024-11-14 15:12:23 +00:00
|
|
|
echo "### CLIENT 3 ###"
|
|
|
|
sleep 1
|
2024-11-14 21:21:36 +00:00
|
|
|
./build/client/simworld-client ${client3_args}
|
2024-11-14 15:12:23 +00:00
|
|
|
|
2024-10-10 22:31:07 +00:00
|
|
|
killall simworld-daemon
|