mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-26 17:52:34 +00:00
UpdateHotzone converted to QueryDatabase
This commit is contained in:
parent
19e04a1875
commit
5a6373c429
@ -2339,24 +2339,15 @@ uint32 Zone::GetSpawnKillCount(uint32 in_spawnid) {
|
|||||||
|
|
||||||
void Zone::UpdateHotzone()
|
void Zone::UpdateHotzone()
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("SELECT hotzone FROM zone WHERE short_name = '%s'", GetShortName());
|
||||||
char* query = 0;
|
auto results = database.QueryDatabase(query);
|
||||||
MYSQL_RES *result;
|
if (!results.Success())
|
||||||
MYSQL_ROW row;
|
return;
|
||||||
bool updh;
|
|
||||||
|
|
||||||
if(database.RunQuery(query, MakeAnyLenString(&query,"SELECT hotzone FROM zone WHERE short_name = '%s'", GetShortName()), errbuf, &result) )
|
if (results.RowCount() == 0)
|
||||||
{
|
return;
|
||||||
if( (row = mysql_fetch_row(result)) )
|
|
||||||
{
|
auto row = results.begin();
|
||||||
updh = atoi(row[0]) == 0 ? false:true;
|
|
||||||
//Hotzone status has changed
|
is_hotzone = atoi(row[0]) == 0 ? false: true;
|
||||||
if(is_hotzone != updh)
|
|
||||||
{
|
|
||||||
is_hotzone = updh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user