[Bug Fix] Fix FindCharacter Using content_db (#4956)

This commit is contained in:
Alex King 2025-06-26 19:35:11 -04:00 committed by GitHub
parent 389047c4e2
commit 76d46ceaf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,9 +4,9 @@
void FindCharacter(Client *c, const Seperator *sep) void FindCharacter(Client *c, const Seperator *sep)
{ {
if (sep->IsNumber(2)) { if (sep->IsNumber(2)) {
const auto character_id = Strings::ToUnsignedInt(sep->arg[2]); const uint32 character_id = Strings::ToUnsignedInt(sep->arg[2]);
const auto& e = CharacterDataRepository::FindOne(content_db, character_id); const auto& e = CharacterDataRepository::FindOne(database, character_id);
if (!e.id) { if (!e.id) {
c->Message( c->Message(
Chat::White, Chat::White,
@ -31,10 +31,10 @@ void FindCharacter(Client *c, const Seperator *sep)
return; return;
} }
const auto search_criteria = Strings::ToLower(sep->argplus[2]); const std::string& search_criteria = Strings::ToLower(sep->argplus[2]);
const auto& l = CharacterDataRepository::GetWhere( const auto& l = CharacterDataRepository::GetWhere(
content_db, database,
fmt::format( fmt::format(
"LOWER(`name`) LIKE '%%{}%%' AND `name` NOT LIKE '%-deleted-%' ORDER BY `id` ASC LIMIT 50", "LOWER(`name`) LIKE '%%{}%%' AND `name` NOT LIKE '%-deleted-%' ORDER BY `id` ASC LIMIT 50",
search_criteria search_criteria
@ -51,7 +51,7 @@ void FindCharacter(Client *c, const Seperator *sep)
); );
} }
auto found_count = 0; uint32 found_count = 0;
for (const auto& e : l) { for (const auto& e : l) {
c->Message( c->Message(