mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
GlobalInstance converted to QueryDatabase
This commit is contained in:
parent
167ce7829c
commit
22d06bc3d1
@ -2604,32 +2604,20 @@ void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||
|
||||
bool Database::GlobalInstance(uint16 instance_id)
|
||||
{
|
||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
||||
char *query = 0;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
bool ret;
|
||||
char *query = nullptr;
|
||||
|
||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT is_global from instance_list where id=%u LIMIT 1", instance_id), errbuf, &result))
|
||||
{
|
||||
auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT is_global from instance_list where id=%u LIMIT 1", instance_id));
|
||||
safe_delete_array(query);
|
||||
row = mysql_fetch_row(result);
|
||||
if(row)
|
||||
{
|
||||
ret = (atoi(row[0]) == 1) ? true : false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mysql_free_result(result);
|
||||
|
||||
if (!results.Success())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_delete_array(query);
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return false;
|
||||
}
|
||||
return ret;
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return (atoi(row[0]) == 1) ? true : false;
|
||||
}
|
||||
|
||||
void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user