mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
GeneralQueryReceive converted to QueryDatabase
This commit is contained in:
parent
0a9732a267
commit
0438042844
@ -349,17 +349,16 @@ void Database::GeneralQueryReceive(ServerPacket *pack) {
|
|||||||
/*
|
/*
|
||||||
These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again
|
These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again
|
||||||
*/
|
*/
|
||||||
char *Query = nullptr;
|
char *queryBuffer = new char[pack->ReadUInt32() + 1];
|
||||||
Query = new char[pack->ReadUInt32() + 1];
|
pack->ReadString(queryBuffer);
|
||||||
pack->ReadString(Query);
|
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query(queryBuffer);
|
||||||
char* query = 0;
|
auto results = QueryDatabase(query);
|
||||||
uint32 lastid = 0;
|
if (!results.Success()) {
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, Query), errbuf, 0, 0, &lastid)) {
|
_log(QUERYSERV__ERROR, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str());
|
||||||
_log(QUERYSERV__ERROR, "Failed Delete Log Record Insert: %s", errbuf);
|
_log(QUERYSERV__ERROR, "%s", query.c_str());
|
||||||
_log(QUERYSERV__ERROR, "%s", query);
|
|
||||||
}
|
}
|
||||||
safe_delete_array(query);
|
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
safe_delete(Query);
|
safe_delete(queryBuffer);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user