Update repositories

This commit is contained in:
Akkadius
2020-08-15 18:28:34 -05:00
parent bda13383ef
commit 3ffb5299a8
19 changed files with 1155 additions and 966 deletions
@@ -51,6 +51,7 @@ public:
int min_expansion;
int max_expansion;
std::string content_flags;
std::string content_flags_disabled;
};
static std::string PrimaryKey()
@@ -77,6 +78,7 @@ public:
"min_expansion",
"max_expansion",
"content_flags",
"content_flags_disabled",
};
}
@@ -127,22 +129,23 @@ public:
{
GlobalLoot entry{};
entry.id = 0;
entry.description = "";
entry.loottable_id = 0;
entry.enabled = 1;
entry.min_level = 0;
entry.max_level = 0;
entry.rare = 0;
entry.raid = 0;
entry.race = "";
entry.class = "";
entry.bodytype = "";
entry.zone = "";
entry.hot_zone = 0;
entry.min_expansion = 0;
entry.max_expansion = 0;
entry.content_flags = "";
entry.id = 0;
entry.description = "";
entry.loottable_id = 0;
entry.enabled = 1;
entry.min_level = 0;
entry.max_level = 0;
entry.rare = 0;
entry.raid = 0;
entry.race = "";
entry.class = "";
entry.bodytype = "";
entry.zone = "";
entry.hot_zone = 0;
entry.min_expansion = 0;
entry.max_expansion = 0;
entry.content_flags = "";
entry.content_flags_disabled = "";
return entry;
}
@@ -177,22 +180,23 @@ public:
if (results.RowCount() == 1) {
GlobalLoot entry{};
entry.id = atoi(row[0]);
entry.description = row[1] ? row[1] : "";
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8] ? row[8] : "";
entry.class = row[9] ? row[9] : "";
entry.bodytype = row[10] ? row[10] : "";
entry.zone = row[11] ? row[11] : "";
entry.hot_zone = atoi(row[12]);
entry.min_expansion = atoi(row[13]);
entry.max_expansion = atoi(row[14]);
entry.content_flags = row[15] ? row[15] : "";
entry.id = atoi(row[0]);
entry.description = row[1] ? row[1] : "";
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8] ? row[8] : "";
entry.class = row[9] ? row[9] : "";
entry.bodytype = row[10] ? row[10] : "";
entry.zone = row[11] ? row[11] : "";
entry.hot_zone = atoi(row[12]);
entry.min_expansion = atoi(row[13]);
entry.max_expansion = atoi(row[14]);
entry.content_flags = row[15] ? row[15] : "";
entry.content_flags_disabled = row[16] ? row[16] : "";
return entry;
}
@@ -239,6 +243,7 @@ public:
update_values.push_back(columns[13] + " = " + std::to_string(global_loot_entry.min_expansion));
update_values.push_back(columns[14] + " = " + std::to_string(global_loot_entry.max_expansion));
update_values.push_back(columns[15] + " = '" + EscapeString(global_loot_entry.content_flags) + "'");
update_values.push_back(columns[16] + " = '" + EscapeString(global_loot_entry.content_flags_disabled) + "'");
auto results = content_db.QueryDatabase(
fmt::format(
@@ -274,6 +279,7 @@ public:
insert_values.push_back(std::to_string(global_loot_entry.min_expansion));
insert_values.push_back(std::to_string(global_loot_entry.max_expansion));
insert_values.push_back("'" + EscapeString(global_loot_entry.content_flags) + "'");
insert_values.push_back("'" + EscapeString(global_loot_entry.content_flags_disabled) + "'");
auto results = content_db.QueryDatabase(
fmt::format(
@@ -317,6 +323,7 @@ public:
insert_values.push_back(std::to_string(global_loot_entry.min_expansion));
insert_values.push_back(std::to_string(global_loot_entry.max_expansion));
insert_values.push_back("'" + EscapeString(global_loot_entry.content_flags) + "'");
insert_values.push_back("'" + EscapeString(global_loot_entry.content_flags_disabled) + "'");
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@@ -350,22 +357,23 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GlobalLoot entry{};
entry.id = atoi(row[0]);
entry.description = row[1] ? row[1] : "";
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8] ? row[8] : "";
entry.class = row[9] ? row[9] : "";
entry.bodytype = row[10] ? row[10] : "";
entry.zone = row[11] ? row[11] : "";
entry.hot_zone = atoi(row[12]);
entry.min_expansion = atoi(row[13]);
entry.max_expansion = atoi(row[14]);
entry.content_flags = row[15] ? row[15] : "";
entry.id = atoi(row[0]);
entry.description = row[1] ? row[1] : "";
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8] ? row[8] : "";
entry.class = row[9] ? row[9] : "";
entry.bodytype = row[10] ? row[10] : "";
entry.zone = row[11] ? row[11] : "";
entry.hot_zone = atoi(row[12]);
entry.min_expansion = atoi(row[13]);
entry.max_expansion = atoi(row[14]);
entry.content_flags = row[15] ? row[15] : "";
entry.content_flags_disabled = row[16] ? row[16] : "";
all_entries.push_back(entry);
}
@@ -390,22 +398,23 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GlobalLoot entry{};
entry.id = atoi(row[0]);
entry.description = row[1] ? row[1] : "";
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8] ? row[8] : "";
entry.class = row[9] ? row[9] : "";
entry.bodytype = row[10] ? row[10] : "";
entry.zone = row[11] ? row[11] : "";
entry.hot_zone = atoi(row[12]);
entry.min_expansion = atoi(row[13]);
entry.max_expansion = atoi(row[14]);
entry.content_flags = row[15] ? row[15] : "";
entry.id = atoi(row[0]);
entry.description = row[1] ? row[1] : "";
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8] ? row[8] : "";
entry.class = row[9] ? row[9] : "";
entry.bodytype = row[10] ? row[10] : "";
entry.zone = row[11] ? row[11] : "";
entry.hot_zone = atoi(row[12]);
entry.min_expansion = atoi(row[13]);
entry.max_expansion = atoi(row[14]);
entry.content_flags = row[15] ? row[15] : "";
entry.content_flags_disabled = row[16] ? row[16] : "";
all_entries.push_back(entry);
}