use existing methods to validate name instead of raw sql

This commit is contained in:
catapultam-habeo
2024-02-15 12:31:52 -06:00
parent caf84310d4
commit 43750c6f4f
+1 -3
View File
@@ -643,9 +643,7 @@ bool Client::HandleGenerateRandomNamePacket(const EQApplicationPacket *app) {
if (len < 10) newName[len++] = c; if (len < 10) newName[len++] = c;
} }
std::string query = StringFormat("SELECT `name` FROM `character_data` WHERE `name` = '%s'", newName); if (!database.CheckNameFilter(newName) && !database.ReserveName(GetAccountID(), newName)) {
auto res = database.QueryDatabase(query);
if (!res.Success() || res.RowCount() == 0) {
unique = true; unique = true;
} }
} }