Pārlūkot izejas kodu

Adds Sockets on randomFree

Nikatlas 6 gadi atpakaļ
vecāks
revīzija
ce725fd626
1 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 11 1
      services/matchmaking/randomFree.js

+ 11 - 1
services/matchmaking/randomFree.js

@@ -1,7 +1,17 @@
+const io  = require('socket.io')();
+const nsp = io.of('/randomFree');
+
 class randomFree {
+
+	constructor() {
+		nsp.on('connection', function(socket){
+		  console.log('someone connected');
+		});
+	}
+
     join(user){
         //join randomFree queue room
     }
 }
 
-module.exports = randomFree;
+module.exports = new randomFree();