[Bug] PR 3638 Missed the blocked spells repository updates (#3748)

Ran generator to update blocked_spells Repo
This commit is contained in:
Fryguy 2023-12-08 15:19:54 -05:00 committed by GitHub
parent 56c29154f0
commit 841d7f2700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@
#include "../../strings.h"
#include <ctime>
class BaseBlockedSpellsRepository {
public:
struct BlockedSpells {
@ -31,6 +32,10 @@ public:
float z_diff;
std::string message;
std::string description;
int8_t min_expansion;
int8_t max_expansion;
std::string content_flags;
std::string content_flags_disabled;
};
static std::string PrimaryKey()
@ -53,6 +58,10 @@ public:
"z_diff",
"message",
"description",
"min_expansion",
"max_expansion",
"content_flags",
"content_flags_disabled",
};
}
@ -71,6 +80,10 @@ public:
"z_diff",
"message",
"description",
"min_expansion",
"max_expansion",
"content_flags",
"content_flags_disabled",
};
}
@ -123,6 +136,10 @@ public:
e.z_diff = 0;
e.message = "";
e.description = "";
e.min_expansion = -1;
e.max_expansion = -1;
e.content_flags = "";
e.content_flags_disabled = "";
return e;
}
@ -148,8 +165,9 @@ public:
{
auto results = db.QueryDatabase(
fmt::format(
"{} WHERE id = {} LIMIT 1",
"{} WHERE {} = {} LIMIT 1",
BaseSelect(),
PrimaryKey(),
blocked_spells_id
)
);
@ -170,6 +188,10 @@ public:
e.z_diff = strtof(row[9], nullptr);
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
return e;
}
@ -214,6 +236,10 @@ public:
v.push_back(columns[9] + " = " + std::to_string(e.z_diff));
v.push_back(columns[10] + " = '" + Strings::Escape(e.message) + "'");
v.push_back(columns[11] + " = '" + Strings::Escape(e.description) + "'");
v.push_back(columns[12] + " = " + std::to_string(e.min_expansion));
v.push_back(columns[13] + " = " + std::to_string(e.max_expansion));
v.push_back(columns[14] + " = '" + Strings::Escape(e.content_flags) + "'");
v.push_back(columns[15] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
auto results = db.QueryDatabase(
fmt::format(
@ -247,6 +273,10 @@ public:
v.push_back(std::to_string(e.z_diff));
v.push_back("'" + Strings::Escape(e.message) + "'");
v.push_back("'" + Strings::Escape(e.description) + "'");
v.push_back(std::to_string(e.min_expansion));
v.push_back(std::to_string(e.max_expansion));
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
auto results = db.QueryDatabase(
fmt::format(
@ -288,6 +318,10 @@ public:
v.push_back(std::to_string(e.z_diff));
v.push_back("'" + Strings::Escape(e.message) + "'");
v.push_back("'" + Strings::Escape(e.description) + "'");
v.push_back(std::to_string(e.min_expansion));
v.push_back(std::to_string(e.max_expansion));
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
@ -333,6 +367,10 @@ public:
e.z_diff = strtof(row[9], nullptr);
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
all_entries.push_back(e);
}
@ -369,6 +407,10 @@ public:
e.z_diff = strtof(row[9], nullptr);
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
all_entries.push_back(e);
}