refactor(Core/ObjectMgr): Change GetAcoreString from char const* to s… (#21213)
...ring
This commit is contained in:
parent
137337601d
commit
9e9a2fe5e3
@ -44,7 +44,7 @@ def parsing_file(files: list) -> None:
|
||||
multiple_blank_lines_check(file, file_path)
|
||||
trailing_whitespace_check(file, file_path)
|
||||
sql_check(file, file_path)
|
||||
insert_safety_check(file, file_path)
|
||||
insert_delete_safety_check(file, file_path)
|
||||
semicolon_check(file, file_path)
|
||||
except UnicodeDecodeError:
|
||||
print(f"\nCould not decode file {file_path}")
|
||||
@ -102,16 +102,10 @@ def trailing_whitespace_check(file: io, file_path: str) -> None:
|
||||
def sql_check(file: io, file_path: str) -> None:
|
||||
global error_handler, results
|
||||
file.seek(0) # Reset file pointer to the beginning
|
||||
not_delete = ["creature_template", "gameobject_template", "item_template", "quest_template"]
|
||||
check_failed = False
|
||||
|
||||
# Parse all the file
|
||||
for line_number, line in enumerate(file, start = 1):
|
||||
for table in not_delete:
|
||||
if f"DELETE FROM `{table}`" in line:
|
||||
print(
|
||||
f"Entries from this {table} should not be deleted! {file_path} at line {line_number}")
|
||||
check_failed = True
|
||||
if [match for match in ['broadcast_text'] if match in line]:
|
||||
print(
|
||||
f"DON'T EDIT broadcast_text TABLE UNLESS YOU KNOW WHAT YOU ARE DOING!\nThis error can safely be ignored if the changes are approved to be sniffed: {file_path} at line {line_number}")
|
||||
@ -140,9 +134,10 @@ def sql_check(file: io, file_path: str) -> None:
|
||||
error_handler = True
|
||||
results["SQL codestyle check"] = "Failed"
|
||||
|
||||
def insert_safety_check(file: io, file_path: str) -> None:
|
||||
def insert_delete_safety_check(file: io, file_path: str) -> None:
|
||||
global error_handler, results
|
||||
file.seek(0) # Reset file pointer to the beginning
|
||||
not_delete = ["creature_template", "gameobject_template", "item_template", "quest_template"]
|
||||
check_failed = False
|
||||
previous_line = ""
|
||||
|
||||
@ -154,11 +149,18 @@ def insert_safety_check(file: io, file_path: str) -> None:
|
||||
print(f"No DELETE keyword found after the INSERT in {file_path} at line {line_number}\nIf this error is intended, please advert a maintainer")
|
||||
check_failed = True
|
||||
previous_line = line
|
||||
match = re.match(r"DELETE FROM\s+`([^`]+)`", line, re.IGNORECASE)
|
||||
if match:
|
||||
table_name = match.group(1)
|
||||
if table_name in not_delete:
|
||||
print(
|
||||
f"Entries from {table} should not be deleted! {file_path} at line {line_number}")
|
||||
check_failed = True
|
||||
|
||||
# Handle the script error and update the result output
|
||||
if check_failed:
|
||||
error_handler = True
|
||||
results["INSERT safety usage check"] = "Failed"
|
||||
results["INSERT & DELETE safety usage check"] = "Failed"
|
||||
|
||||
def semicolon_check(file: io, file_path: str) -> None:
|
||||
global error_handler, results
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
--
|
||||
DELETE FROM `acore_string` WHERE `entry` = 6617;
|
||||
@ -2696,7 +2696,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
case SMART_ACTION_PLAYER_TALK:
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(e.action.playerTalk.textId, DEFAULT_LOCALE);
|
||||
std::string text = sObjectMgr->GetAcoreString(e.action.playerTalk.textId, DEFAULT_LOCALE);
|
||||
|
||||
if (!targets.empty())
|
||||
for (WorldObject* target : targets)
|
||||
|
||||
@ -58,7 +58,8 @@ namespace Acore
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(_textId, loc_idx);
|
||||
std::string strtext = sObjectMgr->GetAcoreString(_textId, loc_idx);
|
||||
char const* text = strtext.c_str();
|
||||
if (_args)
|
||||
{
|
||||
// we need copy va_list before use or original va_list will corrupted
|
||||
@ -95,9 +96,12 @@ namespace Acore
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(_textId, loc_idx);
|
||||
char const* arg1str = _arg1 ? sObjectMgr->GetAcoreString(_arg1, loc_idx) : "";
|
||||
char const* arg2str = _arg2 ? sObjectMgr->GetAcoreString(_arg2, loc_idx) : "";
|
||||
std::string strtext = sObjectMgr->GetAcoreString(_textId, loc_idx);
|
||||
char const* text = strtext.c_str();
|
||||
std::string stragr1str = sObjectMgr->GetAcoreString(_arg1, loc_idx);
|
||||
char const* arg1str = _arg1 ? stragr1str.c_str() : "";
|
||||
std::string strarg2str = sObjectMgr->GetAcoreString(_arg2, loc_idx);
|
||||
char const* arg2str = _arg2 ? strarg2str.c_str() : "";
|
||||
|
||||
char str[2048];
|
||||
snprintf(str, 2048, text, arg1str, arg2str);
|
||||
@ -1659,13 +1663,6 @@ void Battleground::EndNow()
|
||||
SetEndTime(0);
|
||||
}
|
||||
|
||||
// To be removed
|
||||
char const* Battleground::GetAcoreString(int32 entry)
|
||||
{
|
||||
// FIXME: now we have different DBC locales and need localized message for each target client
|
||||
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
void Battleground::HandleTriggerBuff(GameObject* gameObject)
|
||||
{
|
||||
// Xinef: crash fix?
|
||||
|
||||
@ -558,8 +558,6 @@ public:
|
||||
|
||||
void DoorOpen(uint32 type);
|
||||
void DoorClose(uint32 type);
|
||||
//to be removed
|
||||
const char* GetAcoreString(int32 entry);
|
||||
|
||||
virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ Player* ChatHandler::GetPlayer() const
|
||||
return m_session ? m_session->GetPlayer() : nullptr;
|
||||
}
|
||||
|
||||
char const* ChatHandler::GetAcoreString(uint32 entry) const
|
||||
std::string ChatHandler::GetAcoreString(uint32 entry) const
|
||||
{
|
||||
return m_session->GetAcoreString(entry);
|
||||
}
|
||||
@ -881,7 +881,7 @@ std::string ChatHandler::GetNameLink(Player* chr) const
|
||||
return playerLink(chr->GetName());
|
||||
}
|
||||
|
||||
char const* CliHandler::GetAcoreString(uint32 entry) const
|
||||
std::string CliHandler::GetAcoreString(uint32 entry) const
|
||||
{
|
||||
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ public:
|
||||
}
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual char const* GetAcoreString(uint32 entry) const;
|
||||
virtual std::string GetAcoreString(uint32 entry) const;
|
||||
virtual void SendSysMessage(std::string_view str, bool escapeCharacters = false);
|
||||
|
||||
void SendSysMessage(uint32 entry);
|
||||
@ -258,7 +258,7 @@ public:
|
||||
explicit CliHandler(void* callbackArg, Print* zprint) : m_callbackArg(callbackArg), m_print(zprint) { }
|
||||
|
||||
// overwrite functions
|
||||
char const* GetAcoreString(uint32 entry) const override;
|
||||
std::string GetAcoreString(uint32 entry) const override;
|
||||
void SendSysMessage(std::string_view, bool escapeCharacters) override;
|
||||
bool ParseCommands(std::string_view str) override;
|
||||
std::string GetNameLink() const override;
|
||||
|
||||
@ -24,7 +24,7 @@ void Acore::Impl::ChatCommands::SendErrorMessageToHandler(ChatHandler* handler,
|
||||
handler->SetSentErrorMessage(true);
|
||||
}
|
||||
|
||||
char const* Acore::Impl::ChatCommands::GetAcoreString(ChatHandler const* handler, AcoreStrings which)
|
||||
std::string Acore::Impl::ChatCommands::GetAcoreString(ChatHandler const* handler, AcoreStrings which)
|
||||
{
|
||||
return handler->GetAcoreString(which);
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ namespace Acore::Impl::ChatCommands
|
||||
};
|
||||
|
||||
AC_GAME_API void SendErrorMessageToHandler(ChatHandler* handler, std::string_view str);
|
||||
AC_GAME_API char const* GetAcoreString(ChatHandler const* handler, AcoreStrings which);
|
||||
AC_GAME_API std::string GetAcoreString(ChatHandler const* handler, AcoreStrings which);
|
||||
template <typename... Ts>
|
||||
std::string FormatAcoreString(ChatHandler const* handler, AcoreStrings which, Ts&&... args)
|
||||
{
|
||||
|
||||
@ -554,7 +554,7 @@ void Player::UpdateLocalChannels(uint32 newZone)
|
||||
|
||||
if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY)
|
||||
currentNameExt = sObjectMgr->GetAcoreStringForDBCLocale(
|
||||
LANG_CHANNEL_CITY);
|
||||
LANG_CHANNEL_CITY).c_str();
|
||||
else
|
||||
currentNameExt = current_zone_name.c_str();
|
||||
|
||||
|
||||
@ -8770,19 +8770,20 @@ bool ObjectMgr::LoadAcoreStrings()
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* ObjectMgr::GetAcoreString(uint32 entry, LocaleConstant locale) const
|
||||
std::string ObjectMgr::GetAcoreString(uint32 entry, LocaleConstant locale) const
|
||||
{
|
||||
if (AcoreString const* ts = GetAcoreString(entry))
|
||||
AcoreString const* as = GetAcoreString(entry);
|
||||
if (as && !as->Content.empty())
|
||||
{
|
||||
if (ts->Content.size() > std::size_t(locale) && !ts->Content[locale].empty())
|
||||
return ts->Content[locale].c_str();
|
||||
if (as->Content.size() > std::size_t(locale) && !as->Content[locale].empty())
|
||||
return as->Content[locale];
|
||||
|
||||
return ts->Content[DEFAULT_LOCALE].c_str();
|
||||
return as->Content[DEFAULT_LOCALE];
|
||||
}
|
||||
|
||||
LOG_ERROR("sql.sql", "Acore string entry {} not found in DB.", entry);
|
||||
|
||||
return "<error>";
|
||||
std::string msg = Acore::StringFormat("No entry for acore_string ({}) in DB.", entry);
|
||||
LOG_ERROR("sql.sql", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadFishingBaseSkillLevel()
|
||||
|
||||
@ -1314,8 +1314,8 @@ public:
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
[[nodiscard]] char const* GetAcoreString(uint32 entry, LocaleConstant locale) const;
|
||||
[[nodiscard]] char const* GetAcoreStringForDBCLocale(uint32 entry) const { return GetAcoreString(entry, DBCLocaleIndex); }
|
||||
[[nodiscard]] std::string GetAcoreString(uint32 entry, LocaleConstant locale) const;
|
||||
[[nodiscard]] std::string GetAcoreStringForDBCLocale(uint32 entry) const { return GetAcoreString(entry, DBCLocaleIndex); }
|
||||
[[nodiscard]] LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; }
|
||||
void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; }
|
||||
|
||||
|
||||
@ -1169,8 +1169,7 @@ enum AcoreStrings
|
||||
|
||||
LANG_GM_SILENCE = 6616, // "Silence is ON for %s" - Spell 1852
|
||||
|
||||
// Used for .string command
|
||||
LANG_NO_ACORE_STRING_FOUND = 6617,
|
||||
// Free strings 6617-7522
|
||||
|
||||
LANG_WORLD_CLOSED = 7523,
|
||||
LANG_WORLD_OPENED = 7524,
|
||||
|
||||
@ -802,7 +802,7 @@ bool WorldSession::DisallowHyperlinksAndMaybeKick(std::string_view str)
|
||||
return false;
|
||||
}
|
||||
|
||||
char const* WorldSession::GetAcoreString(uint32 entry) const
|
||||
std::string WorldSession::GetAcoreString(uint32 entry) const
|
||||
{
|
||||
return sObjectMgr->GetAcoreString(entry, GetSessionDbLocaleIndex());
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ public:
|
||||
void SendAreaTriggerMessage(std::string_view str);
|
||||
|
||||
template<typename... Args>
|
||||
void SendAreaTriggerMessage(char const* fmt, Args&&... args)
|
||||
void SendAreaTriggerMessage(std::string fmt, Args&&... args)
|
||||
{
|
||||
if (!m_playerLoading)
|
||||
SendAreaTriggerMessage(Acore::StringFormat(fmt, std::forward<Args>(args)...));
|
||||
@ -510,7 +510,7 @@ public:
|
||||
// Locales
|
||||
LocaleConstant GetSessionDbcLocale() const { return m_sessionDbcLocale; }
|
||||
LocaleConstant GetSessionDbLocaleIndex() const { return m_sessionDbLocaleIndex; }
|
||||
char const* GetAcoreString(uint32 entry) const;
|
||||
std::string GetAcoreString(uint32 entry) const;
|
||||
std::string const* GetModuleString(std::string module, uint32 id) const;
|
||||
|
||||
uint32 GetLatency() const { return m_latency; }
|
||||
|
||||
@ -39,7 +39,8 @@ void Acore::CustomChatTextBuilder::operator()(WorldPacket& data, LocaleConstant
|
||||
|
||||
void Acore::AcoreStringChatBuilder::operator()(WorldPacket& data, LocaleConstant locale) const
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(_textId, locale);
|
||||
std::string strtext = sObjectMgr->GetAcoreString(_textId, locale);
|
||||
char const* text = strtext.c_str();
|
||||
|
||||
if (_args)
|
||||
{
|
||||
|
||||
@ -572,7 +572,7 @@ public:
|
||||
virtual void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
|
||||
virtual void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
|
||||
virtual bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
|
||||
virtual void SendZoneText(uint32 zone, const char* text, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
|
||||
virtual void SendZoneText(uint32 zone, std::string text, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) = 0;
|
||||
virtual void SendServerMessage(ServerMessageType messageID, std::string stringParam = "", Player* player = nullptr) = 0;
|
||||
[[nodiscard]] virtual bool IsShuttingDown() const = 0;
|
||||
[[nodiscard]] virtual uint32 GetShutDownTimeLeft() const = 0;
|
||||
|
||||
@ -2572,7 +2572,8 @@ namespace Acore
|
||||
explicit WorldWorldTextBuilder(uint32 textId, va_list* args = nullptr) : i_textId(textId), i_args(args) {}
|
||||
void operator()(WorldPacketList& data_list, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(i_textId, loc_idx);
|
||||
std::string strtext = sObjectMgr->GetAcoreString(i_textId, loc_idx);
|
||||
char const* text = strtext.c_str();
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
@ -2631,10 +2632,10 @@ bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession
|
||||
}
|
||||
|
||||
/// Send a System Message to all players in the zone (except self if mentioned)
|
||||
void World::SendZoneText(uint32 zone, const char* text, WorldSession* self, TeamId teamId)
|
||||
void World::SendZoneText(uint32 zone, std::string text, WorldSession* self, TeamId teamId)
|
||||
{
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text);
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text.c_str());
|
||||
SendZoneMessage(zone, &data, self, teamId);
|
||||
}
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ public:
|
||||
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
|
||||
void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
|
||||
void SendZoneText(uint32 zone, const char* text, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
|
||||
void SendZoneText(uint32 zone, std::string text, WorldSession* self = nullptr, TeamId teamId = TEAM_NEUTRAL) override;
|
||||
void SendServerMessage(ServerMessageType messageID, std::string stringParam = "", Player* player = nullptr) override;
|
||||
|
||||
/// Are we in the middle of a shutdown?
|
||||
|
||||
@ -292,7 +292,7 @@ public:
|
||||
Player const* target = player->GetConnectedPlayer();
|
||||
|
||||
LocaleConstant loc = handler->GetSessionDbcLocale();
|
||||
char const* knownStr = handler->GetAcoreString(LANG_KNOWN);
|
||||
std::string knownStr = handler->GetAcoreString(LANG_KNOWN);
|
||||
|
||||
// Search in CharTitles.dbc
|
||||
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
|
||||
@ -308,7 +308,7 @@ public:
|
||||
if (!*name)
|
||||
continue;
|
||||
|
||||
char const* activeStr = "";
|
||||
std::string activeStr = "";
|
||||
if (target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index)
|
||||
activeStr = handler->GetAcoreString(LANG_ACTIVE);
|
||||
|
||||
|
||||
@ -61,28 +61,22 @@ public:
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
|
||||
char const* active = handler->GetAcoreString(LANG_ACTIVE);
|
||||
std::string active = handler->GetAcoreString(LANG_ACTIVE);
|
||||
|
||||
for (uint16 eventId : activeEvents)
|
||||
{
|
||||
GameEventData const& eventData = events[eventId];
|
||||
|
||||
if (handler->GetSession())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, eventId, eventId, eventData.description, active);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, eventId, eventData.description, active);
|
||||
}
|
||||
|
||||
++counter;
|
||||
}
|
||||
|
||||
if (counter == 0)
|
||||
{
|
||||
handler->SendSysMessage(LANG_NOEVENTFOUND);
|
||||
}
|
||||
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@ -108,7 +102,7 @@ public:
|
||||
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
bool active = activeEvents.find(eventId) != activeEvents.end();
|
||||
char const* activeStr = active ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
std::string activeStr = active ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
std::string startTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.start));
|
||||
std::string endTimeStr = Acore::Time::TimeToTimestampStr(Seconds(eventData.end));
|
||||
|
||||
@ -460,8 +460,8 @@ public:
|
||||
|
||||
wstrToLower(namePart);
|
||||
|
||||
char const* talentStr = handler->GetAcoreString(LANG_TALENT);
|
||||
char const* passiveStr = handler->GetAcoreString(LANG_PASSIVE);
|
||||
std::string talentStr = handler->GetAcoreString(LANG_TALENT);
|
||||
std::string passiveStr = handler->GetAcoreString(LANG_PASSIVE);
|
||||
|
||||
Unit::AuraApplicationMap const& auras = unit->GetAppliedAuras();
|
||||
handler->PSendSysMessage(LANG_COMMAND_TARGET_LISTAURAS, auras.size());
|
||||
|
||||
@ -308,7 +308,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* active = activeEvents.find(id) != activeEvents.end() ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
std::string active = activeEvents.find(id) != activeEvents.end() ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
if (handler->GetSession())
|
||||
{
|
||||
@ -806,7 +806,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* statusStr = "";
|
||||
std::string statusStr = "";
|
||||
|
||||
if (target)
|
||||
{
|
||||
@ -862,7 +862,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* statusStr = "";
|
||||
std::string statusStr = "";
|
||||
|
||||
if (target)
|
||||
{
|
||||
@ -1498,20 +1498,16 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetAcoreString(LANG_KNOWN) : "";
|
||||
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
std::string knownStr = target && target->HasTitle(titleInfo) ? handler->GetAcoreString(LANG_KNOWN) : "";
|
||||
std::string activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index ? handler->GetAcoreString(LANG_ACTIVE) : "";
|
||||
|
||||
std::string titleNameStr = Acore::StringFormat(name, targetName);
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (handler->GetSession())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, titleInfo->ID, titleInfo->bit_index, titleInfo->ID, titleNameStr, localeNames[locale], knownStr, activeStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, titleInfo->ID, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr);
|
||||
}
|
||||
|
||||
++counter;
|
||||
}
|
||||
|
||||
@ -1992,8 +1992,8 @@ public:
|
||||
uint32 mapId;
|
||||
uint32 areaId;
|
||||
uint32 phase = 0;
|
||||
char const* areaName = nullptr;
|
||||
char const* zoneName = nullptr;
|
||||
std::string areaName = "";
|
||||
std::string zoneName = "";
|
||||
|
||||
// Guild data print variables defined so that they exist, but are not necessarily used
|
||||
uint32 guildId = 0;
|
||||
@ -2325,19 +2325,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (!zoneName)
|
||||
{
|
||||
if (zoneName.empty())
|
||||
zoneName = handler->GetAcoreString(LANG_UNKNOWN);
|
||||
}
|
||||
|
||||
if (areaName)
|
||||
{
|
||||
if (!areaName.empty())
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAP_WITH_AREA, map->name[locale], zoneName, areaName);
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale], zoneName);
|
||||
}
|
||||
|
||||
// Output XVII. - XVIX. if they are not empty
|
||||
if (!guildName.empty())
|
||||
@ -3022,18 +3016,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* str = sObjectMgr->GetAcoreString(id, locale ? static_cast<LocaleConstant>(*locale) : DEFAULT_LOCALE);
|
||||
|
||||
if (!strcmp(str, "<error>"))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_NO_ACORE_STRING_FOUND, id);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->SendSysMessage(str);
|
||||
return true;
|
||||
}
|
||||
std::string str = sObjectMgr->GetAcoreString(id, locale ? static_cast<LocaleConstant>(*locale) : DEFAULT_LOCALE);
|
||||
handler->SendSysMessage(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleOpenDoorCommand(ChatHandler* handler, Optional<float> range)
|
||||
|
||||
@ -75,7 +75,7 @@ public:
|
||||
MOCK_METHOD(void, SendGlobalMessage, (WorldPacket const* packet, WorldSession* self, TeamId teamId), ());
|
||||
MOCK_METHOD(void, SendGlobalGMMessage, (WorldPacket const* packet, WorldSession* self, TeamId teamId), ());
|
||||
MOCK_METHOD(bool, SendZoneMessage, (uint32 zone, WorldPacket const* packet, WorldSession* self, TeamId teamId), ());
|
||||
MOCK_METHOD(void, SendZoneText, (uint32 zone, const char* text, WorldSession* self, TeamId teamId), ());
|
||||
MOCK_METHOD(void, SendZoneText, (uint32 zone, std::string text, WorldSession* self, TeamId teamId), ());
|
||||
MOCK_METHOD(void, SendServerMessage, (ServerMessageType messageID, std::string stringParam, Player* player));
|
||||
MOCK_METHOD(bool, IsShuttingDown, (), (const));
|
||||
MOCK_METHOD(uint32, GetShutDownTimeLeft, (), (const));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user