|
@@ -4,11 +4,20 @@ const nsp = io.of('/randomFree');
|
|
class randomFree {
|
|
class randomFree {
|
|
|
|
|
|
constructor() {
|
|
constructor() {
|
|
- nsp.on('connection', function(socket){
|
|
|
|
|
|
+ nsp.on('connection', (socket) => {
|
|
console.log('someone connected');
|
|
console.log('someone connected');
|
|
|
|
+ this.match();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ match() {
|
|
|
|
+ let clients = Object.keys(nsp.sockets);
|
|
|
|
+ console.log(clients);
|
|
|
|
+ if(clients.length > 1) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
join(user){
|
|
join(user){
|
|
//join randomFree queue room
|
|
//join randomFree queue room
|
|
}
|
|
}
|