mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-06 06:12:29 +00:00
LoadAdventureFlavor converted to QueryDatabase
This commit is contained in:
parent
2bc58a97bc
commit
cee4a3f475
@ -2192,28 +2192,18 @@ void Zone::DeleteQGlobal(std::string name, uint32 npcID, uint32 charID, uint32 z
|
|||||||
|
|
||||||
void Zone::LoadAdventureFlavor()
|
void Zone::LoadAdventureFlavor()
|
||||||
{
|
{
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
const std::string query = "SELECT id, text FROM adventure_template_entry_flavor";
|
||||||
char* query = 0;
|
auto results = database.QueryDatabase(query);
|
||||||
MYSQL_RES *result;
|
if (!results.Success()) {
|
||||||
MYSQL_ROW row;
|
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str());
|
||||||
|
|
||||||
if(database.RunQuery(query,MakeAnyLenString(&query,"SELECT id, text FROM adventure_template_entry_flavor"), errbuf, &result))
|
|
||||||
{
|
|
||||||
while((row = mysql_fetch_row(result)))
|
|
||||||
{
|
|
||||||
uint32 id = atoi(row[0]);
|
|
||||||
std::string in_str = row[1];
|
|
||||||
adventure_entry_list_flavor[id] = in_str;
|
|
||||||
}
|
|
||||||
mysql_free_result(result);
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogFile->write(EQEMuLog::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query, errbuf);
|
|
||||||
safe_delete_array(query);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
uint32 id = atoi(row[0]);
|
||||||
|
adventure_entry_list_flavor[id] = row[1];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Zone::DoAdventureCountIncrease()
|
void Zone::DoAdventureCountIncrease()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user