mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 04:11:30 +00:00
LoadAlternateCurrencies converted to QueryDatabase
This commit is contained in:
parent
2eb270376f
commit
2bc58a97bc
@ -2141,30 +2141,23 @@ void Zone::LoadVeteranRewards()
|
|||||||
void Zone::LoadAlternateCurrencies()
|
void Zone::LoadAlternateCurrencies()
|
||||||
{
|
{
|
||||||
AlternateCurrencies.clear();
|
AlternateCurrencies.clear();
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char* query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
AltCurrencyDefinition_Struct current_currency;
|
AltCurrencyDefinition_Struct current_currency;
|
||||||
|
|
||||||
if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT id, item_id from alternate_currency"),
|
const std::string query = "SELECT id, item_id FROM alternate_currency";
|
||||||
errbuf,&result))
|
auto results = database.QueryDatabase(query);
|
||||||
{
|
if (!results.Success()) {
|
||||||
while((row = mysql_fetch_row(result)))
|
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
{
|
return;
|
||||||
current_currency.id = atoi(row[0]);
|
}
|
||||||
current_currency.item_id = atoi(row[1]);
|
|
||||||
AlternateCurrencies.push_back(current_currency);
|
for (auto row = results.begin(); row != results.end(); ++row)
|
||||||
}
|
{
|
||||||
|
current_currency.id = atoi(row[0]);
|
||||||
|
current_currency.item_id = atoi(row[1]);
|
||||||
|
AlternateCurrencies.push_back(current_currency);
|
||||||
|
}
|
||||||
|
|
||||||
mysql_free_result(result);
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query, errbuf);
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zone::UpdateQGlobal(uint32 qid, QGlobal newGlobal)
|
void Zone::UpdateQGlobal(uint32 qid, QGlobal newGlobal)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user