Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luke #5

Merged
merged 5 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes
File renamed without changes.
10 changes: 4 additions & 6 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@
<link rel="stylesheet" href="bootstrap-5.3.3-dist/aos/aos-next/src/sass/aos.scss" />
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />



</head>

<body>
<div>
<div class="container-fluid custom-footer" data-aos="fade-down">
<nav class="navbar navbar-expand-sm navbar-dark container">
<a href="index.html" class="navbar-brand" ><img src="asset/navBarIcon.png" width="200" height="70"></a>
<a href="index.html" class="navbar-brand" ><img src="../asset/navBarIcon.png" width="200" height="70"></a>


<!-- Create ticket to fix this, doesn't respone on click -->
Expand Down Expand Up @@ -162,10 +160,10 @@ <h1>LEADERBOARD</h1>



<script src="../bootstrap-5.3.3-dist/js/bootstrap.js"></script>
<script src="../bootstrap-5.3.3-dist/js/js.js"></script>
<script src="bootstrap-5.3.3-dist/js/bootstrap.js"></script>
<script src="bootstrap-5.3.3-dist/js/js.js"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script src="../bootstrap-5.3.3-dist/js/usernameValidation.js"></script>
<script src="bootstrap-5.3.3-dist/js/usernameValidation.js"></script>

<script>AOS.init();</script>
<script src="usernameValidation.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion html/match.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<body>
<div class="container-fluid custom-footer" data-aos="fade-down">
<nav class="navbar navbar-expand-sm navbar-dark container">
<a href="index.html" class="navbar-brand" ><img src="asset/navBarIcon.png" width="200" height="70"></a>
<a href="index.html" class="navbar-brand" ><img src="../asset/navBarIcon.png" width="200" height="70"></a>


