mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 00:01:28 +00:00
Handle_OP_ItemLinkClick converted to QueryDatabase
This commit is contained in:
parent
b36cc3ab08
commit
c851cd3f12
@ -3137,6 +3137,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
|
||||
DumpPacket(app);
|
||||
return;
|
||||
}
|
||||
|
||||
DumpPacket(app);
|
||||
ItemViewRequest_Struct* ivrs = (ItemViewRequest_Struct*)app->pBuffer;
|
||||
|
||||
@ -3156,30 +3157,24 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
|
||||
silentsaylink = true;
|
||||
}
|
||||
|
||||
if (sayid && sayid > 0)
|
||||
if (sayid > 0)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
|
||||
|
||||
if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT `phrase` FROM saylink WHERE `id` = '%i'", sayid),errbuf,&result))
|
||||
{
|
||||
if (mysql_num_rows(result) == 1)
|
||||
{
|
||||
row = mysql_fetch_row(result);
|
||||
response = row[0];
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
Message(13, "Error: The saylink (%s) was not found in the database.",response.c_str());
|
||||
safe_delete_array(query);
|
||||
std::string query = StringFormat("SELECT `phrase` FROM saylink WHERE `id` = '%i'", sayid);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
Message(13, "Error: The saylink (%s) was not found in the database.", response.c_str());
|
||||
return;
|
||||
}
|
||||
safe_delete_array(query);
|
||||
|
||||
if (results.RowCount() != 1) {
|
||||
Message(13, "Error: The saylink (%s) was not found in the database.", response.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
response = row[0];
|
||||
|
||||
}
|
||||
|
||||
if((response).size() > 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user