remove bots on empty lobby
continuous-integration/drone/push Build is failing Details

pull/91/head
Thomas Chazot 1 year ago
parent 94f9c7f79f
commit a8adf7374f

@ -93,6 +93,9 @@ io.on('connection', (socket) => {
if (tab[i].id === socket.id){ if (tab[i].id === socket.id){
tab.splice(i, 1) tab.splice(i, 1)
io.to(k).emit("player left", tab, i) 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 ADRESSE_DBSERVER = "http://localhost:3003"
const tmp = ADRESSE_DBSERVER const tmp = ADRESSE_DBSERVER
const mp2 = ADRESSE_WEBSERVER const tmp2 = ADRESSE_WEBSERVER
const ADRESSE_WEBSITE = "" const ADRESSE_WEBSITE = ""

Loading…
Cancel
Save