-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.sh
executable file
·38 lines (29 loc) · 889 Bytes
/
launch.sh
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
#!/bin/bash
Port=2222
Server=jeux.cam.main.Server
ClientJeu=cam.ClientJeu
Joueur=cam.modele.JoueurCam
AddrServer=localhost
echo "Start the server"
#java -cp target/iia.projet-1.0.jar $Server $Port >server.log 2>&1 &
java -cp obfcam.jar cam.ServeurJeu $Port 1 >server.log 2>&1 &
serverPID=$!
echo "Server launched PID: $serverPID"
sleep 1
echo "Start the first client"
java -cp target/iia.projet-1.0.jar $ClientJeu $Joueur $AddrServer $Port &
fistClientPID=$!
echo "First client launched PID: $fistClientPID"
echo "Start the second client"
java -cp target/iia.projet-1.0.jar $ClientJeu $Joueur $AddrServer $Port &
secondClientPID=$!
echo "Second client launched PID: $secondClientPID"
wait $fistClientPID
echo "The first client ended."
wait $secondClientPID
echo "The second client ended."
echo "Press any key to exit..."
read end
kill -9 $serverPID
echo "Kill the server."
exit 0