mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 20:51:29 +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);
|
DumpPacket(app);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DumpPacket(app);
|
DumpPacket(app);
|
||||||
ItemViewRequest_Struct* ivrs = (ItemViewRequest_Struct*)app->pBuffer;
|
ItemViewRequest_Struct* ivrs = (ItemViewRequest_Struct*)app->pBuffer;
|
||||||
|
|
||||||
@ -3156,30 +3157,24 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
|
|||||||
silentsaylink = true;
|
silentsaylink = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sayid && sayid > 0)
|
if (sayid > 0)
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char *query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
|
|
||||||
|
std::string query = StringFormat("SELECT `phrase` FROM saylink WHERE `id` = '%i'", sayid);
|
||||||
if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT `phrase` FROM saylink WHERE `id` = '%i'", sayid),errbuf,&result))
|
auto results = database.QueryDatabase(query);
|
||||||
{
|
if (!results.Success()) {
|
||||||
if (mysql_num_rows(result) == 1)
|
Message(13, "Error: The saylink (%s) was not found in the database.", response.c_str());
|
||||||
{
|
|
||||||
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);
|
|
||||||
return;
|
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)
|
if((response).size() > 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user