[Strings] Refactor Strings Usage (#2305)

* Initial commit checkpoint

* More functions converted

* Commify

* More functions

* Fin

* Sort declarations

* Split functions between files

* Bots

* Update strings.h

* Split

* Revert find replaces

* Repository template

* Money

* Misc function

* Update CMakeLists.txt

* Saylink

* Update strings.cpp

* Swap Strings::Saylink for Saylink::Create since saylink is coupled to zone database

* API casings
This commit is contained in:
Chris Miles
2022-07-14 02:10:52 -05:00
committed by GitHub
parent 44c85a0dd7
commit dfd8f84cac
573 changed files with 5197 additions and 5137 deletions
+8 -8
View File
@@ -22,7 +22,7 @@ Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
#include "../common/eq_packet_structs.h"
#include "../common/races.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "aa.h"
#include "client.h"
#include "corpse.h"
@@ -310,7 +310,7 @@ void Mob::WakeTheDead(uint16 spell_id, Corpse *corpse_to_use, Mob *target, uint3
//pet.duration += GetFocusEffect(focusSwarmPetDuration, spell_id) / 1000; //TODO: Does WTD use pet focus?
pet.npc_id = WAKE_THE_DEAD_NPCTYPEID;
NPCType *made_npc = nullptr;
const NPCType *npc_type = content_db.LoadNPCTypesData(WAKE_THE_DEAD_NPCTYPEID);
@@ -545,7 +545,7 @@ void Client::ResetAA() {
m_pp.raid_leadership_points = 0;
m_pp.group_leadership_exp = 0;
m_pp.raid_leadership_exp = 0;
database.DeleteCharacterAAs(CharacterID());
database.DeleteCharacterLeadershipAAs(CharacterID());
}
@@ -1766,7 +1766,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
LogInfo("Loaded [{}] Alternate Advancement Abilities", (int)abilities.size());
int expansion = RuleI(Expansion, CurrentExpansion);
bool use_expansion_aa = RuleB(Expansion, UseCurrentExpansionAAOnly);
LogInfo("Loading Alternate Advancement Ability Ranks");
ranks.clear();
if (use_expansion_aa && expansion >= 0) {
@@ -1927,9 +1927,9 @@ void Client::TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ab
//Enable
TogglePurchaseAlternativeAdvancementRank(rank.next_id);
Message(Chat::Spells, "You enable an ability."); //Message live gives you. Should come from spell.
AA::Rank *rank_next = zone->GetAlternateAdvancementRank(rank.next_id);
//Add checks for any special cases for toggle.
if (IsEffectinAlternateAdvancementRankEffects(*rank_next, SE_Weapon_Stance)) {
weaponstance.aabonus_enabled = true;
@@ -1990,7 +1990,7 @@ bool Client::IsEffectinAlternateAdvancementRankEffects(const AA::Rank &rank, int
}
void Client::ResetAlternateAdvancementRank(uint32 aa_id) {
/*
Resets your AA to baseline
*/
@@ -2010,7 +2010,7 @@ void Client::ResetAlternateAdvancementRank(uint32 aa_id) {
}
void Client::TogglePurchaseAlternativeAdvancementRank(int rank_id){
/*
Stripped down version of purchasing AA. Will give no messages.
Used with toggle hotkey functions.
+1 -1
View File
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/rulesys.h"
#include "../common/skills.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/data_verification.h"
#include "../common/misc_functions.h"
#include "queryserv.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "../common/string_util.h"
#include "../common/strings.h"
#include "aura.h"
#include "client.h"
+2 -2
View File
@@ -23,7 +23,7 @@
#include "doors.h"
#include "quest_parser_collection.h"
#include "lua_parser.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/say_link.h"
extern volatile bool is_zone_loaded;
@@ -9929,7 +9929,7 @@ bool Bot::UseDiscipline(uint32 spell_id, uint32 target) {
fmt::format(
"{} can use this discipline in {}.",
GetCleanName(),
ConvertSecondsToTime(remaining_time)
Strings::SecondsToTime(remaining_time)
).c_str()
);
return false;
+6 -6
View File
@@ -53,7 +53,7 @@
#include "../common/ptimer.h"
#include "../common/rulesys.h"
#include "../common/serverinfo.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/say_link.h"
#include "../common/eqemu_logsys.h"
#include "../common/emu_constants.h"
@@ -5270,7 +5270,7 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep)
return;
}
std::string bot_name = sep->arg[1];
bot_name = ucfirst(bot_name);
bot_name = Strings::UcFirst(bot_name);
if (sep->arg[2][0] == '\0' || !sep->IsNumber(2)) {
c->Message(Chat::White, "Invalid Class!");
return;
@@ -5938,7 +5938,7 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep)
}
auto* bot = entity_list.GetBotByBotName(bots_iter.Name);
auto bot_spawn_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto bot_spawn_saylink = Saylink::Create(
fmt::format("^spawn {}", bots_iter.Name),
false,
bots_iter.Name
@@ -7318,7 +7318,7 @@ void bot_subcommand_botgroup_list(Client *c, const Seperator *sep)
botgroups_iter.first,
botgroups_iter.second,
database.botdb.IsBotGroupAutoSpawn(botgroups_iter.first) ? " (Auto Spawn)" : "",
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("^botgroupload {}", botgroups_iter.first),
false,
"Load"
@@ -8825,7 +8825,7 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
slot_id,
EQ::invslot::GetInvPossessionsSlotName(slot_id),
linker.GenerateLink(),
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("^inventoryremove {}", slot_id),
false,
"Remove"
@@ -9354,7 +9354,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class)) {
const char* bot_race_name = GetRaceIDName(bot_race);
const char* bot_class_name = GetClassIDName(bot_class);
std::string view_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(fmt::format("^viewcombos {}", bot_race), false, "view");
std::string view_saylink = Saylink::Create(fmt::format("^viewcombos {}", bot_race), false, "view");
bot_owner->Message(
Chat::White,
fmt::format(
+5 -5
View File
@@ -20,7 +20,7 @@
#include "../common/global_define.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/eqemu_logsys.h"
#include "zonedb.h"
@@ -45,7 +45,7 @@ bool BotDatabase::LoadBotCommandSettings(std::map<std::string, std::pair<uint8,
if (row[2][0] == 0)
continue;
auto aliases = SplitString(row[2], '|');
auto aliases = Strings::Split(row[2], '|');
for (auto iter : aliases) {
if (!iter.empty())
bot_command_settings[row[0]].second.push_back(iter);
@@ -61,7 +61,7 @@ bool BotDatabase::UpdateInjectedBotCommandSettings(const std::vector<std::pair<s
query = fmt::format(
"REPLACE INTO `bot_command_settings`(`bot_command`, `access`) VALUES {}",
implode(
Strings::ImplodePair(
",",
std::pair<char, char>('(', ')'),
join_pair(",", std::pair<char, char>('\'', '\''), injected)
@@ -89,7 +89,7 @@ bool BotDatabase::UpdateOrphanedBotCommandSettings(const std::vector<std::string
query = fmt::format(
"DELETE FROM `bot_command_settings` WHERE `bot_command` IN ({})",
implode(",", std::pair<char, char>('\'', '\''), orphaned)
Strings::ImplodePair(",", std::pair<char, char>('\'', '\''), orphaned)
);
if (!database.QueryDatabase(query).Success()) {
@@ -2361,7 +2361,7 @@ bool BotDatabase::LoadBotGroupIDByBotGroupName(const std::string& group_name, ui
query = fmt::format(
"SELECT `groups_index` FROM `bot_groups` WHERE `group_name` = '{}' LIMIT 1",
EscapeString(group_name)
Strings::Escape(group_name)
);
auto results = database.QueryDatabase(query);
+1 -1
View File
@@ -19,7 +19,7 @@
#ifdef BOTS
#include "bot.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#if EQDEBUG >= 12
#define BotAI_DEBUG_Spells 25
+79 -79
View File
@@ -36,7 +36,7 @@ extern volatile bool RunLoops;
#include "../common/spdat.h"
#include "../common/guilds.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/data_verification.h"
#include "../common/profanity_manager.h"
#include "data_bucket.h"
@@ -3901,7 +3901,7 @@ void Client::EnteringMessages(Client* client)
if (database.GetVariable("Rules", rules)) {
uint8 flag = database.GetAgreementFlag(client->AccountID());
if (!flag) {
auto rules_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto rules_link = Saylink::Create(
"#serverrules",
false,
"rules"
@@ -3928,7 +3928,7 @@ void Client::SendRules()
return;
}
auto lines = split_string(rules, "|");
auto lines = Strings::Split(rules, "|");
auto line_number = 1;
for (auto&& line : lines) {
Message(
@@ -6337,7 +6337,7 @@ void Client::NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra)
return;
}
std::string spawn_type = str_tolower(identifier);
std::string spawn_type = Strings::ToLower(identifier);
bool is_add = spawn_type.find("add") != std::string::npos;
bool is_create = spawn_type.find("create") != std::string::npos;
bool is_delete = spawn_type.find("delete") != std::string::npos;
@@ -9522,60 +9522,60 @@ void Client::ShowDevToolsMenu()
/**
* Search entity commands
*/
menu_search += EQ::SayLinkEngine::GenerateQuestSaylink("#list corpses", false, "Corpses");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list doors", false, "Doors");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#finditem", false, "Items");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list npcs", false, "NPC");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list objects", false, "Objects");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#list players", false, "Players");
menu_search += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#findzone", false, "Zones");
menu_search += Saylink::Create("#list corpses", false, "Corpses");
menu_search += " | " + Saylink::Create("#list doors", false, "Doors");
menu_search += " | " + Saylink::Create("#finditem", false, "Items");
menu_search += " | " + Saylink::Create("#list npcs", false, "NPC");
menu_search += " | " + Saylink::Create("#list objects", false, "Objects");
menu_search += " | " + Saylink::Create("#list players", false, "Players");
menu_search += " | " + Saylink::Create("#findzone", false, "Zones");
/**
* Show
*/
menu_show += EQ::SayLinkEngine::GenerateQuestSaylink("#showzonepoints", false, "Zone Points");
menu_show += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#showzonegloballoot", false, "Zone Global Loot");
menu_show += Saylink::Create("#showzonepoints", false, "Zone Points");
menu_show += " | " + Saylink::Create("#showzonegloballoot", false, "Zone Global Loot");
/**
* Reload
*/
menu_reload_one += EQ::SayLinkEngine::GenerateQuestSaylink("#reload aa", false, "AAs");
menu_reload_one += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload alternate_currencies", false, "Alternate Currencies");
menu_reload_one += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload blocked_spells", false, "Blocked Spells");
menu_reload_one += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload content_flags", false, "Content Flags");
menu_reload_one += Saylink::Create("#reload aa", false, "AAs");
menu_reload_one += " | " + Saylink::Create("#reload alternate_currencies", false, "Alternate Currencies");
menu_reload_one += " | " + Saylink::Create("#reload blocked_spells", false, "Blocked Spells");
menu_reload_one += " | " + Saylink::Create("#reload content_flags", false, "Content Flags");
menu_reload_two += EQ::SayLinkEngine::GenerateQuestSaylink("#reload doors", false, "Doors");
menu_reload_two += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload ground_spawns", false, "Ground Spawns");
menu_reload_two += Saylink::Create("#reload doors", false, "Doors");
menu_reload_two += " | " + Saylink::Create("#reload ground_spawns", false, "Ground Spawns");
menu_reload_three += EQ::SayLinkEngine::GenerateQuestSaylink("#reload logs", false, "Level Based Experience Modifiers");
menu_reload_three += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload logs", false, "Log Settings");
menu_reload_three += Saylink::Create("#reload logs", false, "Level Based Experience Modifiers");
menu_reload_three += " | " + Saylink::Create("#reload logs", false, "Log Settings");
menu_reload_four += EQ::SayLinkEngine::GenerateQuestSaylink("#reload merchants", false, "Merchants");
menu_reload_four += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload npc_emotes", false, "NPC Emotes");
menu_reload_four += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload objects", false, "Objects");
menu_reload_four += Saylink::Create("#reload merchants", false, "Merchants");
menu_reload_four += " | " + Saylink::Create("#reload npc_emotes", false, "NPC Emotes");
menu_reload_four += " | " + Saylink::Create("#reload objects", false, "Objects");
menu_reload_five += EQ::SayLinkEngine::GenerateQuestSaylink("#reload perl_export", false, "Perl Event Export Settings");
menu_reload_five += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload quest", false, "Quests");
menu_reload_five += Saylink::Create("#reload perl_export", false, "Perl Event Export Settings");
menu_reload_five += " | " + Saylink::Create("#reload quest", false, "Quests");
menu_reload_six += EQ::SayLinkEngine::GenerateQuestSaylink("#reload rules", false, "Rules");
menu_reload_six += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload static", false, "Static Zone Data");
menu_reload_six += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload tasks", false, "Tasks");
menu_reload_seven += EQ::SayLinkEngine::GenerateQuestSaylink("#reload titles", false, "Titles");
menu_reload_seven += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload traps 1", false, "Traps");
menu_reload_seven += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload variables", false, "Variables");
menu_reload_seven += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload veteran_rewards", false, "Veteran Rewards");
menu_reload_eight += EQ::SayLinkEngine::GenerateQuestSaylink("#reload world", false, "World");
menu_reload_eight += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload zone", false, "Zone");
menu_reload_eight += " | " + EQ::SayLinkEngine::GenerateQuestSaylink("#reload zone_points", false, "Zone Points");
menu_reload_six += Saylink::Create("#reload rules", false, "Rules");
menu_reload_six += " | " + Saylink::Create("#reload static", false, "Static Zone Data");
menu_reload_six += " | " + Saylink::Create("#reload tasks", false, "Tasks");
menu_reload_seven += Saylink::Create("#reload titles", false, "Titles");
menu_reload_seven += " | " + Saylink::Create("#reload traps 1", false, "Traps");
menu_reload_seven += " | " + Saylink::Create("#reload variables", false, "Variables");
menu_reload_seven += " | " + Saylink::Create("#reload veteran_rewards", false, "Veteran Rewards");
menu_reload_eight += Saylink::Create("#reload world", false, "World");
menu_reload_eight += " | " + Saylink::Create("#reload zone", false, "Zone");
menu_reload_eight += " | " + Saylink::Create("#reload zone_points", false, "Zone Points");
/**
* Show window status
*/
menu_toggle = EQ::SayLinkEngine::GenerateQuestSaylink("#devtools enable", false, "Enable");
menu_toggle = Saylink::Create("#devtools enable", false, "Enable");
if (IsDevToolsEnabled()) {
menu_toggle = EQ::SayLinkEngine::GenerateQuestSaylink("#devtools disable", false, "Disable");
menu_toggle = Saylink::Create("#devtools disable", false, "Disable");
}
/**
@@ -9597,7 +9597,7 @@ void Client::ShowDevToolsMenu()
Chat::White,
fmt::format(
"Show Menu | {}",
EQ::SayLinkEngine::GenerateQuestSaylink("#dev", false, "#dev")
Saylink::Create("#dev", false, "#dev")
).c_str()
);
@@ -9689,7 +9689,7 @@ void Client::ShowDevToolsMenu()
).c_str()
);
auto help_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto help_link = Saylink::Create(
"#help",
false,
"#help"
@@ -10439,7 +10439,7 @@ void Client::SetAFK(uint8 afk_flag) {
void Client::SendToInstance(std::string instance_type, std::string zone_short_name, uint32 instance_version, float x, float y, float z, float heading, std::string instance_identifier, uint32 duration) {
uint32 zone_id = ZoneID(zone_short_name);
std::string current_instance_type = str_tolower(instance_type);
std::string current_instance_type = Strings::ToLower(instance_type);
std::string instance_type_name = "public";
if (current_instance_type.find("solo") != std::string::npos) {
instance_type_name = GetCleanName();
@@ -11190,7 +11190,7 @@ void Client::ReconnectUCS()
void Client::SendReloadCommandMessages() {
SendChatLineBreak();
auto aa_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto aa_link = Saylink::Create(
"#reload aa",
false,
"#reload aa"
@@ -11204,7 +11204,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto alternate_currencies_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto alternate_currencies_link = Saylink::Create(
"#reload alternate_currencies",
false,
"#reload alternate_currencies"
@@ -11218,7 +11218,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto blocked_spells_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto blocked_spells_link = Saylink::Create(
"#reload blocked_spells",
false,
"#reload blocked_spells"
@@ -11232,7 +11232,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto content_flags_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto content_flags_link = Saylink::Create(
"#reload content_flags",
false,
"#reload content_flags"
@@ -11246,7 +11246,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto doors_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto doors_link = Saylink::Create(
"#reload doors",
false,
"#reload doors"
@@ -11260,7 +11260,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto ground_spawns_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto ground_spawns_link = Saylink::Create(
"#reload ground_spawns",
false,
"#reload ground_spawns"
@@ -11274,7 +11274,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto level_mods_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto level_mods_link = Saylink::Create(
"#reload level_mods",
false,
"#reload level_mods"
@@ -11288,7 +11288,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto logs_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto logs_link = Saylink::Create(
"#reload logs",
false,
"#reload logs"
@@ -11302,7 +11302,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto merchants_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto merchants_link = Saylink::Create(
"#reload merchants",
false,
"#reload merchants"
@@ -11316,7 +11316,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto npc_emotes_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto npc_emotes_link = Saylink::Create(
"#reload npc_emotes",
false,
"#reload npc_emotes"
@@ -11330,7 +11330,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto objects_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto objects_link = Saylink::Create(
"#reload objects",
false,
"#reload objects"
@@ -11344,7 +11344,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto perl_export_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto perl_export_link = Saylink::Create(
"#reload perl_export",
false,
"#reload perl_export"
@@ -11358,19 +11358,19 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto quest_link_one = EQ::SayLinkEngine::GenerateQuestSaylink(
auto quest_link_one = Saylink::Create(
"#reload quest",
false,
"#reload quest"
);
auto quest_link_two = EQ::SayLinkEngine::GenerateQuestSaylink(
auto quest_link_two = Saylink::Create(
"#reload quest",
false,
"0"
);
auto quest_link_three = EQ::SayLinkEngine::GenerateQuestSaylink(
auto quest_link_three = Saylink::Create(
"#reload quest 1",
false,
"1"
@@ -11386,7 +11386,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto rules_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto rules_link = Saylink::Create(
"#reload rules",
false,
"#reload rules"
@@ -11400,7 +11400,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto static_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto static_link = Saylink::Create(
"#reload static",
false,
"#reload static"
@@ -11414,7 +11414,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto tasks_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto tasks_link = Saylink::Create(
"#reload tasks",
false,
"#reload tasks"
@@ -11428,7 +11428,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto titles_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto titles_link = Saylink::Create(
"#reload titles",
false,
"#reload titles"
@@ -11442,19 +11442,19 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto traps_link_one = EQ::SayLinkEngine::GenerateQuestSaylink(
auto traps_link_one = Saylink::Create(
"#reload traps",
false,
"#reload traps"
);
auto traps_link_two = EQ::SayLinkEngine::GenerateQuestSaylink(
auto traps_link_two = Saylink::Create(
"#reload traps",
false,
"0"
);
auto traps_link_three = EQ::SayLinkEngine::GenerateQuestSaylink(
auto traps_link_three = Saylink::Create(
"#reload traps 1",
false,
"1"
@@ -11470,7 +11470,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto variables_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto variables_link = Saylink::Create(
"#reload variables",
false,
"#reload variables"
@@ -11484,7 +11484,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto veteran_rewards_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto veteran_rewards_link = Saylink::Create(
"#reload veteran_rewards",
false,
"#reload veteran_rewards"
@@ -11498,25 +11498,25 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto world_link_one = EQ::SayLinkEngine::GenerateQuestSaylink(
auto world_link_one = Saylink::Create(
"#reload world",
false,
"#reload world"
);
auto world_link_two = EQ::SayLinkEngine::GenerateQuestSaylink(
auto world_link_two = Saylink::Create(
"#reload world",
false,
"0"
);
auto world_link_three = EQ::SayLinkEngine::GenerateQuestSaylink(
auto world_link_three = Saylink::Create(
"#reload world 1",
false,
"1"
);
auto world_link_four = EQ::SayLinkEngine::GenerateQuestSaylink(
auto world_link_four = Saylink::Create(
"#reload world 2",
false,
"2"
@@ -11533,7 +11533,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto zone_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto zone_link = Saylink::Create(
"#reload zone",
false,
"#reload zone"
@@ -11547,7 +11547,7 @@ void Client::SendReloadCommandMessages() {
).c_str()
);
auto zone_points_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto zone_points_link = Saylink::Create(
"#reload zone_points",
false,
"#reload zone_points"
@@ -11623,12 +11623,12 @@ bool Client::CheckMerchantDataBucket(uint8 bucket_comparison, std::string bucket
}
passes = true;
break;
}
case MerchantBucketComparison::BucketIsAny:
{
bucket_checks = split_string(bucket_value, "|");
bucket_checks = Strings::Split(bucket_value, "|");
if (bucket_checks.empty()) {
break;
}
@@ -11649,7 +11649,7 @@ bool Client::CheckMerchantDataBucket(uint8 bucket_comparison, std::string bucket
}
case MerchantBucketComparison::BucketIsNotAny:
{
bucket_checks = split_string(bucket_value, "|");
bucket_checks = Strings::Split(bucket_value, "|");
if (bucket_checks.empty()) {
break;
}
@@ -11670,7 +11670,7 @@ bool Client::CheckMerchantDataBucket(uint8 bucket_comparison, std::string bucket
}
case MerchantBucketComparison::BucketIsBetween:
{
bucket_checks = split_string(bucket_value, "|");
bucket_checks = Strings::Split(bucket_value, "|");
if (bucket_checks.empty()) {
break;
}
@@ -11687,7 +11687,7 @@ bool Client::CheckMerchantDataBucket(uint8 bucket_comparison, std::string bucket
}
case MerchantBucketComparison::BucketIsNotBetween:
{
bucket_checks = split_string(bucket_value, "|");
bucket_checks = Strings::Split(bucket_value, "|");
if (bucket_checks.empty()) {
break;
}
@@ -11713,7 +11713,7 @@ std::map<std::string,std::string> Client::GetMerchantDataBuckets()
auto query = fmt::format(
"SELECT `key`, `value` FROM data_buckets WHERE `key` LIKE '{}-%'",
EscapeString(GetBucketKey())
Strings::Escape(GetBucketKey())
);
auto results = database.QueryDatabase(query);
+9 -9
View File
@@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/rulesys.h"
#include "../common/skills.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/zone_numbers.h"
#include "data_bucket.h"
#include "event_codes.h"
@@ -795,7 +795,7 @@ void Client::CompleteConnect()
if (zone && zone->GetInstanceTimer()) {
bool is_permanent = false;
uint32 remaining_time = database.GetTimeRemainingInstance(zone->GetInstanceID(), is_permanent);
auto time_string = ConvertSecondsToTime(remaining_time);
auto time_string = Strings::SecondsToTime(remaining_time);
Message(
Chat::Yellow,
fmt::format(
@@ -4230,7 +4230,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app)
fmt::format(
"Door ({}) [{}]",
currentdoor->GetEntityID(),
EQ::SayLinkEngine::GenerateQuestSaylink("#door edit", false, "#door edit")
Saylink::Create("#door edit", false, "#door edit")
).c_str()
);
}
@@ -4852,7 +4852,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app)
uint32 decay_time = target->GetDecayTime();
if (decay_time) {
auto time_string = ConvertSecondsToTime(decay_time, true);
auto time_string = Strings::SecondsToTime(decay_time, true);
Message(
Chat::NPCQuestSay,
fmt::format(
@@ -12945,7 +12945,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
Chat::White,
fmt::format(
"You can use the ability /shield in {}.",
ConvertSecondsToTime(remaining_time)
Strings::SecondsToTime(remaining_time)
).c_str()
);
return;
@@ -13100,7 +13100,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
auto hacker_str = fmt::format("Vendor Cheat: attempted to buy {} of {}: {} that cost {} cp but only has {} pp {} gp {} sp {} cp",
mpo->quantity, item->ID, item->Name,
mpo->price, m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper);
database.SetMQDetectionFlag(AccountName(), GetName(), EscapeString(hacker_str), zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), Strings::Escape(hacker_str), zone->GetShortName());
safe_delete(outapp);
safe_delete(inst);
return;
@@ -14027,7 +14027,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
{
auto hacker_str = fmt::format("{} attempting to target something untargetable, {} bodytype: {}",
GetName(), GetTarget()->GetName(), (int)GetTarget()->GetBodyType());
database.SetMQDetectionFlag(AccountName(), GetName(), EscapeString(hacker_str), zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), Strings::Escape(hacker_str), zone->GetShortName());
SetTarget((Mob*)nullptr);
return;
}
@@ -14064,7 +14064,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
(zone->newzone_data.maxclip * zone->newzone_data.maxclip), GetX(),
GetY(), GetZ(), GetTarget()->GetName(), GetTarget()->GetX(),
GetTarget()->GetY(), GetTarget()->GetZ());
database.SetMQDetectionFlag(AccountName(), GetName(), EscapeString(hacker_str), zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), Strings::Escape(hacker_str), zone->GetShortName());
SetTarget(nullptr);
return;
}
@@ -14078,7 +14078,7 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
GetName(), (zone->newzone_data.maxclip * zone->newzone_data.maxclip),
GetX(), GetY(), GetZ(), GetTarget()->GetName(), GetTarget()->GetX(),
GetTarget()->GetY(), GetTarget()->GetZ());
database.SetMQDetectionFlag(AccountName(), GetName(), EscapeString(hacker_str), zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), Strings::Escape(hacker_str), zone->GetShortName());
SetTarget(nullptr);
return;
}
+3 -3
View File
@@ -42,7 +42,7 @@
#include "../common/rulesys.h"
#include "../common/skills.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "event_codes.h"
#include "expedition.h"
#include "guild_mgr.h"
@@ -918,7 +918,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
// Account for merchant lists with gaps.
if (ml.slot >= slot_id) {
if (ml.slot > slot_id) {
LogDebug("(WARNING) Merchantlist contains gap at slot [{}]. Merchant: [{}], NPC: [{}]", slot_id, merchant_id, npcid);
LogDebug("(WARNING) Merchantlist Contains gap at slot [{}]. Merchant: [{}], NPC: [{}]", slot_id, merchant_id, npcid);
}
slot_id = ml.slot + 1;
@@ -967,7 +967,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
//this resets the slot
zone->tmpmerchanttable[npcid] = temporary_merchant_list;
if (npc && handy_item) {
int greet_id = zone->random.Int(MERCHANT_GREETING, MERCHANT_HANDY_ITEM4);
int greet_id = zone->random.Int(MERCHANT_GREETING, MERCHANT_HANDY_ITEM4);
auto handy_id = std::to_string(greet_id);
if (greet_id != MERCHANT_GREETING) {
MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, npc->GetCleanName(), handy_id.c_str(), GetName(), handy_item->Name);
+2 -2
View File
@@ -1,6 +1,6 @@
#include "combat_record.h"
#include "../common/eqemu_logsys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
void CombatRecord::Start(std::string in_mob_name)
{
@@ -22,7 +22,7 @@ void CombatRecord::Stop()
mob_name,
time_in_combat > 0 ? (damage_received / time_in_combat) : damage_received,
time_in_combat > 0 ? (heal_received / time_in_combat) : heal_received,
time_in_combat > 0 ? ConvertSecondsToTime(time_in_combat) : "",
time_in_combat > 0 ? Strings::SecondsToTime(time_in_combat) : "",
time_in_combat
);
}
+6 -6
View File
@@ -16,7 +16,7 @@
#include "../common/features.h"
#include "../common/ptimer.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/say_link.h"
#include "../common/net/eqstream.h"
#include "../common/file_util.h"
@@ -592,7 +592,7 @@ void command_help(Client *c, const Seperator *sep)
{
int found_count = 0;
std::string command_link;
std::string search_criteria = str_tolower(sep->argplus[1]);
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
for (const auto& cur : commandlist) {
if (!search_criteria.empty()) {
@@ -605,7 +605,7 @@ void command_help(Client *c, const Seperator *sep)
continue;
}
command_link = EQ::SayLinkEngine::GenerateQuestSaylink(
command_link = Saylink::Create(
fmt::format(
"{}{}",
COMMAND_CHAR,
@@ -664,7 +664,7 @@ void command_findaliases(Client *c, const Seperator *sep)
return;
}
std::string search_criteria = str_tolower(sep->argplus[1]);
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
auto find_iter = commandaliases.find(search_criteria);
if (find_iter == commandaliases.end()) {
@@ -687,7 +687,7 @@ void command_findaliases(Client *c, const Seperator *sep)
return;
}
auto current_commmand_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto current_commmand_link = Saylink::Create(
fmt::format(
"{}{}",
COMMAND_CHAR,
@@ -712,7 +712,7 @@ void command_findaliases(Client *c, const Seperator *sep)
continue;
}
alias_link = EQ::SayLinkEngine::GenerateQuestSaylink(
alias_link = Saylink::Create(
fmt::format(
"{}{}",
COMMAND_CHAR,
+5 -5
View File
@@ -33,7 +33,7 @@ Child of the Mob class.
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/say_link.h"
#include "corpse.h"
@@ -1028,8 +1028,8 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
client->Message(
Chat::Yellow,
fmt::format(
"This corpse contains {}.",
ConvertMoneyToString(
"This corpse Contains {}.",
Strings::Money(
GetPlatinum(),
GetGold(),
GetSilver(),
@@ -1038,7 +1038,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
).c_str()
);
} else {
client->Message(Chat::Yellow, "This corpse contains no money.");
client->Message(Chat::Yellow, "This corpse Contains no money.");
}
auto outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct));
@@ -1534,7 +1534,7 @@ void Corpse::QueryLoot(Client* to) {
Chat::White,
fmt::format(
"Money | {}",
ConvertMoneyToString(
Strings::Money(
platinum,
gold,
silver,
+7 -7
View File
@@ -1,6 +1,6 @@
#include "data_bucket.h"
#include <utility>
#include "../common/string_util.h"
#include "../common/strings.h"
#include "zonedb.h"
#include "zone_store.h"
#include <ctime>
@@ -35,16 +35,16 @@ void DataBucket::SetData(std::string bucket_key, std::string bucket_value, std::
query = StringFormat(
"UPDATE `data_buckets` SET `value` = '%s' %s WHERE `id` = %i",
EscapeString(bucket_value).c_str(),
EscapeString(update_expired_time).c_str(),
Strings::Escape(bucket_value).c_str(),
Strings::Escape(update_expired_time).c_str(),
bucket_id
);
}
else {
query = StringFormat(
"INSERT INTO `data_buckets` (`key`, `value`, `expires`) VALUES ('%s', '%s', '%lld')",
EscapeString(bucket_key).c_str(),
EscapeString(bucket_value).c_str(),
Strings::Escape(bucket_key).c_str(),
Strings::Escape(bucket_value).c_str(),
expires_time_unix
);
}
@@ -133,7 +133,7 @@ std::string DataBucket::GetDataRemaining(std::string bucket_key) {
uint64 DataBucket::DoesBucketExist(std::string bucket_key) {
std::string query = StringFormat(
"SELECT `id` from `data_buckets` WHERE `key` = '%s' AND (`expires` > %lld OR `expires` = 0) LIMIT 1",
EscapeString(bucket_key).c_str(),
Strings::Escape(bucket_key).c_str(),
(long long) std::time(nullptr)
);
@@ -157,7 +157,7 @@ uint64 DataBucket::DoesBucketExist(std::string bucket_key) {
bool DataBucket::DeleteData(std::string bucket_key) {
std::string query = StringFormat(
"DELETE FROM `data_buckets` WHERE `key` = '%s'",
EscapeString(bucket_key).c_str()
Strings::Escape(bucket_key).c_str()
);
auto results = database.QueryDatabase(query);
+63 -63
View File
@@ -16,28 +16,28 @@ void DialogueWindow::Render(Client *c, std::string markdown)
c->SetEntityVariable(DIAWIND_RESPONSE_TWO_KEY.c_str(), "");
// simple find and replace for the markdown
find_replace(output, "~", "</c>");
find_replace(output, "{y}", "<c \"#CCFF33\">");
find_replace(output, "{lb}", "<c \"#00FFFF\">");
find_replace(output, "{r}", "<c \"#FF0000\">");
find_replace(output, "{g}", "<c \"#00FF00\">");
find_replace(output, "{gold}", "<c \"#FFFF66\">");
find_replace(output, "{orange}", "<c \"#FFA500\">");
find_replace(output, "{gray}", "<c \"#808080\">");
find_replace(output, "{tan}", "<c \"#daa520\">");
find_replace(output, "{bullet}", "");
find_replace(output, "{name}", fmt::format("{}", c->GetCleanName()));
find_replace(output, "{linebreak}", "--------------------------------------------------------------------");
find_replace(output, "{rowpad}", R"(<tr><td>{tdpad}<"td><td>{tdpad}<"td><"tr>)");
find_replace(output, "{tdpad}", "----------------------");
find_replace(output, "{in}", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
Strings::FindReplace(output, "~", "</c>");
Strings::FindReplace(output, "{y}", "<c \"#CCFF33\">");
Strings::FindReplace(output, "{lb}", "<c \"#00FFFF\">");
Strings::FindReplace(output, "{r}", "<c \"#FF0000\">");
Strings::FindReplace(output, "{g}", "<c \"#00FF00\">");
Strings::FindReplace(output, "{gold}", "<c \"#FFFF66\">");
Strings::FindReplace(output, "{orange}", "<c \"#FFA500\">");
Strings::FindReplace(output, "{gray}", "<c \"#808080\">");
Strings::FindReplace(output, "{tan}", "<c \"#daa520\">");
Strings::FindReplace(output, "{bullet}", "");
Strings::FindReplace(output, "{name}", fmt::format("{}", c->GetCleanName()));
Strings::FindReplace(output, "{linebreak}", "--------------------------------------------------------------------");
Strings::FindReplace(output, "{rowpad}", R"(<tr><td>{tdpad}<"td><td>{tdpad}<"td><"tr>)");
Strings::FindReplace(output, "{tdpad}", "----------------------");
Strings::FindReplace(output, "{in}", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
// mysterious voice
bool render_mysterious_voice = false;
if (markdown.find("{mysterious}") != std::string::npos) {
render_mysterious_voice = true;
LogDiaWind("Client [{}] Rendering mysterious voice", c->GetCleanName());
find_replace(output, "{mysterious}", "");
Strings::FindReplace(output, "{mysterious}", "");
}
// noquotes
@@ -45,7 +45,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
if (markdown.find("noquotes") != std::string::npos) {
render_noquotes = true;
LogDiaWind("Client [{}] Rendering noquotes", c->GetCleanName());
find_replace(output, "noquotes", "");
Strings::FindReplace(output, "noquotes", "");
}
// nobracket
@@ -53,30 +53,30 @@ void DialogueWindow::Render(Client *c, std::string markdown)
if (markdown.find("nobracket") != std::string::npos) {
render_nobracket = true;
LogDiaWind("Client [{}] Rendering nobracket", c->GetCleanName());
find_replace(output, "nobracket", "");
Strings::FindReplace(output, "nobracket", "");
}
bool render_hiddenresponse = false;
if (markdown.find("hiddenresponse") != std::string::npos) {
render_hiddenresponse = true;
LogDiaWind("Client [{}] Rendering hiddenresponse", c->GetCleanName());
find_replace(output, "hiddenresponse", "");
Strings::FindReplace(output, "hiddenresponse", "");
}
// animations
std::string animation = get_between(output, "+", "+");
std::string animation = Strings::GetBetween(output, "+", "+");
if (!animation.empty()) {
LogDiaWind("Client [{}] Animation is not empty, contents are [{}]", c->GetCleanName(), animation);
find_replace(output, fmt::format("+{}+", animation), "");
Strings::FindReplace(output, fmt::format("+{}+", animation), "");
// we treat the animation field differently if it is a number
if (StringIsNumber(animation)) {
if (Strings::IsNumber(animation)) {
LogDiaWindDetail("Client [{}] Animation is a number, firing animation [{}]", c->GetCleanName(), animation);
target->DoAnim(std::stoi(animation));
}
else {
for (auto &a: animations) {
if (a.first.find(str_tolower(animation)) != std::string::npos) {
if (a.first.find(Strings::ToLower(animation)) != std::string::npos) {
LogDiaWindDetail(
"Client [{}] Animation is a string, firing animation [{}] [{}]",
c->GetCleanName(),
@@ -105,14 +105,14 @@ void DialogueWindow::Render(Client *c, std::string markdown)
}
// window expire time
std::string expire_time = get_between(output, "=", "=");
std::string expire_time = Strings::GetBetween(output, "=", "=");
uint32 window_expire_seconds = 0;
if (!expire_time.empty()) {
LogDiaWind("Client [{}] Window expire time is not empty, contents are [{}]", c->GetCleanName(), expire_time);
find_replace(output, fmt::format("={}=", expire_time), "");
Strings::FindReplace(output, fmt::format("={}=", expire_time), "");
// we treat the animation field differently if it is a number
if (StringIsNumber(expire_time)) {
if (Strings::IsNumber(expire_time)) {
LogDiaWindDetail(
"Client [{}] Window expire time is a number, setting expiration to [{}]",
c->GetCleanName(),
@@ -133,12 +133,12 @@ void DialogueWindow::Render(Client *c, std::string markdown)
if (markdown.find("wintype:") != std::string::npos) {
LogDiaWind("Client [{}] Rendering wintype option", c->GetCleanName());
auto first_split = split_string(output, "wintype:");
auto first_split = Strings::Split(output, "wintype:");
if (!first_split.empty()) {
// assumed that there is more after the wintype declaration
// wintype:0 +animation+ etc.
auto second_split = split_string(first_split[1], " ");
auto second_split = Strings::Split(first_split[1], " ");
if (!second_split.empty()) {
wintype = second_split[0];
LogDiaWindDetail("Client [{}] Rendering wintype option wintype [{}]", c->GetCleanName(), wintype);
@@ -155,7 +155,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
);
}
find_replace(output, fmt::format("wintype:{}", wintype), "");
Strings::FindReplace(output, fmt::format("wintype:{}", wintype), "");
}
}
@@ -164,12 +164,12 @@ void DialogueWindow::Render(Client *c, std::string markdown)
if (markdown.find("popupid:") != std::string::npos) {
LogDiaWind("Client [{}] Rendering popupid option", c->GetCleanName());
auto first_split = split_string(output, "popupid:");
auto first_split = Strings::Split(output, "popupid:");
if (!first_split.empty()) {
// assumed that there is more after the popupid declaration
// popupid:0 +animation+ etc.
auto second_split = split_string(first_split[1], " ");
auto second_split = Strings::Split(first_split[1], " ");
if (!second_split.empty()) {
popupid = second_split[0];
LogDiaWindDetail("Client [{}] Rendering popupid option popupid [{}]", c->GetCleanName(), popupid);
@@ -186,11 +186,11 @@ void DialogueWindow::Render(Client *c, std::string markdown)
);
}
find_replace(output, fmt::format("popupid:{}", popupid), "");
Strings::FindReplace(output, fmt::format("popupid:{}", popupid), "");
// set the popup id
if (!popupid.empty()) {
popup_id = (StringIsNumber(popupid) ? std::atoi(popupid.c_str()) : 0);
popup_id = (Strings::IsNumber(popupid) ? std::atoi(popupid.c_str()) : 0);
}
}
}
@@ -200,9 +200,9 @@ void DialogueWindow::Render(Client *c, std::string markdown)
if (markdown.find("secondresponseid:") != std::string::npos) {
LogDiaWind("Client [{}] Rendering secondresponseid option", c->GetCleanName());
auto first_split = split_string(output, "secondresponseid:");
auto first_split = Strings::Split(output, "secondresponseid:");
if (!first_split.empty()) {
auto second_split = split_string(first_split[1], " ");
auto second_split = Strings::Split(first_split[1], " ");
if (!second_split.empty()) {
secondresponseid = second_split[0];
LogDiaWindDetail("Client [{}] Rendering secondresponseid option secondresponseid [{}]",
@@ -219,10 +219,10 @@ void DialogueWindow::Render(Client *c, std::string markdown)
);
}
find_replace(output, fmt::format("secondresponseid:{}", secondresponseid), "");
Strings::FindReplace(output, fmt::format("secondresponseid:{}", secondresponseid), "");
if (!secondresponseid.empty()) {
negative_id = (StringIsNumber(secondresponseid) ? std::atoi(secondresponseid.c_str()) : 0);
negative_id = (Strings::IsNumber(secondresponseid) ? std::atoi(secondresponseid.c_str()) : 0);
}
}
}
@@ -237,20 +237,20 @@ void DialogueWindow::Render(Client *c, std::string markdown)
LogDiaWind("Client [{}] Rendering button_one option.", c->GetCleanName());
button_one = get_between(output, "{button_one:", "}");
button_one = Strings::GetBetween(output, "{button_one:", "}");
LogDiaWind("Client [{}] button_one [{}]", c->GetCleanName(), button_one);
if (!button_one.empty()) {
find_replace(output, fmt::format("{{button_one:{}}}", button_one), "");
button_one_name = trim(button_one);
Strings::FindReplace(output, fmt::format("{{button_one:{}}}", button_one), "");
button_one_name = Strings::Trim(button_one);
}
button_two = get_between(output, "{button_two:", "}");
button_two = Strings::GetBetween(output, "{button_two:", "}");
LogDiaWind("Client [{}] button_two [{}]", c->GetCleanName(), button_two);
if (!button_two.empty()) {
find_replace(output, fmt::format("{{button_two:{}}}", button_two), "");
button_two_name = trim(button_two);
Strings::FindReplace(output, fmt::format("{{button_two:{}}}", button_two), "");
button_two_name = Strings::Trim(button_two);
}
LogDiaWind(
@@ -270,7 +270,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
std::string strip_saylinks = output;
std::map<std::string, std::string> replacements = {};
while (strip_saylinks.find('[') != std::string::npos && strip_saylinks.find(']') != std::string::npos) {
std::string bracket_message = get_between(strip_saylinks, "[", "]");
std::string bracket_message = Strings::GetBetween(strip_saylinks, "[", "]");
// strip saylinks and normalize to [regular message]
size_t link_open = bracket_message.find('\x12');
@@ -284,12 +284,12 @@ void DialogueWindow::Render(Client *c, std::string markdown)
);
}
find_replace(strip_saylinks, fmt::format("[{}]", bracket_message), "");
Strings::FindReplace(strip_saylinks, fmt::format("[{}]", bracket_message), "");
}
// write replacement strips
for (auto &replacement: replacements) {
find_replace(output, replacement.first, replacement.second.substr(0, replacement.second.size() - 1));
Strings::FindReplace(output, replacement.first, replacement.second.substr(0, replacement.second.size() - 1));
}
// copy
@@ -298,7 +298,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// while brackets still exist
int response_index = 0;
while (content.find('[') != std::string::npos && content.find(']') != std::string::npos) {
std::string bracket_message = get_between(content, "[", "]");
std::string bracket_message = Strings::GetBetween(content, "[", "]");
LogDiaWindDetail(
"Client [{}] Rendering responses ({}) [{}]",
@@ -311,7 +311,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
responses.emplace_back(bracket_message);
// pop the response off of the message
find_replace(content, fmt::format("[{}]", bracket_message), "");
Strings::FindReplace(content, fmt::format("[{}]", bracket_message), "");
// too many iterations / safety net
if (response_index > 100) {
@@ -326,7 +326,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
if (responses.size() > 1) {
for (auto &r: responses) {
bracket_responses.emplace_back(
fmt::format("[{}]", EQ::SayLinkEngine::GenerateQuestSaylink(r, false, r))
fmt::format("[{}]", Saylink::Create(r, false, r))
);
}
}
@@ -346,13 +346,13 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// handle silent prompts from the [> silent syntax
std::string silent_message;
if (responses.empty() && markdown.find('[') != std::string::npos && markdown.find('>') != std::string::npos) {
silent_message = get_between(output, "[", ">");
silent_message = Strings::GetBetween(output, "[", ">");
// temporary and used during the response
c->SetEntityVariable(DIAWIND_RESPONSE_ONE_KEY.c_str(), silent_message.c_str());
// pop the silent message off
find_replace(output, fmt::format("[{}>", silent_message), "");
Strings::FindReplace(output, fmt::format("[{}>", silent_message), "");
}
else if (!responses.empty()) {
// handle silent prompts from the single respond bracket syntax []
@@ -362,13 +362,13 @@ void DialogueWindow::Render(Client *c, std::string markdown)
c->SetEntityVariable(DIAWIND_RESPONSE_ONE_KEY.c_str(), silent_message.c_str());
// pop the silent message off
find_replace(output, fmt::format("[{}]", silent_message), "");
Strings::FindReplace(output, fmt::format("[{}]", silent_message), "");
}
// strip brackets
if (render_nobracket) {
find_replace(output, "[", "");
find_replace(output, "]", "");
Strings::FindReplace(output, "[", "");
Strings::FindReplace(output, "]", "");
}
// render title
@@ -385,13 +385,13 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// title
std::string popup_title;
if (markdown.find("{title:") != std::string::npos) {
popup_title = get_between(output, "{title:", "}");
popup_title = Strings::GetBetween(output, "{title:", "}");
LogDiaWind("Client [{}] Rendering title option title [{}]", c->GetCleanName(), popup_title);
if (!popup_title.empty()) {
find_replace(output, fmt::format("{{title:{}}}", popup_title), "");
title = trim(popup_title);
Strings::FindReplace(output, fmt::format("{{title:{}}}", popup_title), "");
title = Strings::Trim(popup_title);
}
}
@@ -407,7 +407,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// click response
// window type response
uint32 window_type = (StringIsNumber(wintype) ? std::atoi(wintype.c_str()) : 0);
uint32 window_type = (Strings::IsNumber(wintype) ? std::atoi(wintype.c_str()) : 0);
std::string click_response_button = (window_type == 1 ? "Yes" : "OK");
std::string click_response = fmt::format(
"<c \"#F07F00\">Click [{}] to continue...</c>",
@@ -449,7 +449,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// while brackets still exist
int tag_index = 0;
while (output.find('{') != std::string::npos && output.find('}') != std::string::npos) {
std::string color_tag = get_between(output, "{", "}");
std::string color_tag = Strings::GetBetween(output, "{", "}");
LogDiaWindDetail(
"Client [{}] Rendering color tags ({}) [{}]",
@@ -464,7 +464,7 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// build html tag
html_tag = fmt::format("<c \"{}\">", color.second);
// pop the response off of the message
find_replace(output, fmt::format("{{{}}}", color.first), html_tag);
Strings::FindReplace(output, fmt::format("{{{}}}", color.first), html_tag);
}
}
@@ -479,9 +479,9 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// build the final output string
std::string final_output;
final_output = fmt::format("{}{}{} <br><br> {}", quote_string, trim(output), quote_string, click_response);
final_output = fmt::format("{}{}{} <br><br> {}", quote_string, Strings::Trim(output), quote_string, click_response);
if (render_hiddenresponse) {
final_output = fmt::format("{}{}{}", quote_string, trim(output), quote_string);
final_output = fmt::format("{}{}{}", quote_string, Strings::Trim(output), quote_string);
}
// send popup
@@ -500,6 +500,6 @@ void DialogueWindow::Render(Client *c, std::string markdown)
// if multiple brackets are presented, send message
if (!bracket_responses.empty()) {
c->Message(Chat::White, " --- Select Response from Options --- ");
c->Message(Chat::White, implode(" ", bracket_responses).c_str());
c->Message(Chat::White, Strings::Implode(" ", bracket_responses).c_str());
}
}
+1 -1
View File
@@ -18,7 +18,7 @@
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "client.h"
#include "doors.h"
+4 -4
View File
@@ -571,7 +571,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
uint32 spell_id = item->Scroll.Effect;
if(!IsValidSpell(spell_id)) {
Message(Chat::Red, "This tome contains invalid knowledge.");
Message(Chat::Red, "This tome Contains invalid knowledge.");
return(false);
}
@@ -649,7 +649,7 @@ bool Client::MemorizeSpellFromItem(uint32 item_id) {
uint32 spell_id = item->Scroll.Effect;
if(!IsValidSpell(spell_id)) {
Message(Chat::Red, "This scroll contains invalid knowledge.");
Message(Chat::Red, "This scroll Contains invalid knowledge.");
return false;
}
@@ -755,7 +755,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
//make sure we can use it..
if(!IsValidSpell(spell_id)) {
Message(Chat::Red, "This tome contains invalid knowledge.");
Message(Chat::Red, "This tome Contains invalid knowledge.");
return(false);
}
@@ -801,7 +801,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
Chat::White,
fmt::format(
"You can use this discipline in {}.",
ConvertSecondsToTime(remaining_time)
Strings::SecondsToTime(remaining_time)
).c_str()
);
return false;
+5 -5
View File
@@ -21,7 +21,7 @@
#include "../common/global_define.h"
#include "../common/seperator.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/features.h"
#include "masterentity.h"
#include "embparser.h"
@@ -934,7 +934,7 @@ int PerlembParser::SendCommands(
"Script Error | Package [{}] Event [{}] Error [{}]",
pkgprefix,
event,
trim(e)
Strings::Trim(e)
)
);
}
@@ -1413,7 +1413,7 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "version", zone->GetInstanceVersion());
break;
}
case EVENT_LOOT_ZONE:
case EVENT_LOOT: {
Seperator sep(data);
@@ -1666,12 +1666,12 @@ void PerlembParser::ExportEventVariables(
ExportVar(package_name.c_str(), "from_z", sep.arg[2]);
break;
}
case EVENT_CONSIDER: {
ExportVar(package_name.c_str(), "entity_id", std::stoi(data));
break;
}
case EVENT_CONSIDER_CORPSE: {
ExportVar(package_name.c_str(), "corpse_entity_id", std::stoi(data));
break;
+1 -1
View File
@@ -3638,7 +3638,7 @@ std::string Perl__getenvironmentaldamagename(uint8 damage_type)
std::string Perl__commify(perl::scalar number)
{
return commify(number.c_str());
return Strings::Commify(number.c_str());
}
bool Perl__checknamefilter(std::string name)
+2 -2
View File
@@ -3335,7 +3335,7 @@ void EntityList::CorpseFix(Client* c)
cur->GetFixedZ(c->GetPosition()),
c->GetHeading()
);
fixed_count++;
}
}
@@ -5129,7 +5129,7 @@ std::vector<Bot *> EntityList::GetBotListByClientName(std::string client_name)
}
for (auto bot : bot_list) {
if (bot->GetOwner() && str_tolower(bot->GetOwner()->GetCleanName()) == str_tolower(client_name)) {
if (bot->GetOwner() && Strings::ToLower(bot->GetOwner()->GetCleanName()) == Strings::ToLower(client_name)) {
client_bot_list.push_back(bot);
}
}
+4 -4
View File
@@ -19,7 +19,7 @@
#include "../common/global_define.h"
#include "../common/features.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "client.h"
#include "data_bucket.h"
@@ -1160,7 +1160,7 @@ uint8 Client::GetCharMaxLevelFromQGlobal() {
for (const auto& global : global_map) {
if (global.name == "CharMaxLevel") {
if (StringIsNumber(global.value)) {
if (Strings::IsNumber(global.value)) {
return static_cast<uint8>(std::stoul(global.value));
}
}
@@ -1178,7 +1178,7 @@ uint8 Client::GetCharMaxLevelFromBucket()
auto bucket_value = DataBucket::GetData(new_bucket_name);
if (!bucket_value.empty()) {
if (StringIsNumber(bucket_value)) {
if (Strings::IsNumber(bucket_value)) {
return static_cast<uint8>(std::stoul(bucket_value));
}
}
@@ -1190,7 +1190,7 @@ uint8 Client::GetCharMaxLevelFromBucket()
bucket_value = DataBucket::GetData(old_bucket_name);
if (!bucket_value.empty()) {
if (StringIsNumber(bucket_value)) {
if (Strings::IsNumber(bucket_value)) {
return static_cast<uint8>(std::stoul(bucket_value));
}
}
+14 -14
View File
@@ -23,7 +23,7 @@
#include "zonedb.h"
#include "../common/database.h"
#include "../common/expedition_lockout_timer.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include <fmt/core.h>
uint32_t ExpeditionDatabase::InsertExpedition(uint32_t dz_id)
@@ -100,7 +100,7 @@ std::vector<ExpeditionLockoutTimer> ExpeditionDatabase::LoadCharacterLockouts(
character_id = {}
AND expire_time > NOW()
AND expedition_name = '{}';
), character_id, EscapeString(expedition_name));
), character_id, Strings::Escape(expedition_name));
auto results = database.QueryDatabase(query);
if (results.Success())
@@ -145,7 +145,7 @@ void ExpeditionDatabase::DeleteAllCharacterLockouts(
std::string query = fmt::format(SQL(
DELETE FROM character_expedition_lockouts
WHERE character_id = {} AND expedition_name = '{}';
), character_id, EscapeString(expedition_name));
), character_id, Strings::Escape(expedition_name));
database.QueryDatabase(query);
}
@@ -164,7 +164,7 @@ void ExpeditionDatabase::DeleteCharacterLockout(
character_id = {}
AND expedition_name = '{}'
AND event_name = '{}';
), character_id, EscapeString(expedition_name), EscapeString(event_name));
), character_id, Strings::Escape(expedition_name), Strings::Escape(event_name));
database.QueryDatabase(query);
}
@@ -191,7 +191,7 @@ void ExpeditionDatabase::DeleteMembersLockout(
IN ({})
AND expedition_name = '{}'
AND event_name = '{}';
), query_character_ids, EscapeString(expedition_name), EscapeString(event_name));
), query_character_ids, Strings::Escape(expedition_name), Strings::Escape(event_name));
database.QueryDatabase(query);
}
@@ -204,7 +204,7 @@ void ExpeditionDatabase::DeleteLockout(uint32_t expedition_id, const std::string
auto query = fmt::format(SQL(
DELETE FROM expedition_lockouts
WHERE expedition_id = {} AND event_name = '{}';
), expedition_id, EscapeString(event_name));
), expedition_id, Strings::Escape(event_name));
database.QueryDatabase(query);
}
@@ -223,8 +223,8 @@ void ExpeditionDatabase::InsertCharacterLockouts(uint32_t character_id,
lockout.GetExpireTime(),
lockout.GetDuration(),
lockout.GetExpeditionUUID(),
EscapeString(lockout.GetExpeditionName()),
EscapeString(lockout.GetEventName())
Strings::Escape(lockout.GetExpeditionName()),
Strings::Escape(lockout.GetEventName())
);
}
@@ -263,8 +263,8 @@ void ExpeditionDatabase::InsertMembersLockout(
lockout.GetExpireTime(),
lockout.GetDuration(),
lockout.GetExpeditionUUID(),
EscapeString(lockout.GetExpeditionName()),
EscapeString(lockout.GetEventName())
Strings::Escape(lockout.GetExpeditionName()),
Strings::Escape(lockout.GetEventName())
);
}
@@ -306,7 +306,7 @@ void ExpeditionDatabase::InsertLockout(
),
expedition_id,
lockout.GetExpeditionUUID(),
EscapeString(lockout.GetEventName()),
Strings::Escape(lockout.GetEventName()),
lockout.GetExpireTime(),
lockout.GetDuration()
);
@@ -326,7 +326,7 @@ void ExpeditionDatabase::InsertLockouts(
"({}, '{}', '{}', FROM_UNIXTIME({}), {}),",
expedition_id,
lockout.second.GetExpeditionUUID(),
EscapeString(lockout.second.GetEventName()),
Strings::Escape(lockout.second.GetEventName()),
lockout.second.GetExpireTime(),
lockout.second.GetDuration()
);
@@ -388,8 +388,8 @@ void ExpeditionDatabase::AddLockoutDuration(const std::vector<DynamicZoneMember>
lockout.GetExpireTime(),
lockout.GetDuration(),
lockout.GetExpeditionUUID(),
EscapeString(lockout.GetExpeditionName()),
EscapeString(lockout.GetEventName())
Strings::Escape(lockout.GetExpeditionName()),
Strings::Escape(lockout.GetEventName())
);
}
+1 -1
View File
@@ -20,7 +20,7 @@
#include "../common/eqemu_logsys.h"
#include "../common/misc_functions.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "entity.h"
#include "forage.h"
+1 -1
View File
@@ -33,7 +33,7 @@ void command_advnpcspawn(Client *c, const Seperator *sep)
return;
}
std::string spawn_command = str_tolower(sep->arg[1]);
std::string spawn_command = Strings::ToLower(sep->arg[1]);
bool is_add_entry = spawn_command.find("addentry") != std::string::npos;
bool is_add_spawn = spawn_command.find("addspawn") != std::string::npos;
bool is_clear_box = spawn_command.find("clearbox") != std::string::npos;
+6 -6
View File
@@ -17,7 +17,7 @@ void command_ai(Client *c, const Seperator *sep)
c->Message(Chat::White, "You must target an NPC to use this command.");
return;
}
auto target = c->GetTarget()->CastToNPC();
bool is_consider = !strcasecmp(sep->arg[1], "consider");
@@ -42,7 +42,7 @@ void command_ai(Client *c, const Seperator *sep)
return;
}
if (is_consider) {
if (is_consider) {
if (arguments == 2) {
auto mob_name = sep->arg[2];
auto mob_to_consider = entity_list.GetMob(mob_name);
@@ -153,7 +153,7 @@ void command_ai(Client *c, const Seperator *sep)
delay ?
fmt::format(
"a delay of {} ({})",
ConvertMillisecondsToTime(delay),
Strings::MillisecondsToTime(delay),
delay
):
"no delay"
@@ -162,7 +162,7 @@ void command_ai(Client *c, const Seperator *sep)
minimum_delay ?
fmt::format(
"a minimum delay of {} ({})",
ConvertMillisecondsToTime(minimum_delay),
Strings::MillisecondsToTime(minimum_delay),
minimum_delay
):
"no minimum delay"
@@ -209,7 +209,7 @@ void command_ai(Client *c, const Seperator *sep)
fmt::format(
"a delay of {} ({})",
delay,
ConvertMillisecondsToTime(delay)
Strings::MillisecondsToTime(delay)
):
"no delay"
),
@@ -218,7 +218,7 @@ void command_ai(Client *c, const Seperator *sep)
fmt::format(
"a minimum delay of {} ({})",
minimum_delay,
ConvertMillisecondsToTime(delay)
Strings::MillisecondsToTime(delay)
):
"no minimum delay"
)
+1 -1
View File
@@ -37,7 +37,7 @@ void command_ban(Client *c, const Seperator *sep)
auto query = fmt::format(
"UPDATE account SET status = -2, ban_reason = '{}' WHERE id = {}",
EscapeString(reason),
Strings::Escape(reason),
account_id
);
auto results = database.QueryDatabase(query);
+1 -1
View File
@@ -23,7 +23,7 @@ void command_camerashake(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Sending camera shake to world with a duration of {} ({}) and an intensity of {}.",
ConvertMillisecondsToTime(duration),
Strings::MillisecondsToTime(duration),
duration,
intensity
).c_str()
+2 -2
View File
@@ -21,7 +21,7 @@ void command_databuckets(Client *c, const Seperator *sep)
}
}
if (sep->arg[2]) {
key_filter = str_tolower(sep->arg[2]);
key_filter = Strings::ToLower(sep->arg[2]);
}
std::string query = "SELECT `id`, `key`, `value`, `expires` FROM data_buckets";
if (!key_filter.empty()) { query += StringFormat(" WHERE `key` LIKE '%%%s%%'", key_filter.c_str()); }
@@ -68,7 +68,7 @@ void command_databuckets(Client *c, const Seperator *sep)
c->Message(
Chat::White,
"%s : %s",
EQ::SayLinkEngine::GenerateQuestSaylink(del_saylink, false, "Delete").c_str(),
Saylink::Create(del_saylink, false, "Delete").c_str(),
key.c_str(),
" Value: ",
value.c_str());
+56 -56
View File
@@ -48,8 +48,8 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"#door model <modelname> | Changes door model for selected door or select from [{}] or [{}]",
EQ::SayLinkEngine::GenerateQuestSaylink("#door showmodelszone", false, "local zone"),
EQ::SayLinkEngine::GenerateQuestSaylink("#door showmodelsglobal", false, "global")
Saylink::Create("#door showmodelszone", false, "local zone"),
Saylink::Create("#door showmodelsglobal", false, "global")
).c_str()
);
c->Message(
@@ -61,7 +61,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"{} | Shows available models in the current zone that you are in",
EQ::SayLinkEngine::GenerateQuestSaylink("#door showmodelszone", false, "#door showmodelszone")
Saylink::Create("#door showmodelszone", false, "#door showmodelszone")
).c_str()
);
@@ -69,7 +69,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"{} | Shows available models globally by first listing all global model files",
EQ::SayLinkEngine::GenerateQuestSaylink("#door showmodelsglobal", false, "#door showmodelsglobal")
Saylink::Create("#door showmodelsglobal", false, "#door showmodelsglobal")
).c_str()
);
@@ -78,14 +78,14 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"{} - Brings up editing interface for selected door",
EQ::SayLinkEngine::GenerateQuestSaylink("#door edit", false, "#door edit")
Saylink::Create("#door edit", false, "#door edit")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"{} - lists doors in zone",
EQ::SayLinkEngine::GenerateQuestSaylink("#list doors", false, "#list doors")
Saylink::Create("#list doors", false, "#list doors")
).c_str()
);
@@ -104,8 +104,8 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
door->GetDoorName(),
door->GetOpenType(),
door->GetInvertState(),
EQ::SayLinkEngine::GenerateQuestSaylink("#door setinvertstate 0", false, "0"),
EQ::SayLinkEngine::GenerateQuestSaylink("#door setinvertstate 1", false, "1")
Saylink::Create("#door setinvertstate 0", false, "0"),
Saylink::Create("#door setinvertstate 1", false, "1")
).c_str()
);
@@ -135,7 +135,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (const auto &move_option : move_options) {
if (move_option == move_x_action) {
move_x_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} .25", move_option),
false,
".25"
@@ -145,7 +145,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = 0; move_index <= 15; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index);
move_x_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -156,7 +156,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = -15; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index);
move_x_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -165,7 +165,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
move_x_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} -.25", move_option),
false,
".25"
@@ -174,7 +174,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
else if (move_option == move_y_action) {
move_y_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} .25", move_option),
false,
".25"
@@ -184,7 +184,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = 0; move_index <= 15; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index);
move_y_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -195,7 +195,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = -15; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? -1 : move_index);
move_y_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -204,7 +204,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
move_y_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} -.25", move_option),
false,
".25"
@@ -213,7 +213,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
else if (move_option == move_z_action) {
move_z_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} .25", move_option),
false,
".25"
@@ -223,7 +223,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = 0; move_index <= 15; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index);
move_z_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -234,7 +234,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = -15; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? -1 : move_index);
move_z_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -243,7 +243,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
move_z_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} -.25", move_option),
false,
".25"
@@ -254,7 +254,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = 0; move_index <= 50; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index);
move_h_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -265,7 +265,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = -50; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? -1 : move_index);
move_h_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -277,7 +277,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = 0; move_index <= 100; move_index += 10) {
int value = (move_index == 0 ? 1 : move_index);
set_size_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -288,7 +288,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int move_index = -100; move_index <= 0; move_index += 10) {
int value = (move_index == 0 ? -1 : move_index);
set_size_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door edit {} {}", move_option, value),
false,
fmt::format("{}", std::abs(value))
@@ -299,7 +299,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
// we're passing a move action here
if (!arg3.empty() && StringIsNumber(arg3)) {
if (!arg3.empty() && Strings::IsNumber(arg3)) {
float x_move = 0.0f;
float y_move = 0.0f;
float z_move = 0.0f;
@@ -410,17 +410,17 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
fmt::format(
"Name [{}] [{}] [{}] [{}]",
door->GetDoorName(),
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#door save",
false,
"Save"
),
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#door changemodelqueue",
false,
"Change Model"
),
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#door setinclineinc",
false,
"Incline"
@@ -431,40 +431,40 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"[{}] - [X] + [{}]",
implode(" | ", move_x_options_negative),
implode(" | ", move_x_options_positive)
Strings::Implode(" | ", move_x_options_negative),
Strings::Implode(" | ", move_x_options_positive)
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"[{}] - [Y] + [{}]",
implode(" | ", move_y_options_negative),
implode(" | ", move_y_options_positive)
Strings::Implode(" | ", move_y_options_negative),
Strings::Implode(" | ", move_y_options_positive)
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"[{}] - [Z] + [{}]",
implode(" | ", move_z_options_negative),
implode(" | ", move_z_options_positive)
Strings::Implode(" | ", move_z_options_negative),
Strings::Implode(" | ", move_z_options_positive)
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"[{}] - [H] + [{}]",
implode(" | ", move_h_options_negative),
implode(" | ", move_h_options_positive)
Strings::Implode(" | ", move_h_options_negative),
Strings::Implode(" | ", move_h_options_positive)
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"[{}] - [Size] + [{}]",
implode(" | ", set_size_options_negative),
implode(" | ", set_size_options_positive)
Strings::Implode(" | ", set_size_options_negative),
Strings::Implode(" | ", set_size_options_positive)
).c_str()
);
@@ -476,7 +476,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
// create
if (arg1 == "create") {
std::string model = str_toupper(arg2);
std::string model = Strings::ToUpper(arg2);
uint16 entity_id = entity_list.CreateDoor(
model.c_str(),
c->GetPosition(),
@@ -493,7 +493,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
// set model
if (arg1 == "model") {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
std::string model = str_toupper(arg2);
std::string model = Strings::ToUpper(arg2);
if (door) {
door->SetDoorName(model.c_str());
}
@@ -505,14 +505,14 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"#door model <modelname> | Changes door model for selected door or select from [{}] or [{}]",
EQ::SayLinkEngine::GenerateQuestSaylink("#door showmodelszone", false, "local zone"),
EQ::SayLinkEngine::GenerateQuestSaylink("#door showmodelsglobal", false, "global")
Saylink::Create("#door showmodelszone", false, "local zone"),
Saylink::Create("#door showmodelsglobal", false, "global")
).c_str()
);
}
// open type
if (arg1 == "opentype" && !arg2.empty() && StringIsNumber(arg2)) {
if (arg1 == "opentype" && !arg2.empty() && Strings::IsNumber(arg2)) {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
if (door) {
door->SetOpenType(std::atoi(arg2.c_str()));
@@ -520,7 +520,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
// incline
if (arg1 == "setincline" && !arg2.empty() && StringIsNumber(arg2)) {
if (arg1 == "setincline" && !arg2.empty() && Strings::IsNumber(arg2)) {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
if (door) {
door->SetIncline(std::atoi(arg2.c_str()));
@@ -528,7 +528,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
// incline
if (arg1 == "setinvertstate" && !arg2.empty() && StringIsNumber(arg2)) {
if (arg1 == "setinvertstate" && !arg2.empty() && Strings::IsNumber(arg2)) {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
if (door) {
door->SetInvertState(std::atoi(arg2.c_str()));
@@ -545,7 +545,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
}
// incline incremental
if (arg1 == "setinclineinc" && !arg2.empty() && StringIsNumber(arg2)) {
if (arg1 == "setinclineinc" && !arg2.empty() && Strings::IsNumber(arg2)) {
Doors *door = entity_list.GetDoorsByID(c->GetDoorToolEntityId());
if (door) {
door->SetIncline(door->GetIncline() + std::atoi(arg2.c_str()));
@@ -569,7 +569,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
std::vector<std::string> incline_negative_options;
for (auto incline_value : incline_values) {
incline_normal_options.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format(
"#door setincline {}",
incline_value.first
@@ -583,7 +583,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int incline_index = 0; incline_index <= 100; incline_index += 10) {
int incline_value = (incline_index == 0 ? 1 : incline_index);
incline_positive_options.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format(
"#door setinclineinc {}",
incline_value
@@ -597,7 +597,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
for (int incline_index = -100; incline_index <= 1; incline_index += 10) {
int incline_value = (incline_index == 0 ? -1 : incline_index);
incline_negative_options.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format(
"#door setinclineinc {}",
incline_value
@@ -612,7 +612,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"[Incline] [{}]",
implode(" | ", incline_normal_options)
Strings::Implode(" | ", incline_normal_options)
).c_str()
);
@@ -620,8 +620,8 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"[Incline Increments] [{}] - | + [{}]",
implode(" | ", incline_negative_options),
implode(" | ", incline_positive_options)
Strings::Implode(" | ", incline_negative_options),
Strings::Implode(" | ", incline_positive_options)
).c_str()
);
}
@@ -700,7 +700,7 @@ void DoorManipulation::DisplayObjectResultToClient(
say_links.emplace_back(
fmt::format(
"[{}] ",
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door model {}", g.object_name),
false,
g.object_name
@@ -733,7 +733,7 @@ void DoorManipulation::DisplayObjectResultToClient(
}
if (!buffered_links.empty()) {
c->Message(Chat::White, implode(" ", buffered_links).c_str());
c->Message(Chat::White, Strings::Implode(" ", buffered_links).c_str());
}
}
@@ -748,7 +748,7 @@ void DoorManipulation::DisplayModelsFromFileResults(
say_links.emplace_back(
fmt::format(
"[{}] ",
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
fmt::format("#door showmodelsfromfile {}", g.file_from),
false,
g.file_from
@@ -781,6 +781,6 @@ void DoorManipulation::DisplayModelsFromFileResults(
}
if (!buffered_links.empty()) {
c->Message(Chat::White, implode(" ", buffered_links).c_str());
c->Message(Chat::White, Strings::Implode(" ", buffered_links).c_str());
}
}
+1 -1
View File
@@ -41,7 +41,7 @@ void command_dye(Client *c, const Seperator *sep)
fmt::format(
"{} {}",
"Slots are as follows:",
implode(", ", slot_messages)
Strings::Implode(", ", slot_messages)
).c_str()
);
return;
+4 -4
View File
@@ -42,10 +42,10 @@ void command_dz(Client *c, const Seperator *sep)
continue;
}
auto leader_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto leader_saylink = Saylink::Create(
fmt::format(
"#goto {}", expedition->GetLeaderName()), false, expedition->GetLeaderName());
auto zone_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto zone_saylink = Saylink::Create(
fmt::format(
"#zoneinstance {}", dz->GetInstanceID()), false, "zone"
);
@@ -123,7 +123,7 @@ void command_dz(Client *c, const Seperator *sep)
for (const auto &dz : dynamic_zones) {
auto seconds = dz->GetSecondsRemaining();
auto zone_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto zone_saylink = Saylink::Create(
fmt::format("#zoneinstance {}", dz->GetInstanceID()), false, "zone"
);
@@ -159,7 +159,7 @@ void command_dz(Client *c, const Seperator *sep)
bool is_expired = now > expire_time;
if (!is_expired || strcasecmp(sep->arg[2], "all") == 0) {
auto zone_saylink = is_expired ? "zone" : EQ::SayLinkEngine::GenerateQuestSaylink(
auto zone_saylink = is_expired ? "zone" : Saylink::Create(
fmt::format("#zoneinstance {}", dz.instance), false, "zone"
);
+1 -1
View File
@@ -126,7 +126,7 @@ void command_editmassrespawn(Client *c, const Seperator *sep)
c->Message(
Chat::Yellow, "To apply these changes, click <%s> or type [%s]",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Apply").c_str(),
Saylink::Create(saylink, false, "Apply").c_str(),
saylink.c_str()
);
}
+2 -2
View File
@@ -18,7 +18,7 @@ void command_faction(Client *c, const Seperator *sep)
std::string faction_filter;
if (sep->arg[2]) {
faction_filter = str_tolower(sep->arg[2]);
faction_filter = Strings::ToLower(sep->arg[2]);
}
if (!strcasecmp(sep->arg[1], "review")) {
@@ -56,7 +56,7 @@ void command_faction(Client *c, const Seperator *sep)
auto faction_id = std::stoul(row[0]);
std::string faction_name = row[1];
std::string faction_value = row[2];
std::string reset_link = EQ::SayLinkEngine::GenerateQuestSaylink(
std::string reset_link = Saylink::Create(
fmt::format("#faction reset {}", faction_id),
false,
"Reset"
+2 -2
View File
@@ -4,7 +4,7 @@ void command_feature(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (arguments < 2 || !sep->IsNumber(2)) {
auto feature_save_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto feature_save_link = Saylink::Create(
"#npcedit featuresave",
false,
"#npcedit featuresave"
@@ -67,7 +67,7 @@ void command_feature(Client *c, const Seperator *sep)
!is_tattoo &&
!is_texture
) {
auto feature_save_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto feature_save_link = Saylink::Create(
"#npcedit featuresave",
false,
"#npcedit featuresave"
+2 -2
View File
@@ -39,11 +39,11 @@ void command_findclass(Client *c, const Seperator *sep)
);
}
} else {
auto search_criteria = str_tolower(sep->argplus[1]);
auto search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
for (uint16 class_id = WARRIOR; class_id <= MERCENARY_MASTER; class_id++) {
std::string class_name = GetClassIDName(class_id);
auto class_name_lower = str_tolower(class_name);
auto class_name_lower = Strings::ToLower(class_name);
if (
search_criteria.length() &&
class_name_lower.find(search_criteria) == std::string::npos
+2 -2
View File
@@ -33,12 +33,12 @@ void command_findfaction(Client *c, const Seperator *sep)
}
}
else {
std::string search_criteria = str_tolower(sep->argplus[1]);
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
int max_faction_id = content_db.GetMaxFaction();
for (int faction_id = 0; faction_id < max_faction_id; faction_id++) {
std::string faction_name = content_db.GetFactionName(faction_id);
std::string faction_name_lower = str_tolower(faction_name);
std::string faction_name_lower = Strings::ToLower(faction_name);
if (faction_name.empty()) {
continue;
}
+3 -3
View File
@@ -41,13 +41,13 @@ void command_findrace(Client *c, const Seperator *sep)
);
}
} else {
auto search_criteria = str_tolower(sep->argplus[1]);
auto search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
std::string race_name = GetRaceIDName(race_id);
auto race_name_lower = str_tolower(race_name);
auto race_name_lower = Strings::ToLower(race_name);
if (
search_criteria.length() &&
search_criteria.length() &&
race_name_lower.find(search_criteria) == std::string::npos
) {
continue;
+2 -2
View File
@@ -38,11 +38,11 @@ void command_findskill(Client *c, const Seperator *sep)
}
}
else {
std::string search_criteria = str_tolower(sep->argplus[1]);
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
if (!search_criteria.empty()) {
int found_count = 0;
for (auto skill : skills) {
std::string skill_name_lower = str_tolower(skill.second);
std::string skill_name_lower = Strings::ToLower(skill.second);
if (skill_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
+2 -2
View File
@@ -37,13 +37,13 @@ void command_findspell(Client *c, const Seperator *sep)
}
}
else {
std::string search_criteria = str_tolower(sep->argplus[1]);
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
int found_count = 0;
for (int spell_id = 0; spell_id < SPDAT_RECORDS; spell_id++) {
auto current_spell = spells[spell_id];
if (current_spell.name[0] != 0) {
std::string spell_name = current_spell.name;
std::string spell_name_lower = str_tolower(spell_name);
std::string spell_name_lower = Strings::ToLower(spell_name);
if (search_criteria.length() > 0 && spell_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
+2 -2
View File
@@ -32,12 +32,12 @@ void command_findtask(Client *c, const Seperator *sep)
);
}
else {
std::string search_criteria = str_tolower(sep->argplus[1]);
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
if (!search_criteria.empty()) {
int found_count = 0;
for (uint32 task_id = 1; task_id <= MAXTASKS; task_id++) {
auto task_name = task_manager->GetTaskName(task_id);
std::string task_name_lower = str_tolower(task_name);
std::string task_name_lower = Strings::ToLower(task_name);
if (task_name_lower.find(search_criteria) == std::string::npos) {
continue;
}
+4 -4
View File
@@ -27,8 +27,8 @@ void command_findzone(Client *c, const Seperator *sep)
if (id == 0) {
query = fmt::format(
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE long_name LIKE '%{}%' OR `short_name` LIKE '%{}%'",
EscapeString(sep->arg[1]),
EscapeString(sep->arg[1])
Strings::Escape(sep->arg[1]),
Strings::Escape(sep->arg[1])
);
}
else {
@@ -60,8 +60,8 @@ void command_findzone(Client *c, const Seperator *sep)
break;
}
std::string command_zone = EQ::SayLinkEngine::GenerateQuestSaylink("#zone " + short_name, false, "zone");
std::string command_gmzone = EQ::SayLinkEngine::GenerateQuestSaylink(
std::string command_zone = Saylink::Create("#zone " + short_name, false, "zone");
std::string command_gmzone = Saylink::Create(
fmt::format("#gmzone {} {}", short_name, version),
false,
"gmzone"
+9 -9
View File
@@ -4,7 +4,7 @@ void command_flagedit(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
auto flags_link = EQ::SayLinkEngine::GenerateQuestSaylink("#flags", false, "#flags");
auto flags_link = Saylink::Create("#flags", false, "#flags");
c->Message(
Chat::White,
"Usage: #flagedit lock [Zone ID|Zone Short Name] [Flag Name] - Set the specified flag name on the zone, locking the zone"
@@ -48,7 +48,7 @@ void command_flagedit(Client *c, const Seperator *sep)
!is_take &&
!is_unlock
) {
auto flags_link = EQ::SayLinkEngine::GenerateQuestSaylink("#flags", false, "#flags");
auto flags_link = Saylink::Create("#flags", false, "#flags");
c->Message(
Chat::White,
"Usage: #flagedit lock [Zone ID|Zone Short Name] [Flag Name] - Set the specified flag name on the zone, locking the zone"
@@ -85,7 +85,7 @@ void command_flagedit(Client *c, const Seperator *sep)
std::stoul(sep->arg[2]) :
ZoneID(sep->arg[2])
);
std::string zone_short_name = str_tolower(ZoneName(zone_id, true));
std::string zone_short_name = Strings::ToLower(ZoneName(zone_id, true));
bool is_unknown_zone = zone_short_name.find("unknown") != std::string::npos;
if (zone_id && !is_unknown_zone) {
std::string zone_long_name = ZoneLongName(zone_id);
@@ -120,7 +120,7 @@ void command_flagedit(Client *c, const Seperator *sep)
}
std::string popup_text = "<table>";
popup_text += "<tr><td>Zone</td><td>Flag Required</td></tr>";
for (auto row : results) {
@@ -154,7 +154,7 @@ void command_flagedit(Client *c, const Seperator *sep)
std::stoul(sep->arg[2]) :
ZoneID(sep->arg[2])
);
std::string zone_short_name = str_tolower(ZoneName(zone_id, true));
std::string zone_short_name = Strings::ToLower(ZoneName(zone_id, true));
bool is_unknown_zone = zone_short_name.find("unknown") != std::string::npos;
if (zone_id && !is_unknown_zone) {
if (arguments < 3) {
@@ -164,8 +164,8 @@ void command_flagedit(Client *c, const Seperator *sep)
);
return;
}
std::string flag_name = EscapeString(sep->argplus[3]);
std::string flag_name = Strings::Escape(sep->argplus[3]);
std::string zone_long_name = ZoneLongName(zone_id);
auto query = fmt::format(
@@ -209,7 +209,7 @@ void command_flagedit(Client *c, const Seperator *sep)
std::stoul(sep->arg[2]) :
ZoneID(sep->arg[2])
);
std::string zone_short_name = str_tolower(ZoneName(zone_id, true));
std::string zone_short_name = Strings::ToLower(ZoneName(zone_id, true));
bool is_unknown_zone = zone_short_name.find("unknown") != std::string::npos;
if (zone_id && !is_unknown_zone) {
std::string zone_long_name = ZoneLongName(zone_id);
@@ -237,7 +237,7 @@ void command_flagedit(Client *c, const Seperator *sep)
std::stoul(sep->arg[2]) :
ZoneID(sep->arg[2])
);
std::string zone_short_name = str_tolower(ZoneName(zone_id, true));
std::string zone_short_name = Strings::ToLower(ZoneName(zone_id, true));
bool is_unknown_zone = zone_short_name.find("unknown") != std::string::npos;
if (zone_id && !is_unknown_zone) {
std::string zone_long_name = ZoneLongName(zone_id);
+3 -3
View File
@@ -25,8 +25,8 @@ void command_gearup(Client *c, const Seperator *sep)
if (auto res = cli.Get(url.c_str())) {
if (res->status == 200) {
for (auto &s: SplitString(res->body, ';')) {
if (!trim(s).empty()) {
for (auto &s: Strings::Split(res->body, ';')) {
if (!Strings::Trim(s).empty()) {
auto results = database.QueryDatabase(s);
if (!results.ErrorMessage().empty()) {
c->Message(
@@ -161,7 +161,7 @@ void command_gearup(Client *c, const Seperator *sep)
std::string message;
for (auto row = results.begin(); row != results.end(); ++row) {
int expansion = atoi(row[0]);
message += "[" + EQ::SayLinkEngine::GenerateQuestSaylink(
message += "[" + Saylink::Create(
fmt::format("#gearup {}", expansion),
false,
Expansion::ExpansionName[expansion]
+3 -3
View File
@@ -8,7 +8,7 @@ void command_givemoney(Client *c, const Seperator *sep)
return;
}
Client *target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
@@ -30,12 +30,12 @@ void command_givemoney(Client *c, const Seperator *sep)
platinum,
true
);
c->Message(
Chat::White,
fmt::format(
"Added {} to {}.",
ConvertMoneyToString(
Strings::Money(
platinum,
gold,
silver,
+3 -3
View File
@@ -9,7 +9,7 @@ void command_gmzone(Client *c, const Seperator *sep)
return;
}
std::string zone_short_name = str_tolower(
std::string zone_short_name = Strings::ToLower(
sep->IsNumber(1) ?
ZoneName(std::stoul(sep->arg[1]), true) :
sep->arg[1]
@@ -44,13 +44,13 @@ void command_gmzone(Client *c, const Seperator *sep)
std::stoul(sep->arg[2]) :
0
);
std::string instance_identifier = (
sep->arg[3] ?
sep->arg[3] :
"gmzone"
);
auto bucket_key = fmt::format(
"{}-{}-{}-instance",
zone_short_name,
+5 -5
View File
@@ -100,7 +100,7 @@ void command_instance(Client *c, const Seperator *sep)
uint32 zone_id = database.ZoneIDFromInstanceID(instance_id);
uint32 version = database.VersionFromInstanceID(instance_id);
uint32 current_id = database.GetInstanceID(zone_id, character_id, version);
if (!current_id) {
if (!current_id) {
c->Message(
Chat::White,
(
@@ -109,7 +109,7 @@ void command_instance(Client *c, const Seperator *sep)
"Added {} to Instance ID {}.",
c->GetTargetDescription(target),
instance_id
) :
) :
fmt::format(
"Failed to add {} to Instance ID {}.",
c->GetTargetDescription(target),
@@ -182,7 +182,7 @@ void command_instance(Client *c, const Seperator *sep)
ZoneLongName(zone_id),
zone_id,
(
version ?
version ?
fmt::format(
" Version: {}",
version
@@ -197,7 +197,7 @@ void command_instance(Client *c, const Seperator *sep)
fmt::format(
"Instance {} Created | Duration: {} ({})",
instance_id,
ConvertSecondsToTime(duration),
Strings::SecondsToTime(duration),
duration
).c_str()
);
@@ -295,7 +295,7 @@ void command_instance(Client *c, const Seperator *sep)
"Removed {} from Instance ID {}.",
c->GetTargetDescription(target),
instance_id
) :
) :
fmt::format(
"Failed to remove {} from Instance ID {}.",
c->GetTargetDescription(target),
+4 -4
View File
@@ -19,7 +19,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string item_id = std::to_string(item->ID);
std::string saylink_commands =
"[" +
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#si " + item_id,
false,
"X"
@@ -30,7 +30,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string stack_size = std::to_string(item->StackSize);
saylink_commands +=
"[" +
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#si " + item_id + " " + stack_size,
false,
stack_size
@@ -77,7 +77,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string item_id = std::to_string(item->ID);
std::string saylink_commands =
"[" +
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#si " + item_id,
false,
"X"
@@ -87,7 +87,7 @@ void command_itemsearch(Client *c, const Seperator *sep)
std::string stack_size = std::to_string(item->StackSize);
saylink_commands +=
"[" +
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#si " + item_id + " " + stack_size,
false,
stack_size
+2 -2
View File
@@ -4,7 +4,7 @@ void command_killallnpcs(Client *c, const Seperator *sep)
{
std::string search_string;
if (sep->arg[1]) {
search_string = str_tolower(sep->arg[1]);
search_string = Strings::ToLower(sep->arg[1]);
}
int killed_count = 0;
@@ -15,7 +15,7 @@ void command_killallnpcs(Client *c, const Seperator *sep)
continue;
}
std::string entity_name = str_tolower(entity->GetName());
std::string entity_name = Strings::ToLower(entity->GetName());
if ((!search_string.empty() && entity_name.find(search_string) == std::string::npos) ||
!entity->IsAttackAllowed(c)) {
continue;
+5 -5
View File
@@ -69,7 +69,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | ID %5d | %s | x %.0f | y %0.f | z %.0f",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Goto").c_str(),
Saylink::Create(saylink, false, "Goto").c_str(),
entity->GetID(),
entity->GetName(),
entity->GetX(),
@@ -110,7 +110,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | ID %5d | %s | x %.0f | y %0.f | z %.0f",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Goto").c_str(),
Saylink::Create(saylink, false, "Goto").c_str(),
entity->GetID(),
entity->GetName(),
entity->GetX(),
@@ -151,7 +151,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | ID %5d | %s | x %.0f | y %0.f | z %.0f",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Goto").c_str(),
Saylink::Create(saylink, false, "Goto").c_str(),
entity->GetID(),
entity->GetName(),
entity->GetX(),
@@ -192,7 +192,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | Entity ID %5d | Door ID %i | %s | x %.0f | y %0.f | z %.0f",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Goto").c_str(),
Saylink::Create(saylink, false, "Goto").c_str(),
entity->GetID(),
entity->GetDoorID(),
entity->GetDoorName(),
@@ -234,7 +234,7 @@ void command_list(Client *c, const Seperator *sep)
c->Message(
0,
"| %s | Entity ID %5d | Object DBID %i | %s | x %.0f | y %0.f | z %.0f",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Goto").c_str(),
Saylink::Create(saylink, false, "Goto").c_str(),
entity->GetID(),
entity->GetDBID(),
entity->GetModelName(),
+1 -1
View File
@@ -115,7 +115,7 @@ void command_logs(Client *c, const Seperator *sep)
next_category_id
);
auto next_list_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto next_list_link = Saylink::Create(
next_list_string,
false,
next_list_string
+2 -2
View File
@@ -7,7 +7,7 @@ void command_movechar(Client *c, const Seperator *sep)
c->Message(Chat::White, "Usage: #movechar [Character ID|Character Name] [Zone ID|Zone Short Name]");
return;
}
std::string character_name = (
sep->IsNumber(1) ?
database.GetCharNameByID(std::stoul(sep->arg[1])) :
@@ -27,7 +27,7 @@ void command_movechar(Client *c, const Seperator *sep)
auto account_id = database.GetAccountIDByChar(character_name.c_str());
std::string zone_short_name = str_tolower(
std::string zone_short_name = Strings::ToLower(
sep->IsNumber(2) ?
ZoneName(std::stoul(sep->arg[2]), true) :
sep->arg[2]
+4 -4
View File
@@ -17,7 +17,7 @@ void command_mysql(Client *c, const Seperator *sep)
c->Message(Chat::White, "Usage: #mysql [Help|Query] [SQL Query]");
return;
}
if (is_help) {
c->Message(Chat::White, "Usage: #mysql query \"Query goes here quoted\"");
c->Message(Chat::White, "Note: To use 'LIKE \"%%something%%\" replace the %% with a #");
@@ -32,14 +32,14 @@ void command_mysql(Client *c, const Seperator *sep)
}
std::string query = sep->arg[2];
find_replace(query, "#", "%");
Strings::FindReplace(query, "#", "%");
auto results = database.QueryDatabase(query);
if (!results.Success()) {
return;
}
query = sep->arg[2];
find_replace(query, "#", "%%");
query = sep->arg[2];
Strings::FindReplace(query, "#", "%%");
c->Message(
Chat::White,
+46 -46
View File
@@ -178,7 +178,7 @@ void command_npcedit(Client *c, const Seperator *sep)
uint32 npc_id = c->GetTarget()->CastToNPC()->GetNPCTypeID();
auto npc_id_string = fmt::format(
"NPC ID {}",
commify(std::to_string(npc_id))
Strings::Commify(std::to_string(npc_id))
);
if (!strcasecmp(sep->arg[1], "name")) {
@@ -318,7 +318,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Health.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -339,7 +339,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Mana.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -466,7 +466,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now regenerates {} Health per Tick.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -487,7 +487,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now regenerates {} HP per Second.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -508,7 +508,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now regenerates {} Mana per Tick.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -529,7 +529,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Loottable ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -550,7 +550,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Merchant ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -601,7 +601,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Spell List ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -622,7 +622,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Spells Effects ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -651,7 +651,7 @@ void command_npcedit(Client *c, const Seperator *sep)
faction_name,
faction_id
) :
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
)
).c_str()
);
@@ -673,7 +673,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Adventure Template ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -694,7 +694,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Trap Template ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -716,8 +716,8 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now hits from {} to {} damage.",
npc_id_string,
commify(sep->arg[2]),
commify(sep->arg[3])
Strings::Commify(sep->arg[2]),
Strings::Commify(sep->arg[3])
).c_str()
);
auto query = fmt::format(
@@ -794,7 +794,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has an Aggro Radius of {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -815,7 +815,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has an Assist Radius of {}",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -873,7 +873,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Armor Tint ID {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -921,7 +921,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} is now using Ammo ID File {}.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -943,8 +943,8 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} will have Model {} set to their Primary and Model {} set to their Secondary on repop.",
npc_id_string,
commify(sep->arg[2]),
sep->IsNumber(3) ? commify(sep->arg[3]) : 0
Strings::Commify(sep->arg[2]),
sep->IsNumber(3) ? Strings::Commify(sep->arg[3]) : 0
).c_str()
);
auto query = fmt::format(
@@ -1414,7 +1414,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Strength.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1435,7 +1435,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Stamina.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1456,7 +1456,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Agility.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1477,7 +1477,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Dexterity.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1498,7 +1498,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Intelligence.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1519,7 +1519,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Wisdom.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1540,7 +1540,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Charisma.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1630,7 +1630,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Attack.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1651,7 +1651,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Accuracy.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1672,7 +1672,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Avoidance.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1693,7 +1693,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Slow Mitigation.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1756,7 +1756,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has a Scaling Rate of {}%%.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1777,7 +1777,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has a Spell Scaling Rate of {}%%.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -1801,7 +1801,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has a Heal Scaling Rate of {}%%.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2044,7 +2044,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Armor Class while Charmed.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2065,7 +2065,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now does {} Minimum Damage while Charmed.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2086,7 +2086,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now does {} Maximum Damage while Charmed.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2126,7 +2126,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Accuracy Rating while Charmed.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2147,7 +2147,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Avoidance Rating while Charmed.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2168,7 +2168,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has {} Attack while Charmed.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2226,7 +2226,7 @@ void command_npcedit(Client *c, const Seperator *sep)
c->Message(
Chat::White,
"Usage: #npcedit rarespawn [Flag] - Sets an NPC's Rare Spawn Flag [0 = Not a Rare Spawn, 1 = Rare Spawn]"
);
);
}
return;
} else if (!strcasecmp(sep->arg[1], "stuck_behavior")) {
@@ -2335,7 +2335,7 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has an Experience Modifier of {}%%.",
npc_id_string,
commify(sep->arg[2])
Strings::Commify(sep->arg[2])
).c_str()
);
auto query = fmt::format(
@@ -2373,7 +2373,7 @@ void command_npcedit(Client *c, const Seperator *sep)
) :
std::to_string(animation_id)
),
commify(std::to_string(c->GetTarget()->CastToNPC()->GetSpawnGroupId()))
Strings::Commify(std::to_string(c->GetTarget()->CastToNPC()->GetSpawnGroupId()))
).c_str()
);
auto query = fmt::format(
@@ -2397,9 +2397,9 @@ void command_npcedit(Client *c, const Seperator *sep)
fmt::format(
"{} now has a Respawn Timer of {} ({}) on Spawn Group ID {}.",
npc_id_string,
ConvertSecondsToTime(respawn_time),
Strings::SecondsToTime(respawn_time),
respawn_time,
commify(std::to_string(c->GetTarget()->CastToNPC()->GetSpawnGroupId()))
Strings::Commify(std::to_string(c->GetTarget()->CastToNPC()->GetSpawnGroupId()))
).c_str()
);
auto query = fmt::format(
+5 -5
View File
@@ -72,7 +72,7 @@ void command_npceditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"Possible columns [{}]",
implode(options_glue, possible_column_options)
Strings::Implode(options_glue, possible_column_options)
).c_str()
);
return;
@@ -91,7 +91,7 @@ void command_npceditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"Possible columns [{}]",
implode(options_glue, possible_column_options)
Strings::Implode(options_glue, possible_column_options)
).c_str()
);
return;
@@ -139,7 +139,7 @@ void command_npceditmass(Client *c, const Seperator *sep)
for (auto row : results) {
std::string npc_id = row[0];
std::string npc_name = row[1];
std::string search_column_value = str_tolower(row[2]);
std::string search_column_value = Strings::ToLower(row[2]);
std::string change_column_current_value = row[3];
if (exact_match) {
@@ -183,7 +183,7 @@ void command_npceditmass(Client *c, const Seperator *sep)
);
if (strcasecmp(sep->arg[5], "apply") == 0) {
std::string npc_ids_string = implode(",", npc_ids);
std::string npc_ids_string = Strings::Implode(",", npc_ids);
if (npc_ids_string.empty()) {
c->Message(Chat::Red, "Error: Ran into an unknown error compiling NPC IDs");
return;
@@ -223,7 +223,7 @@ void command_npceditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"Would you like to {} these changes?",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "apply")
Saylink::Create(saylink, false, "apply")
).c_str()
);
+7 -7
View File
@@ -8,7 +8,7 @@ void command_npcloot(Client *c, const Seperator *sep)
c->Message(Chat::White, "You must target an NPC or a Corpse to use this command.");
return;
}
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Usage: #npcloot add [Item ID] [Charges] [Equip] [Augment 1 ID] [Augment 2 ID] [Augment 3 ID] [Augment 4 ID] [Augment 5 ID] [Augment 6 ID] - Adds the specified item to an NPC's loot");
@@ -132,12 +132,12 @@ void command_npcloot(Client *c, const Seperator *sep)
gold ||
platinum
) ?
ConvertMoneyToString(
platinum,
gold,
silver,
copper
) :
Strings::Money(
platinum,
gold,
silver,
copper
) :
"no money"
);
+1 -1
View File
@@ -9,7 +9,7 @@ void command_nudge(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"Note: Partial or mixed arguments allowed, example {}.",
EQ::SayLinkEngine::GenerateQuestSaylink(
Saylink::Create(
"#nudge x=5.0",
false,
"#nudge x=5.0"
+2 -2
View File
@@ -1,13 +1,13 @@
#include "../client.h"
void command_nukebuffs(Client *c, const Seperator *sep)
{
{
Mob* target = c;
if (c->GetTarget()) {
target = c->GetTarget();
}
std::string buff_identifier = str_tolower(sep->arg[1]);
std::string buff_identifier = Strings::ToLower(sep->arg[1]);
std::string buff_type;
bool is_beneficial = buff_identifier.find("beneficial") != std::string::npos;
bool is_detrimental = buff_identifier.find("detrimental") != std::string::npos;
+1 -1
View File
@@ -16,7 +16,7 @@ void command_peqzone(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"You must wait {} before using this command again.",
ConvertSecondsToTime(time_left)
Strings::SecondsToTime(time_left)
).c_str()
);
return;
+3 -3
View File
@@ -29,7 +29,7 @@ void command_qglobal(Client *c, const Seperator *sep)
c->Message(Chat::White, "Usage: #qglobal on - Enables target NPC's ability to view quest globals");
c->Message(Chat::White, "Usage: #qglobal off - Disables target NPC's ability to view quest globals");
c->Message(Chat::White, "Usage: #qglobal view - View target NPC's ability to view quest globals");
return;
return;
}
if (is_off) {
@@ -50,7 +50,7 @@ void command_qglobal(Client *c, const Seperator *sep)
return;
}
auto repop_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto repop_link = Saylink::Create(
"#repop",
false,
"repop"
@@ -83,7 +83,7 @@ void command_qglobal(Client *c, const Seperator *sep)
return;
}
auto repop_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto repop_link = Saylink::Create(
"#repop",
false,
"repop"
+1 -1
View File
@@ -22,7 +22,7 @@ void command_raidloot(Client *c, const Seperator *sep)
return;
}
std::string raid_loot_type = str_tolower(sep->arg[1]);
std::string raid_loot_type = Strings::ToLower(sep->arg[1]);
bool is_all = raid_loot_type.find("all") != std::string::npos;
bool is_group_leader = raid_loot_type.find("groupleader") != std::string::npos;
bool is_raid_leader = raid_loot_type.find("raidleader") != std::string::npos;
+1 -1
View File
@@ -91,7 +91,7 @@ void command_roambox(Client *c, const Seperator *sep)
box_size,
c->GetTargetDescription(target),
spawn_group_id,
ConvertMillisecondsToTime(delay),
Strings::MillisecondsToTime(delay),
delay
).c_str()
);
+1 -1
View File
@@ -127,7 +127,7 @@ void command_scale(Client *c, const Seperator *sep)
c->Message(Chat::Yellow, "Found (%i) NPC's that match this search...", found_count);
c->Message(
Chat::Yellow, "To apply these changes, click <%s> or type %s",
EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Apply").c_str(),
Saylink::Create(saylink, false, "Apply").c_str(),
saylink.c_str()
);
}
+1 -1
View File
@@ -46,7 +46,7 @@ void command_serverinfo(Client *c, const Seperator *sep)
popup_text.append(
fmt::format(
"<tr><td>Uptime</td><td>{}</td></tr>",
ConvertSecondsToTime(uptime)
Strings::SecondsToTime(uptime)
)
);
+1 -1
View File
@@ -16,7 +16,7 @@ void command_setaapts(Client *c, const Seperator *sep)
target = c->GetTarget()->CastToClient();
}
std::string aa_type = str_tolower(sep->arg[1]);
std::string aa_type = Strings::ToLower(sep->arg[1]);
std::string group_raid_string;
uint32 aa_points = static_cast<uint32>(std::min(std::stoull(sep->arg[2]), (unsigned long long) 2000000000));
bool is_aa = aa_type.find("aa") != std::string::npos;
+1 -1
View File
@@ -16,7 +16,7 @@ void command_setaaxp(Client *c, const Seperator *sep)
target = c->GetTarget()->CastToClient();
}
std::string aa_type = str_tolower(sep->arg[1]);
std::string aa_type = Strings::ToLower(sep->arg[1]);
std::string group_raid_string;
uint32 aa_experience = static_cast<uint32>(std::min(
std::stoull(sep->arg[2]),
+1 -1
View File
@@ -13,7 +13,7 @@ void command_setcrystals(Client *c, const Seperator *sep)
target = c->GetTarget()->CastToClient();
}
std::string crystal_type = str_tolower(sep->arg[1]);
std::string crystal_type = Strings::ToLower(sep->arg[1]);
uint32 crystal_amount = static_cast<uint32>(std::min(
std::stoull(sep->arg[2]),
(unsigned long long) 2000000000
+3 -3
View File
@@ -55,7 +55,7 @@ void command_showskills(Client *c, const Seperator *sep)
popup_title.c_str(),
popup_text.c_str()
);
c->Message(
Chat::White,
@@ -76,7 +76,7 @@ void command_showskills(Client *c, const Seperator *sep)
next_skill_id
);
auto next_list_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto next_list_link = Saylink::Create(
next_list_string,
false,
next_list_string
@@ -87,7 +87,7 @@ void command_showskills(Client *c, const Seperator *sep)
next_skill_id
);
auto next_list_all_link = EQ::SayLinkEngine::GenerateQuestSaylink(
auto next_list_all_link = Saylink::Create(
next_list_all_string,
false,
next_list_all_string
+8 -8
View File
@@ -63,11 +63,11 @@ void command_spawneditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"Spawn2 ID: {} NPC ID: {} Name: {} Respawn Time: {} ({})",
commify(spawn2_id),
commify(npc_id),
Strings::Commify(spawn2_id),
Strings::Commify(npc_id),
npc_name,
ConvertSecondsToTime(std::stoi(respawn_time)),
commify(respawn_time)
Strings::SecondsToTime(std::stoi(respawn_time)),
Strings::Commify(respawn_time)
).c_str()
);
@@ -94,7 +94,7 @@ void command_spawneditmass(Client *c, const Seperator *sep)
search_criteria
).c_str()
);
if (!is_apply) {
auto edit_link = fmt::format(
"#spawneditmass {} {} {} apply",
@@ -107,14 +107,14 @@ void command_spawneditmass(Client *c, const Seperator *sep)
Chat::Yellow,
fmt::format(
"To apply these changes, click {} or type \"{}\".",
EQ::SayLinkEngine::GenerateQuestSaylink(edit_link, false, "apply"),
Saylink::Create(edit_link, false, "apply"),
edit_link
).c_str()
);
}
if (edit_option == "respawn_time" && is_apply) {
auto spawn2_ids_string = implode(", ", spawn2_ids);
auto spawn2_ids_string = Strings::Implode(", ", spawn2_ids);
if (spawn2_ids_string.empty()) {
c->Message(
Chat::Yellow,
@@ -144,5 +144,5 @@ void command_spawneditmass(Client *c, const Seperator *sep)
spawn2_ids.size() != 1 ? "s" : ""
).c_str()
);
}
}
}
+3 -3
View File
@@ -36,7 +36,7 @@ void command_spawnstatus(Client *c, const Seperator *sep)
filter_type = "Enabled";
}
uint32 spawn_id = 0;
uint32 spawn_id = 0;
if (is_search) {
spawn_id = std::stoul(sep->arg[1]);
}
@@ -84,7 +84,7 @@ void command_spawnstatus(Client *c, const Seperator *sep)
fmt::format(
"Spawn {} | Respawn: {} ({} Second{})",
spawn_number,
ConvertSecondsToTime(seconds_remaining),
Strings::SecondsToTime(seconds_remaining),
seconds_remaining,
seconds_remaining != 1 ? "s" : ""
).c_str()
@@ -112,7 +112,7 @@ void command_spawnstatus(Client *c, const Seperator *sep)
);
return;
}
if (is_all) {
c->Message(
Chat::White,
+1 -1
View File
@@ -31,7 +31,7 @@ void command_stun(Client *c, const Seperator *sep)
fmt::format(
"You stunned {} for {}.",
c->GetTargetDescription(target),
ConvertMillisecondsToTime(duration)
Strings::MillisecondsToTime(duration)
) :
fmt::format(
"You unstunned {}.",
+1 -1
View File
@@ -58,7 +58,7 @@ void command_suspend(Client *c, const Seperator *sep)
std::string query = StringFormat(
"UPDATE `account` SET `suspendeduntil` = DATE_ADD(NOW(), INTERVAL %i DAY), "
"suspend_reason = '%s' WHERE `id` = %i",
duration, EscapeString(message).c_str(), accountID
duration, Strings::Escape(message).c_str(), accountID
);
auto results = database.QueryDatabase(query);
+18 -18
View File
@@ -18,7 +18,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] List active tasks for a client",
EQ::SayLinkEngine::GenerateQuestSaylink("#task show", false, "show")
Saylink::Create("#task show", false, "show")
).c_str()
);
c->Message(Chat::White, "--- update <task_id> <activity_id> [count] | Updates task");
@@ -28,42 +28,42 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Reload all Task information from the database",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reloadall", false, "reloadall")
Saylink::Create("#task reloadall", false, "reloadall")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] <task_id> Reload Task and Activity information for a single task",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload task", false, "reload task")
Saylink::Create("#task reload task", false, "reload task")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload goal/reward list information",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload lists", false, "reload lists")
Saylink::Create("#task reload lists", false, "reload lists")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload proximity information",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload prox", false, "reload prox")
Saylink::Create("#task reload prox", false, "reload prox")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload task set information",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload sets", false, "reload sets")
Saylink::Create("#task reload sets", false, "reload sets")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Purges targeted characters task timers",
EQ::SayLinkEngine::GenerateQuestSaylink("#task purgetimers", false, "purgetimers")
Saylink::Create("#task purgetimers", false, "purgetimers")
).c_str()
);
@@ -74,7 +74,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Purges all active Shared Tasks in memory and database ",
EQ::SayLinkEngine::GenerateQuestSaylink("#task sharedpurge", false, "sharedpurge")
Saylink::Create("#task sharedpurge", false, "sharedpurge")
).c_str()
);
return;
@@ -112,7 +112,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] List active tasks for a client",
EQ::SayLinkEngine::GenerateQuestSaylink("#task show", false, "show")
Saylink::Create("#task show", false, "show")
).c_str()
);
c->Message(Chat::White, "--- update <task_id> <activity_id> [count] | Updates task");
@@ -122,42 +122,42 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Reload all Task information from the database",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reloadall", false, "reloadall")
Saylink::Create("#task reloadall", false, "reloadall")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] <task_id> Reload Task and Activity information for a single task",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload task", false, "reload task")
Saylink::Create("#task reload task", false, "reload task")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload goal/reward list information",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload lists", false, "reload lists")
Saylink::Create("#task reload lists", false, "reload lists")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload proximity information",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload prox", false, "reload prox")
Saylink::Create("#task reload prox", false, "reload prox")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Reload task set information",
EQ::SayLinkEngine::GenerateQuestSaylink("#task reload sets", false, "reload sets")
Saylink::Create("#task reload sets", false, "reload sets")
).c_str()
);
c->Message(
Chat::White,
fmt::format(
"--- [{}] Purges targeted characters task timers",
EQ::SayLinkEngine::GenerateQuestSaylink("#task purgetimers", false, "purgetimers")
Saylink::Create("#task purgetimers", false, "purgetimers")
).c_str()
);
@@ -168,7 +168,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"--- [{}] Purges all active Shared Tasks in memory and database ",
EQ::SayLinkEngine::GenerateQuestSaylink("#task sharedpurge", false, "sharedpurge")
Saylink::Create("#task sharedpurge", false, "sharedpurge")
).c_str()
);
return;
@@ -260,7 +260,7 @@ void command_task(Client *c, const Seperator *sep)
Chat::White,
fmt::format(
"[WARNING] This will purge all active Shared Tasks [{}]?",
EQ::SayLinkEngine::GenerateQuestSaylink("#task sharedpurge confirm", false, "confirm")
Saylink::Create("#task sharedpurge confirm", false, "confirm")
).c_str()
);
@@ -278,7 +278,7 @@ void command_task(Client *c, const Seperator *sep)
if (
CompletedTasksRepository::DeleteWhere(
database,
database,
fmt::format(
"charid = {} AND taskid = {}",
target->CharacterID(),
+1 -1
View File
@@ -25,7 +25,7 @@ void command_timers(Client *c, const Seperator *sep)
popup_text += fmt::format(
"<tr><td>{}</td><td>{}</td></tr>",
timer.first,
ConvertSecondsToTime(remaining_time)
Strings::SecondsToTime(remaining_time)
);
}
}
+3 -3
View File
@@ -8,10 +8,10 @@ void command_title(Client *c, const Seperator *sep)
c->Message(Chat::White, "Usage: #title [Title] (use \"-1\" to remove title)");
return;
}
bool is_remove = !strcasecmp(sep->argplus[1], "-1");
std::string title = is_remove ? "" : sep->argplus[1];
auto target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
@@ -23,7 +23,7 @@ void command_title(Client *c, const Seperator *sep)
}
if (!title.empty()) {
find_replace(title, "_", " ");
Strings::FindReplace(title, "_", " ");
}
if (is_remove) {
+3 -3
View File
@@ -11,10 +11,10 @@ void command_titlesuffix(Client *c, const Seperator *sep)
);
return;
}
bool is_remove = !strcasecmp(sep->argplus[1], "-1");
std::string suffix = is_remove ? "" : sep->argplus[1];
auto target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
@@ -26,7 +26,7 @@ void command_titlesuffix(Client *c, const Seperator *sep)
}
if (!suffix.empty()) {
find_replace(suffix, "_", " ");
Strings::FindReplace(suffix, "_", " ");
}
if (is_remove) {
+5 -5
View File
@@ -1,7 +1,7 @@
#include "../client.h"
void command_viewcurrencies(Client *c, const Seperator *sep)
{
{
Client *target = c;
if (c->GetTarget() && c->GetTarget()->IsClient()) {
target = c->GetTarget()->CastToClient();
@@ -13,19 +13,19 @@ void command_viewcurrencies(Client *c, const Seperator *sep)
target->GetMoney(3, 2) +
target->GetMoney(3, 3)
);
auto gold = (
target->GetMoney(2, 0) +
target->GetMoney(2, 1) +
target->GetMoney(2, 2)
);
auto silver = (
target->GetMoney(1, 0) +
target->GetMoney(1, 1) +
target->GetMoney(1, 2)
);
auto copper = (
target->GetMoney(0, 0) +
target->GetMoney(0, 1) +
@@ -43,7 +43,7 @@ void command_viewcurrencies(Client *c, const Seperator *sep)
fmt::format(
"Money for {} | {}",
c->GetTargetDescription(target, TargetDescriptionType::UCSelf),
ConvertMoneyToString(
Strings::Money(
platinum,
gold,
silver,
+1 -1
View File
@@ -30,7 +30,7 @@ void command_viewzoneloot(Client *c, const Seperator *sep)
std::string npc_name = current_npc->GetCleanName();
uint32 instance_id = zone->GetInstanceID();
uint32 zone_id = zone->GetZoneID();
std::string command_link = EQ::SayLinkEngine::GenerateQuestSaylink(
std::string command_link = Saylink::Create(
fmt::format(
"#{} {} {} {} {}",
(instance_id != 0 ? "zoneinstance" : "zone"),
+16 -16
View File
@@ -55,7 +55,7 @@ void command_who(Client *c, const Seperator *sep)
std::string search_string;
if (sep->arg[1]) {
search_string = str_tolower(sep->arg[1]);
search_string = Strings::ToLower(sep->arg[1]);
}
int found_count = 0;
@@ -82,13 +82,13 @@ void command_who(Client *c, const Seperator *sep)
if (search_string.length()) {
bool found_search_term = (
str_tolower(player_name).find(search_string) != std::string::npos ||
str_tolower(zone_short_name).find(search_string) != std::string::npos ||
str_tolower(displayed_race_name).find(search_string) != std::string::npos ||
str_tolower(base_class_name).find(search_string) != std::string::npos ||
str_tolower(guild_name).find(search_string) != std::string::npos ||
str_tolower(account_name).find(search_string) != std::string::npos ||
str_tolower(account_ip).find(search_string) != std::string::npos
Strings::ToLower(player_name).find(search_string) != std::string::npos ||
Strings::ToLower(zone_short_name).find(search_string) != std::string::npos ||
Strings::ToLower(displayed_race_name).find(search_string) != std::string::npos ||
Strings::ToLower(base_class_name).find(search_string) != std::string::npos ||
Strings::ToLower(guild_name).find(search_string) != std::string::npos ||
Strings::ToLower(account_name).find(search_string) != std::string::npos ||
Strings::ToLower(account_ip).find(search_string) != std::string::npos
);
if (!found_search_term) {
@@ -98,7 +98,7 @@ void command_who(Client *c, const Seperator *sep)
std::string displayed_guild_name;
if (guild_name.length()) {
displayed_guild_name = EQ::SayLinkEngine::GenerateQuestSaylink(
displayed_guild_name = Saylink::Create(
fmt::format(
"#who \"{}\"",
guild_name
@@ -111,7 +111,7 @@ void command_who(Client *c, const Seperator *sep)
);
}
auto goto_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto goto_saylink = Saylink::Create(
fmt::format(
"#goto {}",
player_name
@@ -120,7 +120,7 @@ void command_who(Client *c, const Seperator *sep)
"Goto"
);
auto summon_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto summon_saylink = Saylink::Create(
fmt::format(
"#summon {}",
player_name
@@ -134,7 +134,7 @@ void command_who(Client *c, const Seperator *sep)
static_cast<uint8>(player_level)
);
auto class_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto class_saylink = Saylink::Create(
fmt::format(
"#who {}",
base_class_name
@@ -143,7 +143,7 @@ void command_who(Client *c, const Seperator *sep)
display_class_name
);
auto race_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto race_saylink = Saylink::Create(
fmt::format(
"#who %s",
displayed_race_name
@@ -152,7 +152,7 @@ void command_who(Client *c, const Seperator *sep)
displayed_race_name
);
auto zone_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto zone_saylink = Saylink::Create(
fmt::format(
"#who {}",
zone_short_name
@@ -161,7 +161,7 @@ void command_who(Client *c, const Seperator *sep)
zone_long_name
);
auto account_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto account_saylink = Saylink::Create(
fmt::format(
"#who {}",
account_name
@@ -170,7 +170,7 @@ void command_who(Client *c, const Seperator *sep)
account_name
);
auto account_ip_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(
auto account_ip_saylink = Saylink::Create(
fmt::format(
"#who {}",
account_ip
+1 -1
View File
@@ -10,7 +10,7 @@ void command_zone(Client *c, const Seperator *sep)
std::string zone_identifier = sep->arg[1];
if (StringIsNumber(zone_identifier) && zone_identifier == "0") {
if (Strings::IsNumber(zone_identifier) && zone_identifier == "0") {
c->Message(Chat::White, "Sending you to the safe coordinates of this zone.");
c->MovePC(
+2 -2
View File
@@ -21,7 +21,7 @@ void command_zonelock(Client *c, const Seperator *sep)
return;
}
std::string lock_type = str_tolower(sep->arg[1]);
std::string lock_type = Strings::ToLower(sep->arg[1]);
bool is_list = lock_type.find("list") != std::string::npos;
bool is_lock = lock_type.find("lock") != std::string::npos;
bool is_unlock = lock_type.find("unlock") != std::string::npos;
@@ -54,7 +54,7 @@ void command_zonelock(Client *c, const Seperator *sep)
static_cast<uint16>(std::stoul(sep->arg[2])) :
static_cast<uint16>(ZoneID(sep->arg[2]))
);
std::string zone_short_name = str_tolower(ZoneName(zone_id, true));
std::string zone_short_name = Strings::ToLower(ZoneName(zone_id, true));
bool is_unknown_zone = zone_short_name.find("unknown") != std::string::npos;
if (zone_id && !is_unknown_zone) {
lock_zone->op = is_lock ? ServerLockType::Lock : ServerLockType::Unlock;
+2 -2
View File
@@ -23,7 +23,7 @@
#include "npc_ai.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "worldserver.h"
#include "string_ids.h"
@@ -180,7 +180,7 @@ void Group::SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinu
members[i]->CastToClient()->MessageString(
Chat::MoneySplit,
YOU_RECEIVE_AS_SPLIT,
ConvertMoneyToString(
Strings::Money(
platinum_split,
gold_split,
silver_split,
+1 -1
View File
@@ -18,7 +18,7 @@
#include "../common/database.h"
#include "../common/guilds.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "guild_mgr.h"
#include "worldserver.h"
+1 -1
View File
@@ -17,7 +17,7 @@
*/
#include "../common/servertalk.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "client.h"
#include "entity.h"
+1 -1
View File
@@ -19,7 +19,7 @@
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include "../common/linked_list.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "client.h"
#include "entity.h"
+1 -1
View File
@@ -19,7 +19,7 @@
#include "../common/global_define.h"
#include "../common/eqemu_logsys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "quest_parser_collection.h"
#include "worldserver.h"
#include "zonedb.h"
+4 -4
View File
@@ -652,7 +652,7 @@ void ZoneDatabase::LoadGlobalLoot()
for (auto row = results.begin(); row != results.end(); ++row) {
// checking zone limits
if (row[10]) {
auto zones = SplitString(row[10], '|');
auto zones = Strings::Split(row[10], '|');
auto it = std::find(zones.begin(), zones.end(), zoneid);
if (it == zones.end()) { // not in here, skip
@@ -683,21 +683,21 @@ void ZoneDatabase::LoadGlobalLoot()
}
if (row[7]) {
auto races = SplitString(row[7], '|');
auto races = Strings::Split(row[7], '|');
for (auto &r : races)
e.AddRule(GlobalLoot::RuleTypes::Race, std::stoi(r));
}
if (row[8]) {
auto classes = SplitString(row[8], '|');
auto classes = Strings::Split(row[8], '|');
for (auto &c : classes)
e.AddRule(GlobalLoot::RuleTypes::Class, std::stoi(c));
}
if (row[9]) {
auto bodytypes = SplitString(row[9], '|');
auto bodytypes = Strings::Split(row[9], '|');
for (auto &b : bodytypes)
e.AddRule(GlobalLoot::RuleTypes::BodyType, std::stoi(b));
+1 -1
View File
@@ -3389,7 +3389,7 @@ std::string lua_get_environmental_damage_name(uint8 damage_type) {
}
std::string lua_commify(std::string number) {
return commify(number);
return Strings::Commify(number);
}
bool lua_check_name_filter(std::string name) {
+4 -4
View File
@@ -31,7 +31,7 @@
#include "../common/patches/patches.h"
#include "../common/rulesys.h"
#include "../common/profanity_manager.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/crash.h"
#include "../common/memory_mapped_file.h"
#include "../common/spdat.h"
@@ -157,7 +157,7 @@ int main(int argc, char** argv) {
if (argc == 4) {
instance_id = atoi(argv[3]);
worldserver.SetLauncherName(argv[2]);
auto zone_port = SplitString(argv[1], ':');
auto zone_port = Strings::Split(argv[1], ':');
if (!zone_port.empty()) {
z_name = zone_port[0];
@@ -178,7 +178,7 @@ int main(int argc, char** argv) {
}
else if (argc == 3) {
worldserver.SetLauncherName(argv[2]);
auto zone_port = SplitString(argv[1], ':');
auto zone_port = Strings::Split(argv[1], ':');
if (!zone_port.empty()) {
z_name = zone_port[0];
@@ -199,7 +199,7 @@ int main(int argc, char** argv) {
}
else if (argc == 2) {
worldserver.SetLauncherName("NONE");
auto zone_port = SplitString(argv[1], ':');
auto zone_port = Strings::Split(argv[1], ':');
if (!zone_port.empty()) {
z_name = zone_port[0];
+1 -1
View File
@@ -15,7 +15,7 @@
#include "zone.h"
#include "string_ids.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/rulesys.h"
extern volatile bool is_zone_loaded;
+4 -4
View File
@@ -17,7 +17,7 @@
*/
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/misc_functions.h"
#include "data_bucket.h"
@@ -512,7 +512,7 @@ Mob::Mob(
mob_close_scan_timer.Trigger();
SetCanOpenDoors(true);
is_boat = IsBoat();
}
@@ -6231,9 +6231,9 @@ void Mob::ClearSpecialAbilities() {
void Mob::ProcessSpecialAbilities(const std::string &str) {
ClearSpecialAbilities();
std::vector<std::string> sp = SplitString(str, '^');
std::vector<std::string> sp = Strings::Split(str, '^');
for(auto iter = sp.begin(); iter != sp.end(); ++iter) {
std::vector<std::string> sub_sp = SplitString((*iter), ',');
std::vector<std::string> sub_sp = Strings::Split((*iter), ',');
if(sub_sp.size() >= 2) {
int ability = std::stoi(sub_sp[0]);
int value = std::stoi(sub_sp[1]);
+1 -1
View File
@@ -19,7 +19,7 @@
#include "../common/global_define.h"
#include "../common/features.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "client.h"
#include "entity.h"
+1 -1
View File
@@ -22,7 +22,7 @@
#include "../common/misc_functions.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "mob.h"
#include "quest_parser_collection.h"
+106 -104
View File
@@ -22,7 +22,7 @@
#include "mob.h"
#include "../common/races.h"
#include "../common/say_link.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "npc_scale_manager.h"
inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribute)
@@ -38,7 +38,7 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
scaling_modified = " *";
}
return commify(std::to_string(mob->GetAC())) + scaling_modified;
return Strings::Commify(std::to_string(mob->GetAC())) + scaling_modified;
}
if (attribute == "atk") {
@@ -51,11 +51,11 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
endurance = mob->CastToClient()->GetEndurance();
}
return commify(std::to_string(endurance));
return Strings::Commify(std::to_string(endurance));
}
if (attribute == "hp") {
return commify(std::to_string(mob->GetHP()));
return Strings::Commify(std::to_string(mob->GetHP()));
}
if (attribute == "hp_min_max") {
@@ -63,115 +63,117 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
scaling_modified = " *";
}
return commify(std::to_string(mob->GetHP())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxHP())) + " (" +
return Strings::Commify(std::to_string(mob->GetHP())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxHP())) + " (" +
std::to_string((int) mob->GetHPRatio()) + "%)";
}
if (attribute == "mana") {
return commify(std::to_string(mob->GetMana()));
return Strings::Commify(std::to_string(mob->GetMana()));
}
if (attribute == "mp_min_max") {
return commify(std::to_string(mob->GetMana())) + " / " + commify(std::to_string(mob->GetMaxMana())) + " (" +
return Strings::Commify(std::to_string(mob->GetMana())) + " / " +
Strings::Commify(std::to_string(mob->GetMaxMana())) + " (" +
std::to_string((int) mob->GetManaPercent()) + "%)";
}
if (attribute == "end_min_max") {
return commify(std::to_string(mob->GetEndurance())) + " / " + commify(std::to_string(mob->GetMaxEndurance())) + " (" +
return Strings::Commify(std::to_string(mob->GetEndurance())) + " / " +
Strings::Commify(std::to_string(mob->GetMaxEndurance())) + " (" +
std::to_string((int)mob->GetEndurancePercent()) + "%)";
}
if (attribute == "str") {
return commify(std::to_string(mob->GetSTR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxSTR())) + " +" +
commify(std::to_string(mob->GetHeroicSTR()));
return Strings::Commify(std::to_string(mob->GetSTR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxSTR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicSTR()));
}
if (attribute == "sta") {
return commify(std::to_string(mob->GetSTA())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxSTA())) + " +" +
commify(std::to_string(mob->GetHeroicSTA()));
return Strings::Commify(std::to_string(mob->GetSTA())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxSTA())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicSTA()));
}
if (attribute == "dex") {
return commify(std::to_string(mob->GetDEX())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxDEX())) + " +" +
commify(std::to_string(mob->GetHeroicDEX()));
return Strings::Commify(std::to_string(mob->GetDEX())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxDEX())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicDEX()));
}
if (attribute == "agi") {
return commify(std::to_string(mob->GetAGI())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxAGI())) + " +" +
commify(std::to_string(mob->GetHeroicAGI()));
return Strings::Commify(std::to_string(mob->GetAGI())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxAGI())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicAGI()));
}
if (attribute == "int") {
return commify(std::to_string(mob->GetINT())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxINT())) + " +" +
commify(std::to_string(mob->GetHeroicINT()));
return Strings::Commify(std::to_string(mob->GetINT())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxINT())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicINT()));
}
if (attribute == "wis") {
return commify(std::to_string(mob->GetWIS())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxWIS())) + " +" +
commify(std::to_string(mob->GetHeroicWIS()));
return Strings::Commify(std::to_string(mob->GetWIS())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxWIS())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicWIS()));
}
if (attribute == "cha") {
return commify(std::to_string(mob->GetCHA())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxCHA())) + " +" +
commify(std::to_string(mob->GetHeroicCHA()));
return Strings::Commify(std::to_string(mob->GetCHA())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxCHA())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicCHA()));
}
if (attribute == "mr") {
return commify(std::to_string(mob->GetMR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxMR())) + " +" +
commify(std::to_string(mob->GetHeroicMR()));
return Strings::Commify(std::to_string(mob->GetMR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxMR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicMR()));
}
if (attribute == "cr") {
return commify(std::to_string(mob->GetCR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxCR())) + " +" +
commify(std::to_string(mob->GetHeroicCR()));
return Strings::Commify(std::to_string(mob->GetCR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxCR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicCR()));
}
if (attribute == "fr") {
return commify(std::to_string(mob->GetFR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxFR())) + " +" +
commify(std::to_string(mob->GetHeroicFR()));
return Strings::Commify(std::to_string(mob->GetFR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxFR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicFR()));
}
if (attribute == "pr") {
return commify(std::to_string(mob->GetPR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxPR())) + " +" +
commify(std::to_string(mob->GetHeroicPR()));
return Strings::Commify(std::to_string(mob->GetPR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxPR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicPR()));
}
if (attribute == "dr") {
return commify(std::to_string(mob->GetDR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxDR())) + " +" +
commify(std::to_string(mob->GetHeroicDR()));
return Strings::Commify(std::to_string(mob->GetDR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxDR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicDR()));
}
if (attribute == "cr") {
return commify(std::to_string(mob->GetCR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxCR())) + " +" +
commify(std::to_string(mob->GetHeroicCR()));
return Strings::Commify(std::to_string(mob->GetCR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxCR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicCR()));
}
if (attribute == "pr") {
return commify(std::to_string(mob->GetPR())) + scaling_modified + " / " +
commify(std::to_string(mob->GetMaxPR())) + " +" +
commify(std::to_string(mob->GetHeroicPR()));
return Strings::Commify(std::to_string(mob->GetPR())) + scaling_modified + " / " +
Strings::Commify(std::to_string(mob->GetMaxPR())) + " +" +
Strings::Commify(std::to_string(mob->GetHeroicPR()));
}
if (attribute == "cor") {
return commify(std::to_string(mob->GetCorrup())) + scaling_modified;
return Strings::Commify(std::to_string(mob->GetCorrup())) + scaling_modified;
}
if (attribute == "phy") {
return commify(std::to_string(mob->GetPhR())) + scaling_modified;
return Strings::Commify(std::to_string(mob->GetPhR())) + scaling_modified;
}
if (attribute == "name") {
@@ -361,45 +363,45 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
scaling_modified = " *";
}
return commify(std::to_string((int)npc->GetMinDMG())) + scaling_modified;
return Strings::Commify(std::to_string((int) npc->GetMinDMG())) + scaling_modified;
}
if (attribute == "max_hit") {
if (mob->GetEntityVariable(std::string("modify_stat_max_hit").c_str())) {
scaling_modified = " *";
}
return commify(std::to_string((int)npc->GetMaxDMG())) + scaling_modified;
return Strings::Commify(std::to_string((int) npc->GetMaxDMG())) + scaling_modified;
}
if (attribute == "hp_regen") {
if (mob->GetEntityVariable(std::string("modify_stat_hp_regen").c_str())) {
scaling_modified = " *";
}
return commify(std::to_string((int)npc->GetHPRegen())) + scaling_modified;
return Strings::Commify(std::to_string((int) npc->GetHPRegen())) + scaling_modified;
}
if (attribute == "attack_delay") {
if (mob->GetEntityVariable(std::string("modify_stat_attack_delay").c_str())) {
scaling_modified = " *";
}
return commify(std::to_string(npc->GetAttackDelay())) + scaling_modified;
return Strings::Commify(std::to_string(npc->GetAttackDelay())) + scaling_modified;
}
if (attribute == "spell_scale") {
if (mob->GetEntityVariable(std::string("modify_stat_spell_scale").c_str())) {
scaling_modified = " *";
}
return commify(std::to_string((int)npc->GetSpellScale())) + scaling_modified;
return Strings::Commify(std::to_string((int) npc->GetSpellScale())) + scaling_modified;
}
if (attribute == "heal_scale") {
if (mob->GetEntityVariable(std::string("modify_stat_heal_scale").c_str())) {
scaling_modified = " *";
}
return commify(std::to_string((int)npc->GetHealScale())) + scaling_modified;
return Strings::Commify(std::to_string((int) npc->GetHealScale())) + scaling_modified;
}
if (attribute == "avoidance") {
return commify(std::to_string((int)npc->GetAvoidanceRating())) + scaling_modified;
return Strings::Commify(std::to_string((int) npc->GetAvoidanceRating())) + scaling_modified;
}
npc->GetNPCEmote(npc->GetEmoteID(), 0);
@@ -409,68 +411,68 @@ inline std::string GetMobAttributeByString(Mob *mob, const std::string &attribut
Client *client = mob->CastToClient();
if (attribute == "shielding") {
return commify(std::to_string((int)client->GetShielding())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemShieldingCap)));
return Strings::Commify(std::to_string((int) client->GetShielding())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemShieldingCap)));
}
if (attribute == "spell_shielding") {
return commify(std::to_string((int)client->GetSpellShield())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemSpellShieldingCap)));
return Strings::Commify(std::to_string((int) client->GetSpellShield())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemSpellShieldingCap)));
}
if (attribute == "dot_shielding") {
return commify(std::to_string((int)client->GetDoTShield())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemDoTShieldingCap)));
return Strings::Commify(std::to_string((int) client->GetDoTShield())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemDoTShieldingCap)));
}
if (attribute == "stun_resist") {
return commify(std::to_string((int)client->GetStunResist())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemStunResistCap)));
return Strings::Commify(std::to_string((int) client->GetStunResist())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemStunResistCap)));
}
if (attribute == "damage_shield") {
return commify(std::to_string((int)client->GetDS())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemDamageShieldCap)));
return Strings::Commify(std::to_string((int) client->GetDS())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemDamageShieldCap)));
}
if (attribute == "avoidance") {
return commify(std::to_string((int) client->GetAvoidance())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemAvoidanceCap)));
return Strings::Commify(std::to_string((int) client->GetAvoidance())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemAvoidanceCap)));
}
if (attribute == "strikethrough") {
return commify(std::to_string((int) client->GetStrikeThrough())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemStrikethroughCap)));
return Strings::Commify(std::to_string((int) client->GetStrikeThrough())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemStrikethroughCap)));
}
if (attribute == "accuracy") {
return commify(std::to_string((int) client->GetAccuracy())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemAccuracyCap)));
return Strings::Commify(std::to_string((int) client->GetAccuracy())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemAccuracyCap)));
}
if (attribute == "combat_effects") {
return commify(std::to_string((int) client->GetCombatEffects())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemCombatEffectsCap)));
return Strings::Commify(std::to_string((int) client->GetCombatEffects())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemCombatEffectsCap)));
}
if (attribute == "heal_amount") {
return commify(std::to_string((int) client->GetHealAmt())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemHealAmtCap)));
return Strings::Commify(std::to_string((int) client->GetHealAmt())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemHealAmtCap)));
}
if (attribute == "spell_dmg") {
return commify(std::to_string((int) client->GetSpellDmg())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemSpellDmgCap)));
return Strings::Commify(std::to_string((int) client->GetSpellDmg())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemSpellDmgCap)));
}
if (attribute == "clairvoyance") {
return commify(std::to_string((int) client->GetClair())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemClairvoyanceCap)));
return Strings::Commify(std::to_string((int) client->GetClair())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemClairvoyanceCap)));
}
if (attribute == "ds_mitigation") {
return commify(std::to_string((int) client->GetDSMit())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemDSMitigationCap)));
return Strings::Commify(std::to_string((int) client->GetDSMit())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemDSMitigationCap)));
}
if (attribute == "hp_regen") {
return commify(std::to_string((int64) client->GetHPRegen())) + " / " +
commify(std::to_string((int) RuleI(Character, ItemHealthRegenCap)));
return Strings::Commify(std::to_string((int64) client->GetHPRegen())) + " / " +
Strings::Commify(std::to_string((int) RuleI(Character, ItemHealthRegenCap)));
}
if (attribute == "mana_regen") {
return commify(std::to_string((int64) client->GetManaRegen())) + " / " +
commify(std::to_string((int64) RuleI(Character, ItemManaRegenCap)));
return Strings::Commify(std::to_string((int64) client->GetManaRegen())) + " / " +
Strings::Commify(std::to_string((int64) RuleI(Character, ItemManaRegenCap)));
}
if (attribute == "end_regen") {
return commify(std::to_string((int) client->CalcEnduranceRegen())) + " / " +
commify(std::to_string((int) client->CalcEnduranceRegenCap()));
return Strings::Commify(std::to_string((int) client->CalcEnduranceRegen())) + " / " +
Strings::Commify(std::to_string((int) client->CalcEnduranceRegenCap()));
}
}
@@ -528,17 +530,17 @@ inline std::string WriteDisplayInfoSection(
std::string attribute_name = attribute;
find_replace(attribute_name, "_min_max", std::string(""));
Strings::FindReplace(attribute_name, "_min_max", std::string(""));
/**
* Translate attribute names with underscores
* "total_to_hit" = "Total To Hit"
*/
if (attribute_name.find('_') != std::string::npos) {
auto split_string = SplitString(attribute_name, '_');
auto split_string = Strings::Split(attribute_name, '_');
std::string new_attribute_name;
for (std::string &string_value : split_string) {
new_attribute_name += ucfirst(string_value) + " ";
new_attribute_name += Strings::UcFirst(string_value) + " ";
}
attribute_name = new_attribute_name;
}
@@ -548,7 +550,7 @@ inline std::string WriteDisplayInfoSection(
* "hp" = "HP"
*/
if (attribute_name.length() <= 3) {
attribute_name = str_toupper(attribute_name);
attribute_name = Strings::ToUpper(attribute_name);
}
/**
@@ -556,11 +558,11 @@ inline std::string WriteDisplayInfoSection(
* "avoidance" = "Avoidance"
*/
if (attribute_name.length() > 3) {
attribute_name = ucfirst(attribute_name);
attribute_name = Strings::UcFirst(attribute_name);
}
find_replace(attribute_name, "Proximity", std::string(""));
find_replace(attribute_name, "Roambox", std::string(""));
Strings::FindReplace(attribute_name, "Proximity", std::string(""));
Strings::FindReplace(attribute_name, "Roambox", std::string(""));
std::string attribute_value = GetMobAttributeByString(mob, attribute);
@@ -588,24 +590,24 @@ inline void NPCCommandsMenu(Client* client, NPC* npc)
std::string menu_commands;
if (npc->GetGrid() > 0) {
menu_commands += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#grid show", false, "Grid Points") + "] ";
menu_commands += "[" + Saylink::Create("#grid show", false, "Grid Points") + "] ";
}
if (npc->GetEmoteID() > 0) {
std::string saylink = StringFormat("#emotesearch %u", npc->GetEmoteID());
menu_commands += "[" + EQ::SayLinkEngine::GenerateQuestSaylink(saylink, false, "Emotes") + "] ";
menu_commands += "[" + Saylink::Create(saylink, false, "Emotes") + "] ";
}
if (npc->GetLoottableID() > 0) {
menu_commands += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#npcloot show", false, "Loot") + "] ";
menu_commands += "[" + Saylink::Create("#npcloot show", false, "Loot") + "] ";
}
if (npc->IsProximitySet()) {
menu_commands += "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#proximity show", false, "Proximity") + "] ";
menu_commands += "[" + Saylink::Create("#proximity show", false, "Proximity") + "] ";
}
if (menu_commands.length() > 0) {
std::string dev_menu = "[" + EQ::SayLinkEngine::GenerateQuestSaylink("#devtools", false, "DevTools") + "] ";;
std::string dev_menu = "[" + Saylink::Create("#devtools", false, "DevTools") + "] ";;
client->Message(Chat::White, "| %s [Show Commands] %s", dev_menu.c_str(), menu_commands.c_str());
}
}
+7 -7
View File
@@ -23,7 +23,7 @@
#include "../common/rulesys.h"
#include "../common/seperator.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/emu_versions.h"
#include "../common/features.h"
#include "../common/item_instance.h"
@@ -703,7 +703,7 @@ void NPC::QueryLoot(Client* to, bool is_pet_query)
Chat::White,
fmt::format(
"Money | {}",
ConvertMoneyToString(
Strings::Money(
platinum,
gold,
silver,
@@ -1212,8 +1212,8 @@ void NPC::SpawnGridNodeNPC(const glm::vec4 &position, int32 grid_id, int32 grid_
auto npc_type = new NPCType;
memset(npc_type, 0, sizeof(NPCType));
std::string str_zoffset = numberToWords(zoffset);
std::string str_number = numberToWords(grid_number);
std::string str_zoffset = Strings::NumberToWords(zoffset);
std::string str_number = Strings::NumberToWords(grid_number);
strcpy(npc_type->name, str_number.c_str());
if (zoffset != 0) {
@@ -1551,7 +1551,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(
std::string query = fmt::format(
"INSERT INTO spawngroup (name) VALUES('{}{}{}')",
zone,
EscapeString(spawn->GetName()),
Strings::Escape(spawn->GetName()),
Timer::GetCurrentTime()
);
@@ -2424,7 +2424,7 @@ void NPC::SetLevel(uint8 in_level, bool command)
void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
{
std::string id = str_tolower(identifier);
std::string id = Strings::ToLower(identifier);
std::string val = new_value;
std::string variable_key = StringFormat("modify_stat_%s", id.c_str());
@@ -2650,7 +2650,7 @@ void NPC::ModifyNPCStat(const char *identifier, const char *new_value)
float NPC::GetNPCStat(const char *identifier)
{
std::string id = str_tolower(identifier);
std::string id = Strings::ToLower(identifier);
if (id == "ac") {
return AC;
+1 -1
View File
@@ -19,7 +19,7 @@
*/
#include "npc_scale_manager.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/repositories/npc_scale_global_base_repository.h"
#include "../common/repositories/npc_types_repository.h"
+1 -1
View File
@@ -17,7 +17,7 @@
*/
#include "../common/global_define.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "client.h"
#include "entity.h"
+37 -37
View File
@@ -12,7 +12,7 @@
#include "zone.h"
#include "client.h"
#include "../common/eqemu_logsys.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/rulesys.h"
extern Zone *zone;
@@ -123,26 +123,26 @@ IPathfinder::IPath PathfinderWaypoint::FindRoute(const glm::vec3 &start, const g
if (result_start_n.size() == 0) {
return IPath();
}
std::vector<RTreeValue> result_end_n;
m_impl->Tree.query(boost::geometry::index::nearest(Point(end.x, end.y, end.z), 1), std::back_inserter(result_end_n));
if (result_end_n.size() == 0) {
return IPath();
}
auto &nearest_start = *result_start_n.begin();
auto &nearest_end = *result_end_n.begin();
if (nearest_start.second == nearest_end.second) {
IPath Route;
Route.push_back(start);
Route.push_back(end);
return Route;
}
std::vector<GraphType::vertex_descriptor> p(boost::num_vertices(m_impl->Graph));
try {
boost::astar_search(m_impl->Graph, nearest_start.second,
boost::astar_search(m_impl->Graph, nearest_start.second,
distance_heuristic<GraphType, float, Node*>(&m_impl->Nodes[0], nearest_end.second),
boost::predecessor_map(&p[0])
.visitor(astar_goal_visitor<size_t>(nearest_end.second)));
@@ -150,7 +150,7 @@ IPathfinder::IPath PathfinderWaypoint::FindRoute(const glm::vec3 &start, const g
catch (found_goal)
{
IPath Route;
Route.push_front(end);
for (size_t v = nearest_end.second;; v = p[v]) {
if (p[v] == v) {
@@ -159,7 +159,7 @@ IPathfinder::IPath PathfinderWaypoint::FindRoute(const glm::vec3 &start, const g
}
else {
auto &node = m_impl->Nodes[v];
auto iter = node.edges.find((int)p[v + 1]);
if (iter != node.edges.end()) {
auto &edge = iter->second;
@@ -176,11 +176,11 @@ IPathfinder::IPath PathfinderWaypoint::FindRoute(const glm::vec3 &start, const g
}
}
}
Route.push_front(start);
return Route;
}
return IPath();
}
@@ -192,7 +192,7 @@ glm::vec3 PathfinderWaypoint::GetRandomLocation(const glm::vec3 &start)
return node.v;
}
return glm::vec3();
}
@@ -205,32 +205,32 @@ void PathfinderWaypoint::DebugCommand(Client *c, const Seperator *sep)
c->Message(Chat::White, "#path info node_id: Gives information about node info (requires shownode target).");
return;
}
if(!strcasecmp(sep->arg[1], "shownodes"))
{
ShowNodes();
ShowNodes();
return;
}
if (!strcasecmp(sep->arg[1], "show"))
{
if (c->GetTarget() != nullptr) {
auto target = c->GetTarget();
glm::vec3 start(c->GetX(), c->GetY(), c->GetZ());
glm::vec3 end(target->GetX(), target->GetY(), target->GetZ());
ShowPath(c, start, end);
}
return;
}
if (!strcasecmp(sep->arg[1], "reload"))
{
Load(m_impl->FileName);
return;
}
if (!strcasecmp(sep->arg[1], "info"))
{
NodeInfo(c);
@@ -242,25 +242,25 @@ void PathfinderWaypoint::Load(const std::string &filename) {
PathFileHeader Head;
Head.PathNodeCount = 0;
Head.version = 2;
FILE *f = fopen(filename.c_str(), "rb");
if (f) {
char Magic[10];
fread(&Magic, 9, 1, f);
if (strncmp(Magic, "EQEMUPATH", 9))
{
LogError("Bad Magic String in .path file");
fclose(f);
return;
}
fread(&Head, sizeof(Head), 1, f);
LogInfo("Path File Header: Version [{}], PathNodes [{}]",
(long)Head.version, (long)Head.PathNodeCount);
if (Head.version == 2)
{
LoadV2(f, Head);
@@ -281,13 +281,13 @@ void PathfinderWaypoint::Load(const std::string &filename) {
void PathfinderWaypoint::LoadV2(FILE *f, const PathFileHeader &header)
{
std::unique_ptr<PathNode[]> PathNodes(new PathNode[header.PathNodeCount]);
fread(PathNodes.get(), sizeof(PathNode), header.PathNodeCount, f);
int MaxNodeID = header.PathNodeCount - 1;
m_impl->PathFileValid = true;
m_impl->Nodes.reserve(header.PathNodeCount);
for (uint32 i = 0; i < header.PathNodeCount; ++i)
{
@@ -298,7 +298,7 @@ void PathfinderWaypoint::LoadV2(FILE *f, const PathFileHeader &header)
node.bestz = n.bestz;
m_impl->Nodes.push_back(node);
}
auto weightmap = boost::get(boost::edge_weight, m_impl->Graph);
for (uint32 i = 0; i < header.PathNodeCount; ++i) {
for (uint32 j = 0; j < 50; ++j)
@@ -309,18 +309,18 @@ void PathfinderWaypoint::LoadV2(FILE *f, const PathFileHeader &header)
LogError("Path Node [{}], Neighbour [{}] ([{}]) out of range", i, j, PathNodes[i].Neighbours[j].id);
m_impl->PathFileValid = false;
}
if (PathNodes[i].Neighbours[j].id > 0) {
Edge edge;
edge.distance = PathNodes[i].Neighbours[j].distance;
edge.door_id = PathNodes[i].Neighbours[j].DoorID;
edge.teleport = PathNodes[i].Neighbours[j].Teleport;
node.edges[PathNodes[i].Neighbours[j].id] = edge;
}
}
}
BuildGraph();
fclose(f);
}
@@ -339,7 +339,7 @@ void PathfinderWaypoint::LoadV3(FILE *f, const PathFileHeader &header)
float y = 0.0f;
float z = 0.0f;
float best_z = 0.0f;
fread(&id, sizeof(uint32), 1, f);
fread(&x, sizeof(float), 1, f);
fread(&y, sizeof(float), 1, f);
@@ -352,7 +352,7 @@ void PathfinderWaypoint::LoadV3(FILE *f, const PathFileHeader &header)
n.v.x = x;
n.v.y = y;
n.v.z = z;
m_impl->Nodes.push_back(n);
}
@@ -377,10 +377,10 @@ void PathfinderWaypoint::LoadV3(FILE *f, const PathFileHeader &header)
auto &n = m_impl->Nodes[from];
n.edges[to] = e;
}
m_impl->PathFileValid = true;
BuildGraph();
BuildGraph();
fclose(f);
}
+1 -1
View File
@@ -3,7 +3,7 @@
#ifdef EMBPERL_XS_CLASSES
#include "../common/global_define.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "embperl.h"
#include "entity.h"
#include <list>
+1 -1
View File
@@ -33,7 +33,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/eq_packet_structs.h"
#include "../common/servertalk.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "entity.h"
#include "petitions.h"
+1 -1
View File
@@ -18,7 +18,7 @@
#include "../common/global_define.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/strings.h"
#include "../common/types.h"
#include "entity.h"

Some files were not shown because too many files have changed in this diff Show More