From 43750c6f4f597864f3e433885f9e3f84144e3d65 Mon Sep 17 00:00:00 2001 From: catapultam-habeo <97849758+catapultam-habeo@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:31:52 -0600 Subject: [PATCH] use existing methods to validate name instead of raw sql --- world/client.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index eedec66d5..141663ea0 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -643,11 +643,9 @@ bool Client::HandleGenerateRandomNamePacket(const EQApplicationPacket *app) { if (len < 10) newName[len++] = c; } - std::string query = StringFormat("SELECT `name` FROM `character_data` WHERE `name` = '%s'", newName); - auto res = database.QueryDatabase(query); - if (!res.Success() || res.RowCount() == 0) { - unique = true; - } + if (!database.CheckNameFilter(newName) && !database.ReserveName(GetAccountID(), newName)) { + unique = true; + } } NameGeneration_Struct* ngs = (NameGeneration_Struct*)app->pBuffer;