socket id error fix

This commit is contained in:
gocivici 2024-02-25 17:00:31 +03:00
parent fb3698b4bf
commit 8fee6deed2

View File

@ -101,8 +101,8 @@ socket.on('updatePlayers', (bPlayers) =>{
})
// console.log(fPlayers[id])
fPlayers[socket.id].username = localStorage.getItem('username')
socket.emit('username',fPlayers[socket.id].username);
fPlayers[id].username = localStorage.getItem('username')
socket.emit('username',fPlayers[id].username);
} else {
// if players already exist