mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 09:06:46 +00:00
use existing methods to validate name instead of raw sql
This commit is contained in:
+3
-5
@@ -643,11 +643,9 @@ 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);
|
unique = true;
|
||||||
if (!res.Success() || res.RowCount() == 0) {
|
}
|
||||||
unique = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NameGeneration_Struct* ngs = (NameGeneration_Struct*)app->pBuffer;
|
NameGeneration_Struct* ngs = (NameGeneration_Struct*)app->pBuffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user