<!-- Create ticket to fix this, doesn't respone on click -->
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/com/cse3310/App.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.cse3310;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
Expand All @@ -16,6 +17,7 @@
import java.util.Timer;
import java.util.TimerTask;
import java.util.Vector;
import java.util.ArrayList;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
Expand All @@ -24,6 +26,7 @@ public class App extends WebSocketServer
{
Vector<Game> ActiveGames = new Vector<Game>();
int GameID;


public App(int port){
super(new InetSocketAddress(port));
Expand Down Expand Up @@ -91,6 +94,21 @@ public void onStart() {
}

public static void main(String[] args) {
String filename = "words.txt";
//Read in file of words
ArrayList<String> wordList = new ArrayList<>();
try(BufferedReader br = new BufferedReader(new FileReader(filename)))
{
String line;
while((line = br.readLine()) != null)
{
wordList.add(line.trim());
}
}
catch (IOException e)
{
System.err.println("Error reading file:"+ e.getMessage());
}
// Set up the http server
try{
String envPort = System.getenv("HTTP_PORT");
Expand All @@ -101,6 +119,7 @@ public static void main(String[] args) {
else{
httpPort = 9026;
}

HttpServer H = new HttpServer(httpPort, "./html");
H.start();
System.out.println("http Server started on port:" + httpPort);
Expand All @@ -114,12 +133,15 @@ public static void main(String[] args) {
else{
socketPort = 9126;
}

App A = new App(socketPort);
A.start();
System.out.println("websocket Server started on port: " + socketPort);
}
catch (NullPointerException e){ // Checks for environment variable
e.printStackTrace();
}


}
}
5 changes: 3 additions & 2 deletions src/main/java/com/cse3310/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
public class Game{
private ArrayList<User> users;
public int GameId;
public int[][] grid;
public char[][] grid;

public Game()
public Game(ArrayList words)
{
grid = new char[50][50];

}

Expand Down
Binary file modified target/classes/com/cse3310/App.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/Coordinate.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/Game.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/HttpServer$1.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/HttpServer.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/Locations.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/ServerEvent.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/User.class
Binary file not shown.
Binary file modified target/classes/com/cse3310/UserEvent.class
Binary file not shown.
Binary file modified target/cse3310-wordsearch.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Created by Apache Maven 3.9.6
artifactId=cse3310
groupId=com.cse3310_sp24_group26
artifactId=cse3310
version=wordsearch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
com/cse3310/Locations.class
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/HttpServer.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/Coordinate.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/ServerEvent.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/UserEvent.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/User.java
/workspaces/cse3310_sp24_group_26/src/main/java/com/cse3310/UserEvent.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
39 changes: 21 additions & 18 deletions target/surefire-reports/TEST-com.cse3310.AppTest.xml
Original file line number Diff line number Diff line change
@@ -1,57 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="com.cse3310.AppTest" time="0.051" tests="1" errors="0" skipped="0" failures="0">
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="com.cse3310.AppTest" time="0.068" tests="1" errors="0" skipped="0" failures="0">
<properties>
<property name="java.specification.version" value="21"/>
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="java.specification.version" value="11"/>
<property name="sun.cpu.isalist" value=""/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.class.path" value="/workspaces/cse3310_sp24_group_26/target/test-classes:/workspaces/cse3310_sp24_group_26/target/classes:/home/codespace/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/codespace/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/codespace/.m2/repository/com/google/code/gson/gson/2.9.1/gson-2.9.1.jar:/home/codespace/.m2/repository/net/freeutils/jlhttp/2.6/jlhttp-2.6.jar:/home/codespace/.m2/repository/org/java-websocket/Java-WebSocket/1.5.4/Java-WebSocket-1.5.4.jar:/home/codespace/.m2/repository/org/slf4j/slf4j-api/2.0.6/slf4j-api-2.0.6.jar:"/>
<property name="java.vm.vendor" value="Microsoft"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.vendor.url" value="https://www.microsoft.com"/>
<property name="user.timezone" value=""/>
<property name="java.vm.specification.version" value="11"/>
<property name="os.name" value="Linux"/>
<property name="java.vm.specification.version" value="21"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.boot.library.path" value="/usr/local/sdkman/candidates/java/21.0.2-ms/lib"/>
<property name="sun.java.command" value="/workspaces/cse3310_sp24_group_26/target/surefire/surefirebooter14039090773852145503.jar /workspaces/cse3310_sp24_group_26/target/surefire 2024-04-13T19-37-40_596-jvmRun1 surefire17408383254445461201tmp surefire_01577500218245761020tmp"/>
<property name="sun.boot.library.path" value="/opt/java/11.0.14/lib"/>
<property name="sun.java.command" value="/workspaces/cse3310_sp24_group_26/target/surefire/surefirebooter17049158160139990095.jar /workspaces/cse3310_sp24_group_26/target/surefire 2024-04-14T02-35-28_541-jvmRun1 surefire15385354837961070040tmp surefire_018019830404444236789tmp"/>
<property name="jdk.debug" value="release"/>
<property name="surefire.test.class.path" value="/workspaces/cse3310_sp24_group_26/target/test-classes:/workspaces/cse3310_sp24_group_26/target/classes:/home/codespace/.m2/repository/junit/junit/4.11/junit-4.11.jar:/home/codespace/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/codespace/.m2/repository/com/google/code/gson/gson/2.9.1/gson-2.9.1.jar:/home/codespace/.m2/repository/net/freeutils/jlhttp/2.6/jlhttp-2.6.jar:/home/codespace/.m2/repository/org/java-websocket/Java-WebSocket/1.5.4/Java-WebSocket-1.5.4.jar:/home/codespace/.m2/repository/org/slf4j/slf4j-api/2.0.6/slf4j-api-2.0.6.jar:"/>
<property name="sun.cpu.endian" value="little"/>
<property name="user.home" value="/home/codespace"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="java.version.date" value="2024-01-16"/>
<property name="java.home" value="/usr/local/sdkman/candidates/java/21.0.2-ms"/>
<property name="java.version.date" value="2022-02-08"/>
<property name="java.home" value="/opt/java/11.0.14"/>
<property name="file.separator" value="/"/>
<property name="basedir" value="/workspaces/cse3310_sp24_group_26"/>
<property name="java.vm.compressedOopsMode" value="32-bit"/>
<property name="line.separator" value="&#10;"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="surefire.real.class.path" value="/workspaces/cse3310_sp24_group_26/target/surefire/surefirebooter14039090773852145503.jar"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
<property name="surefire.real.class.path" value="/workspaces/cse3310_sp24_group_26/target/surefire/surefirebooter17049158160139990095.jar"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="java.runtime.version" value="21.0.2+13-LTS"/>
<property name="java.runtime.version" value="11.0.14.1+1-LTS"/>
<property name="user.name" value="codespace"/>
<property name="stdout.encoding" value="UTF-8"/>
<property name="path.separator" value=":"/>
<property name="os.version" value="6.2.0-1019-azure"/>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="java.vendor.version" value="Microsoft-8905927"/>
<property name="java.vendor.version" value="Microsoft-31205"/>
<property name="localRepository" value="/home/codespace/.m2/repository"/>
<property name="java.vendor.url.bug" value="https://github.com/microsoft/openjdk/issues"/>
<property name="java.io.tmpdir" value="/tmp"/>
<property name="java.version" value="21.0.2"/>
<property name="java.version" value="11.0.14.1"/>
<property name="user.dir" value="/workspaces/cse3310_sp24_group_26"/>
<property name="os.arch" value="amd64"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="native.encoding" value="UTF-8"/>
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="java.library.path" value="/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="stderr.encoding" value="UTF-8"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.vendor" value="Microsoft"/>
<property name="java.vm.version" value="21.0.2+13-LTS"/>
<property name="java.vm.version" value="11.0.14.1+1-LTS"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="java.class.version" value="65.0"/>
<property name="java.class.version" value="55.0"/>
</properties>
<testcase name="shouldAnswerWithTrue" classname="com.cse3310.AppTest" time="0.004"/>
<testcase name="shouldAnswerWithTrue" classname="com.cse3310.AppTest" time="0"/>
</testsuite>
2 changes: 1 addition & 1 deletion target/surefire-reports/com.cse3310.AppTest.txt
Original file line number Diff line number Diff line change
@@ -1,4 +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
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.068 s - in com.cse3310.AppTest
Binary file modified target/test-classes/com/cse3310/AppTest.class
Binary file not shown.
Loading