Commit dafa39df authored by Jolan RENOUX's avatar Jolan RENOUX
Browse files

maj test3

parent dd8f3c74
......@@ -18,7 +18,7 @@ import java.util.ArrayList;
* @version 1.0
*/
public class Application {
public static void main(String[] args) throws InterruptedException, BadCoordException, CoordsBadShipException, UncompleteFleetException, UnirestException, BadIdException {
public static void main(String[] args) throws InterruptedException {
FenetreConnexion fc = new FenetreConnexion("Connexion au serveur et aux parties");
// http://172.26.82.18//api/v0 (URL à changer si ca ne marche pas)
......@@ -27,6 +27,9 @@ public class Application {
fc.pack();
fc.setVisible(true);
Network.setProxy("srv-proxy-etu-2.iut-nantes.univ-nantes.prive",3128);
Network.enableProxy(true);
//TODO IHM changer le nom de jaquie
Player jaquie = new Player("Jaquie");
try {
......@@ -37,10 +40,12 @@ public class Application {
//TODO Init fleet avec boucle listener ect
NavyFleet fleet = new NavyFleet();
fleet.add(new AircraftCarrier("porteavion1","A1","A6"));
fleet.add(new AircraftCarrier("porteavion2","B1","B6"));
fleet.add(new AircraftCarrier("porteavion3","C1","C6"));
fleet.add(new AircraftCarrier("porteavion4","D1","D6"));
try {
fleet.add(new AircraftCarrier("porteavion1","A1","A6"));
fleet.add(new AircraftCarrier("porteavion2","B1","B6"));
fleet.add(new AircraftCarrier("porteavion3","C1","C6"));
fleet.add(new AircraftCarrier("porteavion4","D1","D6"));
} catch (BadCoordException e) {e.printStackTrace();} catch (CoordsBadShipException e) {e.printStackTrace();}
ArrayList<Game> parties = new ArrayList<Game>();
......@@ -48,8 +53,12 @@ public class Application {
//TODO Init game ou rejoindre
Game newGame = new Game((int) Math.random());
Network.initNewGame("http://37.187.38.219/api/v0/",jaquie,fleet);
try {
Game newGame = new Game((int) Math.random());
} catch (BadIdException e) {e.printStackTrace();}
try {
Network.initNewGame("http://37.187.38.219/api/v0/",jaquie,fleet);
} catch (UnirestException e) {e.printStackTrace();} catch (UncompleteFleetException e) {e.printStackTrace();} catch (BadCoordException e) {e.printStackTrace();}
......
......@@ -21,9 +21,11 @@ import static org.junit.jupiter.api.Assertions.*;
*/
public class RunningGameTest {
//ancien url: http://37.187.38.219/api/v0
//http://37.187.38.219/api/v0
//http://172.26.82.18//api/v0
public static final String HTTP_LOCALHOST = "http://37.187.38.219/api/v0/";
static Player joueur1;
static Player joueur2;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment