diff --git a/pom.xml b/pom.xml
index e5a1b07..b107540 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,8 +14,8 @@
UTF-8
- 1.7
- 1.7
+ 8
+ 8
diff --git a/src/main/java/com/cse3310/App.java b/src/main/java/com/cse3310/App.java
index 5ac9b21..20af118 100644
--- a/src/main/java/com/cse3310/App.java
+++ b/src/main/java/com/cse3310/App.java
@@ -26,15 +26,15 @@ public class App extends WebSocketServer
int GameID;
public App(int port){
-
+ super(new InetSocketAddress(port));
}
public App(InetSocketAddress address){
-
+ super(address);
}
public App(int port, Draft_6455 draft){
-
+ super(new InetSocketAddress(port), Collections.singletonList(draft));
}
@Override
@@ -77,19 +77,32 @@ public void onMessage(WebSocket conn, String message) {
@Override
public void onError(WebSocket conn, Exception ex) {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("Unimplemented method 'onError'");
+ ex.printStackTrace();
+ if (conn != null) {
+ // some errors like port binding failed may not be assignable to a specific
+ // websocket
+ }
}
@Override
public void onStart() {
- // TODO Auto-generated method stub
- throw new UnsupportedOperationException("Unimplemented method 'onStart'");
+ System.out.println("Server started!");
+ setConnectionLostTimeout(0);
}
-
-
public static void main(String[] args) {
-
+ // Set up the http server
+ String envPort = System.getenv("HTTP_PORT");
+ int httpPort = Integer.parseInt(envPort);
+ HttpServer H = new HttpServer(httpPort, "./html");
+ H.start();
+ System.out.println("http Server started on port:" + httpPort);
+
+ // create and start the websocket server
+ envPort = System.getenv("WEBSOCKET_PORT");
+ int socketPort = Integer.parseInt("envPort");
+ App A = new App(socketPort);
+ A.start();
+ System.out.println("websocket Server started on port: " + socketPort);
}
}
diff --git a/src/main/java/com/cse3310/Coordinate.java b/src/main/java/com/cse3310/Coordinate.java
index e052594..0469db9 100644
--- a/src/main/java/com/cse3310/Coordinate.java
+++ b/src/main/java/com/cse3310/Coordinate.java
@@ -4,7 +4,7 @@ class Coordinate {
public int x;
public int y;
- public void Coordinate(int x, int y){
+ public Coordinate(int x, int y){
this.x = x;
this.y = y;
}
diff --git a/src/main/java/com/cse3310/Game.java b/src/main/java/com/cse3310/Game.java
index a160a11..00e7bd8 100644
--- a/src/main/java/com/cse3310/Game.java
+++ b/src/main/java/com/cse3310/Game.java
@@ -32,7 +32,7 @@ public void checkWin(User user){
}
- public String keepScore(ArrayList score){
+ public String keepScore(ArrayList score){
return "";
}
diff --git a/target/classes/com/cse3310/App.class b/target/classes/com/cse3310/App.class
index f367054..6418857 100644
Binary files a/target/classes/com/cse3310/App.class and b/target/classes/com/cse3310/App.class differ
diff --git a/target/classes/com/cse3310/Coordinate.class b/target/classes/com/cse3310/Coordinate.class
index f699dd8..f984aef 100644
Binary files a/target/classes/com/cse3310/Coordinate.class and b/target/classes/com/cse3310/Coordinate.class differ
diff --git a/target/classes/com/cse3310/Game.class b/target/classes/com/cse3310/Game.class
index 35d8130..4e5b09b 100644
Binary files a/target/classes/com/cse3310/Game.class and b/target/classes/com/cse3310/Game.class differ
diff --git a/target/classes/com/cse3310/HttpServer$1.class b/target/classes/com/cse3310/HttpServer$1.class
index ff5f4de..3218db9 100644
Binary files a/target/classes/com/cse3310/HttpServer$1.class and b/target/classes/com/cse3310/HttpServer$1.class differ
diff --git a/target/classes/com/cse3310/HttpServer.class b/target/classes/com/cse3310/HttpServer.class
index 2b6716b..586c59a 100644
Binary files a/target/classes/com/cse3310/HttpServer.class and b/target/classes/com/cse3310/HttpServer.class differ
diff --git a/target/classes/com/cse3310/Locations.class b/target/classes/com/cse3310/Locations.class
index a69f779..21d4d2a 100644
Binary files a/target/classes/com/cse3310/Locations.class and b/target/classes/com/cse3310/Locations.class differ
diff --git a/target/classes/com/cse3310/ServerEvent.class b/target/classes/com/cse3310/ServerEvent.class
index c29c1ae..2ec5abb 100644
Binary files a/target/classes/com/cse3310/ServerEvent.class and b/target/classes/com/cse3310/ServerEvent.class differ
diff --git a/target/classes/com/cse3310/User.class b/target/classes/com/cse3310/User.class
index d376a46..906400f 100644
Binary files a/target/classes/com/cse3310/User.class and b/target/classes/com/cse3310/User.class differ
diff --git a/target/classes/com/cse3310/UserEvent.class b/target/classes/com/cse3310/UserEvent.class
index 2049cc9..3acce81 100644
Binary files a/target/classes/com/cse3310/UserEvent.class and b/target/classes/com/cse3310/UserEvent.class differ
diff --git a/target/cse3310-wordsearch.jar b/target/cse3310-wordsearch.jar
new file mode 100644
index 0000000..c83d8c9
Binary files /dev/null and b/target/cse3310-wordsearch.jar differ
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
new file mode 100644
index 0000000..9cd0eb6
--- /dev/null
+++ b/target/maven-archiver/pom.properties
@@ -0,0 +1,4 @@
+#Created by Apache Maven 3.9.6
+artifactId=cse3310
+groupId=com.cse3310_sp24_group26
+version=wordsearch
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index e69de29..a124adc 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -0,0 +1,9 @@
+com/cse3310/Coordinate.class
+com/cse3310/ServerEvent.class
+com/cse3310/Locations.class
+com/cse3310/HttpServer.class
+com/cse3310/HttpServer$1.class
+com/cse3310/UserEvent.class
+com/cse3310/User.class
+com/cse3310/App.class
+com/cse3310/Game.class
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 5f81ea2..1240858 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -6,4 +6,3 @@
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/User.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/Locations.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/App.java
-/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/WebSocket.java
diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
new file mode 100644
index 0000000..1d907bd
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
@@ -0,0 +1 @@
+com/cse3310/AppTest.class
diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
new file mode 100644
index 0000000..ddf09ab
--- /dev/null
+++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
@@ -0,0 +1 @@
+/workspaces/cse3310_sp24_group_26/src/test/java/com/cse3310/AppTest.java
diff --git a/target/surefire-reports/TEST-com.cse3310.AppTest.xml b/target/surefire-reports/TEST-com.cse3310.AppTest.xml
new file mode 100644
index 0000000..0454e51
--- /dev/null
+++ b/target/surefire-reports/TEST-com.cse3310.AppTest.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/target/surefire-reports/com.cse3310.AppTest.txt b/target/surefire-reports/com.cse3310.AppTest.txt
new file mode 100644
index 0000000..1bfe75a
--- /dev/null
+++ b/target/surefire-reports/com.cse3310.AppTest.txt
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------------------
+Test set: com.cse3310.AppTest
+-------------------------------------------------------------------------------
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.051 s - in com.cse3310.AppTest
diff --git a/target/test-classes/com/cse3310/AppTest.class b/target/test-classes/com/cse3310/AppTest.class
index 35d0340..50dc4d7 100644
Binary files a/target/test-classes/com/cse3310/AppTest.class and b/target/test-classes/com/cse3310/AppTest.class differ