mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/DBLayer): replace char const* to std::string_view (#10211)
* feat(Core/DBLayer): replace `char const*` to `std::string_view` * CString * 1 * chore(Core/Misc): code cleanup * cl * db fix * fmt style sql * to fmt * py * del old * 1 * 2 * 3 * 1 * 1
This commit is contained in:
@@ -102,18 +102,18 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
Field* fields = result->Fetch();
|
||||
CreatureTextEntry temp;
|
||||
|
||||
temp.entry = fields[0].GetUInt32();
|
||||
temp.group = fields[1].GetUInt8();
|
||||
temp.id = fields[2].GetUInt8();
|
||||
temp.text = fields[3].GetString();
|
||||
temp.type = ChatMsg(fields[4].GetUInt8());
|
||||
temp.lang = Language(fields[5].GetUInt8());
|
||||
temp.probability = fields[6].GetFloat();
|
||||
temp.emote = Emote(fields[7].GetUInt32());
|
||||
temp.duration = fields[8].GetUInt32();
|
||||
temp.sound = fields[9].GetUInt32();
|
||||
temp.BroadcastTextId = fields[10].GetUInt32();
|
||||
temp.TextRange = CreatureTextRange(fields[11].GetUInt8());
|
||||
temp.entry = fields[0].Get<uint32>();
|
||||
temp.group = fields[1].Get<uint8>();
|
||||
temp.id = fields[2].Get<uint8>();
|
||||
temp.text = fields[3].Get<std::string>();
|
||||
temp.type = ChatMsg(fields[4].Get<uint8>());
|
||||
temp.lang = Language(fields[5].Get<uint8>());
|
||||
temp.probability = fields[6].Get<float>();
|
||||
temp.emote = Emote(fields[7].Get<uint32>());
|
||||
temp.duration = fields[8].Get<uint32>();
|
||||
temp.sound = fields[9].Get<uint32>();
|
||||
temp.BroadcastTextId = fields[10].Get<uint32>();
|
||||
temp.TextRange = CreatureTextRange(fields[11].Get<uint8>());
|
||||
|
||||
if (temp.sound)
|
||||
{
|
||||
@@ -180,16 +180,16 @@ void CreatureTextMgr::LoadCreatureTextLocales()
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 CreatureId = fields[0].GetUInt32();
|
||||
uint32 GroupId = fields[1].GetUInt8();
|
||||
uint32 ID = fields[2].GetUInt8();
|
||||
uint32 CreatureId = fields[0].Get<uint32>();
|
||||
uint32 GroupId = fields[1].Get<uint8>();
|
||||
uint32 ID = fields[2].Get<uint8>();
|
||||
|
||||
LocaleConstant locale = GetLocaleByName(fields[3].GetString());
|
||||
LocaleConstant locale = GetLocaleByName(fields[3].Get<std::string>());
|
||||
if (locale == LOCALE_enUS)
|
||||
continue;
|
||||
|
||||
CreatureTextLocale& data = mLocaleTextMap[CreatureTextId(CreatureId, GroupId, ID)];
|
||||
ObjectMgr::AddLocaleString(fields[4].GetString(), locale, data.Text);
|
||||
ObjectMgr::AddLocaleString(fields[4].Get<std::string>(), locale, data.Text);
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded {} Creature Text Locale in {} ms", uint32(mLocaleTextMap.size()), GetMSTimeDiffToNow(oldMSTime));
|
||||
|
||||
Reference in New Issue
Block a user