50 {
52
56
57 if (!result)
58 {
60 return true;
61 }
62
63
65 localeStmt->
SetData(0, realmId);
67
68 std::unordered_map<uint32, std::vector<std::pair<std::string, std::string>>> localeMap;
69 if (localeResult)
70 {
71 do
72 {
73 Field* localeFields = localeResult->Fetch();
75 std::string locale = localeFields[1].
Get<std::string>();
76 std::string localeText = localeFields[2].
Get<std::string>();
77 localeMap[localeId].emplace_back(std::move(locale), std::move(localeText));
78 } while (localeResult->NextRow());
79 }
80
82
83 do
84 {
85 Field* fields = result->Fetch();
88 std::string text = fields[2].
Get<std::string>();
89
91
92 auto itr = localeMap.find(id);
93 if (itr != localeMap.end())
94 for (auto const& [locale, localeText] : itr->second)
96 } while (result->NextRow());
97
98 return true;
99 }
std::uint8_t uint8
Definition Define.h:109
@ LANG_AUTOBROADCAST_LIST_ENTRY
Definition Language.h:1209
@ LANG_AUTOBROADCAST_LIST_EMPTY
Definition Language.h:1210
@ LANG_AUTOBROADCAST_LIST_HEADER
Definition Language.h:1208
@ LANG_AUTOBROADCAST_LOCALE_ENTRY
Definition Language.h:1215
@ LOGIN_SEL_AUTOBROADCAST_LOCALIZED
Definition LoginDatabase.h:102
@ LOGIN_SEL_AUTOBROADCAST
Definition LoginDatabase.h:101
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition Chat.cpp:160
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