diff --git a/html/index_1.html b/html/index_1.html index c753dd3..44e85df 100644 --- a/html/index_1.html +++ b/html/index_1.html @@ -259,10 +259,8 @@

Leaderboard

function requestGameList() { var data = { type: "RequestGameList" }; - if(socket.readyState===1) - { - socket.send(JSON.stringify(data)); - } + + socket.send(JSON.stringify(data)); } function updateGameList(serverData) @@ -361,7 +359,7 @@

Leaderboard

cell.setAttribute("id",k.toString()); - const cellText=document.createTextNode(grid[i][j]); + const cellText=document.createTextNode(grid[i][j].toUpperCase()); cell.appendChild(cellText); row.appendChild(cell); } @@ -512,10 +510,8 @@

Leaderboard

var data={ type: "updateLobby" } - if(socket.readyState===1) - { - socket.send(JSON.stringify(data)); - } + socket.send(JSON.stringify(data)); + } diff --git a/src/main/java/uta/cse3310/App.java b/src/main/java/uta/cse3310/App.java index f8bc4e5..0949485 100644 --- a/src/main/java/uta/cse3310/App.java +++ b/src/main/java/uta/cse3310/App.java @@ -472,8 +472,15 @@ public void messageHandler(Gson gson, String jsonString, WebSocket conn) jsonObject.addProperty("type","RequestGameList"); //FIX LATER //does not end up sending the active games - String jsonGameList= gson.toJson(activeGames); - System.out.println(activeGames.toString()); + String[] activeGameArr= new String[activeGames.size()]; + int j=0; + for(Game i: activeGames) + { + activeGameArr[j]=i.getGameID(); + j++; + } + String jsonGameList= gson.toJson(activeGameArr.toString()); + System.out.println(activeGameArr.toString()); jsonObject.addProperty("gameList",jsonGameList); conn.send(jsonObject.toString()); break;