[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
+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;
}