Skip to content

Commit

Permalink
hash work mayb?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge-Hurt committed May 1, 2024
1 parent e36997f commit a6ca412
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion html/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ socket.onmessage = function(event) {

//document.getElementById("title").innerHTML += data.event.Data.version;
if (data.type === 'version') {
document.getElementById("title").innerHTML = "Version: " + data.data; // Append version to the title
document.getElementById("title").innerHTML = "Version: " + data.username; // Append version to the title
console.log(data);
}
else if (data.type === "puzzle") {
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/uta/cse3310/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ public class App extends WebSocketServer {

private Duration gameDuration = Duration.ofMinutes(8); // Set the game duration to 8 minutes


private static final Map<String, WebSocket> userSessions = new HashMap<>();
static String version = System.getenv("VERSION");
private static String version = System.getenv("VERSION");

private Map<String, Integer> scoreboard = new HashMap<>();

Expand Down Expand Up @@ -168,9 +167,6 @@ public void onOpen(WebSocket conn, ClientHandshake handshake) {
Gson gson = new Gson();

//Obtain VERSION variable in order to print out the github hash on the title of the webpage.
if (version == null) {
version = "default-version";
}
String versionMessage = gson.toJson(new Message("version", version));
System.out.println(versionMessage);
conn.send(versionMessage);
Expand Down

0 comments on commit a6ca412

Please sign in to comment.