mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21: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)
|
bool Database::GlobalInstance(uint16 instance_id)
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
char *query = nullptr;
|
||||||
char *query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
bool ret;
|
|
||||||
|
|
||||||
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);
|
safe_delete_array(query);
|
||||||
row = mysql_fetch_row(result);
|
|
||||||
if(row)
|
if (!results.Success())
|
||||||
{
|
|
||||||
ret = (atoi(row[0]) == 1) ? true : false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mysql_free_result(result);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
if (results.RowCount() == 0)
|
||||||
else
|
|
||||||
{
|
|
||||||
safe_delete_array(query);
|
|
||||||
return false;
|
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)
|
void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user