Explicitly pass database pointers to repository methods

This commit is contained in:
Akkadius
2021-02-05 23:00:27 -06:00
parent 7fe0bbacd4
commit e8ab176d4a
167 changed files with 2738 additions and 1938 deletions
+1 -1
View File
@@ -3447,7 +3447,7 @@ bool TaskGoalListManager::LoadLists()
list_index++;
}
auto goal_lists = GoallistsRepository::GetWhere("TRUE ORDER BY listid, entry ASC");
auto goal_lists = GoallistsRepository::GetWhere(content_db, "TRUE ORDER BY listid, entry ASC");
for (list_index = 0; list_index < NumberOfLists; list_index++) {
+1 -1
View File
@@ -1582,7 +1582,7 @@ void Client::LearnRecipe(uint32 recipe_id)
return;
}
auto tradeskill_recipe = TradeskillRecipeRepository::FindOne(recipe_id);
auto tradeskill_recipe = TradeskillRecipeRepository::FindOne(content_db, recipe_id);
if (tradeskill_recipe.id == 0) {
LogError("Invalid recipe [{}]", recipe_id);
return;
+1 -1
View File
@@ -1979,7 +1979,7 @@ bool ZoneDatabase::LoadStaticZonePoints(LinkedList<ZonePoint *> *zone_point_list
zone->numzonepoints = 0;
zone->virtual_zone_point_list.clear();
auto zone_points = ZonePointsRepository::GetWhere(
auto zone_points = ZonePointsRepository::GetWhere(content_db,
fmt::format(
"zone = '{}' AND (version = {} OR version = -1) {} ORDER BY number",
zonename,
+5 -5
View File
@@ -27,7 +27,7 @@ ZoneStore::~ZoneStore() = default;
void ZoneStore::LoadZones()
{
zones = ZoneRepository::All();
zones = ZoneRepository::All(content_db);
}
/**
@@ -147,7 +147,7 @@ ZoneRepository::Zone ZoneStore::GetZone(const char *in_zone_name)
void ZoneStore::LoadContentFlags()
{
std::vector<std::string> set_content_flags;
auto content_flags = ContentFlagsRepository::GetWhere("enabled = 1");
auto content_flags = ContentFlagsRepository::GetWhere(database, "enabled = 1");
set_content_flags.reserve(content_flags.size());
for (auto &flags: content_flags) {
@@ -170,7 +170,7 @@ void ZoneStore::LoadContentFlags()
*/
void ZoneStore::SetContentFlag(const std::string &content_flag_name, bool enabled)
{
auto content_flags = ContentFlagsRepository::GetWhere(
auto content_flags = ContentFlagsRepository::GetWhere(database,
fmt::format("flag_name = '{}'", content_flag_name)
);
@@ -183,10 +183,10 @@ void ZoneStore::SetContentFlag(const std::string &content_flag_name, bool enable
content_flag.flag_name = content_flag_name;
if (!content_flags.empty()) {
ContentFlagsRepository::UpdateOne(content_flag);
ContentFlagsRepository::UpdateOne(database, content_flag);
}
else {
ContentFlagsRepository::InsertOne(content_flag);
ContentFlagsRepository::InsertOne(database, content_flag);
}
LoadContentFlags();
+1 -1
View File
@@ -313,7 +313,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) {
* In 99% of cases we would never get here and this would be fallback
*/
if (!found_zone) {
auto zones = ZoneRepository::GetWhere(
auto zones = ZoneRepository::GetWhere(content_db,
fmt::format(
"expansion <= {} AND short_name = '{}' and version = 0",
(content_service.GetCurrentExpansion() + 1),