Skip to content

Commit

Permalink
feat(version): v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianjnuwu committed Jan 6, 2025
1 parent 1fa9cf1 commit cdeb598
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions socket/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ io.on("connection", (socket) => {
const room = ROOMS[room_code];

if (!room) return;
if (room.state === "finished") return;

// trocar o socket id
// Trocar o socket id
Expand Down
12 changes: 6 additions & 6 deletions www/src/js/cookie/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ function $message(text) {
</div>
<div class="toast-body"> ${text}</div></div>`);
}
/*

// connect the server to the socket
const socket = io("http://0.0.0.0:3000", {
transports: ["websocket", "polling"],
});*/
});/*
const socket = io("https://socket-hj1h.onrender.com", {
transports: ["websocket", "polling"],
});
});*/

let cookies = localStorage.getItem("cookie") || 0;
let cookies = Number(localStorage.getItem("cookie")) || 0;
let $cps = 0;

const $update_cps = () => {
Expand All @@ -42,7 +42,7 @@ const $update_cookies = () => {
socket.emit("update_cookies", {
room_player: localStorage.getItem("name"),
room_code: localStorage.getItem("code"),
cookies: Number.parseInt(localStorage.getItem("cookie")),
cookies
});
};

Expand Down Expand Up @@ -214,7 +214,7 @@ socket.on("game_end", ({ ranking }) => {
$("#cps").text("0");
$("#click-cookie").text("0");

localStorage.setItem("cookie", null);
localStorage.setItem("cookie", 0);
localStorage.setItem("code", null);

$(".room-code").hide();
Expand Down

0 comments on commit cdeb598

Please sign in to comment.