51 {
53
57
58 if (!result)
59 {
61 return true;
62 }
63
64
66 localeStmt->
SetData(0, realmId);
68
69 std::unordered_map<uint32, std::vector<std::pair<std::string, std::string>>> localeMap;
70 if (localeResult)
71 {
72 do
73 {
74 Field* localeFields = localeResult->Fetch();
76 std::string locale = localeFields[1].
Get<std::string>();
77 std::string localeText = localeFields[2].
Get<std::string>();
78 localeMap[localeId].emplace_back(std::move(locale), std::move(localeText));
79 } while (localeResult->NextRow());
80 }
81
83
84 do
85 {
86 Field* fields = result->Fetch();
89 std::string text = fields[2].
Get<std::string>();
90
92
93 auto itr = localeMap.find(id);
94 if (itr != localeMap.end())
95 for (auto const& [locale, localeText] : itr->second)
97 } while (result->NextRow());
98
99 return true;
100 }
std::uint8_t uint8
Definition Define.h:109
@ LANG_AUTOBROADCAST_LIST_ENTRY
Definition Language.h:1212
@ LANG_AUTOBROADCAST_LIST_EMPTY
Definition Language.h:1213
@ LANG_AUTOBROADCAST_LIST_HEADER
Definition Language.h:1211
@ LANG_AUTOBROADCAST_LOCALE_ENTRY
Definition Language.h:1218
@ LOGIN_SEL_AUTOBROADCAST_LOCALIZED
Definition LoginDatabase.h:104
@ LOGIN_SEL_AUTOBROADCAST
Definition LoginDatabase.h:103
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:168
Class used to access individual fields of database query result.
Definition Field.h:98
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition Field.h:112