/**
 * @module socket/controllers/room
 */
const emitters = require('../emitters/emitters');

/**
 * Join a socket to a room.
 * @param {Socket} socket the socket.io socket
 * @param {String} room the room to join
 */
function joinRoom(socket, room) {
  socket.join(room);
  emitters.emitInfoEventResults(socket, 'join room', true, `You've joined room: ${room}`);
  emitters.emitInfoFromSocketToRoom(socket, 'join room', true, `Socket ${socket.id} has entered the room`, room);
}

module.exports = {
  joinRoom,
};

@@ -36,16 +36,19 @@
 oom%0A */%0A
+// 
 const em
@@ -76,16 +76,55 @@
 emitters
+');%0Aconst generalEmitters = require('..
 /emitter
@@ -120,24 +120,32 @@
 '../emitters
+/general
 ');%0A%0A/**%0A * 
@@ -291,16 +291,26 @@
 et, room
+, callback
 ) %7B%0A  so
@@ -324,25 +324,32 @@
 in(room);%0A  
-e
+generalE
 mitters.emit
@@ -426,17 +426,24 @@
 m%7D%60);%0A  
-e
+generalE
 mitters.
@@ -545,16 +545,131 @@
  room);%0A
+  callback();%0A%7D%0A%0Afunction joinGameRoom(socket, gameId, callback) %7B%0A  joinRoom(socket, %60game_$%7BgameId%7D%60, callback);%0A
 %7D%0A%0Amodul
@@ -694,11 +694,27 @@
 inRoom,%0A
+  joinGameRoom,%0A
 %7D;%0A

Add room controller with joinRoom and joinGameRoom functions.