mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-24 20:02:27 +00:00
GetCharactersInInstance converted to QueryDatabase
This commit is contained in:
parent
4f4f9e8eb3
commit
0ea1010e3f
@ -2504,23 +2504,20 @@ uint16 Database::GetInstanceID(uint32 zone, uint32 charid, int16 version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &charid_list) {
|
void Database::GetCharactersInInstance(uint16 instance_id, std::list<uint32> &charid_list) {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char *query = nullptr;
|
||||||
char *query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
|
|
||||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT charid FROM instance_list_player WHERE id=%u", instance_id), errbuf, &result)) {
|
auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT charid FROM instance_list_player WHERE id=%u", instance_id));
|
||||||
safe_delete_array(query);
|
|
||||||
while ((row = mysql_fetch_row(result)))
|
if (!results.Success())
|
||||||
{
|
{
|
||||||
charid_list.push_back(atoi(row[0]));
|
LogFile->write(EQEMuLog::Error, "Error in GetCharactersInInstace query '%s': %s", query, results.ErrorMessage().c_str());
|
||||||
}
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LogFile->write(EQEMuLog::Error, "Error in GetCharactersInInstace query '%s': %s", query, errbuf);
|
|
||||||
safe_delete_array(query);
|
safe_delete_array(query);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
safe_delete_array(query);
|
||||||
|
|
||||||
|
for(auto row=results.begin();row != results.end();++row)
|
||||||
|
charid_list.push_back(atoi(row[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::AssignGroupToInstance(uint32 gid, uint32 instance_id)
|
void Database::AssignGroupToInstance(uint32 gid, uint32 instance_id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user