mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 17:43:47 +00:00
feat(Core/Motd): Allow localized motd (#20542)
* Initial commit for localized motd * Rename function that created world packages * Update to satisfy code check * Update code to accomodate localized motd * Update command to support multiple optionales & adjusted db * Code cleanup * Update sql name * Fix codestyle issues * Remove hardcoded schema * Add check for valid player in reload command * Update to better code style * Add missing include * Fix redundant code usage * Add missing include * Remove sql files and create new rev sql files * Address minor code reviews * Fix code style * Update code to address code revisions. - Remove two unused functions - Remove map - Use available function to resolve LocaleConstant * Fix code style * Add check for base motd and update locale to DEFAULT_LOCALE * Code docs * Removed some docs, readd defaultd motd formatting * Fix oversight in variable declaration * Code style fix * Update code based on code review * ready for merge * Fix set motd command due to changes to DEFAULT_LOCALE * Fix CI * Fix trailing whitespace --------- Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "Define.h"
|
||||
#include <string>
|
||||
#include "Common.h"
|
||||
|
||||
class WorldPacket;
|
||||
|
||||
@@ -28,17 +29,33 @@ class AC_GAME_API MotdMgr
|
||||
public:
|
||||
static MotdMgr* instance();
|
||||
|
||||
/// Converts the localized string to world packages
|
||||
void CreateWorldPackages();
|
||||
|
||||
/// Set a new Message of the Day
|
||||
void SetMotd(std::string motd);
|
||||
void SetMotd(std::string motd, LocaleConstant locale);
|
||||
|
||||
/// Load Message of the Day
|
||||
void LoadMotd();
|
||||
|
||||
/// Get the current Message of the Day
|
||||
char const* GetMotd();
|
||||
char const* GetMotd(LocaleConstant locale);
|
||||
|
||||
/// Get the motd packet to send at login
|
||||
WorldPacket const* GetMotdPacket();
|
||||
/// Returns the current motd packet for the given locale
|
||||
WorldPacket const* GetMotdPacket(LocaleConstant locale);
|
||||
|
||||
// Checks if string is valid locale
|
||||
bool IsValidLocale(std::string const& locale);
|
||||
|
||||
private:
|
||||
// Loads the default motd from the motd table
|
||||
std::string LoadDefaultMotd(uint32 realmId);
|
||||
// Loads all available localized motd for the realm
|
||||
void LoadLocalizedMotds(uint32 realmId);
|
||||
// Sets the default mode if none is found in the database
|
||||
void SetDefaultMotd();
|
||||
// Create a worldpacket for a given motd localization
|
||||
WorldPacket CreateWorldPacket(std::string const& motd);
|
||||
};
|
||||
|
||||
#define sMotdMgr MotdMgr::instance()
|
||||
|
||||
Reference in New Issue
Block a user