Merge pull request #320 from AttorneyOnline/Fix-Musiclist-Loading-Order

Fix empty musiclist due to incorrect loading order
This commit is contained in:
Rosemary Witchaven 2022-08-04 22:08:07 -05:00 committed by GitHub
commit 81da1db622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ class MusicManager : public QObject
*
* @param Copy of the server musiclist generated by ConfigManager::musiclist();
*/
MusicManager(QStringList f_root_ordered, QStringList f_cdns, QMap<QString, QPair<QString, int>> f_root_list, QObject *parent = nullptr);
MusicManager(QStringList f_cdns, MusicList f_root_list, QStringList f_root_ordered, QObject *parent = nullptr);
/**
* @brief Destructor for the server-wide musiclist manager.

View File

@ -3,7 +3,7 @@
#include "include/config_manager.h"
#include "include/packet/packet_factory.h"
MusicManager::MusicManager(QStringList f_root_ordered, QStringList f_cdns, QMap<QString, QPair<QString, int>> f_root_list, QObject *parent) :
MusicManager::MusicManager(QStringList f_cdns, MusicList f_root_list, QStringList f_root_ordered, QObject *parent) :
QObject(parent),
m_root_list(f_root_list),
m_root_ordered(f_root_ordered)

View File

@ -114,7 +114,7 @@ void Server::start()
m_backgrounds = ConfigManager::backgrounds();
// Build our music manager.
music_manager = new MusicManager(ConfigManager::ordered_songs(), ConfigManager::cdnList(), ConfigManager::musiclist(), this);
music_manager = new MusicManager(ConfigManager::cdnList(), ConfigManager::musiclist(), ConfigManager::ordered_songs(), this);
connect(music_manager, &MusicManager::sendFMPacket, this, &Server::unicast);
connect(music_manager, &MusicManager::sendAreaFMPacket, this, QOverload<AOPacket *, int>::of(&Server::broadcast));

View File

@ -84,7 +84,7 @@ void MusicListManager::init()
<< "Announce The Truth (AJ).opus"
<< "Announce The Truth (JFA).opus";
m_music_manager = new MusicManager(l_list, {"my.cdn.com", "your.cdn.com"}, l_test_list, nullptr);
m_music_manager = new MusicManager({"my.cdn.com", "your.cdn.com"}, l_test_list, l_list, nullptr);
}
void MusicListManager::registerArea()