Merge remote-tracking branch 'origin/develop' into feature/multiplayer-game-interface

This commit is contained in:
AfonsoCMSousa
2026-01-02 13:34:53 +00:00
5 changed files with 219 additions and 23 deletions
-3
View File
@@ -27,20 +27,17 @@ export const handleConnectionEvents = (io, socket) => {
socket.on("join", (user) => {
addUser(socket, user);
console.log(`[Connection] User ${user.name} has joined the server`);
console.log(`[Connection] ${getUserCount()} users online`);
});
socket.on("leave", () => {
const user = removeUser(socket.id);
if (user) {
console.log(`[Connection] User ${user.name} has left the server`);
console.log(`[Connection] ${getUserCount()} users online`);
}
});
socket.on("disconnect", () => {
console.log("Connection Lost:", socket.id);
removeUser(socket.id);
console.log(`[Connection] ${getUserCount()} users online`);
});
};