mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 14:46:24 +00:00
Merge branch 'master' into Playerbot
# Conflicts: # src/server/game/World/IWorld.h # src/server/game/World/World.h
This commit is contained in:
@@ -24,6 +24,7 @@ EndScriptData */
|
||||
|
||||
#include "AchievementMgr.h"
|
||||
#include "AuctionHouseMgr.h"
|
||||
#include "AutobroadcastMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
@@ -32,6 +33,7 @@ EndScriptData */
|
||||
#include "LFGMgr.h"
|
||||
#include "Language.h"
|
||||
#include "MapMgr.h"
|
||||
#include "ServerMotd.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SkillDiscovery.h"
|
||||
@@ -80,6 +82,7 @@ public:
|
||||
{ "areatrigger_tavern", HandleReloadAreaTriggerTavernCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "areatrigger_teleport", HandleReloadAreaTriggerTeleportCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "autobroadcast", HandleReloadAutobroadcastCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "motd", HandleReloadMotdCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "broadcast_text", HandleReloadBroadcastTextCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "battleground_template", HandleReloadBattlegroundTemplate, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "command", HandleReloadCommandCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
@@ -209,6 +212,7 @@ public:
|
||||
HandleReloadVehicleTemplateAccessoryCommand(handler);
|
||||
|
||||
HandleReloadAutobroadcastCommand(handler);
|
||||
HandleReloadMotdCommand(handler);
|
||||
HandleReloadBroadcastTextCommand(handler);
|
||||
HandleReloadBattlegroundTemplate(handler);
|
||||
return true;
|
||||
@@ -398,11 +402,20 @@ public:
|
||||
static bool HandleReloadAutobroadcastCommand(ChatHandler* handler)
|
||||
{
|
||||
LOG_INFO("server.loading", "Re-Loading Autobroadcasts...");
|
||||
sWorld->LoadAutobroadcasts();
|
||||
sAutobroadcastMgr->LoadAutobroadcasts();
|
||||
handler->SendGlobalGMSysMessage("DB table `autobroadcast` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadMotdCommand(ChatHandler* handler)
|
||||
{
|
||||
LOG_INFO("server.loading", "Re-Loading Motd...");
|
||||
sWorld->LoadMotd();
|
||||
handler->SendGlobalGMSysMessage("DB table `motd` reloaded.");
|
||||
handler->SendGlobalSysMessage(Motd::GetMotd());
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadBroadcastTextCommand(ChatHandler* handler)
|
||||
{
|
||||
LOG_INFO("server.loading", "Re-Loading Broadcast texts...");
|
||||
|
||||
@@ -509,10 +509,40 @@ public:
|
||||
}
|
||||
|
||||
// Define the 'Message of the day' for the realm
|
||||
static bool HandleServerSetMotdCommand(ChatHandler* handler, std::string motd)
|
||||
static bool HandleServerSetMotdCommand(ChatHandler* handler, std::string realmId, Tail motd)
|
||||
{
|
||||
Motd::SetMotd(motd);
|
||||
handler->PSendSysMessage(LANG_MOTD_NEW, motd);
|
||||
std::wstring wMotd = std::wstring();
|
||||
std::string strMotd = std::string();
|
||||
|
||||
if (realmId.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (motd.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Utf8toWStr(motd, wMotd))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!WStrToUtf8(wMotd, strMotd))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_REP_MOTD);
|
||||
stmt->SetData(0, Acore::StringTo<int32>(realmId).value());
|
||||
stmt->SetData(1, strMotd);
|
||||
trans->Append(stmt);
|
||||
LoginDatabase.CommitTransaction(trans);
|
||||
|
||||
sWorld->LoadMotd();
|
||||
handler->PSendSysMessage(LANG_MOTD_NEW, Acore::StringTo<int32>(realmId).value(), strMotd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user