remove bots on empty lobby

demo_bourges
Thomas Chazot 7 months ago
parent 19957da05c
commit 2b31997bc7

@ -93,6 +93,9 @@ io.on('connection', (socket) => {
if (tab[i].id === socket.id){
tab.splice(i, 1)
io.to(k).emit("player left", tab, i)
if (tab.filter((p) => p.type=="User").length == 0){
map.delete(k)
}
}
}
}

@ -3,8 +3,7 @@ const ADRESSE_WEBSERVER = "http://localhost:3002"
const ADRESSE_DBSERVER = "http://localhost:3003"
const tmp = ADRESSE_DBSERVER
const mp2 = ADRESSE_WEBSERVER
const tmp2 = ADRESSE_WEBSERVER
const ADRESSE_WEBSITE = ""

Loading…
Cancel
Save