mirror of
https://github.com/azerothcore/mod-solo-lfg
synced 2025-11-29 15:58:17 +08:00
update add announcer and config
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
** AzerothCore 2019 http://www.azerothcore.org/
|
** AzerothCore 2019 http://www.azerothcore.org/
|
||||||
** Conan513 https://github.com/conan513
|
** Conan513 https://github.com/conan513
|
||||||
** Made into a module by Micrah https://github.com/milestorme/
|
** Made into a module by Micrah https://github.com/milestorme/
|
||||||
** Updated to work with AzerothCore Docker Installations by Artanisx https://github.com/Artanisx/
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
@@ -14,6 +13,23 @@
|
|||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
|
|
||||||
|
class lfg_solo_announce : public PlayerScript
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
lfg_solo_announce() : PlayerScript("lfg_solo_announce") {}
|
||||||
|
|
||||||
|
void OnLogin(Player* player)
|
||||||
|
{
|
||||||
|
// Announce Module
|
||||||
|
if (sConfigMgr->GetBoolDefault("SoloLFG.Announce", true))
|
||||||
|
{
|
||||||
|
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00Solo Dungeon Finder |rmodule.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class lfg_solo : public PlayerScript
|
class lfg_solo : public PlayerScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -33,8 +49,27 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class lfg_solo_config : public WorldScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
lfg_solo_config() : WorldScript("lfg_solo_config") { }
|
||||||
|
|
||||||
|
void OnBeforeConfigLoad(bool reload) override
|
||||||
|
{
|
||||||
|
if (!reload) {
|
||||||
|
std::string conf_path = _CONF_DIR;
|
||||||
|
std::string cfg_file = conf_path + "/SoloLfg.conf";
|
||||||
|
|
||||||
|
std::string cfg_def_file = cfg_file + ".dist";
|
||||||
|
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||||
|
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddLfgSoloScripts()
|
void AddLfgSoloScripts()
|
||||||
{
|
{
|
||||||
|
new lfg_solo_announce();
|
||||||
new lfg_solo();
|
new lfg_solo();
|
||||||
|
new lfg_solo_config();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user