randomFree.js 424 B

1234567891011121314151617181920212223242526
  1. const io = require('socket.io')(3555);
  2. const nsp = io.of('/randomFree');
  3. class randomFree {
  4. constructor() {
  5. nsp.on('connection', (socket) => {
  6. console.log('someone connected');
  7. this.match();
  8. });
  9. }
  10. match() {
  11. let clients = Object.keys(nsp.sockets);
  12. console.log(clients);
  13. if(clients.length > 1) {
  14. }
  15. }
  16. join(user){
  17. //join randomFree queue room
  18. }
  19. }
  20. module.exports = new randomFree();