|
|
|
@ -31,7 +31,8 @@ server.listen(21111, () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io.on('connection', (socket1) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
socket1.on('disconnect',(socket)=>{
|
|
|
|
|
console.log(`[Server Side] disconnection : ${socket1.id}`)
|
|
|
|
|
rooms.forEach(it =>{
|
|
|
|
@ -132,6 +133,7 @@ function roomChanged(room)
|
|
|
|
|
}
|
|
|
|
|
room.sockets.forEach((element,key) => {
|
|
|
|
|
io.to(key).emit('players',JSON.stringify(Array.from(room.players.entries())))
|
|
|
|
|
io.to(key).emit('roomID',room.id)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|