35 std::string_view title(text.Title);
36 std::string_view constant(text.Constant);
40 auto constantIt = std::ranges::lower_bound(map, constant, compare, Containers::MapKey);
41 if (constantIt == map.end() || compare(constant, constantIt->first))
42 map.emplace(constantIt, constant, val);
44 constantIt->second = std::nullopt;
46 if (title != constant)
48 auto titleIt = std::ranges::lower_bound(map, title, compare, Containers::MapKey);
49 if (titleIt == map.end() || compare(title, titleIt->first))
50 map.emplace(titleIt, title, val);
52 titleIt->second = std::nullopt;
79 if (!current.IsSuccessful())
81 if (current.HasErrorMessage())
83 if (combined.HasErrorMessage())
85 std::string mergedError = std::move(combined).GetErrorMessage();
86 mergedError.append(1,
'\n');
88 mergedError.append(1,
' ');
89 mergedError.append(current.GetErrorMessage());
90 combined = std::move(mergedError);
93 combined = std::move(current).GetErrorMessage();
105 if (combined.HasErrorMessage() && combined.GetErrorMessage().find(
'\n') != std::string::npos)
109 .append(combined.GetErrorMessage());
110 combined = std::move(error);
123 ChatCommandResult result = ArgInfo<
decltype(val)>::TryConsume(val, handler, args);
126 if (
uint32*
id = std::get_if<uint32>(&val))
129 result = std::nullopt;
142 ChatCommandResult result = ArgInfo<
decltype(val)>::TryConsume(val, handler, args);
145 if (
uint32*
id = std::get_if<uint32>(&val))
148 result = std::nullopt;
161 ChatCommandResult result = ArgInfo<
decltype(val)>::TryConsume(val, handler, args);
180 ChatCommandResult result = ArgInfo<
decltype(val)>::TryConsume(val, handler, args);
183 if (
uint32*
id = std::get_if<uint32>(&val))
186 result = std::nullopt;
199 ChatCommandResult result = ArgInfo<
decltype(val)>::TryConsume(val, handler, args);
202 if (
uint32*
id = std::get_if<uint32>(&val))
205 result = std::nullopt;
228 ChatCommandResult result = ArgInfo<
decltype(val)>::TryConsume(val, handler, args);
231 if (
uint32*
id = std::get_if<uint32>(&val))
234 result = std::nullopt;
DB2Storage< AchievementEntry > sAchievementStore("Achievement.db2", &AchievementLoadInfo::Instance)
DB2Storage< CurrencyTypesEntry > sCurrencyTypesStore("CurrencyTypes.db2", &CurrencyTypesLoadInfo::Instance)
#define STRING_VIEW_FMT_ARG(str)
@ LANG_CMDPARSER_ITEM_NO_EXIST
@ LANG_CMDPARSER_GAME_TELE_ID_NO_EXIST
@ LANG_CMDPARSER_STRING_VALUE_INVALID
@ LANG_CMDPARSER_ACHIEVEMENT_NO_EXIST
@ LANG_CMDPARSER_GAME_TELE_NO_EXIST
@ LANG_CMDPARSER_QUEST_NO_EXIST
@ LANG_CMDPARSER_CURRENCY_NO_EXIST
@ LANG_CMDPARSER_SPELL_NO_EXIST
TC_COMMON_API bool StringEqualI(std::string_view str1, std::string_view str2)
bool StringStartsWithI(std::string_view haystack, std::string_view needle)
TC_GAME_API bool HandleVariantChatCommandConsumeResults(ChatCommandResult &combined, ChatCommandResult &¤t, ChatHandler const *handler) noexcept
TC_GAME_API char const * GetTrinityString(ChatHandler const *handler, TrinityStrings which)
TC_GAME_API void PrefixVariantChatCommandError(ChatCommandResult &combined, ChatHandler const *handler) noexcept
TC_GAME_API std::string FormatTrinityString(std::string_view messageFormat, fmt::printf_args messageFormatArgs)
TC_GAME_API void InvalidStringValueFormatError(ChatCommandResult &result, ChatHandler const *handler, std::string_view arg, std::type_info const &type) noexcept
std::string GetTypeName()
value_type operator()(Hyperlink< achievement > const &achData) const
value_type operator()(uint32 achId) const
AchievementEntry const * value_type
value_type operator()(Hyperlink< currency > currency) const
value_type operator()(uint32 currencyId) const
CurrencyTypesEntry const * value_type
value_type operator()(std::string_view tele) const
value_type operator()(Hyperlink< tele > tele) const
GameTele const * value_type
value_type operator()(uint32 item) const
ItemTemplate const * value_type
value_type operator()(Hyperlink< item > const &item) const
value_type operator()(Hyperlink< quest > quest) const
value_type operator()(uint32 questId) const
value_type operator()(Hyperlink< pvptal > pvpTalent) const
value_type operator()(uint32 spellId) const
value_type operator()(Hyperlink< enchant > enchant) const
value_type operator()(Hyperlink< trade > const &trade) const
value_type operator()(Hyperlink< mawpower > mawPower) const
SpellInfo const * value_type
value_type operator()(Hyperlink< conduit > soulbindConduit) const
value_type operator()(Hyperlink< spell > spell) const
value_type operator()(Hyperlink< apower > artifactPower) const
value_type operator()(Hyperlink< mount > const &mount) const
value_type operator()(Hyperlink< talent > talent) const
constexpr bool holds_alternative() const
constexpr decltype(auto) visit(T &&arg)
static void AddSearchMapEntry(SearchMap &map, int64 val, EnumText const &text) noexcept
static int64 const * Match(SearchMap const &map, std::string_view s) noexcept
std::vector< std::pair< std::string_view, Optional< int64 > > > SearchMap