const utils = require('./utils');
const fifolength = config.songsinarun * config.gameswithnorepeats;
-const rooms = {}; // The Object that contains all the room instances
+var rooms = {}; // The Object that contains all the room instances
const songsdb = clients.songs;
const usersdb = clients.users;
const isString = utils.isString;
module.exports.rooms = rooms;
+/**
+ * Actively re-read the rooms from genres, so the config may be hot reloaded on that part, this will also reinitalize the rooms
+ */
+module.exports.reloadRooms = function() {
+ rooms = {}
+ config.rooms.forEach(function(room) {
+ rooms[room] = new Room(room)
+ }
+}
+
/**
* Room constructor.
*/