From a52e7199253c065ab78ca17c4f0ca54b7342cb19 Mon Sep 17 00:00:00 2001 From: 2weiEmu Date: Wed, 11 Mar 2026 23:08:22 +0100 Subject: [PATCH] update: reinitalise rooms using new config room names --- lib/rooms.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/rooms.js b/lib/rooms.js index 9740715..6d0f03d 100644 --- a/lib/rooms.js +++ b/lib/rooms.js @@ -8,7 +8,7 @@ const updateStats = require('./stats'); 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; @@ -31,6 +31,16 @@ module.exports = function(options) { 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. */ -- 2.54.0