forked from Kareem-Emad/RoboGo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoslayer.sh
More file actions
78 lines (71 loc) · 2.15 KB
/
goslayer.sh
File metadata and controls
78 lines (71 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
usage()
{
echo "usage: goslayer [[[-i | --install goslayer ] [-p | --port port to run on]] | [ -u | --uri remote server uri for remote games ] [-h | --help]]"
}
uri="ws://localhost:8080"
port=9002
install=0
mode=""
debug=0
while [ "$1" != "" ]; do
case $1 in
-i | --install ) shift
install=$1
;;
-p | --port ) shift
port=$1
;;
-m | --mode ) shift
mode=$1
;;
-u | --uri ) shift
uri=$1
;;
-d | --debug ) shift
debug=$1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
if [ "$install" = "1" ]; then
echo "cloning..."
git clone git@github.com:Kareem-Emad/RoboGo.git
cd RoboGo
git checkout integration-communication
echo "Building GoSlayer ..."
rm -rf build
mkdir build
cd build
export CC=clang
export CXX=clang++
cmake -DCMAKE_BUILD_TYPE=Release ..
make
echo "Installing GoSlayer..."
mkdir ~/goslayer
cp -a ./bin ~/goslayer
cd ../src/GUI
cp -a ./client ~/goslayer
echo "installation complete!!!"
else
echo "file:///home/$USER/goslayer/client/index.html?port=$port";
firefox "file:///home/$USER/goslayer/client/index.html?port=$port" &
if [ "$mode" -ne "" ]; then
if [ "$debug" = "1" ]; then
~/goslayer/bin/goslayer-executable --mode $mode --port $port --uri $uri
else
~/goslayer/bin/goslayer-executable --mode $mode --port $port --uri $uri &
fi
else
if [ "$debug" = "1" ]; then
~/goslayer/bin/goslayer-executable --port $port --uri $uri
else
~/goslayer/bin/goslayer-executable --port $port --uri $uri &
fi
fi
fi