diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 34be1121a..e77ed1a08 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -132,10 +132,8 @@ SET(repositories repositories/base/base_adventure_template_entry_flavor_repository.h repositories/base/base_alternate_currency_repository.h repositories/base/base_auras_repository.h - repositories/base/base_banned_ips_repository.h repositories/base/base_base_data_repository.h repositories/base/base_blocked_spells_repository.h - repositories/base/base_books_repository.h repositories/base/base_bugs_repository.h repositories/base/base_bug_reports_repository.h repositories/base/base_buyer_repository.h @@ -164,12 +162,9 @@ SET(repositories repositories/base/base_character_skills_repository.h repositories/base/base_character_spells_repository.h repositories/base/base_character_tasks_repository.h - repositories/base/base_character_tribute_repository.h repositories/base/base_char_create_combinations_repository.h repositories/base/base_char_create_point_allocations_repository.h repositories/base/base_char_recipe_list_repository.h - repositories/base/base_chatchannels_repository.h - repositories/base/base_command_settings_repository.h repositories/base/base_completed_tasks_repository.h repositories/base/base_data_buckets_repository.h repositories/base/base_db_str_repository.h @@ -197,7 +192,6 @@ SET(repositories repositories/base/base_guild_ranks_repository.h repositories/base/base_guild_relations_repository.h repositories/base/base_hackers_repository.h - repositories/base/base_horses_repository.h repositories/base/base_instance_list_repository.h repositories/base/base_instance_list_player_repository.h repositories/base/base_inventory_repository.h @@ -205,8 +199,6 @@ SET(repositories repositories/base/base_ip_exemptions_repository.h repositories/base/base_items_repository.h repositories/base/base_item_tick_repository.h - repositories/base/base_launcher_repository.h - repositories/base/base_launcher_zones_repository.h repositories/base/base_ldon_trap_entries_repository.h repositories/base/base_ldon_trap_templates_repository.h repositories/base/base_level_exp_mods_repository.h @@ -297,10 +289,8 @@ SET(repositories repositories/adventure_template_entry_flavor_repository.h repositories/alternate_currency_repository.h repositories/auras_repository.h - repositories/banned_ips_repository.h repositories/base_data_repository.h repositories/blocked_spells_repository.h - repositories/books_repository.h repositories/bugs_repository.h repositories/bug_reports_repository.h repositories/buyer_repository.h @@ -329,12 +319,9 @@ SET(repositories repositories/character_skills_repository.h repositories/character_spells_repository.h repositories/character_tasks_repository.h - repositories/character_tribute_repository.h repositories/char_create_combinations_repository.h repositories/char_create_point_allocations_repository.h repositories/char_recipe_list_repository.h - repositories/chatchannels_repository.h - repositories/command_settings_repository.h repositories/completed_tasks_repository.h repositories/data_buckets_repository.h repositories/db_str_repository.h @@ -362,7 +349,6 @@ SET(repositories repositories/guild_ranks_repository.h repositories/guild_relations_repository.h repositories/hackers_repository.h - repositories/horses_repository.h repositories/instance_list_repository.h repositories/instance_list_player_repository.h repositories/inventory_repository.h @@ -370,8 +356,6 @@ SET(repositories repositories/ip_exemptions_repository.h repositories/items_repository.h repositories/item_tick_repository.h - repositories/launcher_repository.h - repositories/launcher_zones_repository.h repositories/ldon_trap_entries_repository.h repositories/ldon_trap_templates_repository.h repositories/level_exp_mods_repository.h diff --git a/common/repositories/banned_ips_repository.h b/common/repositories/banned_ips_repository.h deleted file mode 100644 index 4610a6575..000000000 --- a/common/repositories/banned_ips_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_BANNED_IPS_REPOSITORY_H -#define EQEMU_BANNED_IPS_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_banned_ips_repository.h" - -class BannedIpsRepository: public BaseBannedIpsRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * BannedIpsRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * BannedIpsRepository::GetWhereNeverExpires() - * BannedIpsRepository::GetWhereXAndY() - * BannedIpsRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_BANNED_IPS_REPOSITORY_H diff --git a/common/repositories/base/base_aa_ability_repository.h b/common/repositories/base/base_aa_ability_repository.h index 3fbc3eeee..bd013a0c2 100644 --- a/common/repositories/base/base_aa_ability_repository.h +++ b/common/repositories/base/base_aa_ability_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -216,6 +216,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(aa_ability_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(aa_ability_entry.name) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(aa_ability_entry.category)); update_values.push_back(columns[3] + " = " + std::to_string(aa_ability_entry.classes)); @@ -249,6 +250,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(aa_ability_entry.id)); insert_values.push_back("'" + EscapeString(aa_ability_entry.name) + "'"); insert_values.push_back(std::to_string(aa_ability_entry.category)); insert_values.push_back(std::to_string(aa_ability_entry.classes)); @@ -290,6 +292,7 @@ public: for (auto &aa_ability_entry: aa_ability_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(aa_ability_entry.id)); insert_values.push_back("'" + EscapeString(aa_ability_entry.name) + "'"); insert_values.push_back(std::to_string(aa_ability_entry.category)); insert_values.push_back(std::to_string(aa_ability_entry.classes)); diff --git a/common/repositories/base/base_aa_rank_effects_repository.h b/common/repositories/base/base_aa_rank_effects_repository.h index 8744febbe..75b8063b2 100644 --- a/common/repositories/base/base_aa_rank_effects_repository.h +++ b/common/repositories/base/base_aa_rank_effects_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("rank_id"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &aa_rank_effects : aa_rank_effectss) { - if (aa_rank_effects.slot == aa_rank_effects_id) { + if (aa_rank_effects.rank_id == aa_rank_effects_id) { return aa_rank_effects; } } @@ -180,6 +180,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(aa_rank_effects_entry.rank_id)); + update_values.push_back(columns[1] + " = " + std::to_string(aa_rank_effects_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(aa_rank_effects_entry.effect_id)); update_values.push_back(columns[3] + " = " + std::to_string(aa_rank_effects_entry.base1)); update_values.push_back(columns[4] + " = " + std::to_string(aa_rank_effects_entry.base2)); @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - aa_rank_effects_entry.slot + aa_rank_effects_entry.rank_id ) ); @@ -203,6 +205,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(aa_rank_effects_entry.rank_id)); + insert_values.push_back(std::to_string(aa_rank_effects_entry.slot)); insert_values.push_back(std::to_string(aa_rank_effects_entry.effect_id)); insert_values.push_back(std::to_string(aa_rank_effects_entry.base1)); insert_values.push_back(std::to_string(aa_rank_effects_entry.base2)); @@ -216,7 +220,7 @@ public: ); if (results.Success()) { - aa_rank_effects_entry.id = results.LastInsertedID(); + aa_rank_effects_entry.rank_id = results.LastInsertedID(); return aa_rank_effects_entry; } @@ -234,6 +238,8 @@ public: for (auto &aa_rank_effects_entry: aa_rank_effects_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(aa_rank_effects_entry.rank_id)); + insert_values.push_back(std::to_string(aa_rank_effects_entry.slot)); insert_values.push_back(std::to_string(aa_rank_effects_entry.effect_id)); insert_values.push_back(std::to_string(aa_rank_effects_entry.base1)); insert_values.push_back(std::to_string(aa_rank_effects_entry.base2)); diff --git a/common/repositories/base/base_aa_rank_prereqs_repository.h b/common/repositories/base/base_aa_rank_prereqs_repository.h index 194917b34..c3cc5f6c3 100644 --- a/common/repositories/base/base_aa_rank_prereqs_repository.h +++ b/common/repositories/base/base_aa_rank_prereqs_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("aa_id"); + return std::string("rank_id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &aa_rank_prereqs : aa_rank_prereqss) { - if (aa_rank_prereqs.aa_id == aa_rank_prereqs_id) { + if (aa_rank_prereqs.rank_id == aa_rank_prereqs_id) { return aa_rank_prereqs; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(aa_rank_prereqs_entry.rank_id)); + update_values.push_back(columns[1] + " = " + std::to_string(aa_rank_prereqs_entry.aa_id)); update_values.push_back(columns[2] + " = " + std::to_string(aa_rank_prereqs_entry.points)); auto results = content_db.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - aa_rank_prereqs_entry.aa_id + aa_rank_prereqs_entry.rank_id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(aa_rank_prereqs_entry.rank_id)); + insert_values.push_back(std::to_string(aa_rank_prereqs_entry.aa_id)); insert_values.push_back(std::to_string(aa_rank_prereqs_entry.points)); auto results = content_db.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - aa_rank_prereqs_entry.id = results.LastInsertedID(); + aa_rank_prereqs_entry.rank_id = results.LastInsertedID(); return aa_rank_prereqs_entry; } @@ -222,6 +226,8 @@ public: for (auto &aa_rank_prereqs_entry: aa_rank_prereqs_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(aa_rank_prereqs_entry.rank_id)); + insert_values.push_back(std::to_string(aa_rank_prereqs_entry.aa_id)); insert_values.push_back(std::to_string(aa_rank_prereqs_entry.points)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_aa_ranks_repository.h b/common/repositories/base/base_aa_ranks_repository.h index d8a7624d5..1561f7b8a 100644 --- a/common/repositories/base/base_aa_ranks_repository.h +++ b/common/repositories/base/base_aa_ranks_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -212,6 +212,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(aa_ranks_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(aa_ranks_entry.upper_hotkey_sid)); update_values.push_back(columns[2] + " = " + std::to_string(aa_ranks_entry.lower_hotkey_sid)); update_values.push_back(columns[3] + " = " + std::to_string(aa_ranks_entry.title_sid)); @@ -244,6 +245,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(aa_ranks_entry.id)); insert_values.push_back(std::to_string(aa_ranks_entry.upper_hotkey_sid)); insert_values.push_back(std::to_string(aa_ranks_entry.lower_hotkey_sid)); insert_values.push_back(std::to_string(aa_ranks_entry.title_sid)); @@ -284,6 +286,7 @@ public: for (auto &aa_ranks_entry: aa_ranks_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(aa_ranks_entry.id)); insert_values.push_back(std::to_string(aa_ranks_entry.upper_hotkey_sid)); insert_values.push_back(std::to_string(aa_ranks_entry.lower_hotkey_sid)); insert_values.push_back(std::to_string(aa_ranks_entry.title_sid)); diff --git a/common/repositories/base/base_account_flags_repository.h b/common/repositories/base/base_account_flags_repository.h index 36a4f7f7c..bd60b5856 100644 --- a/common/repositories/base/base_account_flags_repository.h +++ b/common/repositories/base/base_account_flags_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("p_flag"); + return std::string("p_accid"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &account_flags : account_flagss) { - if (account_flags.p_flag == account_flags_id) { + if (account_flags.p_accid == account_flags_id) { return account_flags; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(account_flags_entry.p_accid)); + update_values.push_back(columns[1] + " = '" + EscapeString(account_flags_entry.p_flag) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(account_flags_entry.p_value) + "'"); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - account_flags_entry.p_flag + account_flags_entry.p_accid ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(account_flags_entry.p_accid)); + insert_values.push_back("'" + EscapeString(account_flags_entry.p_flag) + "'"); insert_values.push_back("'" + EscapeString(account_flags_entry.p_value) + "'"); auto results = database.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - account_flags_entry.id = results.LastInsertedID(); + account_flags_entry.p_accid = results.LastInsertedID(); return account_flags_entry; } @@ -222,6 +226,8 @@ public: for (auto &account_flags_entry: account_flags_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(account_flags_entry.p_accid)); + insert_values.push_back("'" + EscapeString(account_flags_entry.p_flag) + "'"); insert_values.push_back("'" + EscapeString(account_flags_entry.p_value) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_account_ip_repository.h b/common/repositories/base/base_account_ip_repository.h index c85b90c81..a179590fe 100644 --- a/common/repositories/base/base_account_ip_repository.h +++ b/common/repositories/base/base_account_ip_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("ip"); + return std::string("accid"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &account_ip : account_ips) { - if (account_ip.ip == account_ip_id) { + if (account_ip.accid == account_ip_id) { return account_ip; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(account_ip_entry.accid)); + update_values.push_back(columns[1] + " = '" + EscapeString(account_ip_entry.ip) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(account_ip_entry.count)); update_values.push_back(columns[3] + " = '" + EscapeString(account_ip_entry.lastused) + "'"); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - account_ip_entry.ip + account_ip_entry.accid ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(account_ip_entry.accid)); + insert_values.push_back("'" + EscapeString(account_ip_entry.ip) + "'"); insert_values.push_back(std::to_string(account_ip_entry.count)); insert_values.push_back("'" + EscapeString(account_ip_entry.lastused) + "'"); @@ -210,7 +214,7 @@ public: ); if (results.Success()) { - account_ip_entry.id = results.LastInsertedID(); + account_ip_entry.accid = results.LastInsertedID(); return account_ip_entry; } @@ -228,6 +232,8 @@ public: for (auto &account_ip_entry: account_ip_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(account_ip_entry.accid)); + insert_values.push_back("'" + EscapeString(account_ip_entry.ip) + "'"); insert_values.push_back(std::to_string(account_ip_entry.count)); insert_values.push_back("'" + EscapeString(account_ip_entry.lastused) + "'"); diff --git a/common/repositories/base/base_account_repository.h b/common/repositories/base/base_account_repository.h index 3434a9c9f..772ddc45e 100644 --- a/common/repositories/base/base_account_repository.h +++ b/common/repositories/base/base_account_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_account_rewards_repository.h b/common/repositories/base/base_account_rewards_repository.h index 06120dffb..a2ef9ba9d 100644 --- a/common/repositories/base/base_account_rewards_repository.h +++ b/common/repositories/base/base_account_rewards_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("reward_id"); + return std::string("account_id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &account_rewards : account_rewardss) { - if (account_rewards.reward_id == account_rewards_id) { + if (account_rewards.account_id == account_rewards_id) { return account_rewards; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(account_rewards_entry.account_id)); + update_values.push_back(columns[1] + " = " + std::to_string(account_rewards_entry.reward_id)); update_values.push_back(columns[2] + " = " + std::to_string(account_rewards_entry.amount)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - account_rewards_entry.reward_id + account_rewards_entry.account_id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(account_rewards_entry.account_id)); + insert_values.push_back(std::to_string(account_rewards_entry.reward_id)); insert_values.push_back(std::to_string(account_rewards_entry.amount)); auto results = database.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - account_rewards_entry.id = results.LastInsertedID(); + account_rewards_entry.account_id = results.LastInsertedID(); return account_rewards_entry; } @@ -222,6 +226,8 @@ public: for (auto &account_rewards_entry: account_rewards_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(account_rewards_entry.account_id)); + insert_values.push_back(std::to_string(account_rewards_entry.reward_id)); insert_values.push_back(std::to_string(account_rewards_entry.amount)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_adventure_details_repository.h b/common/repositories/base/base_adventure_details_repository.h index d5ffbecc0..c5b1595fd 100644 --- a/common/repositories/base/base_adventure_details_repository.h +++ b/common/repositories/base/base_adventure_details_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_adventure_members_repository.h b/common/repositories/base/base_adventure_members_repository.h index 0636da1ec..c99f51bd3 100644 --- a/common/repositories/base/base_adventure_members_repository.h +++ b/common/repositories/base/base_adventure_members_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -169,6 +169,7 @@ public: auto columns = Columns(); update_values.push_back(columns[0] + " = " + std::to_string(adventure_members_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(adventure_members_entry.charid)); auto results = database.QueryDatabase( fmt::format( @@ -190,6 +191,7 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(adventure_members_entry.id)); + insert_values.push_back(std::to_string(adventure_members_entry.charid)); auto results = database.QueryDatabase( fmt::format( @@ -200,7 +202,7 @@ public: ); if (results.Success()) { - adventure_members_entry.id = results.LastInsertedID(); + adventure_members_entry.charid = results.LastInsertedID(); return adventure_members_entry; } @@ -219,6 +221,7 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(adventure_members_entry.id)); + insert_values.push_back(std::to_string(adventure_members_entry.charid)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_adventure_stats_repository.h b/common/repositories/base/base_adventure_stats_repository.h index fbd571bc9..03a3b6255 100644 --- a/common/repositories/base/base_adventure_stats_repository.h +++ b/common/repositories/base/base_adventure_stats_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -204,6 +204,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(adventure_stats_entry.player_id)); update_values.push_back(columns[1] + " = " + std::to_string(adventure_stats_entry.guk_wins)); update_values.push_back(columns[2] + " = " + std::to_string(adventure_stats_entry.mir_wins)); update_values.push_back(columns[3] + " = " + std::to_string(adventure_stats_entry.mmc_wins)); @@ -234,6 +235,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(adventure_stats_entry.player_id)); insert_values.push_back(std::to_string(adventure_stats_entry.guk_wins)); insert_values.push_back(std::to_string(adventure_stats_entry.mir_wins)); insert_values.push_back(std::to_string(adventure_stats_entry.mmc_wins)); @@ -254,7 +256,7 @@ public: ); if (results.Success()) { - adventure_stats_entry.id = results.LastInsertedID(); + adventure_stats_entry.player_id = results.LastInsertedID(); return adventure_stats_entry; } @@ -272,6 +274,7 @@ public: for (auto &adventure_stats_entry: adventure_stats_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(adventure_stats_entry.player_id)); insert_values.push_back(std::to_string(adventure_stats_entry.guk_wins)); insert_values.push_back(std::to_string(adventure_stats_entry.mir_wins)); insert_values.push_back(std::to_string(adventure_stats_entry.mmc_wins)); diff --git a/common/repositories/base/base_adventure_template_entry_flavor_repository.h b/common/repositories/base/base_adventure_template_entry_flavor_repository.h index 0aec523ed..b1099d0c4 100644 --- a/common/repositories/base/base_adventure_template_entry_flavor_repository.h +++ b/common/repositories/base/base_adventure_template_entry_flavor_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -168,6 +168,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(adventure_template_entry_flavor_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(adventure_template_entry_flavor_entry.text) + "'"); auto results = content_db.QueryDatabase( @@ -189,6 +190,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(adventure_template_entry_flavor_entry.id)); insert_values.push_back("'" + EscapeString(adventure_template_entry_flavor_entry.text) + "'"); auto results = content_db.QueryDatabase( @@ -218,6 +220,7 @@ public: for (auto &adventure_template_entry_flavor_entry: adventure_template_entry_flavor_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(adventure_template_entry_flavor_entry.id)); insert_values.push_back("'" + EscapeString(adventure_template_entry_flavor_entry.text) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_adventure_template_entry_repository.h b/common/repositories/base/base_adventure_template_entry_repository.h index 64799c3bf..e44adb4e4 100644 --- a/common/repositories/base/base_adventure_template_entry_repository.h +++ b/common/repositories/base/base_adventure_template_entry_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -41,7 +41,7 @@ public: static std::string PrimaryKey() { - return std::string("template_id"); + return std::string("id"); } static std::vector Columns() @@ -111,7 +111,7 @@ public: ) { for (auto &adventure_template_entry : adventure_template_entrys) { - if (adventure_template_entry.template_id == adventure_template_entry_id) { + if (adventure_template_entry.id == adventure_template_entry_id) { return adventure_template_entry; } } @@ -168,7 +168,8 @@ public: auto columns = Columns(); - + update_values.push_back(columns[0] + " = " + std::to_string(adventure_template_entry_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(adventure_template_entry_entry.template_id)); auto results = content_db.QueryDatabase( fmt::format( @@ -176,7 +177,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - adventure_template_entry_entry.template_id + adventure_template_entry_entry.id ) ); @@ -189,7 +190,8 @@ public: { std::vector insert_values; - + insert_values.push_back(std::to_string(adventure_template_entry_entry.id)); + insert_values.push_back(std::to_string(adventure_template_entry_entry.template_id)); auto results = content_db.QueryDatabase( fmt::format( @@ -218,7 +220,8 @@ public: for (auto &adventure_template_entry_entry: adventure_template_entry_entries) { std::vector insert_values; - + insert_values.push_back(std::to_string(adventure_template_entry_entry.id)); + insert_values.push_back(std::to_string(adventure_template_entry_entry.template_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_adventure_template_repository.h b/common/repositories/base/base_adventure_template_repository.h index d93f46bf4..d95baa339 100644 --- a/common/repositories/base/base_adventure_template_repository.h +++ b/common/repositories/base/base_adventure_template_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -292,6 +292,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(adventure_template_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(adventure_template_entry.zone) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(adventure_template_entry.zone_version)); update_values.push_back(columns[3] + " = " + std::to_string(adventure_template_entry.is_hard)); @@ -344,6 +345,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(adventure_template_entry.id)); insert_values.push_back("'" + EscapeString(adventure_template_entry.zone) + "'"); insert_values.push_back(std::to_string(adventure_template_entry.zone_version)); insert_values.push_back(std::to_string(adventure_template_entry.is_hard)); @@ -404,6 +406,7 @@ public: for (auto &adventure_template_entry: adventure_template_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(adventure_template_entry.id)); insert_values.push_back("'" + EscapeString(adventure_template_entry.zone) + "'"); insert_values.push_back(std::to_string(adventure_template_entry.zone_version)); insert_values.push_back(std::to_string(adventure_template_entry.is_hard)); diff --git a/common/repositories/base/base_alternate_currency_repository.h b/common/repositories/base/base_alternate_currency_repository.h index 07fc1e489..ff6b98a09 100644 --- a/common/repositories/base/base_alternate_currency_repository.h +++ b/common/repositories/base/base_alternate_currency_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -168,6 +168,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(alternate_currency_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(alternate_currency_entry.item_id)); auto results = content_db.QueryDatabase( @@ -189,6 +190,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(alternate_currency_entry.id)); insert_values.push_back(std::to_string(alternate_currency_entry.item_id)); auto results = content_db.QueryDatabase( @@ -218,6 +220,7 @@ public: for (auto &alternate_currency_entry: alternate_currency_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(alternate_currency_entry.id)); insert_values.push_back(std::to_string(alternate_currency_entry.item_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_auras_repository.h b/common/repositories/base/base_auras_repository.h index a12523bbd..c2845bc49 100644 --- a/common/repositories/base/base_auras_repository.h +++ b/common/repositories/base/base_auras_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -204,6 +204,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(auras_entry.type)); update_values.push_back(columns[1] + " = " + std::to_string(auras_entry.npc_type)); update_values.push_back(columns[2] + " = '" + EscapeString(auras_entry.name) + "'"); update_values.push_back(columns[3] + " = " + std::to_string(auras_entry.spell_id)); @@ -234,6 +235,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(auras_entry.type)); insert_values.push_back(std::to_string(auras_entry.npc_type)); insert_values.push_back("'" + EscapeString(auras_entry.name) + "'"); insert_values.push_back(std::to_string(auras_entry.spell_id)); @@ -254,7 +256,7 @@ public: ); if (results.Success()) { - auras_entry.id = results.LastInsertedID(); + auras_entry.type = results.LastInsertedID(); return auras_entry; } @@ -272,6 +274,7 @@ public: for (auto &auras_entry: auras_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(auras_entry.type)); insert_values.push_back(std::to_string(auras_entry.npc_type)); insert_values.push_back("'" + EscapeString(auras_entry.name) + "'"); insert_values.push_back(std::to_string(auras_entry.spell_id)); diff --git a/common/repositories/base/base_banned_ips_repository.h b/common/repositories/base/base_banned_ips_repository.h deleted file mode 100644 index 9c0178b09..000000000 --- a/common/repositories/base/base_banned_ips_repository.h +++ /dev/null @@ -1,306 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - */ - -/** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to - * the repository extending the base. Any modifications to base repositories are to - * be made by the generator only - */ - -#ifndef EQEMU_BASE_BANNED_IPS_REPOSITORY_H -#define EQEMU_BASE_BANNED_IPS_REPOSITORY_H - -#include "../../database.h" -#include "../../string_util.h" - -class BaseBannedIpsRepository { -public: - struct BannedIps { - std::string ip_address; - std::string notes; - }; - - static std::string PrimaryKey() - { - return std::string("ip_address"); - } - - static std::vector Columns() - { - return { - "ip_address", - "notes", - }; - } - - static std::string ColumnsRaw() - { - return std::string(implode(", ", Columns())); - } - - static std::string InsertColumnsRaw() - { - std::vector insert_columns; - - for (auto &column : Columns()) { - if (column == PrimaryKey()) { - continue; - } - - insert_columns.push_back(column); - } - - return std::string(implode(", ", insert_columns)); - } - - static std::string TableName() - { - return std::string("banned_ips"); - } - - static std::string BaseSelect() - { - return fmt::format( - "SELECT {} FROM {}", - ColumnsRaw(), - TableName() - ); - } - - static std::string BaseInsert() - { - return fmt::format( - "INSERT INTO {} ({}) ", - TableName(), - InsertColumnsRaw() - ); - } - - static BannedIps NewEntity() - { - BannedIps entry{}; - - entry.ip_address = ""; - entry.notes = ""; - - return entry; - } - - static BannedIps GetBannedIpsEntry( - const std::vector &banned_ipss, - int banned_ips_id - ) - { - for (auto &banned_ips : banned_ipss) { - if (banned_ips.ip_address == banned_ips_id) { - return banned_ips; - } - } - - return NewEntity(); - } - - static BannedIps FindOne( - int banned_ips_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE id = {} LIMIT 1", - BaseSelect(), - banned_ips_id - ) - ); - - auto row = results.begin(); - if (results.RowCount() == 1) { - BannedIps entry{}; - - entry.ip_address = row[0] ? row[0] : ""; - entry.notes = row[1] ? row[1] : ""; - - return entry; - } - - return NewEntity(); - } - - static int DeleteOne( - int banned_ips_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {} = {}", - TableName(), - PrimaryKey(), - banned_ips_id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static int UpdateOne( - BannedIps banned_ips_entry - ) - { - std::vector update_values; - - auto columns = Columns(); - - update_values.push_back(columns[1] + " = '" + EscapeString(banned_ips_entry.notes) + "'"); - - auto results = database.QueryDatabase( - fmt::format( - "UPDATE {} SET {} WHERE {} = {}", - TableName(), - implode(", ", update_values), - PrimaryKey(), - banned_ips_entry.ip_address - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static BannedIps InsertOne( - BannedIps banned_ips_entry - ) - { - std::vector insert_values; - - insert_values.push_back("'" + EscapeString(banned_ips_entry.notes) + "'"); - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES ({})", - BaseInsert(), - implode(",", insert_values) - ) - ); - - if (results.Success()) { - banned_ips_entry.id = results.LastInsertedID(); - return banned_ips_entry; - } - - banned_ips_entry = NewEntity(); - - return banned_ips_entry; - } - - static int InsertMany( - std::vector banned_ips_entries - ) - { - std::vector insert_chunks; - - for (auto &banned_ips_entry: banned_ips_entries) { - std::vector insert_values; - - insert_values.push_back("'" + EscapeString(banned_ips_entry.notes) + "'"); - - insert_chunks.push_back("(" + implode(",", insert_values) + ")"); - } - - std::vector insert_values; - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES {}", - BaseInsert(), - implode(",", insert_chunks) - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static std::vector All() - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{}", - BaseSelect() - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - BannedIps entry{}; - - entry.ip_address = row[0] ? row[0] : ""; - entry.notes = row[1] ? row[1] : ""; - - all_entries.push_back(entry); - } - - return all_entries; - } - - static std::vector GetWhere(std::string where_filter) - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE {}", - BaseSelect(), - where_filter - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - BannedIps entry{}; - - entry.ip_address = row[0] ? row[0] : ""; - entry.notes = row[1] ? row[1] : ""; - - all_entries.push_back(entry); - } - - return all_entries; - } - - static int DeleteWhere(std::string where_filter) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {}", - TableName(), - PrimaryKey(), - where_filter - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - -}; - -#endif //EQEMU_BASE_BANNED_IPS_REPOSITORY_H diff --git a/common/repositories/base/base_base_data_repository.h b/common/repositories/base/base_base_data_repository.h index 0cc222895..029023277 100644 --- a/common/repositories/base/base_base_data_repository.h +++ b/common/repositories/base/base_base_data_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -49,7 +49,7 @@ public: static std::string PrimaryKey() { - return std::string("class"); + return std::string("level"); } static std::vector Columns() @@ -135,7 +135,7 @@ public: ) { for (auto &base_data : base_datas) { - if (base_data.class == base_data_id) { + if (base_data.level == base_data_id) { return base_data; } } @@ -200,6 +200,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(base_data_entry.level)); + update_values.push_back(columns[1] + " = " + std::to_string(base_data_entry.class)); update_values.push_back(columns[2] + " = " + std::to_string(base_data_entry.hp)); update_values.push_back(columns[3] + " = " + std::to_string(base_data_entry.mana)); update_values.push_back(columns[4] + " = " + std::to_string(base_data_entry.end)); @@ -215,7 +217,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - base_data_entry.class + base_data_entry.level ) ); @@ -228,6 +230,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(base_data_entry.level)); + insert_values.push_back(std::to_string(base_data_entry.class)); insert_values.push_back(std::to_string(base_data_entry.hp)); insert_values.push_back(std::to_string(base_data_entry.mana)); insert_values.push_back(std::to_string(base_data_entry.end)); @@ -246,7 +250,7 @@ public: ); if (results.Success()) { - base_data_entry.id = results.LastInsertedID(); + base_data_entry.level = results.LastInsertedID(); return base_data_entry; } @@ -264,6 +268,8 @@ public: for (auto &base_data_entry: base_data_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(base_data_entry.level)); + insert_values.push_back(std::to_string(base_data_entry.class)); insert_values.push_back(std::to_string(base_data_entry.hp)); insert_values.push_back(std::to_string(base_data_entry.mana)); insert_values.push_back(std::to_string(base_data_entry.end)); diff --git a/common/repositories/base/base_blocked_spells_repository.h b/common/repositories/base/base_blocked_spells_repository.h index 753fe131d..6a0066ea6 100644 --- a/common/repositories/base/base_blocked_spells_repository.h +++ b/common/repositories/base/base_blocked_spells_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_books_repository.h b/common/repositories/base/base_books_repository.h deleted file mode 100644 index c8453c680..000000000 --- a/common/repositories/base/base_books_repository.h +++ /dev/null @@ -1,315 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - */ - -/** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to - * the repository extending the base. Any modifications to base repositories are to - * be made by the generator only - */ - -#ifndef EQEMU_BASE_BOOKS_REPOSITORY_H -#define EQEMU_BASE_BOOKS_REPOSITORY_H - -#include "../../database.h" -#include "../../string_util.h" - -class BaseBooksRepository { -public: - struct Books { - std::string name; - std::string txtfile; - int language; - }; - - static std::string PrimaryKey() - { - return std::string("name"); - } - - static std::vector Columns() - { - return { - "name", - "txtfile", - "language", - }; - } - - static std::string ColumnsRaw() - { - return std::string(implode(", ", Columns())); - } - - static std::string InsertColumnsRaw() - { - std::vector insert_columns; - - for (auto &column : Columns()) { - if (column == PrimaryKey()) { - continue; - } - - insert_columns.push_back(column); - } - - return std::string(implode(", ", insert_columns)); - } - - static std::string TableName() - { - return std::string("books"); - } - - static std::string BaseSelect() - { - return fmt::format( - "SELECT {} FROM {}", - ColumnsRaw(), - TableName() - ); - } - - static std::string BaseInsert() - { - return fmt::format( - "INSERT INTO {} ({}) ", - TableName(), - InsertColumnsRaw() - ); - } - - static Books NewEntity() - { - Books entry{}; - - entry.name = ""; - entry.txtfile = ""; - entry.language = 0; - - return entry; - } - - static Books GetBooksEntry( - const std::vector &bookss, - int books_id - ) - { - for (auto &books : bookss) { - if (books.name == books_id) { - return books; - } - } - - return NewEntity(); - } - - static Books FindOne( - int books_id - ) - { - auto results = content_db.QueryDatabase( - fmt::format( - "{} WHERE id = {} LIMIT 1", - BaseSelect(), - books_id - ) - ); - - auto row = results.begin(); - if (results.RowCount() == 1) { - Books entry{}; - - entry.name = row[0] ? row[0] : ""; - entry.txtfile = row[1] ? row[1] : ""; - entry.language = atoi(row[2]); - - return entry; - } - - return NewEntity(); - } - - static int DeleteOne( - int books_id - ) - { - auto results = content_db.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {} = {}", - TableName(), - PrimaryKey(), - books_id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static int UpdateOne( - Books books_entry - ) - { - std::vector update_values; - - auto columns = Columns(); - - update_values.push_back(columns[1] + " = '" + EscapeString(books_entry.txtfile) + "'"); - update_values.push_back(columns[2] + " = " + std::to_string(books_entry.language)); - - auto results = content_db.QueryDatabase( - fmt::format( - "UPDATE {} SET {} WHERE {} = {}", - TableName(), - implode(", ", update_values), - PrimaryKey(), - books_entry.name - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static Books InsertOne( - Books books_entry - ) - { - std::vector insert_values; - - insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'"); - insert_values.push_back(std::to_string(books_entry.language)); - - auto results = content_db.QueryDatabase( - fmt::format( - "{} VALUES ({})", - BaseInsert(), - implode(",", insert_values) - ) - ); - - if (results.Success()) { - books_entry.id = results.LastInsertedID(); - return books_entry; - } - - books_entry = NewEntity(); - - return books_entry; - } - - static int InsertMany( - std::vector books_entries - ) - { - std::vector insert_chunks; - - for (auto &books_entry: books_entries) { - std::vector insert_values; - - insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'"); - insert_values.push_back(std::to_string(books_entry.language)); - - insert_chunks.push_back("(" + implode(",", insert_values) + ")"); - } - - std::vector insert_values; - - auto results = content_db.QueryDatabase( - fmt::format( - "{} VALUES {}", - BaseInsert(), - implode(",", insert_chunks) - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static std::vector All() - { - std::vector all_entries; - - auto results = content_db.QueryDatabase( - fmt::format( - "{}", - BaseSelect() - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - Books entry{}; - - entry.name = row[0] ? row[0] : ""; - entry.txtfile = row[1] ? row[1] : ""; - entry.language = atoi(row[2]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static std::vector GetWhere(std::string where_filter) - { - std::vector all_entries; - - auto results = content_db.QueryDatabase( - fmt::format( - "{} WHERE {}", - BaseSelect(), - where_filter - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - Books entry{}; - - entry.name = row[0] ? row[0] : ""; - entry.txtfile = row[1] ? row[1] : ""; - entry.language = atoi(row[2]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static int DeleteWhere(std::string where_filter) - { - auto results = content_db.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {}", - TableName(), - PrimaryKey(), - where_filter - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - -}; - -#endif //EQEMU_BASE_BOOKS_REPOSITORY_H diff --git a/common/repositories/base/base_bug_reports_repository.h b/common/repositories/base/base_bug_reports_repository.h index 5ec89a015..90fa46870 100644 --- a/common/repositories/base/base_bug_reports_repository.h +++ b/common/repositories/base/base_bug_reports_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_bugs_repository.h b/common/repositories/base/base_bugs_repository.h index 08d378271..29c0c6cd0 100644 --- a/common/repositories/base/base_bugs_repository.h +++ b/common/repositories/base/base_bugs_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_buyer_repository.h b/common/repositories/base/base_buyer_repository.h index 2752abe23..ea0f50b10 100644 --- a/common/repositories/base/base_buyer_repository.h +++ b/common/repositories/base/base_buyer_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -45,7 +45,7 @@ public: static std::string PrimaryKey() { - return std::string("buyslot"); + return std::string("charid"); } static std::vector Columns() @@ -123,7 +123,7 @@ public: ) { for (auto &buyer : buyers) { - if (buyer.buyslot == buyer_id) { + if (buyer.charid == buyer_id) { return buyer; } } @@ -184,6 +184,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(buyer_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(buyer_entry.buyslot)); update_values.push_back(columns[2] + " = " + std::to_string(buyer_entry.itemid)); update_values.push_back(columns[3] + " = '" + EscapeString(buyer_entry.itemname) + "'"); update_values.push_back(columns[4] + " = " + std::to_string(buyer_entry.quantity)); @@ -195,7 +197,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - buyer_entry.buyslot + buyer_entry.charid ) ); @@ -208,6 +210,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(buyer_entry.charid)); + insert_values.push_back(std::to_string(buyer_entry.buyslot)); insert_values.push_back(std::to_string(buyer_entry.itemid)); insert_values.push_back("'" + EscapeString(buyer_entry.itemname) + "'"); insert_values.push_back(std::to_string(buyer_entry.quantity)); @@ -222,7 +226,7 @@ public: ); if (results.Success()) { - buyer_entry.id = results.LastInsertedID(); + buyer_entry.charid = results.LastInsertedID(); return buyer_entry; } @@ -240,6 +244,8 @@ public: for (auto &buyer_entry: buyer_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(buyer_entry.charid)); + insert_values.push_back(std::to_string(buyer_entry.buyslot)); insert_values.push_back(std::to_string(buyer_entry.itemid)); insert_values.push_back("'" + EscapeString(buyer_entry.itemname) + "'"); insert_values.push_back(std::to_string(buyer_entry.quantity)); diff --git a/common/repositories/base/base_char_create_combinations_repository.h b/common/repositories/base/base_char_create_combinations_repository.h index d333c7d63..f937fc518 100644 --- a/common/repositories/base/base_char_create_combinations_repository.h +++ b/common/repositories/base/base_char_create_combinations_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -48,7 +48,7 @@ public: static std::string PrimaryKey() { - return std::string("start_zone"); + return std::string("race"); } static std::vector Columns() @@ -132,7 +132,7 @@ public: ) { for (auto &char_create_combinations : char_create_combinationss) { - if (char_create_combinations.start_zone == char_create_combinations_id) { + if (char_create_combinations.race == char_create_combinations_id) { return char_create_combinations; } } @@ -197,6 +197,10 @@ public: auto columns = Columns(); update_values.push_back(columns[0] + " = " + std::to_string(char_create_combinations_entry.allocation_id)); + update_values.push_back(columns[1] + " = " + std::to_string(char_create_combinations_entry.race)); + update_values.push_back(columns[2] + " = " + std::to_string(char_create_combinations_entry.class)); + update_values.push_back(columns[3] + " = " + std::to_string(char_create_combinations_entry.deity)); + update_values.push_back(columns[4] + " = " + std::to_string(char_create_combinations_entry.start_zone)); update_values.push_back(columns[5] + " = " + std::to_string(char_create_combinations_entry.expansions_req)); update_values.push_back(columns[6] + " = " + std::to_string(char_create_combinations_entry.min_expansion)); update_values.push_back(columns[7] + " = " + std::to_string(char_create_combinations_entry.max_expansion)); @@ -208,7 +212,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - char_create_combinations_entry.start_zone + char_create_combinations_entry.race ) ); @@ -222,6 +226,10 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(char_create_combinations_entry.allocation_id)); + insert_values.push_back(std::to_string(char_create_combinations_entry.race)); + insert_values.push_back(std::to_string(char_create_combinations_entry.class)); + insert_values.push_back(std::to_string(char_create_combinations_entry.deity)); + insert_values.push_back(std::to_string(char_create_combinations_entry.start_zone)); insert_values.push_back(std::to_string(char_create_combinations_entry.expansions_req)); insert_values.push_back(std::to_string(char_create_combinations_entry.min_expansion)); insert_values.push_back(std::to_string(char_create_combinations_entry.max_expansion)); @@ -236,7 +244,7 @@ public: ); if (results.Success()) { - char_create_combinations_entry.id = results.LastInsertedID(); + char_create_combinations_entry.race = results.LastInsertedID(); return char_create_combinations_entry; } @@ -255,6 +263,10 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(char_create_combinations_entry.allocation_id)); + insert_values.push_back(std::to_string(char_create_combinations_entry.race)); + insert_values.push_back(std::to_string(char_create_combinations_entry.class)); + insert_values.push_back(std::to_string(char_create_combinations_entry.deity)); + insert_values.push_back(std::to_string(char_create_combinations_entry.start_zone)); insert_values.push_back(std::to_string(char_create_combinations_entry.expansions_req)); insert_values.push_back(std::to_string(char_create_combinations_entry.min_expansion)); insert_values.push_back(std::to_string(char_create_combinations_entry.max_expansion)); diff --git a/common/repositories/base/base_char_create_point_allocations_repository.h b/common/repositories/base/base_char_create_point_allocations_repository.h index 6b97292d1..05dcedd49 100644 --- a/common/repositories/base/base_char_create_point_allocations_repository.h +++ b/common/repositories/base/base_char_create_point_allocations_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -220,6 +220,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(char_create_point_allocations_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(char_create_point_allocations_entry.base_str)); update_values.push_back(columns[2] + " = " + std::to_string(char_create_point_allocations_entry.base_sta)); update_values.push_back(columns[3] + " = " + std::to_string(char_create_point_allocations_entry.base_dex)); @@ -254,6 +255,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(char_create_point_allocations_entry.id)); insert_values.push_back(std::to_string(char_create_point_allocations_entry.base_str)); insert_values.push_back(std::to_string(char_create_point_allocations_entry.base_sta)); insert_values.push_back(std::to_string(char_create_point_allocations_entry.base_dex)); @@ -296,6 +298,7 @@ public: for (auto &char_create_point_allocations_entry: char_create_point_allocations_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(char_create_point_allocations_entry.id)); insert_values.push_back(std::to_string(char_create_point_allocations_entry.base_str)); insert_values.push_back(std::to_string(char_create_point_allocations_entry.base_sta)); insert_values.push_back(std::to_string(char_create_point_allocations_entry.base_dex)); diff --git a/common/repositories/base/base_char_recipe_list_repository.h b/common/repositories/base/base_char_recipe_list_repository.h index 5ad9aa85a..dc4308aeb 100644 --- a/common/repositories/base/base_char_recipe_list_repository.h +++ b/common/repositories/base/base_char_recipe_list_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("recipe_id"); + return std::string("char_id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &char_recipe_list : char_recipe_lists) { - if (char_recipe_list.recipe_id == char_recipe_list_id) { + if (char_recipe_list.char_id == char_recipe_list_id) { return char_recipe_list; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(char_recipe_list_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(char_recipe_list_entry.recipe_id)); update_values.push_back(columns[2] + " = " + std::to_string(char_recipe_list_entry.madecount)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - char_recipe_list_entry.recipe_id + char_recipe_list_entry.char_id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(char_recipe_list_entry.char_id)); + insert_values.push_back(std::to_string(char_recipe_list_entry.recipe_id)); insert_values.push_back(std::to_string(char_recipe_list_entry.madecount)); auto results = database.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - char_recipe_list_entry.id = results.LastInsertedID(); + char_recipe_list_entry.char_id = results.LastInsertedID(); return char_recipe_list_entry; } @@ -222,6 +226,8 @@ public: for (auto &char_recipe_list_entry: char_recipe_list_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(char_recipe_list_entry.char_id)); + insert_values.push_back(std::to_string(char_recipe_list_entry.recipe_id)); insert_values.push_back(std::to_string(char_recipe_list_entry.madecount)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_activities_repository.h b/common/repositories/base/base_character_activities_repository.h index f535c7d41..efdddabca 100644 --- a/common/repositories/base/base_character_activities_repository.h +++ b/common/repositories/base/base_character_activities_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("activityid"); + return std::string("charid"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &character_activities : character_activitiess) { - if (character_activities.activityid == character_activities_id) { + if (character_activities.charid == character_activities_id) { return character_activities; } } @@ -180,6 +180,9 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_activities_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(character_activities_entry.taskid)); + update_values.push_back(columns[2] + " = " + std::to_string(character_activities_entry.activityid)); update_values.push_back(columns[3] + " = " + std::to_string(character_activities_entry.donecount)); update_values.push_back(columns[4] + " = " + std::to_string(character_activities_entry.completed)); @@ -189,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_activities_entry.activityid + character_activities_entry.charid ) ); @@ -202,6 +205,9 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_activities_entry.charid)); + insert_values.push_back(std::to_string(character_activities_entry.taskid)); + insert_values.push_back(std::to_string(character_activities_entry.activityid)); insert_values.push_back(std::to_string(character_activities_entry.donecount)); insert_values.push_back(std::to_string(character_activities_entry.completed)); @@ -214,7 +220,7 @@ public: ); if (results.Success()) { - character_activities_entry.id = results.LastInsertedID(); + character_activities_entry.charid = results.LastInsertedID(); return character_activities_entry; } @@ -232,6 +238,9 @@ public: for (auto &character_activities_entry: character_activities_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_activities_entry.charid)); + insert_values.push_back(std::to_string(character_activities_entry.taskid)); + insert_values.push_back(std::to_string(character_activities_entry.activityid)); insert_values.push_back(std::to_string(character_activities_entry.donecount)); insert_values.push_back(std::to_string(character_activities_entry.completed)); diff --git a/common/repositories/base/base_character_alt_currency_repository.h b/common/repositories/base/base_character_alt_currency_repository.h index 0542f3f87..275c81f9c 100644 --- a/common/repositories/base/base_character_alt_currency_repository.h +++ b/common/repositories/base/base_character_alt_currency_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("currency_id"); + return std::string("char_id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_alt_currency : character_alt_currencys) { - if (character_alt_currency.currency_id == character_alt_currency_id) { + if (character_alt_currency.char_id == character_alt_currency_id) { return character_alt_currency; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_alt_currency_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_alt_currency_entry.currency_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_alt_currency_entry.amount)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_alt_currency_entry.currency_id + character_alt_currency_entry.char_id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_alt_currency_entry.char_id)); + insert_values.push_back(std::to_string(character_alt_currency_entry.currency_id)); insert_values.push_back(std::to_string(character_alt_currency_entry.amount)); auto results = database.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - character_alt_currency_entry.id = results.LastInsertedID(); + character_alt_currency_entry.char_id = results.LastInsertedID(); return character_alt_currency_entry; } @@ -222,6 +226,8 @@ public: for (auto &character_alt_currency_entry: character_alt_currency_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_alt_currency_entry.char_id)); + insert_values.push_back(std::to_string(character_alt_currency_entry.currency_id)); insert_values.push_back(std::to_string(character_alt_currency_entry.amount)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_alternate_abilities_repository.h b/common/repositories/base/base_character_alternate_abilities_repository.h index 0974e5d0c..43b8691ec 100644 --- a/common/repositories/base/base_character_alternate_abilities_repository.h +++ b/common/repositories/base/base_character_alternate_abilities_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("aa_id"); + return std::string("id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &character_alternate_abilities : character_alternate_abilitiess) { - if (character_alternate_abilities.aa_id == character_alternate_abilities_id) { + if (character_alternate_abilities.id == character_alternate_abilities_id) { return character_alternate_abilities; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_alternate_abilities_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_alternate_abilities_entry.aa_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_alternate_abilities_entry.aa_value)); update_values.push_back(columns[3] + " = " + std::to_string(character_alternate_abilities_entry.charges)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_alternate_abilities_entry.aa_id + character_alternate_abilities_entry.id ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_alternate_abilities_entry.id)); + insert_values.push_back(std::to_string(character_alternate_abilities_entry.aa_id)); insert_values.push_back(std::to_string(character_alternate_abilities_entry.aa_value)); insert_values.push_back(std::to_string(character_alternate_abilities_entry.charges)); @@ -228,6 +232,8 @@ public: for (auto &character_alternate_abilities_entry: character_alternate_abilities_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_alternate_abilities_entry.id)); + insert_values.push_back(std::to_string(character_alternate_abilities_entry.aa_id)); insert_values.push_back(std::to_string(character_alternate_abilities_entry.aa_value)); insert_values.push_back(std::to_string(character_alternate_abilities_entry.charges)); diff --git a/common/repositories/base/base_character_auras_repository.h b/common/repositories/base/base_character_auras_repository.h index 41514e158..d296d5c49 100644 --- a/common/repositories/base/base_character_auras_repository.h +++ b/common/repositories/base/base_character_auras_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_auras : character_aurass) { - if (character_auras.slot == character_auras_id) { + if (character_auras.id == character_auras_id) { return character_auras; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_auras_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_auras_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(character_auras_entry.spell_id)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_auras_entry.slot + character_auras_entry.id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_auras_entry.id)); + insert_values.push_back(std::to_string(character_auras_entry.slot)); insert_values.push_back(std::to_string(character_auras_entry.spell_id)); auto results = database.QueryDatabase( @@ -222,6 +226,8 @@ public: for (auto &character_auras_entry: character_auras_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_auras_entry.id)); + insert_values.push_back(std::to_string(character_auras_entry.slot)); insert_values.push_back(std::to_string(character_auras_entry.spell_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_bandolier_repository.h b/common/repositories/base/base_character_bandolier_repository.h index 0b9ef5ccc..9fc1ba6ee 100644 --- a/common/repositories/base/base_character_bandolier_repository.h +++ b/common/repositories/base/base_character_bandolier_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -45,7 +45,7 @@ public: static std::string PrimaryKey() { - return std::string("bandolier_slot"); + return std::string("id"); } static std::vector Columns() @@ -123,7 +123,7 @@ public: ) { for (auto &character_bandolier : character_bandoliers) { - if (character_bandolier.bandolier_slot == character_bandolier_id) { + if (character_bandolier.id == character_bandolier_id) { return character_bandolier; } } @@ -184,6 +184,9 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_bandolier_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_bandolier_entry.bandolier_id)); + update_values.push_back(columns[2] + " = " + std::to_string(character_bandolier_entry.bandolier_slot)); update_values.push_back(columns[3] + " = " + std::to_string(character_bandolier_entry.item_id)); update_values.push_back(columns[4] + " = " + std::to_string(character_bandolier_entry.icon)); update_values.push_back(columns[5] + " = '" + EscapeString(character_bandolier_entry.bandolier_name) + "'"); @@ -194,7 +197,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_bandolier_entry.bandolier_slot + character_bandolier_entry.id ) ); @@ -207,6 +210,9 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_bandolier_entry.id)); + insert_values.push_back(std::to_string(character_bandolier_entry.bandolier_id)); + insert_values.push_back(std::to_string(character_bandolier_entry.bandolier_slot)); insert_values.push_back(std::to_string(character_bandolier_entry.item_id)); insert_values.push_back(std::to_string(character_bandolier_entry.icon)); insert_values.push_back("'" + EscapeString(character_bandolier_entry.bandolier_name) + "'"); @@ -238,6 +244,9 @@ public: for (auto &character_bandolier_entry: character_bandolier_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_bandolier_entry.id)); + insert_values.push_back(std::to_string(character_bandolier_entry.bandolier_id)); + insert_values.push_back(std::to_string(character_bandolier_entry.bandolier_slot)); insert_values.push_back(std::to_string(character_bandolier_entry.item_id)); insert_values.push_back(std::to_string(character_bandolier_entry.icon)); insert_values.push_back("'" + EscapeString(character_bandolier_entry.bandolier_name) + "'"); diff --git a/common/repositories/base/base_character_bind_repository.h b/common/repositories/base/base_character_bind_repository.h index a68ab33b9..ea7847c1f 100644 --- a/common/repositories/base/base_character_bind_repository.h +++ b/common/repositories/base/base_character_bind_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -47,7 +47,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("id"); } static std::vector Columns() @@ -129,7 +129,7 @@ public: ) { for (auto &character_bind : character_binds) { - if (character_bind.slot == character_bind_id) { + if (character_bind.id == character_bind_id) { return character_bind; } } @@ -192,6 +192,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[1] + " = " + std::to_string(character_bind_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(character_bind_entry.zone_id)); update_values.push_back(columns[3] + " = " + std::to_string(character_bind_entry.instance_id)); update_values.push_back(columns[4] + " = " + std::to_string(character_bind_entry.x)); @@ -205,7 +206,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_bind_entry.slot + character_bind_entry.id ) ); @@ -218,6 +219,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_bind_entry.slot)); insert_values.push_back(std::to_string(character_bind_entry.zone_id)); insert_values.push_back(std::to_string(character_bind_entry.instance_id)); insert_values.push_back(std::to_string(character_bind_entry.x)); @@ -252,6 +254,7 @@ public: for (auto &character_bind_entry: character_bind_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_bind_entry.slot)); insert_values.push_back(std::to_string(character_bind_entry.zone_id)); insert_values.push_back(std::to_string(character_bind_entry.instance_id)); insert_values.push_back(std::to_string(character_bind_entry.x)); diff --git a/common/repositories/base/base_character_buffs_repository.h b/common/repositories/base/base_character_buffs_repository.h index 57b35a5c4..a4165cdbf 100644 --- a/common/repositories/base/base_character_buffs_repository.h +++ b/common/repositories/base/base_character_buffs_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -56,7 +56,7 @@ public: static std::string PrimaryKey() { - return std::string("slot_id"); + return std::string("character_id"); } static std::vector Columns() @@ -156,7 +156,7 @@ public: ) { for (auto &character_buffs : character_buffss) { - if (character_buffs.slot_id == character_buffs_id) { + if (character_buffs.character_id == character_buffs_id) { return character_buffs; } } @@ -228,6 +228,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_buffs_entry.character_id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_buffs_entry.slot_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_buffs_entry.spell_id)); update_values.push_back(columns[3] + " = " + std::to_string(character_buffs_entry.caster_level)); update_values.push_back(columns[4] + " = '" + EscapeString(character_buffs_entry.caster_name) + "'"); @@ -250,7 +252,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_buffs_entry.slot_id + character_buffs_entry.character_id ) ); @@ -263,6 +265,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_buffs_entry.character_id)); + insert_values.push_back(std::to_string(character_buffs_entry.slot_id)); insert_values.push_back(std::to_string(character_buffs_entry.spell_id)); insert_values.push_back(std::to_string(character_buffs_entry.caster_level)); insert_values.push_back("'" + EscapeString(character_buffs_entry.caster_name) + "'"); @@ -288,7 +292,7 @@ public: ); if (results.Success()) { - character_buffs_entry.id = results.LastInsertedID(); + character_buffs_entry.character_id = results.LastInsertedID(); return character_buffs_entry; } @@ -306,6 +310,8 @@ public: for (auto &character_buffs_entry: character_buffs_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_buffs_entry.character_id)); + insert_values.push_back(std::to_string(character_buffs_entry.slot_id)); insert_values.push_back(std::to_string(character_buffs_entry.spell_id)); insert_values.push_back(std::to_string(character_buffs_entry.caster_level)); insert_values.push_back("'" + EscapeString(character_buffs_entry.caster_name) + "'"); diff --git a/common/repositories/base/base_character_corpse_items_repository.h b/common/repositories/base/base_character_corpse_items_repository.h index b0b258389..3dc8e0681 100644 --- a/common/repositories/base/base_character_corpse_items_repository.h +++ b/common/repositories/base/base_character_corpse_items_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -50,7 +50,7 @@ public: static std::string PrimaryKey() { - return std::string("equip_slot"); + return std::string("corpse_id"); } static std::vector Columns() @@ -138,7 +138,7 @@ public: ) { for (auto &character_corpse_items : character_corpse_itemss) { - if (character_corpse_items.equip_slot == character_corpse_items_id) { + if (character_corpse_items.corpse_id == character_corpse_items_id) { return character_corpse_items; } } @@ -204,6 +204,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_corpse_items_entry.corpse_id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_corpse_items_entry.equip_slot)); update_values.push_back(columns[2] + " = " + std::to_string(character_corpse_items_entry.item_id)); update_values.push_back(columns[3] + " = " + std::to_string(character_corpse_items_entry.charges)); update_values.push_back(columns[4] + " = " + std::to_string(character_corpse_items_entry.aug_1)); @@ -220,7 +222,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_corpse_items_entry.equip_slot + character_corpse_items_entry.corpse_id ) ); @@ -233,6 +235,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_corpse_items_entry.corpse_id)); + insert_values.push_back(std::to_string(character_corpse_items_entry.equip_slot)); insert_values.push_back(std::to_string(character_corpse_items_entry.item_id)); insert_values.push_back(std::to_string(character_corpse_items_entry.charges)); insert_values.push_back(std::to_string(character_corpse_items_entry.aug_1)); @@ -252,7 +256,7 @@ public: ); if (results.Success()) { - character_corpse_items_entry.id = results.LastInsertedID(); + character_corpse_items_entry.corpse_id = results.LastInsertedID(); return character_corpse_items_entry; } @@ -270,6 +274,8 @@ public: for (auto &character_corpse_items_entry: character_corpse_items_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_corpse_items_entry.corpse_id)); + insert_values.push_back(std::to_string(character_corpse_items_entry.equip_slot)); insert_values.push_back(std::to_string(character_corpse_items_entry.item_id)); insert_values.push_back(std::to_string(character_corpse_items_entry.charges)); insert_values.push_back(std::to_string(character_corpse_items_entry.aug_1)); diff --git a/common/repositories/base/base_character_corpses_repository.h b/common/repositories/base/base_character_corpses_repository.h index 2af2feac1..7027bbc53 100644 --- a/common/repositories/base/base_character_corpses_repository.h +++ b/common/repositories/base/base_character_corpses_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_character_currency_repository.h b/common/repositories/base/base_character_currency_repository.h index d38deb4db..b20163e33 100644 --- a/common/repositories/base/base_character_currency_repository.h +++ b/common/repositories/base/base_character_currency_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -228,6 +228,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_currency_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(character_currency_entry.platinum)); update_values.push_back(columns[2] + " = " + std::to_string(character_currency_entry.gold)); update_values.push_back(columns[3] + " = " + std::to_string(character_currency_entry.silver)); @@ -264,6 +265,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_currency_entry.id)); insert_values.push_back(std::to_string(character_currency_entry.platinum)); insert_values.push_back(std::to_string(character_currency_entry.gold)); insert_values.push_back(std::to_string(character_currency_entry.silver)); @@ -308,6 +310,7 @@ public: for (auto &character_currency_entry: character_currency_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_currency_entry.id)); insert_values.push_back(std::to_string(character_currency_entry.platinum)); insert_values.push_back(std::to_string(character_currency_entry.gold)); insert_values.push_back(std::to_string(character_currency_entry.silver)); diff --git a/common/repositories/base/base_character_data_repository.h b/common/repositories/base/base_character_data_repository.h index 24133e729..4ac3a12e5 100644 --- a/common/repositories/base/base_character_data_repository.h +++ b/common/repositories/base/base_character_data_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_character_disciplines_repository.h b/common/repositories/base/base_character_disciplines_repository.h index 3109327d1..13d98cfed 100644 --- a/common/repositories/base/base_character_disciplines_repository.h +++ b/common/repositories/base/base_character_disciplines_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("slot_id"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_disciplines : character_discipliness) { - if (character_disciplines.slot_id == character_disciplines_id) { + if (character_disciplines.id == character_disciplines_id) { return character_disciplines; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_disciplines_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_disciplines_entry.slot_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_disciplines_entry.disc_id)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_disciplines_entry.slot_id + character_disciplines_entry.id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_disciplines_entry.id)); + insert_values.push_back(std::to_string(character_disciplines_entry.slot_id)); insert_values.push_back(std::to_string(character_disciplines_entry.disc_id)); auto results = database.QueryDatabase( @@ -222,6 +226,8 @@ public: for (auto &character_disciplines_entry: character_disciplines_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_disciplines_entry.id)); + insert_values.push_back(std::to_string(character_disciplines_entry.slot_id)); insert_values.push_back(std::to_string(character_disciplines_entry.disc_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_inspect_messages_repository.h b/common/repositories/base/base_character_inspect_messages_repository.h index bc5ef873c..76aaea0d6 100644 --- a/common/repositories/base/base_character_inspect_messages_repository.h +++ b/common/repositories/base/base_character_inspect_messages_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -168,6 +168,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_inspect_messages_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(character_inspect_messages_entry.inspect_message) + "'"); auto results = database.QueryDatabase( @@ -189,6 +190,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_inspect_messages_entry.id)); insert_values.push_back("'" + EscapeString(character_inspect_messages_entry.inspect_message) + "'"); auto results = database.QueryDatabase( @@ -218,6 +220,7 @@ public: for (auto &character_inspect_messages_entry: character_inspect_messages_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_inspect_messages_entry.id)); insert_values.push_back("'" + EscapeString(character_inspect_messages_entry.inspect_message) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_item_recast_repository.h b/common/repositories/base/base_character_item_recast_repository.h index 67ac8919c..2c5a61bb7 100644 --- a/common/repositories/base/base_character_item_recast_repository.h +++ b/common/repositories/base/base_character_item_recast_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("recast_type"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_item_recast : character_item_recasts) { - if (character_item_recast.recast_type == character_item_recast_id) { + if (character_item_recast.id == character_item_recast_id) { return character_item_recast; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_item_recast_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_item_recast_entry.recast_type)); update_values.push_back(columns[2] + " = " + std::to_string(character_item_recast_entry.timestamp)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_item_recast_entry.recast_type + character_item_recast_entry.id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_item_recast_entry.id)); + insert_values.push_back(std::to_string(character_item_recast_entry.recast_type)); insert_values.push_back(std::to_string(character_item_recast_entry.timestamp)); auto results = database.QueryDatabase( @@ -222,6 +226,8 @@ public: for (auto &character_item_recast_entry: character_item_recast_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_item_recast_entry.id)); + insert_values.push_back(std::to_string(character_item_recast_entry.recast_type)); insert_values.push_back(std::to_string(character_item_recast_entry.timestamp)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_languages_repository.h b/common/repositories/base/base_character_languages_repository.h index 9589fb5c9..2731f40d0 100644 --- a/common/repositories/base/base_character_languages_repository.h +++ b/common/repositories/base/base_character_languages_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("lang_id"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_languages : character_languagess) { - if (character_languages.lang_id == character_languages_id) { + if (character_languages.id == character_languages_id) { return character_languages; } } @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[1] + " = " + std::to_string(character_languages_entry.lang_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_languages_entry.value)); auto results = database.QueryDatabase( @@ -180,7 +181,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_languages_entry.lang_id + character_languages_entry.id ) ); @@ -193,6 +194,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_languages_entry.lang_id)); insert_values.push_back(std::to_string(character_languages_entry.value)); auto results = database.QueryDatabase( @@ -222,6 +224,7 @@ public: for (auto &character_languages_entry: character_languages_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_languages_entry.lang_id)); insert_values.push_back(std::to_string(character_languages_entry.value)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_leadership_abilities_repository.h b/common/repositories/base/base_character_leadership_abilities_repository.h index aa63e3a6c..d138a6b29 100644 --- a/common/repositories/base/base_character_leadership_abilities_repository.h +++ b/common/repositories/base/base_character_leadership_abilities_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_leadership_abilities : character_leadership_abilitiess) { - if (character_leadership_abilities.slot == character_leadership_abilities_id) { + if (character_leadership_abilities.id == character_leadership_abilities_id) { return character_leadership_abilities; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_leadership_abilities_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_leadership_abilities_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(character_leadership_abilities_entry.rank)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_leadership_abilities_entry.slot + character_leadership_abilities_entry.id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_leadership_abilities_entry.id)); + insert_values.push_back(std::to_string(character_leadership_abilities_entry.slot)); insert_values.push_back(std::to_string(character_leadership_abilities_entry.rank)); auto results = database.QueryDatabase( @@ -222,6 +226,8 @@ public: for (auto &character_leadership_abilities_entry: character_leadership_abilities_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_leadership_abilities_entry.id)); + insert_values.push_back(std::to_string(character_leadership_abilities_entry.slot)); insert_values.push_back(std::to_string(character_leadership_abilities_entry.rank)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_material_repository.h b/common/repositories/base/base_character_material_repository.h index 7a94e1b16..547c635bc 100644 --- a/common/repositories/base/base_character_material_repository.h +++ b/common/repositories/base/base_character_material_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -46,7 +46,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("id"); } static std::vector Columns() @@ -126,7 +126,7 @@ public: ) { for (auto &character_material : character_materials) { - if (character_material.slot == character_material_id) { + if (character_material.id == character_material_id) { return character_material; } } @@ -188,6 +188,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[1] + " = " + std::to_string(character_material_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(character_material_entry.blue)); update_values.push_back(columns[3] + " = " + std::to_string(character_material_entry.green)); update_values.push_back(columns[4] + " = " + std::to_string(character_material_entry.red)); @@ -200,7 +201,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_material_entry.slot + character_material_entry.id ) ); @@ -213,6 +214,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_material_entry.slot)); insert_values.push_back(std::to_string(character_material_entry.blue)); insert_values.push_back(std::to_string(character_material_entry.green)); insert_values.push_back(std::to_string(character_material_entry.red)); @@ -246,6 +248,7 @@ public: for (auto &character_material_entry: character_material_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_material_entry.slot)); insert_values.push_back(std::to_string(character_material_entry.blue)); insert_values.push_back(std::to_string(character_material_entry.green)); insert_values.push_back(std::to_string(character_material_entry.red)); diff --git a/common/repositories/base/base_character_memmed_spells_repository.h b/common/repositories/base/base_character_memmed_spells_repository.h index eb224025b..cb553ff4f 100644 --- a/common/repositories/base/base_character_memmed_spells_repository.h +++ b/common/repositories/base/base_character_memmed_spells_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("slot_id"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_memmed_spells : character_memmed_spellss) { - if (character_memmed_spells.slot_id == character_memmed_spells_id) { + if (character_memmed_spells.id == character_memmed_spells_id) { return character_memmed_spells; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_memmed_spells_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_memmed_spells_entry.slot_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_memmed_spells_entry.spell_id)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_memmed_spells_entry.slot_id + character_memmed_spells_entry.id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_memmed_spells_entry.id)); + insert_values.push_back(std::to_string(character_memmed_spells_entry.slot_id)); insert_values.push_back(std::to_string(character_memmed_spells_entry.spell_id)); auto results = database.QueryDatabase( @@ -222,6 +226,8 @@ public: for (auto &character_memmed_spells_entry: character_memmed_spells_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_memmed_spells_entry.id)); + insert_values.push_back(std::to_string(character_memmed_spells_entry.slot_id)); insert_values.push_back(std::to_string(character_memmed_spells_entry.spell_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_pet_buffs_repository.h b/common/repositories/base/base_character_pet_buffs_repository.h index 1cd7b3f8a..10b6fb5b0 100644 --- a/common/repositories/base/base_character_pet_buffs_repository.h +++ b/common/repositories/base/base_character_pet_buffs_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -50,7 +50,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("char_id"); } static std::vector Columns() @@ -138,7 +138,7 @@ public: ) { for (auto &character_pet_buffs : character_pet_buffss) { - if (character_pet_buffs.slot == character_pet_buffs_id) { + if (character_pet_buffs.char_id == character_pet_buffs_id) { return character_pet_buffs; } } @@ -204,6 +204,9 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_pet_buffs_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_pet_buffs_entry.pet)); + update_values.push_back(columns[2] + " = " + std::to_string(character_pet_buffs_entry.slot)); update_values.push_back(columns[3] + " = " + std::to_string(character_pet_buffs_entry.spell_id)); update_values.push_back(columns[4] + " = " + std::to_string(character_pet_buffs_entry.caster_level)); update_values.push_back(columns[5] + " = '" + EscapeString(character_pet_buffs_entry.castername) + "'"); @@ -219,7 +222,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_pet_buffs_entry.slot + character_pet_buffs_entry.char_id ) ); @@ -232,6 +235,9 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_pet_buffs_entry.char_id)); + insert_values.push_back(std::to_string(character_pet_buffs_entry.pet)); + insert_values.push_back(std::to_string(character_pet_buffs_entry.slot)); insert_values.push_back(std::to_string(character_pet_buffs_entry.spell_id)); insert_values.push_back(std::to_string(character_pet_buffs_entry.caster_level)); insert_values.push_back("'" + EscapeString(character_pet_buffs_entry.castername) + "'"); @@ -250,7 +256,7 @@ public: ); if (results.Success()) { - character_pet_buffs_entry.id = results.LastInsertedID(); + character_pet_buffs_entry.char_id = results.LastInsertedID(); return character_pet_buffs_entry; } @@ -268,6 +274,9 @@ public: for (auto &character_pet_buffs_entry: character_pet_buffs_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_pet_buffs_entry.char_id)); + insert_values.push_back(std::to_string(character_pet_buffs_entry.pet)); + insert_values.push_back(std::to_string(character_pet_buffs_entry.slot)); insert_values.push_back(std::to_string(character_pet_buffs_entry.spell_id)); insert_values.push_back(std::to_string(character_pet_buffs_entry.caster_level)); insert_values.push_back("'" + EscapeString(character_pet_buffs_entry.castername) + "'"); diff --git a/common/repositories/base/base_character_pet_info_repository.h b/common/repositories/base/base_character_pet_info_repository.h index fd5c64fd6..d12865504 100644 --- a/common/repositories/base/base_character_pet_info_repository.h +++ b/common/repositories/base/base_character_pet_info_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -47,7 +47,7 @@ public: static std::string PrimaryKey() { - return std::string("pet"); + return std::string("char_id"); } static std::vector Columns() @@ -129,7 +129,7 @@ public: ) { for (auto &character_pet_info : character_pet_infos) { - if (character_pet_info.pet == character_pet_info_id) { + if (character_pet_info.char_id == character_pet_info_id) { return character_pet_info; } } @@ -192,6 +192,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_pet_info_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_pet_info_entry.pet)); update_values.push_back(columns[2] + " = '" + EscapeString(character_pet_info_entry.petname) + "'"); update_values.push_back(columns[3] + " = " + std::to_string(character_pet_info_entry.petpower)); update_values.push_back(columns[4] + " = " + std::to_string(character_pet_info_entry.spell_id)); @@ -205,7 +207,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_pet_info_entry.pet + character_pet_info_entry.char_id ) ); @@ -218,6 +220,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_pet_info_entry.char_id)); + insert_values.push_back(std::to_string(character_pet_info_entry.pet)); insert_values.push_back("'" + EscapeString(character_pet_info_entry.petname) + "'"); insert_values.push_back(std::to_string(character_pet_info_entry.petpower)); insert_values.push_back(std::to_string(character_pet_info_entry.spell_id)); @@ -234,7 +238,7 @@ public: ); if (results.Success()) { - character_pet_info_entry.id = results.LastInsertedID(); + character_pet_info_entry.char_id = results.LastInsertedID(); return character_pet_info_entry; } @@ -252,6 +256,8 @@ public: for (auto &character_pet_info_entry: character_pet_info_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_pet_info_entry.char_id)); + insert_values.push_back(std::to_string(character_pet_info_entry.pet)); insert_values.push_back("'" + EscapeString(character_pet_info_entry.petname) + "'"); insert_values.push_back(std::to_string(character_pet_info_entry.petpower)); insert_values.push_back(std::to_string(character_pet_info_entry.spell_id)); diff --git a/common/repositories/base/base_character_pet_inventory_repository.h b/common/repositories/base/base_character_pet_inventory_repository.h index f2a79f898..8d3d94d1d 100644 --- a/common/repositories/base/base_character_pet_inventory_repository.h +++ b/common/repositories/base/base_character_pet_inventory_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("char_id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &character_pet_inventory : character_pet_inventorys) { - if (character_pet_inventory.slot == character_pet_inventory_id) { + if (character_pet_inventory.char_id == character_pet_inventory_id) { return character_pet_inventory; } } @@ -176,6 +176,9 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_pet_inventory_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_pet_inventory_entry.pet)); + update_values.push_back(columns[2] + " = " + std::to_string(character_pet_inventory_entry.slot)); update_values.push_back(columns[3] + " = " + std::to_string(character_pet_inventory_entry.item_id)); auto results = database.QueryDatabase( @@ -184,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_pet_inventory_entry.slot + character_pet_inventory_entry.char_id ) ); @@ -197,6 +200,9 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_pet_inventory_entry.char_id)); + insert_values.push_back(std::to_string(character_pet_inventory_entry.pet)); + insert_values.push_back(std::to_string(character_pet_inventory_entry.slot)); insert_values.push_back(std::to_string(character_pet_inventory_entry.item_id)); auto results = database.QueryDatabase( @@ -208,7 +214,7 @@ public: ); if (results.Success()) { - character_pet_inventory_entry.id = results.LastInsertedID(); + character_pet_inventory_entry.char_id = results.LastInsertedID(); return character_pet_inventory_entry; } @@ -226,6 +232,9 @@ public: for (auto &character_pet_inventory_entry: character_pet_inventory_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_pet_inventory_entry.char_id)); + insert_values.push_back(std::to_string(character_pet_inventory_entry.pet)); + insert_values.push_back(std::to_string(character_pet_inventory_entry.slot)); insert_values.push_back(std::to_string(character_pet_inventory_entry.item_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_potionbelt_repository.h b/common/repositories/base/base_character_potionbelt_repository.h index 9c017a009..6c570fa1b 100644 --- a/common/repositories/base/base_character_potionbelt_repository.h +++ b/common/repositories/base/base_character_potionbelt_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("potion_id"); + return std::string("id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &character_potionbelt : character_potionbelts) { - if (character_potionbelt.potion_id == character_potionbelt_id) { + if (character_potionbelt.id == character_potionbelt_id) { return character_potionbelt; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_potionbelt_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(character_potionbelt_entry.potion_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_potionbelt_entry.item_id)); update_values.push_back(columns[3] + " = " + std::to_string(character_potionbelt_entry.icon)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_potionbelt_entry.potion_id + character_potionbelt_entry.id ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_potionbelt_entry.id)); + insert_values.push_back(std::to_string(character_potionbelt_entry.potion_id)); insert_values.push_back(std::to_string(character_potionbelt_entry.item_id)); insert_values.push_back(std::to_string(character_potionbelt_entry.icon)); @@ -228,6 +232,8 @@ public: for (auto &character_potionbelt_entry: character_potionbelt_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_potionbelt_entry.id)); + insert_values.push_back(std::to_string(character_potionbelt_entry.potion_id)); insert_values.push_back(std::to_string(character_potionbelt_entry.item_id)); insert_values.push_back(std::to_string(character_potionbelt_entry.icon)); diff --git a/common/repositories/base/base_character_skills_repository.h b/common/repositories/base/base_character_skills_repository.h index 4298c7e5e..65fa1dd60 100644 --- a/common/repositories/base/base_character_skills_repository.h +++ b/common/repositories/base/base_character_skills_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("skill_id"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_skills : character_skillss) { - if (character_skills.skill_id == character_skills_id) { + if (character_skills.id == character_skills_id) { return character_skills; } } @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[1] + " = " + std::to_string(character_skills_entry.skill_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_skills_entry.value)); auto results = database.QueryDatabase( @@ -180,7 +181,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_skills_entry.skill_id + character_skills_entry.id ) ); @@ -193,6 +194,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_skills_entry.skill_id)); insert_values.push_back(std::to_string(character_skills_entry.value)); auto results = database.QueryDatabase( @@ -222,6 +224,7 @@ public: for (auto &character_skills_entry: character_skills_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_skills_entry.skill_id)); insert_values.push_back(std::to_string(character_skills_entry.value)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_spells_repository.h b/common/repositories/base/base_character_spells_repository.h index 0e9a8c182..aeab5a7ab 100644 --- a/common/repositories/base/base_character_spells_repository.h +++ b/common/repositories/base/base_character_spells_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("slot_id"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &character_spells : character_spellss) { - if (character_spells.slot_id == character_spells_id) { + if (character_spells.id == character_spells_id) { return character_spells; } } @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[1] + " = " + std::to_string(character_spells_entry.slot_id)); update_values.push_back(columns[2] + " = " + std::to_string(character_spells_entry.spell_id)); auto results = database.QueryDatabase( @@ -180,7 +181,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_spells_entry.slot_id + character_spells_entry.id ) ); @@ -193,6 +194,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_spells_entry.slot_id)); insert_values.push_back(std::to_string(character_spells_entry.spell_id)); auto results = database.QueryDatabase( @@ -222,6 +224,7 @@ public: for (auto &character_spells_entry: character_spells_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_spells_entry.slot_id)); insert_values.push_back(std::to_string(character_spells_entry.spell_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_character_tasks_repository.h b/common/repositories/base/base_character_tasks_repository.h index 362a81e37..ce67e80ff 100644 --- a/common/repositories/base/base_character_tasks_repository.h +++ b/common/repositories/base/base_character_tasks_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("taskid"); + return std::string("charid"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &character_tasks : character_taskss) { - if (character_tasks.taskid == character_tasks_id) { + if (character_tasks.charid == character_tasks_id) { return character_tasks; } } @@ -180,6 +180,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(character_tasks_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(character_tasks_entry.taskid)); update_values.push_back(columns[2] + " = " + std::to_string(character_tasks_entry.slot)); update_values.push_back(columns[3] + " = " + std::to_string(character_tasks_entry.type)); update_values.push_back(columns[4] + " = " + std::to_string(character_tasks_entry.acceptedtime)); @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - character_tasks_entry.taskid + character_tasks_entry.charid ) ); @@ -203,6 +205,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(character_tasks_entry.charid)); + insert_values.push_back(std::to_string(character_tasks_entry.taskid)); insert_values.push_back(std::to_string(character_tasks_entry.slot)); insert_values.push_back(std::to_string(character_tasks_entry.type)); insert_values.push_back(std::to_string(character_tasks_entry.acceptedtime)); @@ -216,7 +220,7 @@ public: ); if (results.Success()) { - character_tasks_entry.id = results.LastInsertedID(); + character_tasks_entry.charid = results.LastInsertedID(); return character_tasks_entry; } @@ -234,6 +238,8 @@ public: for (auto &character_tasks_entry: character_tasks_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(character_tasks_entry.charid)); + insert_values.push_back(std::to_string(character_tasks_entry.taskid)); insert_values.push_back(std::to_string(character_tasks_entry.slot)); insert_values.push_back(std::to_string(character_tasks_entry.type)); insert_values.push_back(std::to_string(character_tasks_entry.acceptedtime)); diff --git a/common/repositories/base/base_character_tribute_repository.h b/common/repositories/base/base_character_tribute_repository.h deleted file mode 100644 index 8c3d318c8..000000000 --- a/common/repositories/base/base_character_tribute_repository.h +++ /dev/null @@ -1,318 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - */ - -/** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to - * the repository extending the base. Any modifications to base repositories are to - * be made by the generator only - */ - -#ifndef EQEMU_BASE_CHARACTER_TRIBUTE_REPOSITORY_H -#define EQEMU_BASE_CHARACTER_TRIBUTE_REPOSITORY_H - -#include "../../database.h" -#include "../../string_util.h" - -class BaseCharacterTributeRepository { -public: - struct CharacterTribute { - int id; - int8 tier; - int tribute; - }; - - static std::string PrimaryKey() - { - return std::string("id"); - } - - static std::vector Columns() - { - return { - "id", - "tier", - "tribute", - }; - } - - static std::string ColumnsRaw() - { - return std::string(implode(", ", Columns())); - } - - static std::string InsertColumnsRaw() - { - std::vector insert_columns; - - for (auto &column : Columns()) { - if (column == PrimaryKey()) { - continue; - } - - insert_columns.push_back(column); - } - - return std::string(implode(", ", insert_columns)); - } - - static std::string TableName() - { - return std::string("character_tribute"); - } - - static std::string BaseSelect() - { - return fmt::format( - "SELECT {} FROM {}", - ColumnsRaw(), - TableName() - ); - } - - static std::string BaseInsert() - { - return fmt::format( - "INSERT INTO {} ({}) ", - TableName(), - InsertColumnsRaw() - ); - } - - static CharacterTribute NewEntity() - { - CharacterTribute entry{}; - - entry.id = 0; - entry.tier = 0; - entry.tribute = 0; - - return entry; - } - - static CharacterTribute GetCharacterTributeEntry( - const std::vector &character_tributes, - int character_tribute_id - ) - { - for (auto &character_tribute : character_tributes) { - if (character_tribute.id == character_tribute_id) { - return character_tribute; - } - } - - return NewEntity(); - } - - static CharacterTribute FindOne( - int character_tribute_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE id = {} LIMIT 1", - BaseSelect(), - character_tribute_id - ) - ); - - auto row = results.begin(); - if (results.RowCount() == 1) { - CharacterTribute entry{}; - - entry.id = atoi(row[0]); - entry.tier = atoi(row[1]); - entry.tribute = atoi(row[2]); - - return entry; - } - - return NewEntity(); - } - - static int DeleteOne( - int character_tribute_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {} = {}", - TableName(), - PrimaryKey(), - character_tribute_id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static int UpdateOne( - CharacterTribute character_tribute_entry - ) - { - std::vector update_values; - - auto columns = Columns(); - - update_values.push_back(columns[0] + " = " + std::to_string(character_tribute_entry.id)); - update_values.push_back(columns[1] + " = " + std::to_string(character_tribute_entry.tier)); - update_values.push_back(columns[2] + " = " + std::to_string(character_tribute_entry.tribute)); - - auto results = database.QueryDatabase( - fmt::format( - "UPDATE {} SET {} WHERE {} = {}", - TableName(), - implode(", ", update_values), - PrimaryKey(), - character_tribute_entry.id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static CharacterTribute InsertOne( - CharacterTribute character_tribute_entry - ) - { - std::vector insert_values; - - insert_values.push_back(std::to_string(character_tribute_entry.id)); - insert_values.push_back(std::to_string(character_tribute_entry.tier)); - insert_values.push_back(std::to_string(character_tribute_entry.tribute)); - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES ({})", - BaseInsert(), - implode(",", insert_values) - ) - ); - - if (results.Success()) { - character_tribute_entry.id = results.LastInsertedID(); - return character_tribute_entry; - } - - character_tribute_entry = NewEntity(); - - return character_tribute_entry; - } - - static int InsertMany( - std::vector character_tribute_entries - ) - { - std::vector insert_chunks; - - for (auto &character_tribute_entry: character_tribute_entries) { - std::vector insert_values; - - insert_values.push_back(std::to_string(character_tribute_entry.id)); - insert_values.push_back(std::to_string(character_tribute_entry.tier)); - insert_values.push_back(std::to_string(character_tribute_entry.tribute)); - - insert_chunks.push_back("(" + implode(",", insert_values) + ")"); - } - - std::vector insert_values; - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES {}", - BaseInsert(), - implode(",", insert_chunks) - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static std::vector All() - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{}", - BaseSelect() - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - CharacterTribute entry{}; - - entry.id = atoi(row[0]); - entry.tier = atoi(row[1]); - entry.tribute = atoi(row[2]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static std::vector GetWhere(std::string where_filter) - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE {}", - BaseSelect(), - where_filter - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - CharacterTribute entry{}; - - entry.id = atoi(row[0]); - entry.tier = atoi(row[1]); - entry.tribute = atoi(row[2]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static int DeleteWhere(std::string where_filter) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {}", - TableName(), - PrimaryKey(), - where_filter - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - -}; - -#endif //EQEMU_BASE_CHARACTER_TRIBUTE_REPOSITORY_H diff --git a/common/repositories/base/base_chatchannels_repository.h b/common/repositories/base/base_chatchannels_repository.h deleted file mode 100644 index 680e6a4bb..000000000 --- a/common/repositories/base/base_chatchannels_repository.h +++ /dev/null @@ -1,324 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - */ - -/** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to - * the repository extending the base. Any modifications to base repositories are to - * be made by the generator only - */ - -#ifndef EQEMU_BASE_CHATCHANNELS_REPOSITORY_H -#define EQEMU_BASE_CHATCHANNELS_REPOSITORY_H - -#include "../../database.h" -#include "../../string_util.h" - -class BaseChatchannelsRepository { -public: - struct Chatchannels { - std::string name; - std::string owner; - std::string password; - int minstatus; - }; - - static std::string PrimaryKey() - { - return std::string("name"); - } - - static std::vector Columns() - { - return { - "name", - "owner", - "password", - "minstatus", - }; - } - - static std::string ColumnsRaw() - { - return std::string(implode(", ", Columns())); - } - - static std::string InsertColumnsRaw() - { - std::vector insert_columns; - - for (auto &column : Columns()) { - if (column == PrimaryKey()) { - continue; - } - - insert_columns.push_back(column); - } - - return std::string(implode(", ", insert_columns)); - } - - static std::string TableName() - { - return std::string("chatchannels"); - } - - static std::string BaseSelect() - { - return fmt::format( - "SELECT {} FROM {}", - ColumnsRaw(), - TableName() - ); - } - - static std::string BaseInsert() - { - return fmt::format( - "INSERT INTO {} ({}) ", - TableName(), - InsertColumnsRaw() - ); - } - - static Chatchannels NewEntity() - { - Chatchannels entry{}; - - entry.name = ""; - entry.owner = ""; - entry.password = ""; - entry.minstatus = 0; - - return entry; - } - - static Chatchannels GetChatchannelsEntry( - const std::vector &chatchannelss, - int chatchannels_id - ) - { - for (auto &chatchannels : chatchannelss) { - if (chatchannels.name == chatchannels_id) { - return chatchannels; - } - } - - return NewEntity(); - } - - static Chatchannels FindOne( - int chatchannels_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE id = {} LIMIT 1", - BaseSelect(), - chatchannels_id - ) - ); - - auto row = results.begin(); - if (results.RowCount() == 1) { - Chatchannels entry{}; - - entry.name = row[0] ? row[0] : ""; - entry.owner = row[1] ? row[1] : ""; - entry.password = row[2] ? row[2] : ""; - entry.minstatus = atoi(row[3]); - - return entry; - } - - return NewEntity(); - } - - static int DeleteOne( - int chatchannels_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {} = {}", - TableName(), - PrimaryKey(), - chatchannels_id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static int UpdateOne( - Chatchannels chatchannels_entry - ) - { - std::vector update_values; - - auto columns = Columns(); - - update_values.push_back(columns[1] + " = '" + EscapeString(chatchannels_entry.owner) + "'"); - update_values.push_back(columns[2] + " = '" + EscapeString(chatchannels_entry.password) + "'"); - update_values.push_back(columns[3] + " = " + std::to_string(chatchannels_entry.minstatus)); - - auto results = database.QueryDatabase( - fmt::format( - "UPDATE {} SET {} WHERE {} = {}", - TableName(), - implode(", ", update_values), - PrimaryKey(), - chatchannels_entry.name - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static Chatchannels InsertOne( - Chatchannels chatchannels_entry - ) - { - std::vector insert_values; - - insert_values.push_back("'" + EscapeString(chatchannels_entry.owner) + "'"); - insert_values.push_back("'" + EscapeString(chatchannels_entry.password) + "'"); - insert_values.push_back(std::to_string(chatchannels_entry.minstatus)); - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES ({})", - BaseInsert(), - implode(",", insert_values) - ) - ); - - if (results.Success()) { - chatchannels_entry.id = results.LastInsertedID(); - return chatchannels_entry; - } - - chatchannels_entry = NewEntity(); - - return chatchannels_entry; - } - - static int InsertMany( - std::vector chatchannels_entries - ) - { - std::vector insert_chunks; - - for (auto &chatchannels_entry: chatchannels_entries) { - std::vector insert_values; - - insert_values.push_back("'" + EscapeString(chatchannels_entry.owner) + "'"); - insert_values.push_back("'" + EscapeString(chatchannels_entry.password) + "'"); - insert_values.push_back(std::to_string(chatchannels_entry.minstatus)); - - insert_chunks.push_back("(" + implode(",", insert_values) + ")"); - } - - std::vector insert_values; - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES {}", - BaseInsert(), - implode(",", insert_chunks) - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static std::vector All() - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{}", - BaseSelect() - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - Chatchannels entry{}; - - entry.name = row[0] ? row[0] : ""; - entry.owner = row[1] ? row[1] : ""; - entry.password = row[2] ? row[2] : ""; - entry.minstatus = atoi(row[3]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static std::vector GetWhere(std::string where_filter) - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE {}", - BaseSelect(), - where_filter - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - Chatchannels entry{}; - - entry.name = row[0] ? row[0] : ""; - entry.owner = row[1] ? row[1] : ""; - entry.password = row[2] ? row[2] : ""; - entry.minstatus = atoi(row[3]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static int DeleteWhere(std::string where_filter) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {}", - TableName(), - PrimaryKey(), - where_filter - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - -}; - -#endif //EQEMU_BASE_CHATCHANNELS_REPOSITORY_H diff --git a/common/repositories/base/base_command_settings_repository.h b/common/repositories/base/base_command_settings_repository.h deleted file mode 100644 index 98233bdd7..000000000 --- a/common/repositories/base/base_command_settings_repository.h +++ /dev/null @@ -1,315 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - */ - -/** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to - * the repository extending the base. Any modifications to base repositories are to - * be made by the generator only - */ - -#ifndef EQEMU_BASE_COMMAND_SETTINGS_REPOSITORY_H -#define EQEMU_BASE_COMMAND_SETTINGS_REPOSITORY_H - -#include "../../database.h" -#include "../../string_util.h" - -class BaseCommandSettingsRepository { -public: - struct CommandSettings { - std::string command; - int access; - std::string aliases; - }; - - static std::string PrimaryKey() - { - return std::string("command"); - } - - static std::vector Columns() - { - return { - "command", - "access", - "aliases", - }; - } - - static std::string ColumnsRaw() - { - return std::string(implode(", ", Columns())); - } - - static std::string InsertColumnsRaw() - { - std::vector insert_columns; - - for (auto &column : Columns()) { - if (column == PrimaryKey()) { - continue; - } - - insert_columns.push_back(column); - } - - return std::string(implode(", ", insert_columns)); - } - - static std::string TableName() - { - return std::string("command_settings"); - } - - static std::string BaseSelect() - { - return fmt::format( - "SELECT {} FROM {}", - ColumnsRaw(), - TableName() - ); - } - - static std::string BaseInsert() - { - return fmt::format( - "INSERT INTO {} ({}) ", - TableName(), - InsertColumnsRaw() - ); - } - - static CommandSettings NewEntity() - { - CommandSettings entry{}; - - entry.command = ""; - entry.access = 0; - entry.aliases = ""; - - return entry; - } - - static CommandSettings GetCommandSettingsEntry( - const std::vector &command_settingss, - int command_settings_id - ) - { - for (auto &command_settings : command_settingss) { - if (command_settings.command == command_settings_id) { - return command_settings; - } - } - - return NewEntity(); - } - - static CommandSettings FindOne( - int command_settings_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE id = {} LIMIT 1", - BaseSelect(), - command_settings_id - ) - ); - - auto row = results.begin(); - if (results.RowCount() == 1) { - CommandSettings entry{}; - - entry.command = row[0] ? row[0] : ""; - entry.access = atoi(row[1]); - entry.aliases = row[2] ? row[2] : ""; - - return entry; - } - - return NewEntity(); - } - - static int DeleteOne( - int command_settings_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {} = {}", - TableName(), - PrimaryKey(), - command_settings_id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static int UpdateOne( - CommandSettings command_settings_entry - ) - { - std::vector update_values; - - auto columns = Columns(); - - update_values.push_back(columns[1] + " = " + std::to_string(command_settings_entry.access)); - update_values.push_back(columns[2] + " = '" + EscapeString(command_settings_entry.aliases) + "'"); - - auto results = database.QueryDatabase( - fmt::format( - "UPDATE {} SET {} WHERE {} = {}", - TableName(), - implode(", ", update_values), - PrimaryKey(), - command_settings_entry.command - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static CommandSettings InsertOne( - CommandSettings command_settings_entry - ) - { - std::vector insert_values; - - insert_values.push_back(std::to_string(command_settings_entry.access)); - insert_values.push_back("'" + EscapeString(command_settings_entry.aliases) + "'"); - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES ({})", - BaseInsert(), - implode(",", insert_values) - ) - ); - - if (results.Success()) { - command_settings_entry.id = results.LastInsertedID(); - return command_settings_entry; - } - - command_settings_entry = NewEntity(); - - return command_settings_entry; - } - - static int InsertMany( - std::vector command_settings_entries - ) - { - std::vector insert_chunks; - - for (auto &command_settings_entry: command_settings_entries) { - std::vector insert_values; - - insert_values.push_back(std::to_string(command_settings_entry.access)); - insert_values.push_back("'" + EscapeString(command_settings_entry.aliases) + "'"); - - insert_chunks.push_back("(" + implode(",", insert_values) + ")"); - } - - std::vector insert_values; - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES {}", - BaseInsert(), - implode(",", insert_chunks) - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static std::vector All() - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{}", - BaseSelect() - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - CommandSettings entry{}; - - entry.command = row[0] ? row[0] : ""; - entry.access = atoi(row[1]); - entry.aliases = row[2] ? row[2] : ""; - - all_entries.push_back(entry); - } - - return all_entries; - } - - static std::vector GetWhere(std::string where_filter) - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE {}", - BaseSelect(), - where_filter - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - CommandSettings entry{}; - - entry.command = row[0] ? row[0] : ""; - entry.access = atoi(row[1]); - entry.aliases = row[2] ? row[2] : ""; - - all_entries.push_back(entry); - } - - return all_entries; - } - - static int DeleteWhere(std::string where_filter) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {}", - TableName(), - PrimaryKey(), - where_filter - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - -}; - -#endif //EQEMU_BASE_COMMAND_SETTINGS_REPOSITORY_H diff --git a/common/repositories/base/base_completed_tasks_repository.h b/common/repositories/base/base_completed_tasks_repository.h index 5b2ddfd07..b4a82a14b 100644 --- a/common/repositories/base/base_completed_tasks_repository.h +++ b/common/repositories/base/base_completed_tasks_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("activityid"); + return std::string("charid"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &completed_tasks : completed_taskss) { - if (completed_tasks.activityid == completed_tasks_id) { + if (completed_tasks.charid == completed_tasks_id) { return completed_tasks; } } @@ -176,7 +176,10 @@ public: auto columns = Columns(); - + update_values.push_back(columns[0] + " = " + std::to_string(completed_tasks_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(completed_tasks_entry.completedtime)); + update_values.push_back(columns[2] + " = " + std::to_string(completed_tasks_entry.taskid)); + update_values.push_back(columns[3] + " = " + std::to_string(completed_tasks_entry.activityid)); auto results = database.QueryDatabase( fmt::format( @@ -184,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - completed_tasks_entry.activityid + completed_tasks_entry.charid ) ); @@ -197,7 +200,10 @@ public: { std::vector insert_values; - + insert_values.push_back(std::to_string(completed_tasks_entry.charid)); + insert_values.push_back(std::to_string(completed_tasks_entry.completedtime)); + insert_values.push_back(std::to_string(completed_tasks_entry.taskid)); + insert_values.push_back(std::to_string(completed_tasks_entry.activityid)); auto results = database.QueryDatabase( fmt::format( @@ -208,7 +214,7 @@ public: ); if (results.Success()) { - completed_tasks_entry.id = results.LastInsertedID(); + completed_tasks_entry.charid = results.LastInsertedID(); return completed_tasks_entry; } @@ -226,7 +232,10 @@ public: for (auto &completed_tasks_entry: completed_tasks_entries) { std::vector insert_values; - + insert_values.push_back(std::to_string(completed_tasks_entry.charid)); + insert_values.push_back(std::to_string(completed_tasks_entry.completedtime)); + insert_values.push_back(std::to_string(completed_tasks_entry.taskid)); + insert_values.push_back(std::to_string(completed_tasks_entry.activityid)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_data_buckets_repository.h b/common/repositories/base/base_data_buckets_repository.h index a3704fb90..428b0c55c 100644 --- a/common/repositories/base/base_data_buckets_repository.h +++ b/common/repositories/base/base_data_buckets_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_db_str_repository.h b/common/repositories/base/base_db_str_repository.h index 9268f9647..006dc1aa0 100644 --- a/common/repositories/base/base_db_str_repository.h +++ b/common/repositories/base/base_db_str_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("type"); + return std::string("id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &db_str : db_strs) { - if (db_str.type == db_str_id) { + if (db_str.id == db_str_id) { return db_str; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(db_str_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(db_str_entry.type)); update_values.push_back(columns[2] + " = '" + EscapeString(db_str_entry.value) + "'"); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - db_str_entry.type + db_str_entry.id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(db_str_entry.id)); + insert_values.push_back(std::to_string(db_str_entry.type)); insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'"); auto results = database.QueryDatabase( @@ -222,6 +226,8 @@ public: for (auto &db_str_entry: db_str_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(db_str_entry.id)); + insert_values.push_back(std::to_string(db_str_entry.type)); insert_values.push_back("'" + EscapeString(db_str_entry.value) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_discovered_items_repository.h b/common/repositories/base/base_discovered_items_repository.h index 2c7d88ddb..9f31dc3bb 100644 --- a/common/repositories/base/base_discovered_items_repository.h +++ b/common/repositories/base/base_discovered_items_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -176,6 +176,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(discovered_items_entry.item_id)); update_values.push_back(columns[1] + " = '" + EscapeString(discovered_items_entry.char_name) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(discovered_items_entry.discovered_date)); update_values.push_back(columns[3] + " = " + std::to_string(discovered_items_entry.account_status)); @@ -199,6 +200,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(discovered_items_entry.item_id)); insert_values.push_back("'" + EscapeString(discovered_items_entry.char_name) + "'"); insert_values.push_back(std::to_string(discovered_items_entry.discovered_date)); insert_values.push_back(std::to_string(discovered_items_entry.account_status)); @@ -212,7 +214,7 @@ public: ); if (results.Success()) { - discovered_items_entry.id = results.LastInsertedID(); + discovered_items_entry.item_id = results.LastInsertedID(); return discovered_items_entry; } @@ -230,6 +232,7 @@ public: for (auto &discovered_items_entry: discovered_items_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(discovered_items_entry.item_id)); insert_values.push_back("'" + EscapeString(discovered_items_entry.char_name) + "'"); insert_values.push_back(std::to_string(discovered_items_entry.discovered_date)); insert_values.push_back(std::to_string(discovered_items_entry.account_status)); diff --git a/common/repositories/base/base_doors_repository.h b/common/repositories/base/base_doors_repository.h index 885c931b9..67734c00b 100644 --- a/common/repositories/base/base_doors_repository.h +++ b/common/repositories/base/base_doors_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_eventlog_repository.h b/common/repositories/base/base_eventlog_repository.h index 069a56667..76ce850aa 100644 --- a/common/repositories/base/base_eventlog_repository.h +++ b/common/repositories/base/base_eventlog_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_faction_base_data_repository.h b/common/repositories/base/base_faction_base_data_repository.h index b32fdff98..a7e0f5170 100644 --- a/common/repositories/base/base_faction_base_data_repository.h +++ b/common/repositories/base/base_faction_base_data_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -184,6 +184,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(faction_base_data_entry.client_faction_id)); update_values.push_back(columns[1] + " = " + std::to_string(faction_base_data_entry.min)); update_values.push_back(columns[2] + " = " + std::to_string(faction_base_data_entry.max)); update_values.push_back(columns[3] + " = " + std::to_string(faction_base_data_entry.unk_hero1)); @@ -209,6 +210,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(faction_base_data_entry.client_faction_id)); insert_values.push_back(std::to_string(faction_base_data_entry.min)); insert_values.push_back(std::to_string(faction_base_data_entry.max)); insert_values.push_back(std::to_string(faction_base_data_entry.unk_hero1)); @@ -224,7 +226,7 @@ public: ); if (results.Success()) { - faction_base_data_entry.id = results.LastInsertedID(); + faction_base_data_entry.client_faction_id = results.LastInsertedID(); return faction_base_data_entry; } @@ -242,6 +244,7 @@ public: for (auto &faction_base_data_entry: faction_base_data_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(faction_base_data_entry.client_faction_id)); insert_values.push_back(std::to_string(faction_base_data_entry.min)); insert_values.push_back(std::to_string(faction_base_data_entry.max)); insert_values.push_back(std::to_string(faction_base_data_entry.unk_hero1)); diff --git a/common/repositories/base/base_faction_list_mod_repository.h b/common/repositories/base/base_faction_list_mod_repository.h index 8cff9e393..76ab20eca 100644 --- a/common/repositories/base/base_faction_list_mod_repository.h +++ b/common/repositories/base/base_faction_list_mod_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_faction_list_repository.h b/common/repositories/base/base_faction_list_repository.h index c6f191421..56472a500 100644 --- a/common/repositories/base/base_faction_list_repository.h +++ b/common/repositories/base/base_faction_list_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(faction_list_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(faction_list_entry.name) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(faction_list_entry.base)); @@ -194,6 +195,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(faction_list_entry.id)); insert_values.push_back("'" + EscapeString(faction_list_entry.name) + "'"); insert_values.push_back(std::to_string(faction_list_entry.base)); @@ -224,6 +226,7 @@ public: for (auto &faction_list_entry: faction_list_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(faction_list_entry.id)); insert_values.push_back("'" + EscapeString(faction_list_entry.name) + "'"); insert_values.push_back(std::to_string(faction_list_entry.base)); diff --git a/common/repositories/base/base_faction_values_repository.h b/common/repositories/base/base_faction_values_repository.h index 3d2f3da69..287a1f578 100644 --- a/common/repositories/base/base_faction_values_repository.h +++ b/common/repositories/base/base_faction_values_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("faction_id"); + return std::string("char_id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &faction_values : faction_valuess) { - if (faction_values.faction_id == faction_values_id) { + if (faction_values.char_id == faction_values_id) { return faction_values; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(faction_values_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(faction_values_entry.faction_id)); update_values.push_back(columns[2] + " = " + std::to_string(faction_values_entry.current_value)); update_values.push_back(columns[3] + " = " + std::to_string(faction_values_entry.temp)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - faction_values_entry.faction_id + faction_values_entry.char_id ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(faction_values_entry.char_id)); + insert_values.push_back(std::to_string(faction_values_entry.faction_id)); insert_values.push_back(std::to_string(faction_values_entry.current_value)); insert_values.push_back(std::to_string(faction_values_entry.temp)); @@ -210,7 +214,7 @@ public: ); if (results.Success()) { - faction_values_entry.id = results.LastInsertedID(); + faction_values_entry.char_id = results.LastInsertedID(); return faction_values_entry; } @@ -228,6 +232,8 @@ public: for (auto &faction_values_entry: faction_values_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(faction_values_entry.char_id)); + insert_values.push_back(std::to_string(faction_values_entry.faction_id)); insert_values.push_back(std::to_string(faction_values_entry.current_value)); insert_values.push_back(std::to_string(faction_values_entry.temp)); diff --git a/common/repositories/base/base_fishing_repository.h b/common/repositories/base/base_fishing_repository.h index 7e164bc12..f707477f1 100644 --- a/common/repositories/base/base_fishing_repository.h +++ b/common/repositories/base/base_fishing_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_forage_repository.h b/common/repositories/base/base_forage_repository.h index 9b5fbd371..981796e3c 100644 --- a/common/repositories/base/base_forage_repository.h +++ b/common/repositories/base/base_forage_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_friends_repository.h b/common/repositories/base/base_friends_repository.h index 67220e475..fb59c824f 100644 --- a/common/repositories/base/base_friends_repository.h +++ b/common/repositories/base/base_friends_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("name"); + return std::string("charid"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &friends : friendss) { - if (friends.name == friends_id) { + if (friends.charid == friends_id) { return friends; } } @@ -172,7 +172,9 @@ public: auto columns = Columns(); - + update_values.push_back(columns[0] + " = " + std::to_string(friends_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(friends_entry.type)); + update_values.push_back(columns[2] + " = '" + EscapeString(friends_entry.name) + "'"); auto results = database.QueryDatabase( fmt::format( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - friends_entry.name + friends_entry.charid ) ); @@ -193,7 +195,9 @@ public: { std::vector insert_values; - + insert_values.push_back(std::to_string(friends_entry.charid)); + insert_values.push_back(std::to_string(friends_entry.type)); + insert_values.push_back("'" + EscapeString(friends_entry.name) + "'"); auto results = database.QueryDatabase( fmt::format( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - friends_entry.id = results.LastInsertedID(); + friends_entry.charid = results.LastInsertedID(); return friends_entry; } @@ -222,7 +226,9 @@ public: for (auto &friends_entry: friends_entries) { std::vector insert_values; - + insert_values.push_back(std::to_string(friends_entry.charid)); + insert_values.push_back(std::to_string(friends_entry.type)); + insert_values.push_back("'" + EscapeString(friends_entry.name) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_global_loot_repository.h b/common/repositories/base/base_global_loot_repository.h index 4528434c7..ec93f3c36 100644 --- a/common/repositories/base/base_global_loot_repository.h +++ b/common/repositories/base/base_global_loot_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_gm_ips_repository.h b/common/repositories/base/base_gm_ips_repository.h index 6d80f5bd5..933bb047e 100644 --- a/common/repositories/base/base_gm_ips_repository.h +++ b/common/repositories/base/base_gm_ips_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("ip_address"); + return std::string("account_id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &gm_ips : gm_ipss) { - if (gm_ips.ip_address == gm_ips_id) { + if (gm_ips.account_id == gm_ips_id) { return gm_ips; } } @@ -173,6 +173,8 @@ public: auto columns = Columns(); update_values.push_back(columns[0] + " = '" + EscapeString(gm_ips_entry.name) + "'"); + update_values.push_back(columns[1] + " = " + std::to_string(gm_ips_entry.account_id)); + update_values.push_back(columns[2] + " = '" + EscapeString(gm_ips_entry.ip_address) + "'"); auto results = database.QueryDatabase( fmt::format( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - gm_ips_entry.ip_address + gm_ips_entry.account_id ) ); @@ -194,6 +196,8 @@ public: std::vector insert_values; insert_values.push_back("'" + EscapeString(gm_ips_entry.name) + "'"); + insert_values.push_back(std::to_string(gm_ips_entry.account_id)); + insert_values.push_back("'" + EscapeString(gm_ips_entry.ip_address) + "'"); auto results = database.QueryDatabase( fmt::format( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - gm_ips_entry.id = results.LastInsertedID(); + gm_ips_entry.account_id = results.LastInsertedID(); return gm_ips_entry; } @@ -223,6 +227,8 @@ public: std::vector insert_values; insert_values.push_back("'" + EscapeString(gm_ips_entry.name) + "'"); + insert_values.push_back(std::to_string(gm_ips_entry.account_id)); + insert_values.push_back("'" + EscapeString(gm_ips_entry.ip_address) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_goallists_repository.h b/common/repositories/base/base_goallists_repository.h index e1f1f0aa9..e3761f8b2 100644 --- a/common/repositories/base/base_goallists_repository.h +++ b/common/repositories/base/base_goallists_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr11, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_graveyard_repository.h b/common/repositories/base/base_graveyard_repository.h index 7019a7d40..b86b045bb 100644 --- a/common/repositories/base/base_graveyard_repository.h +++ b/common/repositories/base/base_graveyard_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_grid_repository.h b/common/repositories/base/base_grid_repository.h index 0fedf47a5..a60580472 100644 --- a/common/repositories/base/base_grid_repository.h +++ b/common/repositories/base/base_grid_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("zoneid"); + return std::string("id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &grid : grids) { - if (grid.zoneid == grid_id) { + if (grid.id == grid_id) { return grid; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(grid_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(grid_entry.zoneid)); update_values.push_back(columns[2] + " = " + std::to_string(grid_entry.type)); update_values.push_back(columns[3] + " = " + std::to_string(grid_entry.type2)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - grid_entry.zoneid + grid_entry.id ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(grid_entry.id)); + insert_values.push_back(std::to_string(grid_entry.zoneid)); insert_values.push_back(std::to_string(grid_entry.type)); insert_values.push_back(std::to_string(grid_entry.type2)); @@ -228,6 +232,8 @@ public: for (auto &grid_entry: grid_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(grid_entry.id)); + insert_values.push_back(std::to_string(grid_entry.zoneid)); insert_values.push_back(std::to_string(grid_entry.type)); insert_values.push_back(std::to_string(grid_entry.type2)); diff --git a/common/repositories/base/base_ground_spawns_repository.h b/common/repositories/base/base_ground_spawns_repository.h index 4ff76b0c8..8b06cd5d9 100644 --- a/common/repositories/base/base_ground_spawns_repository.h +++ b/common/repositories/base/base_ground_spawns_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_group_id_repository.h b/common/repositories/base/base_group_id_repository.h index c9446a5d1..ac166ee94 100644 --- a/common/repositories/base/base_group_id_repository.h +++ b/common/repositories/base/base_group_id_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("ismerc"); + return std::string("groupid"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &group_id : group_ids) { - if (group_id.ismerc == group_id_id) { + if (group_id.groupid == group_id_id) { return group_id; } } @@ -176,7 +176,10 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(group_id_entry.groupid)); + update_values.push_back(columns[1] + " = " + std::to_string(group_id_entry.charid)); update_values.push_back(columns[2] + " = '" + EscapeString(group_id_entry.name) + "'"); + update_values.push_back(columns[3] + " = " + std::to_string(group_id_entry.ismerc)); auto results = database.QueryDatabase( fmt::format( @@ -184,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - group_id_entry.ismerc + group_id_entry.groupid ) ); @@ -197,7 +200,10 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(group_id_entry.groupid)); + insert_values.push_back(std::to_string(group_id_entry.charid)); insert_values.push_back("'" + EscapeString(group_id_entry.name) + "'"); + insert_values.push_back(std::to_string(group_id_entry.ismerc)); auto results = database.QueryDatabase( fmt::format( @@ -208,7 +214,7 @@ public: ); if (results.Success()) { - group_id_entry.id = results.LastInsertedID(); + group_id_entry.groupid = results.LastInsertedID(); return group_id_entry; } @@ -226,7 +232,10 @@ public: for (auto &group_id_entry: group_id_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(group_id_entry.groupid)); + insert_values.push_back(std::to_string(group_id_entry.charid)); insert_values.push_back("'" + EscapeString(group_id_entry.name) + "'"); + insert_values.push_back(std::to_string(group_id_entry.ismerc)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_group_leaders_repository.h b/common/repositories/base/base_group_leaders_repository.h index 7670f4db9..bfb73c50e 100644 --- a/common/repositories/base/base_group_leaders_repository.h +++ b/common/repositories/base/base_group_leaders_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -196,6 +196,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(group_leaders_entry.gid)); update_values.push_back(columns[1] + " = '" + EscapeString(group_leaders_entry.leadername) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(group_leaders_entry.marknpc) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(group_leaders_entry.leadershipaa) + "'"); @@ -224,6 +225,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(group_leaders_entry.gid)); insert_values.push_back("'" + EscapeString(group_leaders_entry.leadername) + "'"); insert_values.push_back("'" + EscapeString(group_leaders_entry.marknpc) + "'"); insert_values.push_back("'" + EscapeString(group_leaders_entry.leadershipaa) + "'"); @@ -242,7 +244,7 @@ public: ); if (results.Success()) { - group_leaders_entry.id = results.LastInsertedID(); + group_leaders_entry.gid = results.LastInsertedID(); return group_leaders_entry; } @@ -260,6 +262,7 @@ public: for (auto &group_leaders_entry: group_leaders_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(group_leaders_entry.gid)); insert_values.push_back("'" + EscapeString(group_leaders_entry.leadername) + "'"); insert_values.push_back("'" + EscapeString(group_leaders_entry.marknpc) + "'"); insert_values.push_back("'" + EscapeString(group_leaders_entry.leadershipaa) + "'"); diff --git a/common/repositories/base/base_guild_members_repository.h b/common/repositories/base/base_guild_members_repository.h index 56d462a93..f5835d582 100644 --- a/common/repositories/base/base_guild_members_repository.h +++ b/common/repositories/base/base_guild_members_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -196,6 +196,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(guild_members_entry.char_id)); update_values.push_back(columns[1] + " = " + std::to_string(guild_members_entry.guild_id)); update_values.push_back(columns[2] + " = " + std::to_string(guild_members_entry.rank)); update_values.push_back(columns[3] + " = " + std::to_string(guild_members_entry.tribute_enable)); @@ -224,6 +225,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(guild_members_entry.char_id)); insert_values.push_back(std::to_string(guild_members_entry.guild_id)); insert_values.push_back(std::to_string(guild_members_entry.rank)); insert_values.push_back(std::to_string(guild_members_entry.tribute_enable)); @@ -242,7 +244,7 @@ public: ); if (results.Success()) { - guild_members_entry.id = results.LastInsertedID(); + guild_members_entry.char_id = results.LastInsertedID(); return guild_members_entry; } @@ -260,6 +262,7 @@ public: for (auto &guild_members_entry: guild_members_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(guild_members_entry.char_id)); insert_values.push_back(std::to_string(guild_members_entry.guild_id)); insert_values.push_back(std::to_string(guild_members_entry.rank)); insert_values.push_back(std::to_string(guild_members_entry.tribute_enable)); diff --git a/common/repositories/base/base_guild_ranks_repository.h b/common/repositories/base/base_guild_ranks_repository.h index b7c606f23..2b3a9aca8 100644 --- a/common/repositories/base/base_guild_ranks_repository.h +++ b/common/repositories/base/base_guild_ranks_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -50,7 +50,7 @@ public: static std::string PrimaryKey() { - return std::string("rank"); + return std::string("guild_id"); } static std::vector Columns() @@ -138,7 +138,7 @@ public: ) { for (auto &guild_ranks : guild_rankss) { - if (guild_ranks.rank == guild_ranks_id) { + if (guild_ranks.guild_id == guild_ranks_id) { return guild_ranks; } } @@ -204,6 +204,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(guild_ranks_entry.guild_id)); + update_values.push_back(columns[1] + " = " + std::to_string(guild_ranks_entry.rank)); update_values.push_back(columns[2] + " = '" + EscapeString(guild_ranks_entry.title) + "'"); update_values.push_back(columns[3] + " = " + std::to_string(guild_ranks_entry.can_hear)); update_values.push_back(columns[4] + " = " + std::to_string(guild_ranks_entry.can_speak)); @@ -220,7 +222,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - guild_ranks_entry.rank + guild_ranks_entry.guild_id ) ); @@ -233,6 +235,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(guild_ranks_entry.guild_id)); + insert_values.push_back(std::to_string(guild_ranks_entry.rank)); insert_values.push_back("'" + EscapeString(guild_ranks_entry.title) + "'"); insert_values.push_back(std::to_string(guild_ranks_entry.can_hear)); insert_values.push_back(std::to_string(guild_ranks_entry.can_speak)); @@ -252,7 +256,7 @@ public: ); if (results.Success()) { - guild_ranks_entry.id = results.LastInsertedID(); + guild_ranks_entry.guild_id = results.LastInsertedID(); return guild_ranks_entry; } @@ -270,6 +274,8 @@ public: for (auto &guild_ranks_entry: guild_ranks_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(guild_ranks_entry.guild_id)); + insert_values.push_back(std::to_string(guild_ranks_entry.rank)); insert_values.push_back("'" + EscapeString(guild_ranks_entry.title) + "'"); insert_values.push_back(std::to_string(guild_ranks_entry.can_hear)); insert_values.push_back(std::to_string(guild_ranks_entry.can_speak)); diff --git a/common/repositories/base/base_guild_relations_repository.h b/common/repositories/base/base_guild_relations_repository.h index b0ac5c179..c0185cf8c 100644 --- a/common/repositories/base/base_guild_relations_repository.h +++ b/common/repositories/base/base_guild_relations_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("guild2"); + return std::string("guild1"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &guild_relations : guild_relationss) { - if (guild_relations.guild2 == guild_relations_id) { + if (guild_relations.guild1 == guild_relations_id) { return guild_relations; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(guild_relations_entry.guild1)); + update_values.push_back(columns[1] + " = " + std::to_string(guild_relations_entry.guild2)); update_values.push_back(columns[2] + " = " + std::to_string(guild_relations_entry.relation)); auto results = database.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - guild_relations_entry.guild2 + guild_relations_entry.guild1 ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(guild_relations_entry.guild1)); + insert_values.push_back(std::to_string(guild_relations_entry.guild2)); insert_values.push_back(std::to_string(guild_relations_entry.relation)); auto results = database.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - guild_relations_entry.id = results.LastInsertedID(); + guild_relations_entry.guild1 = results.LastInsertedID(); return guild_relations_entry; } @@ -222,6 +226,8 @@ public: for (auto &guild_relations_entry: guild_relations_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(guild_relations_entry.guild1)); + insert_values.push_back(std::to_string(guild_relations_entry.guild2)); insert_values.push_back(std::to_string(guild_relations_entry.relation)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_guilds_repository.h b/common/repositories/base/base_guilds_repository.h index 557804686..85e43ff03 100644 --- a/common/repositories/base/base_guilds_repository.h +++ b/common/repositories/base/base_guilds_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_hackers_repository.h b/common/repositories/base/base_hackers_repository.h index 8b869cfb3..9affdf6ef 100644 --- a/common/repositories/base/base_hackers_repository.h +++ b/common/repositories/base/base_hackers_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_horses_repository.h b/common/repositories/base/base_horses_repository.h index cb365018d..2282e3da0 100644 --- a/common/repositories/base/base_horses_repository.h +++ b/common/repositories/base/base_horses_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -184,6 +184,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = '" + EscapeString(horses_entry.filename) + "'"); update_values.push_back(columns[1] + " = " + std::to_string(horses_entry.race)); update_values.push_back(columns[2] + " = " + std::to_string(horses_entry.gender)); update_values.push_back(columns[3] + " = " + std::to_string(horses_entry.texture)); @@ -209,6 +210,7 @@ public: { std::vector insert_values; + insert_values.push_back("'" + EscapeString(horses_entry.filename) + "'"); insert_values.push_back(std::to_string(horses_entry.race)); insert_values.push_back(std::to_string(horses_entry.gender)); insert_values.push_back(std::to_string(horses_entry.texture)); @@ -224,7 +226,7 @@ public: ); if (results.Success()) { - horses_entry.id = results.LastInsertedID(); + horses_entry.filename = results.LastInsertedID(); return horses_entry; } @@ -242,6 +244,7 @@ public: for (auto &horses_entry: horses_entries) { std::vector insert_values; + insert_values.push_back("'" + EscapeString(horses_entry.filename) + "'"); insert_values.push_back(std::to_string(horses_entry.race)); insert_values.push_back(std::to_string(horses_entry.gender)); insert_values.push_back(std::to_string(horses_entry.texture)); diff --git a/common/repositories/base/base_instance_list_player_repository.h b/common/repositories/base/base_instance_list_player_repository.h index bc7a255c3..dbe253236 100644 --- a/common/repositories/base/base_instance_list_player_repository.h +++ b/common/repositories/base/base_instance_list_player_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -41,7 +41,7 @@ public: static std::string PrimaryKey() { - return std::string("charid"); + return std::string("id"); } static std::vector Columns() @@ -111,7 +111,7 @@ public: ) { for (auto &instance_list_player : instance_list_players) { - if (instance_list_player.charid == instance_list_player_id) { + if (instance_list_player.id == instance_list_player_id) { return instance_list_player; } } @@ -168,7 +168,8 @@ public: auto columns = Columns(); - + update_values.push_back(columns[0] + " = " + std::to_string(instance_list_player_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(instance_list_player_entry.charid)); auto results = database.QueryDatabase( fmt::format( @@ -176,7 +177,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - instance_list_player_entry.charid + instance_list_player_entry.id ) ); @@ -189,7 +190,8 @@ public: { std::vector insert_values; - + insert_values.push_back(std::to_string(instance_list_player_entry.id)); + insert_values.push_back(std::to_string(instance_list_player_entry.charid)); auto results = database.QueryDatabase( fmt::format( @@ -218,7 +220,8 @@ public: for (auto &instance_list_player_entry: instance_list_player_entries) { std::vector insert_values; - + insert_values.push_back(std::to_string(instance_list_player_entry.id)); + insert_values.push_back(std::to_string(instance_list_player_entry.charid)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_instance_list_repository.h b/common/repositories/base/base_instance_list_repository.h index d27d6aa27..1366fa6da 100644 --- a/common/repositories/base/base_instance_list_repository.h +++ b/common/repositories/base/base_instance_list_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_inventory_repository.h b/common/repositories/base/base_inventory_repository.h index c389918f7..e07cc892d 100644 --- a/common/repositories/base/base_inventory_repository.h +++ b/common/repositories/base/base_inventory_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -55,7 +55,7 @@ public: static std::string PrimaryKey() { - return std::string("slotid"); + return std::string("charid"); } static std::vector Columns() @@ -153,7 +153,7 @@ public: ) { for (auto &inventory : inventorys) { - if (inventory.slotid == inventory_id) { + if (inventory.charid == inventory_id) { return inventory; } } @@ -224,6 +224,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(inventory_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(inventory_entry.slotid)); update_values.push_back(columns[2] + " = " + std::to_string(inventory_entry.itemid)); update_values.push_back(columns[3] + " = " + std::to_string(inventory_entry.charges)); update_values.push_back(columns[4] + " = " + std::to_string(inventory_entry.color)); @@ -245,7 +247,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - inventory_entry.slotid + inventory_entry.charid ) ); @@ -258,6 +260,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(inventory_entry.charid)); + insert_values.push_back(std::to_string(inventory_entry.slotid)); insert_values.push_back(std::to_string(inventory_entry.itemid)); insert_values.push_back(std::to_string(inventory_entry.charges)); insert_values.push_back(std::to_string(inventory_entry.color)); @@ -282,7 +286,7 @@ public: ); if (results.Success()) { - inventory_entry.id = results.LastInsertedID(); + inventory_entry.charid = results.LastInsertedID(); return inventory_entry; } @@ -300,6 +304,8 @@ public: for (auto &inventory_entry: inventory_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(inventory_entry.charid)); + insert_values.push_back(std::to_string(inventory_entry.slotid)); insert_values.push_back(std::to_string(inventory_entry.itemid)); insert_values.push_back(std::to_string(inventory_entry.charges)); insert_values.push_back(std::to_string(inventory_entry.color)); diff --git a/common/repositories/base/base_inventory_snapshots_repository.h b/common/repositories/base/base_inventory_snapshots_repository.h index f05b88811..d18700645 100644 --- a/common/repositories/base/base_inventory_snapshots_repository.h +++ b/common/repositories/base/base_inventory_snapshots_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -56,7 +56,7 @@ public: static std::string PrimaryKey() { - return std::string("slotid"); + return std::string("time_index"); } static std::vector Columns() @@ -156,7 +156,7 @@ public: ) { for (auto &inventory_snapshots : inventory_snapshotss) { - if (inventory_snapshots.slotid == inventory_snapshots_id) { + if (inventory_snapshots.time_index == inventory_snapshots_id) { return inventory_snapshots; } } @@ -228,6 +228,9 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(inventory_snapshots_entry.time_index)); + update_values.push_back(columns[1] + " = " + std::to_string(inventory_snapshots_entry.charid)); + update_values.push_back(columns[2] + " = " + std::to_string(inventory_snapshots_entry.slotid)); update_values.push_back(columns[3] + " = " + std::to_string(inventory_snapshots_entry.itemid)); update_values.push_back(columns[4] + " = " + std::to_string(inventory_snapshots_entry.charges)); update_values.push_back(columns[5] + " = " + std::to_string(inventory_snapshots_entry.color)); @@ -249,7 +252,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - inventory_snapshots_entry.slotid + inventory_snapshots_entry.time_index ) ); @@ -262,6 +265,9 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(inventory_snapshots_entry.time_index)); + insert_values.push_back(std::to_string(inventory_snapshots_entry.charid)); + insert_values.push_back(std::to_string(inventory_snapshots_entry.slotid)); insert_values.push_back(std::to_string(inventory_snapshots_entry.itemid)); insert_values.push_back(std::to_string(inventory_snapshots_entry.charges)); insert_values.push_back(std::to_string(inventory_snapshots_entry.color)); @@ -286,7 +292,7 @@ public: ); if (results.Success()) { - inventory_snapshots_entry.id = results.LastInsertedID(); + inventory_snapshots_entry.time_index = results.LastInsertedID(); return inventory_snapshots_entry; } @@ -304,6 +310,9 @@ public: for (auto &inventory_snapshots_entry: inventory_snapshots_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(inventory_snapshots_entry.time_index)); + insert_values.push_back(std::to_string(inventory_snapshots_entry.charid)); + insert_values.push_back(std::to_string(inventory_snapshots_entry.slotid)); insert_values.push_back(std::to_string(inventory_snapshots_entry.itemid)); insert_values.push_back(std::to_string(inventory_snapshots_entry.charges)); insert_values.push_back(std::to_string(inventory_snapshots_entry.color)); diff --git a/common/repositories/base/base_ip_exemptions_repository.h b/common/repositories/base/base_ip_exemptions_repository.h index 9a2bcb45c..380c795f9 100644 --- a/common/repositories/base/base_ip_exemptions_repository.h +++ b/common/repositories/base/base_ip_exemptions_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -206,7 +206,7 @@ public: ); if (results.Success()) { - ip_exemptions_entry.id = results.LastInsertedID(); + ip_exemptions_entry.exemption_id = results.LastInsertedID(); return ip_exemptions_entry; } diff --git a/common/repositories/base/base_item_tick_repository.h b/common/repositories/base/base_item_tick_repository.h index b22039a37..95ea59c9e 100644 --- a/common/repositories/base/base_item_tick_repository.h +++ b/common/repositories/base/base_item_tick_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -224,7 +224,7 @@ public: ); if (results.Success()) { - item_tick_entry.id = results.LastInsertedID(); + item_tick_entry.it_id = results.LastInsertedID(); return item_tick_entry; } diff --git a/common/repositories/base/base_items_repository.h b/common/repositories/base/base_items_repository.h index 69a053c2c..1920c569a 100644 --- a/common/repositories/base/base_items_repository.h +++ b/common/repositories/base/base_items_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -1300,6 +1300,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(items_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(items_entry.minstatus)); update_values.push_back(columns[2] + " = '" + EscapeString(items_entry.Name) + "'"); update_values.push_back(columns[3] + " = " + std::to_string(items_entry.aagi)); @@ -1604,6 +1605,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(items_entry.id)); insert_values.push_back(std::to_string(items_entry.minstatus)); insert_values.push_back("'" + EscapeString(items_entry.Name) + "'"); insert_values.push_back(std::to_string(items_entry.aagi)); @@ -1916,6 +1918,7 @@ public: for (auto &items_entry: items_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(items_entry.id)); insert_values.push_back(std::to_string(items_entry.minstatus)); insert_values.push_back("'" + EscapeString(items_entry.Name) + "'"); insert_values.push_back(std::to_string(items_entry.aagi)); diff --git a/common/repositories/base/base_launcher_repository.h b/common/repositories/base/base_launcher_repository.h index 04d148afc..047f027ce 100644 --- a/common/repositories/base/base_launcher_repository.h +++ b/common/repositories/base/base_launcher_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -168,6 +168,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = '" + EscapeString(launcher_entry.name) + "'"); update_values.push_back(columns[1] + " = " + std::to_string(launcher_entry.dynamics)); auto results = database.QueryDatabase( @@ -189,6 +190,7 @@ public: { std::vector insert_values; + insert_values.push_back("'" + EscapeString(launcher_entry.name) + "'"); insert_values.push_back(std::to_string(launcher_entry.dynamics)); auto results = database.QueryDatabase( @@ -200,7 +202,7 @@ public: ); if (results.Success()) { - launcher_entry.id = results.LastInsertedID(); + launcher_entry.name = results.LastInsertedID(); return launcher_entry; } @@ -218,6 +220,7 @@ public: for (auto &launcher_entry: launcher_entries) { std::vector insert_values; + insert_values.push_back("'" + EscapeString(launcher_entry.name) + "'"); insert_values.push_back(std::to_string(launcher_entry.dynamics)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_launcher_zones_repository.h b/common/repositories/base/base_launcher_zones_repository.h deleted file mode 100644 index ba2fe82b3..000000000 --- a/common/repositories/base/base_launcher_zones_repository.h +++ /dev/null @@ -1,312 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - */ - -/** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to - * the repository extending the base. Any modifications to base repositories are to - * be made by the generator only - */ - -#ifndef EQEMU_BASE_LAUNCHER_ZONES_REPOSITORY_H -#define EQEMU_BASE_LAUNCHER_ZONES_REPOSITORY_H - -#include "../../database.h" -#include "../../string_util.h" - -class BaseLauncherZonesRepository { -public: - struct LauncherZones { - std::string launcher; - std::string zone; - int port; - }; - - static std::string PrimaryKey() - { - return std::string("zone"); - } - - static std::vector Columns() - { - return { - "launcher", - "zone", - "port", - }; - } - - static std::string ColumnsRaw() - { - return std::string(implode(", ", Columns())); - } - - static std::string InsertColumnsRaw() - { - std::vector insert_columns; - - for (auto &column : Columns()) { - if (column == PrimaryKey()) { - continue; - } - - insert_columns.push_back(column); - } - - return std::string(implode(", ", insert_columns)); - } - - static std::string TableName() - { - return std::string("launcher_zones"); - } - - static std::string BaseSelect() - { - return fmt::format( - "SELECT {} FROM {}", - ColumnsRaw(), - TableName() - ); - } - - static std::string BaseInsert() - { - return fmt::format( - "INSERT INTO {} ({}) ", - TableName(), - InsertColumnsRaw() - ); - } - - static LauncherZones NewEntity() - { - LauncherZones entry{}; - - entry.launcher = ""; - entry.zone = ""; - entry.port = 0; - - return entry; - } - - static LauncherZones GetLauncherZonesEntry( - const std::vector &launcher_zoness, - int launcher_zones_id - ) - { - for (auto &launcher_zones : launcher_zoness) { - if (launcher_zones.zone == launcher_zones_id) { - return launcher_zones; - } - } - - return NewEntity(); - } - - static LauncherZones FindOne( - int launcher_zones_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE id = {} LIMIT 1", - BaseSelect(), - launcher_zones_id - ) - ); - - auto row = results.begin(); - if (results.RowCount() == 1) { - LauncherZones entry{}; - - entry.launcher = row[0] ? row[0] : ""; - entry.zone = row[1] ? row[1] : ""; - entry.port = atoi(row[2]); - - return entry; - } - - return NewEntity(); - } - - static int DeleteOne( - int launcher_zones_id - ) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {} = {}", - TableName(), - PrimaryKey(), - launcher_zones_id - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static int UpdateOne( - LauncherZones launcher_zones_entry - ) - { - std::vector update_values; - - auto columns = Columns(); - - update_values.push_back(columns[2] + " = " + std::to_string(launcher_zones_entry.port)); - - auto results = database.QueryDatabase( - fmt::format( - "UPDATE {} SET {} WHERE {} = {}", - TableName(), - implode(", ", update_values), - PrimaryKey(), - launcher_zones_entry.zone - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static LauncherZones InsertOne( - LauncherZones launcher_zones_entry - ) - { - std::vector insert_values; - - insert_values.push_back(std::to_string(launcher_zones_entry.port)); - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES ({})", - BaseInsert(), - implode(",", insert_values) - ) - ); - - if (results.Success()) { - launcher_zones_entry.id = results.LastInsertedID(); - return launcher_zones_entry; - } - - launcher_zones_entry = NewEntity(); - - return launcher_zones_entry; - } - - static int InsertMany( - std::vector launcher_zones_entries - ) - { - std::vector insert_chunks; - - for (auto &launcher_zones_entry: launcher_zones_entries) { - std::vector insert_values; - - insert_values.push_back(std::to_string(launcher_zones_entry.port)); - - insert_chunks.push_back("(" + implode(",", insert_values) + ")"); - } - - std::vector insert_values; - - auto results = database.QueryDatabase( - fmt::format( - "{} VALUES {}", - BaseInsert(), - implode(",", insert_chunks) - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - - static std::vector All() - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{}", - BaseSelect() - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - LauncherZones entry{}; - - entry.launcher = row[0] ? row[0] : ""; - entry.zone = row[1] ? row[1] : ""; - entry.port = atoi(row[2]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static std::vector GetWhere(std::string where_filter) - { - std::vector all_entries; - - auto results = database.QueryDatabase( - fmt::format( - "{} WHERE {}", - BaseSelect(), - where_filter - ) - ); - - all_entries.reserve(results.RowCount()); - - for (auto row = results.begin(); row != results.end(); ++row) { - LauncherZones entry{}; - - entry.launcher = row[0] ? row[0] : ""; - entry.zone = row[1] ? row[1] : ""; - entry.port = atoi(row[2]); - - all_entries.push_back(entry); - } - - return all_entries; - } - - static int DeleteWhere(std::string where_filter) - { - auto results = database.QueryDatabase( - fmt::format( - "DELETE FROM {} WHERE {}", - TableName(), - PrimaryKey(), - where_filter - ) - ); - - return (results.Success() ? results.RowsAffected() : 0); - } - -}; - -#endif //EQEMU_BASE_LAUNCHER_ZONES_REPOSITORY_H diff --git a/common/repositories/base/base_ldon_trap_entries_repository.h b/common/repositories/base/base_ldon_trap_entries_repository.h index aa6d7cc7a..f69ace2f7 100644 --- a/common/repositories/base/base_ldon_trap_entries_repository.h +++ b/common/repositories/base/base_ldon_trap_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -41,7 +41,7 @@ public: static std::string PrimaryKey() { - return std::string("trap_id"); + return std::string("id"); } static std::vector Columns() @@ -111,7 +111,7 @@ public: ) { for (auto &ldon_trap_entries : ldon_trap_entriess) { - if (ldon_trap_entries.trap_id == ldon_trap_entries_id) { + if (ldon_trap_entries.id == ldon_trap_entries_id) { return ldon_trap_entries; } } @@ -168,7 +168,8 @@ public: auto columns = Columns(); - + update_values.push_back(columns[0] + " = " + std::to_string(ldon_trap_entries_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(ldon_trap_entries_entry.trap_id)); auto results = content_db.QueryDatabase( fmt::format( @@ -176,7 +177,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - ldon_trap_entries_entry.trap_id + ldon_trap_entries_entry.id ) ); @@ -189,7 +190,8 @@ public: { std::vector insert_values; - + insert_values.push_back(std::to_string(ldon_trap_entries_entry.id)); + insert_values.push_back(std::to_string(ldon_trap_entries_entry.trap_id)); auto results = content_db.QueryDatabase( fmt::format( @@ -218,7 +220,8 @@ public: for (auto &ldon_trap_entries_entry: ldon_trap_entries_entries) { std::vector insert_values; - + insert_values.push_back(std::to_string(ldon_trap_entries_entry.id)); + insert_values.push_back(std::to_string(ldon_trap_entries_entry.trap_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_ldon_trap_templates_repository.h b/common/repositories/base/base_ldon_trap_templates_repository.h index 3d75990cf..33cb42358 100644 --- a/common/repositories/base/base_ldon_trap_templates_repository.h +++ b/common/repositories/base/base_ldon_trap_templates_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -180,6 +180,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(ldon_trap_templates_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(ldon_trap_templates_entry.type)); update_values.push_back(columns[2] + " = " + std::to_string(ldon_trap_templates_entry.spell_id)); update_values.push_back(columns[3] + " = " + std::to_string(ldon_trap_templates_entry.skill)); @@ -204,6 +205,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(ldon_trap_templates_entry.id)); insert_values.push_back(std::to_string(ldon_trap_templates_entry.type)); insert_values.push_back(std::to_string(ldon_trap_templates_entry.spell_id)); insert_values.push_back(std::to_string(ldon_trap_templates_entry.skill)); @@ -236,6 +238,7 @@ public: for (auto &ldon_trap_templates_entry: ldon_trap_templates_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(ldon_trap_templates_entry.id)); insert_values.push_back(std::to_string(ldon_trap_templates_entry.type)); insert_values.push_back(std::to_string(ldon_trap_templates_entry.spell_id)); insert_values.push_back(std::to_string(ldon_trap_templates_entry.skill)); diff --git a/common/repositories/base/base_level_exp_mods_repository.h b/common/repositories/base/base_level_exp_mods_repository.h index d3c1b5249..15aedfb14 100644 --- a/common/repositories/base/base_level_exp_mods_repository.h +++ b/common/repositories/base/base_level_exp_mods_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(level_exp_mods_entry.level)); update_values.push_back(columns[1] + " = " + std::to_string(level_exp_mods_entry.exp_mod)); update_values.push_back(columns[2] + " = " + std::to_string(level_exp_mods_entry.aa_exp_mod)); @@ -194,6 +195,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(level_exp_mods_entry.level)); insert_values.push_back(std::to_string(level_exp_mods_entry.exp_mod)); insert_values.push_back(std::to_string(level_exp_mods_entry.aa_exp_mod)); @@ -206,7 +208,7 @@ public: ); if (results.Success()) { - level_exp_mods_entry.id = results.LastInsertedID(); + level_exp_mods_entry.level = results.LastInsertedID(); return level_exp_mods_entry; } @@ -224,6 +226,7 @@ public: for (auto &level_exp_mods_entry: level_exp_mods_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(level_exp_mods_entry.level)); insert_values.push_back(std::to_string(level_exp_mods_entry.exp_mod)); insert_values.push_back(std::to_string(level_exp_mods_entry.aa_exp_mod)); diff --git a/common/repositories/base/base_lfguild_repository.h b/common/repositories/base/base_lfguild_repository.h index 9930dc35c..acf7f1f9c 100644 --- a/common/repositories/base/base_lfguild_repository.h +++ b/common/repositories/base/base_lfguild_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -48,7 +48,7 @@ public: static std::string PrimaryKey() { - return std::string("name"); + return std::string("type"); } static std::vector Columns() @@ -132,7 +132,7 @@ public: ) { for (auto &lfguild : lfguilds) { - if (lfguild.name == lfguild_id) { + if (lfguild.type == lfguild_id) { return lfguild; } } @@ -196,6 +196,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(lfguild_entry.type)); + update_values.push_back(columns[1] + " = '" + EscapeString(lfguild_entry.name) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(lfguild_entry.comment) + "'"); update_values.push_back(columns[3] + " = " + std::to_string(lfguild_entry.fromlevel)); update_values.push_back(columns[4] + " = " + std::to_string(lfguild_entry.tolevel)); @@ -210,7 +212,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - lfguild_entry.name + lfguild_entry.type ) ); @@ -223,6 +225,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(lfguild_entry.type)); + insert_values.push_back("'" + EscapeString(lfguild_entry.name) + "'"); insert_values.push_back("'" + EscapeString(lfguild_entry.comment) + "'"); insert_values.push_back(std::to_string(lfguild_entry.fromlevel)); insert_values.push_back(std::to_string(lfguild_entry.tolevel)); @@ -240,7 +244,7 @@ public: ); if (results.Success()) { - lfguild_entry.id = results.LastInsertedID(); + lfguild_entry.type = results.LastInsertedID(); return lfguild_entry; } @@ -258,6 +262,8 @@ public: for (auto &lfguild_entry: lfguild_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(lfguild_entry.type)); + insert_values.push_back("'" + EscapeString(lfguild_entry.name) + "'"); insert_values.push_back("'" + EscapeString(lfguild_entry.comment) + "'"); insert_values.push_back(std::to_string(lfguild_entry.fromlevel)); insert_values.push_back(std::to_string(lfguild_entry.tolevel)); diff --git a/common/repositories/base/base_login_accounts_repository.h b/common/repositories/base/base_login_accounts_repository.h index 8ef4d63c1..91b493ca0 100644 --- a/common/repositories/base/base_login_accounts_repository.h +++ b/common/repositories/base/base_login_accounts_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -196,6 +196,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(login_accounts_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(login_accounts_entry.account_name) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(login_accounts_entry.account_password) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(login_accounts_entry.account_email) + "'"); @@ -224,6 +225,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(login_accounts_entry.id)); insert_values.push_back("'" + EscapeString(login_accounts_entry.account_name) + "'"); insert_values.push_back("'" + EscapeString(login_accounts_entry.account_password) + "'"); insert_values.push_back("'" + EscapeString(login_accounts_entry.account_email) + "'"); @@ -260,6 +262,7 @@ public: for (auto &login_accounts_entry: login_accounts_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(login_accounts_entry.id)); insert_values.push_back("'" + EscapeString(login_accounts_entry.account_name) + "'"); insert_values.push_back("'" + EscapeString(login_accounts_entry.account_password) + "'"); insert_values.push_back("'" + EscapeString(login_accounts_entry.account_email) + "'"); diff --git a/common/repositories/base/base_login_api_tokens_repository.h b/common/repositories/base/base_login_api_tokens_repository.h index 94b995aba..359b1b723 100644 --- a/common/repositories/base/base_login_api_tokens_repository.h +++ b/common/repositories/base/base_login_api_tokens_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_login_server_admins_repository.h b/common/repositories/base/base_login_server_admins_repository.h index 1d637ab00..540b58c4b 100644 --- a/common/repositories/base/base_login_server_admins_repository.h +++ b/common/repositories/base/base_login_server_admins_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_login_server_list_types_repository.h b/common/repositories/base/base_login_server_list_types_repository.h index 5becb3e65..140115123 100644 --- a/common/repositories/base/base_login_server_list_types_repository.h +++ b/common/repositories/base/base_login_server_list_types_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -168,6 +168,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(login_server_list_types_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(login_server_list_types_entry.description) + "'"); auto results = database.QueryDatabase( @@ -189,6 +190,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(login_server_list_types_entry.id)); insert_values.push_back("'" + EscapeString(login_server_list_types_entry.description) + "'"); auto results = database.QueryDatabase( @@ -218,6 +220,7 @@ public: for (auto &login_server_list_types_entry: login_server_list_types_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(login_server_list_types_entry.id)); insert_values.push_back("'" + EscapeString(login_server_list_types_entry.description) + "'"); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_login_world_servers_repository.h b/common/repositories/base/base_login_world_servers_repository.h index 517db98f3..26849902d 100644 --- a/common/repositories/base/base_login_world_servers_repository.h +++ b/common/repositories/base/base_login_world_servers_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_logsys_categories_repository.h b/common/repositories/base/base_logsys_categories_repository.h index dff017855..c0def37ac 100644 --- a/common/repositories/base/base_logsys_categories_repository.h +++ b/common/repositories/base/base_logsys_categories_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -180,6 +180,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(logsys_categories_entry.log_category_id)); update_values.push_back(columns[1] + " = '" + EscapeString(logsys_categories_entry.log_category_description) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(logsys_categories_entry.log_to_console)); update_values.push_back(columns[3] + " = " + std::to_string(logsys_categories_entry.log_to_file)); @@ -204,6 +205,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(logsys_categories_entry.log_category_id)); insert_values.push_back("'" + EscapeString(logsys_categories_entry.log_category_description) + "'"); insert_values.push_back(std::to_string(logsys_categories_entry.log_to_console)); insert_values.push_back(std::to_string(logsys_categories_entry.log_to_file)); @@ -218,7 +220,7 @@ public: ); if (results.Success()) { - logsys_categories_entry.id = results.LastInsertedID(); + logsys_categories_entry.log_category_id = results.LastInsertedID(); return logsys_categories_entry; } @@ -236,6 +238,7 @@ public: for (auto &logsys_categories_entry: logsys_categories_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(logsys_categories_entry.log_category_id)); insert_values.push_back("'" + EscapeString(logsys_categories_entry.log_category_description) + "'"); insert_values.push_back(std::to_string(logsys_categories_entry.log_to_console)); insert_values.push_back(std::to_string(logsys_categories_entry.log_to_file)); diff --git a/common/repositories/base/base_lootdrop_entries_repository.h b/common/repositories/base/base_lootdrop_entries_repository.h index 67ab318d6..02a7d10d4 100644 --- a/common/repositories/base/base_lootdrop_entries_repository.h +++ b/common/repositories/base/base_lootdrop_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -48,7 +48,7 @@ public: static std::string PrimaryKey() { - return std::string("item_id"); + return std::string("lootdrop_id"); } static std::vector Columns() @@ -132,7 +132,7 @@ public: ) { for (auto &lootdrop_entries : lootdrop_entriess) { - if (lootdrop_entries.item_id == lootdrop_entries_id) { + if (lootdrop_entries.lootdrop_id == lootdrop_entries_id) { return lootdrop_entries; } } @@ -196,6 +196,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(lootdrop_entries_entry.lootdrop_id)); + update_values.push_back(columns[1] + " = " + std::to_string(lootdrop_entries_entry.item_id)); update_values.push_back(columns[2] + " = " + std::to_string(lootdrop_entries_entry.item_charges)); update_values.push_back(columns[3] + " = " + std::to_string(lootdrop_entries_entry.equip_item)); update_values.push_back(columns[4] + " = " + std::to_string(lootdrop_entries_entry.chance)); @@ -210,7 +212,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - lootdrop_entries_entry.item_id + lootdrop_entries_entry.lootdrop_id ) ); @@ -223,6 +225,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(lootdrop_entries_entry.lootdrop_id)); + insert_values.push_back(std::to_string(lootdrop_entries_entry.item_id)); insert_values.push_back(std::to_string(lootdrop_entries_entry.item_charges)); insert_values.push_back(std::to_string(lootdrop_entries_entry.equip_item)); insert_values.push_back(std::to_string(lootdrop_entries_entry.chance)); @@ -240,7 +244,7 @@ public: ); if (results.Success()) { - lootdrop_entries_entry.id = results.LastInsertedID(); + lootdrop_entries_entry.lootdrop_id = results.LastInsertedID(); return lootdrop_entries_entry; } @@ -258,6 +262,8 @@ public: for (auto &lootdrop_entries_entry: lootdrop_entries_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(lootdrop_entries_entry.lootdrop_id)); + insert_values.push_back(std::to_string(lootdrop_entries_entry.item_id)); insert_values.push_back(std::to_string(lootdrop_entries_entry.item_charges)); insert_values.push_back(std::to_string(lootdrop_entries_entry.equip_item)); insert_values.push_back(std::to_string(lootdrop_entries_entry.chance)); diff --git a/common/repositories/base/base_lootdrop_repository.h b/common/repositories/base/base_lootdrop_repository.h index 3ee90b6da..c49a0bd15 100644 --- a/common/repositories/base/base_lootdrop_repository.h +++ b/common/repositories/base/base_lootdrop_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_loottable_entries_repository.h b/common/repositories/base/base_loottable_entries_repository.h index fc4542934..4c9dca46d 100644 --- a/common/repositories/base/base_loottable_entries_repository.h +++ b/common/repositories/base/base_loottable_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -45,7 +45,7 @@ public: static std::string PrimaryKey() { - return std::string("lootdrop_id"); + return std::string("loottable_id"); } static std::vector Columns() @@ -123,7 +123,7 @@ public: ) { for (auto &loottable_entries : loottable_entriess) { - if (loottable_entries.lootdrop_id == loottable_entries_id) { + if (loottable_entries.loottable_id == loottable_entries_id) { return loottable_entries; } } @@ -184,6 +184,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(loottable_entries_entry.loottable_id)); + update_values.push_back(columns[1] + " = " + std::to_string(loottable_entries_entry.lootdrop_id)); update_values.push_back(columns[2] + " = " + std::to_string(loottable_entries_entry.multiplier)); update_values.push_back(columns[3] + " = " + std::to_string(loottable_entries_entry.droplimit)); update_values.push_back(columns[4] + " = " + std::to_string(loottable_entries_entry.mindrop)); @@ -195,7 +197,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - loottable_entries_entry.lootdrop_id + loottable_entries_entry.loottable_id ) ); @@ -208,6 +210,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(loottable_entries_entry.loottable_id)); + insert_values.push_back(std::to_string(loottable_entries_entry.lootdrop_id)); insert_values.push_back(std::to_string(loottable_entries_entry.multiplier)); insert_values.push_back(std::to_string(loottable_entries_entry.droplimit)); insert_values.push_back(std::to_string(loottable_entries_entry.mindrop)); @@ -222,7 +226,7 @@ public: ); if (results.Success()) { - loottable_entries_entry.id = results.LastInsertedID(); + loottable_entries_entry.loottable_id = results.LastInsertedID(); return loottable_entries_entry; } @@ -240,6 +244,8 @@ public: for (auto &loottable_entries_entry: loottable_entries_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(loottable_entries_entry.loottable_id)); + insert_values.push_back(std::to_string(loottable_entries_entry.lootdrop_id)); insert_values.push_back(std::to_string(loottable_entries_entry.multiplier)); insert_values.push_back(std::to_string(loottable_entries_entry.droplimit)); insert_values.push_back(std::to_string(loottable_entries_entry.mindrop)); diff --git a/common/repositories/base/base_loottable_repository.h b/common/repositories/base/base_loottable_repository.h index f04f18f69..c6388b3ed 100644 --- a/common/repositories/base/base_loottable_repository.h +++ b/common/repositories/base/base_loottable_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_mail_repository.h b/common/repositories/base/base_mail_repository.h index e8f362c34..b8d610af5 100644 --- a/common/repositories/base/base_mail_repository.h +++ b/common/repositories/base/base_mail_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -236,7 +236,7 @@ public: ); if (results.Success()) { - mail_entry.id = results.LastInsertedID(); + mail_entry.msgid = results.LastInsertedID(); return mail_entry; } diff --git a/common/repositories/base/base_merchantlist_repository.h b/common/repositories/base/base_merchantlist_repository.h index d4dd17828..970f0e56e 100644 --- a/common/repositories/base/base_merchantlist_repository.h +++ b/common/repositories/base/base_merchantlist_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -50,7 +50,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("merchantid"); } static std::vector Columns() @@ -138,7 +138,7 @@ public: ) { for (auto &merchantlist : merchantlists) { - if (merchantlist.slot == merchantlist_id) { + if (merchantlist.merchantid == merchantlist_id) { return merchantlist; } } @@ -204,6 +204,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(merchantlist_entry.merchantid)); + update_values.push_back(columns[1] + " = " + std::to_string(merchantlist_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(merchantlist_entry.item)); update_values.push_back(columns[3] + " = " + std::to_string(merchantlist_entry.faction_required)); update_values.push_back(columns[4] + " = " + std::to_string(merchantlist_entry.level_required)); @@ -220,7 +222,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - merchantlist_entry.slot + merchantlist_entry.merchantid ) ); @@ -233,6 +235,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(merchantlist_entry.merchantid)); + insert_values.push_back(std::to_string(merchantlist_entry.slot)); insert_values.push_back(std::to_string(merchantlist_entry.item)); insert_values.push_back(std::to_string(merchantlist_entry.faction_required)); insert_values.push_back(std::to_string(merchantlist_entry.level_required)); @@ -252,7 +256,7 @@ public: ); if (results.Success()) { - merchantlist_entry.id = results.LastInsertedID(); + merchantlist_entry.merchantid = results.LastInsertedID(); return merchantlist_entry; } @@ -270,6 +274,8 @@ public: for (auto &merchantlist_entry: merchantlist_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(merchantlist_entry.merchantid)); + insert_values.push_back(std::to_string(merchantlist_entry.slot)); insert_values.push_back(std::to_string(merchantlist_entry.item)); insert_values.push_back(std::to_string(merchantlist_entry.faction_required)); insert_values.push_back(std::to_string(merchantlist_entry.level_required)); diff --git a/common/repositories/base/base_merchantlist_temp_repository.h b/common/repositories/base/base_merchantlist_temp_repository.h index 0c5d06010..618229a2d 100644 --- a/common/repositories/base/base_merchantlist_temp_repository.h +++ b/common/repositories/base/base_merchantlist_temp_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("npcid"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &merchantlist_temp : merchantlist_temps) { - if (merchantlist_temp.slot == merchantlist_temp_id) { + if (merchantlist_temp.npcid == merchantlist_temp_id) { return merchantlist_temp; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(merchantlist_temp_entry.npcid)); + update_values.push_back(columns[1] + " = " + std::to_string(merchantlist_temp_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(merchantlist_temp_entry.itemid)); update_values.push_back(columns[3] + " = " + std::to_string(merchantlist_temp_entry.charges)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - merchantlist_temp_entry.slot + merchantlist_temp_entry.npcid ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(merchantlist_temp_entry.npcid)); + insert_values.push_back(std::to_string(merchantlist_temp_entry.slot)); insert_values.push_back(std::to_string(merchantlist_temp_entry.itemid)); insert_values.push_back(std::to_string(merchantlist_temp_entry.charges)); @@ -210,7 +214,7 @@ public: ); if (results.Success()) { - merchantlist_temp_entry.id = results.LastInsertedID(); + merchantlist_temp_entry.npcid = results.LastInsertedID(); return merchantlist_temp_entry; } @@ -228,6 +232,8 @@ public: for (auto &merchantlist_temp_entry: merchantlist_temp_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(merchantlist_temp_entry.npcid)); + insert_values.push_back(std::to_string(merchantlist_temp_entry.slot)); insert_values.push_back(std::to_string(merchantlist_temp_entry.itemid)); insert_values.push_back(std::to_string(merchantlist_temp_entry.charges)); diff --git a/common/repositories/base/base_name_filter_repository.h b/common/repositories/base/base_name_filter_repository.h index a79fc338c..1077e08a8 100644 --- a/common/repositories/base/base_name_filter_repository.h +++ b/common/repositories/base/base_name_filter_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_emotes_repository.h b/common/repositories/base/base_npc_emotes_repository.h index bb6567e8c..ce0271f8a 100644 --- a/common/repositories/base/base_npc_emotes_repository.h +++ b/common/repositories/base/base_npc_emotes_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_faction_entries_repository.h b/common/repositories/base/base_npc_faction_entries_repository.h index 64d07c6a9..177609556 100644 --- a/common/repositories/base/base_npc_faction_entries_repository.h +++ b/common/repositories/base/base_npc_faction_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("faction_id"); + return std::string("npc_faction_id"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &npc_faction_entries : npc_faction_entriess) { - if (npc_faction_entries.faction_id == npc_faction_entries_id) { + if (npc_faction_entries.npc_faction_id == npc_faction_entries_id) { return npc_faction_entries; } } @@ -180,6 +180,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(npc_faction_entries_entry.npc_faction_id)); + update_values.push_back(columns[1] + " = " + std::to_string(npc_faction_entries_entry.faction_id)); update_values.push_back(columns[2] + " = " + std::to_string(npc_faction_entries_entry.value)); update_values.push_back(columns[3] + " = " + std::to_string(npc_faction_entries_entry.npc_value)); update_values.push_back(columns[4] + " = " + std::to_string(npc_faction_entries_entry.temp)); @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - npc_faction_entries_entry.faction_id + npc_faction_entries_entry.npc_faction_id ) ); @@ -203,6 +205,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(npc_faction_entries_entry.npc_faction_id)); + insert_values.push_back(std::to_string(npc_faction_entries_entry.faction_id)); insert_values.push_back(std::to_string(npc_faction_entries_entry.value)); insert_values.push_back(std::to_string(npc_faction_entries_entry.npc_value)); insert_values.push_back(std::to_string(npc_faction_entries_entry.temp)); @@ -216,7 +220,7 @@ public: ); if (results.Success()) { - npc_faction_entries_entry.id = results.LastInsertedID(); + npc_faction_entries_entry.npc_faction_id = results.LastInsertedID(); return npc_faction_entries_entry; } @@ -234,6 +238,8 @@ public: for (auto &npc_faction_entries_entry: npc_faction_entries_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(npc_faction_entries_entry.npc_faction_id)); + insert_values.push_back(std::to_string(npc_faction_entries_entry.faction_id)); insert_values.push_back(std::to_string(npc_faction_entries_entry.value)); insert_values.push_back(std::to_string(npc_faction_entries_entry.npc_value)); insert_values.push_back(std::to_string(npc_faction_entries_entry.temp)); diff --git a/common/repositories/base/base_npc_faction_repository.h b/common/repositories/base/base_npc_faction_repository.h index dc5f89300..7e9547770 100644 --- a/common/repositories/base/base_npc_faction_repository.h +++ b/common/repositories/base/base_npc_faction_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_scale_global_base_repository.h b/common/repositories/base/base_npc_scale_global_base_repository.h index 543fa6261..ad39a47f3 100644 --- a/common/repositories/base/base_npc_scale_global_base_repository.h +++ b/common/repositories/base/base_npc_scale_global_base_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -67,7 +67,7 @@ public: static std::string PrimaryKey() { - return std::string("level"); + return std::string("type"); } static std::vector Columns() @@ -189,7 +189,7 @@ public: ) { for (auto &npc_scale_global_base : npc_scale_global_bases) { - if (npc_scale_global_base.level == npc_scale_global_base_id) { + if (npc_scale_global_base.type == npc_scale_global_base_id) { return npc_scale_global_base; } } @@ -272,6 +272,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(npc_scale_global_base_entry.type)); + update_values.push_back(columns[1] + " = " + std::to_string(npc_scale_global_base_entry.level)); update_values.push_back(columns[2] + " = " + std::to_string(npc_scale_global_base_entry.ac)); update_values.push_back(columns[3] + " = " + std::to_string(npc_scale_global_base_entry.hp)); update_values.push_back(columns[4] + " = " + std::to_string(npc_scale_global_base_entry.accuracy)); @@ -305,7 +307,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - npc_scale_global_base_entry.level + npc_scale_global_base_entry.type ) ); @@ -318,6 +320,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(npc_scale_global_base_entry.type)); + insert_values.push_back(std::to_string(npc_scale_global_base_entry.level)); insert_values.push_back(std::to_string(npc_scale_global_base_entry.ac)); insert_values.push_back(std::to_string(npc_scale_global_base_entry.hp)); insert_values.push_back(std::to_string(npc_scale_global_base_entry.accuracy)); @@ -354,7 +358,7 @@ public: ); if (results.Success()) { - npc_scale_global_base_entry.id = results.LastInsertedID(); + npc_scale_global_base_entry.type = results.LastInsertedID(); return npc_scale_global_base_entry; } @@ -372,6 +376,8 @@ public: for (auto &npc_scale_global_base_entry: npc_scale_global_base_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(npc_scale_global_base_entry.type)); + insert_values.push_back(std::to_string(npc_scale_global_base_entry.level)); insert_values.push_back(std::to_string(npc_scale_global_base_entry.ac)); insert_values.push_back(std::to_string(npc_scale_global_base_entry.hp)); insert_values.push_back(std::to_string(npc_scale_global_base_entry.accuracy)); diff --git a/common/repositories/base/base_npc_spells_effects_entries_repository.h b/common/repositories/base/base_npc_spells_effects_entries_repository.h index e4631037c..30206e5a8 100644 --- a/common/repositories/base/base_npc_spells_effects_entries_repository.h +++ b/common/repositories/base/base_npc_spells_effects_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_spells_effects_repository.h b/common/repositories/base/base_npc_spells_effects_repository.h index 831d5b6c9..ef6755e9b 100644 --- a/common/repositories/base/base_npc_spells_effects_repository.h +++ b/common/repositories/base/base_npc_spells_effects_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_spells_entries_repository.h b/common/repositories/base/base_npc_spells_entries_repository.h index 85bdbc383..52f34c15b 100644 --- a/common/repositories/base/base_npc_spells_entries_repository.h +++ b/common/repositories/base/base_npc_spells_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_spells_repository.h b/common/repositories/base/base_npc_spells_repository.h index 10bf88898..563da0517 100644 --- a/common/repositories/base/base_npc_spells_repository.h +++ b/common/repositories/base/base_npc_spells_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_types_repository.h b/common/repositories/base/base_npc_types_repository.h index 62a75c88f..d0e0d340b 100644 --- a/common/repositories/base/base_npc_types_repository.h +++ b/common/repositories/base/base_npc_types_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_npc_types_tint_repository.h b/common/repositories/base/base_npc_types_tint_repository.h index 3c11932ed..c645859ab 100644 --- a/common/repositories/base/base_npc_types_tint_repository.h +++ b/common/repositories/base/base_npc_types_tint_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -276,6 +276,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(npc_types_tint_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(npc_types_tint_entry.tint_set_name) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(npc_types_tint_entry.red1h)); update_values.push_back(columns[3] + " = " + std::to_string(npc_types_tint_entry.grn1h)); @@ -324,6 +325,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(npc_types_tint_entry.id)); insert_values.push_back("'" + EscapeString(npc_types_tint_entry.tint_set_name) + "'"); insert_values.push_back(std::to_string(npc_types_tint_entry.red1h)); insert_values.push_back(std::to_string(npc_types_tint_entry.grn1h)); @@ -380,6 +382,7 @@ public: for (auto &npc_types_tint_entry: npc_types_tint_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(npc_types_tint_entry.id)); insert_values.push_back("'" + EscapeString(npc_types_tint_entry.tint_set_name) + "'"); insert_values.push_back(std::to_string(npc_types_tint_entry.red1h)); insert_values.push_back(std::to_string(npc_types_tint_entry.grn1h)); diff --git a/common/repositories/base/base_object_contents_repository.h b/common/repositories/base/base_object_contents_repository.h index 04a261381..632612862 100644 --- a/common/repositories/base/base_object_contents_repository.h +++ b/common/repositories/base/base_object_contents_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -51,7 +51,7 @@ public: static std::string PrimaryKey() { - return std::string("bagidx"); + return std::string("parentid"); } static std::vector Columns() @@ -141,7 +141,7 @@ public: ) { for (auto &object_contents : object_contentss) { - if (object_contents.bagidx == object_contents_id) { + if (object_contents.parentid == object_contents_id) { return object_contents; } } @@ -209,6 +209,8 @@ public: auto columns = Columns(); update_values.push_back(columns[0] + " = " + std::to_string(object_contents_entry.zoneid)); + update_values.push_back(columns[1] + " = " + std::to_string(object_contents_entry.parentid)); + update_values.push_back(columns[2] + " = " + std::to_string(object_contents_entry.bagidx)); update_values.push_back(columns[3] + " = " + std::to_string(object_contents_entry.itemid)); update_values.push_back(columns[4] + " = " + std::to_string(object_contents_entry.charges)); update_values.push_back(columns[5] + " = '" + EscapeString(object_contents_entry.droptime) + "'"); @@ -225,7 +227,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - object_contents_entry.bagidx + object_contents_entry.parentid ) ); @@ -239,6 +241,8 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(object_contents_entry.zoneid)); + insert_values.push_back(std::to_string(object_contents_entry.parentid)); + insert_values.push_back(std::to_string(object_contents_entry.bagidx)); insert_values.push_back(std::to_string(object_contents_entry.itemid)); insert_values.push_back(std::to_string(object_contents_entry.charges)); insert_values.push_back("'" + EscapeString(object_contents_entry.droptime) + "'"); @@ -258,7 +262,7 @@ public: ); if (results.Success()) { - object_contents_entry.id = results.LastInsertedID(); + object_contents_entry.parentid = results.LastInsertedID(); return object_contents_entry; } @@ -277,6 +281,8 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(object_contents_entry.zoneid)); + insert_values.push_back(std::to_string(object_contents_entry.parentid)); + insert_values.push_back(std::to_string(object_contents_entry.bagidx)); insert_values.push_back(std::to_string(object_contents_entry.itemid)); insert_values.push_back(std::to_string(object_contents_entry.charges)); insert_values.push_back("'" + EscapeString(object_contents_entry.droptime) + "'"); diff --git a/common/repositories/base/base_object_repository.h b/common/repositories/base/base_object_repository.h index c3287bf96..9896520f1 100644 --- a/common/repositories/base/base_object_repository.h +++ b/common/repositories/base/base_object_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_perl_event_export_settings_repository.h b/common/repositories/base/base_perl_event_export_settings_repository.h index 8e72aa8eb..0db0459d8 100644 --- a/common/repositories/base/base_perl_event_export_settings_repository.h +++ b/common/repositories/base/base_perl_event_export_settings_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -188,6 +188,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(perl_event_export_settings_entry.event_id)); update_values.push_back(columns[1] + " = '" + EscapeString(perl_event_export_settings_entry.event_description) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(perl_event_export_settings_entry.export_qglobals)); update_values.push_back(columns[3] + " = " + std::to_string(perl_event_export_settings_entry.export_mob)); @@ -214,6 +215,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(perl_event_export_settings_entry.event_id)); insert_values.push_back("'" + EscapeString(perl_event_export_settings_entry.event_description) + "'"); insert_values.push_back(std::to_string(perl_event_export_settings_entry.export_qglobals)); insert_values.push_back(std::to_string(perl_event_export_settings_entry.export_mob)); @@ -230,7 +232,7 @@ public: ); if (results.Success()) { - perl_event_export_settings_entry.id = results.LastInsertedID(); + perl_event_export_settings_entry.event_id = results.LastInsertedID(); return perl_event_export_settings_entry; } @@ -248,6 +250,7 @@ public: for (auto &perl_event_export_settings_entry: perl_event_export_settings_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(perl_event_export_settings_entry.event_id)); insert_values.push_back("'" + EscapeString(perl_event_export_settings_entry.event_description) + "'"); insert_values.push_back(std::to_string(perl_event_export_settings_entry.export_qglobals)); insert_values.push_back(std::to_string(perl_event_export_settings_entry.export_mob)); diff --git a/common/repositories/base/base_petitions_repository.h b/common/repositories/base/base_petitions_repository.h index 97a9e5761..b450c02fc 100644 --- a/common/repositories/base/base_petitions_repository.h +++ b/common/repositories/base/base_petitions_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -284,7 +284,7 @@ public: ); if (results.Success()) { - petitions_entry.id = results.LastInsertedID(); + petitions_entry.dib = results.LastInsertedID(); return petitions_entry; } diff --git a/common/repositories/base/base_pets_equipmentset_entries_repository.h b/common/repositories/base/base_pets_equipmentset_entries_repository.h index 6b27208f2..ef2238b9d 100644 --- a/common/repositories/base/base_pets_equipmentset_entries_repository.h +++ b/common/repositories/base/base_pets_equipmentset_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -42,7 +42,7 @@ public: static std::string PrimaryKey() { - return std::string("slot"); + return std::string("set_id"); } static std::vector Columns() @@ -114,7 +114,7 @@ public: ) { for (auto &pets_equipmentset_entries : pets_equipmentset_entriess) { - if (pets_equipmentset_entries.slot == pets_equipmentset_entries_id) { + if (pets_equipmentset_entries.set_id == pets_equipmentset_entries_id) { return pets_equipmentset_entries; } } @@ -172,6 +172,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(pets_equipmentset_entries_entry.set_id)); + update_values.push_back(columns[1] + " = " + std::to_string(pets_equipmentset_entries_entry.slot)); update_values.push_back(columns[2] + " = " + std::to_string(pets_equipmentset_entries_entry.item_id)); auto results = content_db.QueryDatabase( @@ -180,7 +182,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - pets_equipmentset_entries_entry.slot + pets_equipmentset_entries_entry.set_id ) ); @@ -193,6 +195,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(pets_equipmentset_entries_entry.set_id)); + insert_values.push_back(std::to_string(pets_equipmentset_entries_entry.slot)); insert_values.push_back(std::to_string(pets_equipmentset_entries_entry.item_id)); auto results = content_db.QueryDatabase( @@ -204,7 +208,7 @@ public: ); if (results.Success()) { - pets_equipmentset_entries_entry.id = results.LastInsertedID(); + pets_equipmentset_entries_entry.set_id = results.LastInsertedID(); return pets_equipmentset_entries_entry; } @@ -222,6 +226,8 @@ public: for (auto &pets_equipmentset_entries_entry: pets_equipmentset_entries_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(pets_equipmentset_entries_entry.set_id)); + insert_values.push_back(std::to_string(pets_equipmentset_entries_entry.slot)); insert_values.push_back(std::to_string(pets_equipmentset_entries_entry.item_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); diff --git a/common/repositories/base/base_pets_equipmentset_repository.h b/common/repositories/base/base_pets_equipmentset_repository.h index 0a2fe7143..1d8d33ee3 100644 --- a/common/repositories/base/base_pets_equipmentset_repository.h +++ b/common/repositories/base/base_pets_equipmentset_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(pets_equipmentset_entry.set_id)); update_values.push_back(columns[1] + " = '" + EscapeString(pets_equipmentset_entry.setname) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(pets_equipmentset_entry.nested_set)); @@ -194,6 +195,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(pets_equipmentset_entry.set_id)); insert_values.push_back("'" + EscapeString(pets_equipmentset_entry.setname) + "'"); insert_values.push_back(std::to_string(pets_equipmentset_entry.nested_set)); @@ -206,7 +208,7 @@ public: ); if (results.Success()) { - pets_equipmentset_entry.id = results.LastInsertedID(); + pets_equipmentset_entry.set_id = results.LastInsertedID(); return pets_equipmentset_entry; } @@ -224,6 +226,7 @@ public: for (auto &pets_equipmentset_entry: pets_equipmentset_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(pets_equipmentset_entry.set_id)); insert_values.push_back("'" + EscapeString(pets_equipmentset_entry.setname) + "'"); insert_values.push_back(std::to_string(pets_equipmentset_entry.nested_set)); diff --git a/common/repositories/base/base_pets_repository.h b/common/repositories/base/base_pets_repository.h index adfccf8d5..940c6261a 100644 --- a/common/repositories/base/base_pets_repository.h +++ b/common/repositories/base/base_pets_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -47,7 +47,7 @@ public: static std::string PrimaryKey() { - return std::string("petpower"); + return std::string("type"); } static std::vector Columns() @@ -129,7 +129,7 @@ public: ) { for (auto &pets : petss) { - if (pets.petpower == pets_id) { + if (pets.type == pets_id) { return pets; } } @@ -192,6 +192,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = '" + EscapeString(pets_entry.type) + "'"); + update_values.push_back(columns[1] + " = " + std::to_string(pets_entry.petpower)); update_values.push_back(columns[2] + " = " + std::to_string(pets_entry.npcID)); update_values.push_back(columns[3] + " = " + std::to_string(pets_entry.temp)); update_values.push_back(columns[4] + " = " + std::to_string(pets_entry.petcontrol)); @@ -205,7 +207,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - pets_entry.petpower + pets_entry.type ) ); @@ -218,6 +220,8 @@ public: { std::vector insert_values; + insert_values.push_back("'" + EscapeString(pets_entry.type) + "'"); + insert_values.push_back(std::to_string(pets_entry.petpower)); insert_values.push_back(std::to_string(pets_entry.npcID)); insert_values.push_back(std::to_string(pets_entry.temp)); insert_values.push_back(std::to_string(pets_entry.petcontrol)); @@ -234,7 +238,7 @@ public: ); if (results.Success()) { - pets_entry.id = results.LastInsertedID(); + pets_entry.type = results.LastInsertedID(); return pets_entry; } @@ -252,6 +256,8 @@ public: for (auto &pets_entry: pets_entries) { std::vector insert_values; + insert_values.push_back("'" + EscapeString(pets_entry.type) + "'"); + insert_values.push_back(std::to_string(pets_entry.petpower)); insert_values.push_back(std::to_string(pets_entry.npcID)); insert_values.push_back(std::to_string(pets_entry.temp)); insert_values.push_back(std::to_string(pets_entry.petcontrol)); diff --git a/common/repositories/base/base_player_titlesets_repository.h b/common/repositories/base/base_player_titlesets_repository.h index 4f036f2a5..648da53c3 100644 --- a/common/repositories/base/base_player_titlesets_repository.h +++ b/common/repositories/base/base_player_titlesets_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_proximities_repository.h b/common/repositories/base/base_proximities_repository.h index b1257616e..de9026645 100644 --- a/common/repositories/base/base_proximities_repository.h +++ b/common/repositories/base/base_proximities_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -47,7 +47,7 @@ public: static std::string PrimaryKey() { - return std::string("exploreid"); + return std::string("zoneid"); } static std::vector Columns() @@ -129,7 +129,7 @@ public: ) { for (auto &proximities : proximitiess) { - if (proximities.exploreid == proximities_id) { + if (proximities.zoneid == proximities_id) { return proximities; } } @@ -192,6 +192,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(proximities_entry.zoneid)); + update_values.push_back(columns[1] + " = " + std::to_string(proximities_entry.exploreid)); update_values.push_back(columns[2] + " = " + std::to_string(proximities_entry.minx)); update_values.push_back(columns[3] + " = " + std::to_string(proximities_entry.maxx)); update_values.push_back(columns[4] + " = " + std::to_string(proximities_entry.miny)); @@ -205,7 +207,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - proximities_entry.exploreid + proximities_entry.zoneid ) ); @@ -218,6 +220,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(proximities_entry.zoneid)); + insert_values.push_back(std::to_string(proximities_entry.exploreid)); insert_values.push_back(std::to_string(proximities_entry.minx)); insert_values.push_back(std::to_string(proximities_entry.maxx)); insert_values.push_back(std::to_string(proximities_entry.miny)); @@ -234,7 +238,7 @@ public: ); if (results.Success()) { - proximities_entry.id = results.LastInsertedID(); + proximities_entry.zoneid = results.LastInsertedID(); return proximities_entry; } @@ -252,6 +256,8 @@ public: for (auto &proximities_entry: proximities_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(proximities_entry.zoneid)); + insert_values.push_back(std::to_string(proximities_entry.exploreid)); insert_values.push_back(std::to_string(proximities_entry.minx)); insert_values.push_back(std::to_string(proximities_entry.maxx)); insert_values.push_back(std::to_string(proximities_entry.miny)); diff --git a/common/repositories/base/base_quest_globals_repository.h b/common/repositories/base/base_quest_globals_repository.h index 944bc4c44..6db28c9a2 100644 --- a/common/repositories/base/base_quest_globals_repository.h +++ b/common/repositories/base/base_quest_globals_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -45,7 +45,7 @@ public: static std::string PrimaryKey() { - return std::string("name"); + return std::string("charid"); } static std::vector Columns() @@ -123,7 +123,7 @@ public: ) { for (auto &quest_globals : quest_globalss) { - if (quest_globals.name == quest_globals_id) { + if (quest_globals.charid == quest_globals_id) { return quest_globals; } } @@ -184,6 +184,10 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(quest_globals_entry.charid)); + update_values.push_back(columns[1] + " = " + std::to_string(quest_globals_entry.npcid)); + update_values.push_back(columns[2] + " = " + std::to_string(quest_globals_entry.zoneid)); + update_values.push_back(columns[3] + " = '" + EscapeString(quest_globals_entry.name) + "'"); update_values.push_back(columns[4] + " = '" + EscapeString(quest_globals_entry.value) + "'"); update_values.push_back(columns[5] + " = " + std::to_string(quest_globals_entry.expdate)); @@ -193,7 +197,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - quest_globals_entry.name + quest_globals_entry.charid ) ); @@ -206,6 +210,10 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(quest_globals_entry.charid)); + insert_values.push_back(std::to_string(quest_globals_entry.npcid)); + insert_values.push_back(std::to_string(quest_globals_entry.zoneid)); + insert_values.push_back("'" + EscapeString(quest_globals_entry.name) + "'"); insert_values.push_back("'" + EscapeString(quest_globals_entry.value) + "'"); insert_values.push_back(std::to_string(quest_globals_entry.expdate)); @@ -218,7 +226,7 @@ public: ); if (results.Success()) { - quest_globals_entry.id = results.LastInsertedID(); + quest_globals_entry.charid = results.LastInsertedID(); return quest_globals_entry; } @@ -236,6 +244,10 @@ public: for (auto &quest_globals_entry: quest_globals_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(quest_globals_entry.charid)); + insert_values.push_back(std::to_string(quest_globals_entry.npcid)); + insert_values.push_back(std::to_string(quest_globals_entry.zoneid)); + insert_values.push_back("'" + EscapeString(quest_globals_entry.name) + "'"); insert_values.push_back("'" + EscapeString(quest_globals_entry.value) + "'"); insert_values.push_back(std::to_string(quest_globals_entry.expdate)); diff --git a/common/repositories/base/base_raid_details_repository.h b/common/repositories/base/base_raid_details_repository.h index e5e9ca728..80181d8bc 100644 --- a/common/repositories/base/base_raid_details_repository.h +++ b/common/repositories/base/base_raid_details_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -176,6 +176,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(raid_details_entry.raidid)); update_values.push_back(columns[1] + " = " + std::to_string(raid_details_entry.loottype)); update_values.push_back(columns[2] + " = " + std::to_string(raid_details_entry.locked)); update_values.push_back(columns[3] + " = '" + EscapeString(raid_details_entry.motd) + "'"); @@ -199,6 +200,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(raid_details_entry.raidid)); insert_values.push_back(std::to_string(raid_details_entry.loottype)); insert_values.push_back(std::to_string(raid_details_entry.locked)); insert_values.push_back("'" + EscapeString(raid_details_entry.motd) + "'"); @@ -212,7 +214,7 @@ public: ); if (results.Success()) { - raid_details_entry.id = results.LastInsertedID(); + raid_details_entry.raidid = results.LastInsertedID(); return raid_details_entry; } @@ -230,6 +232,7 @@ public: for (auto &raid_details_entry: raid_details_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(raid_details_entry.raidid)); insert_values.push_back(std::to_string(raid_details_entry.loottype)); insert_values.push_back(std::to_string(raid_details_entry.locked)); insert_values.push_back("'" + EscapeString(raid_details_entry.motd) + "'"); diff --git a/common/repositories/base/base_raid_members_repository.h b/common/repositories/base/base_raid_members_repository.h index c69a369ac..b567edf70 100644 --- a/common/repositories/base/base_raid_members_repository.h +++ b/common/repositories/base/base_raid_members_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -197,6 +197,7 @@ public: auto columns = Columns(); update_values.push_back(columns[0] + " = " + std::to_string(raid_members_entry.raidid)); + update_values.push_back(columns[1] + " = " + std::to_string(raid_members_entry.charid)); update_values.push_back(columns[2] + " = " + std::to_string(raid_members_entry.groupid)); update_values.push_back(columns[3] + " = " + std::to_string(raid_members_entry._class)); update_values.push_back(columns[4] + " = " + std::to_string(raid_members_entry.level)); @@ -225,6 +226,7 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(raid_members_entry.raidid)); + insert_values.push_back(std::to_string(raid_members_entry.charid)); insert_values.push_back(std::to_string(raid_members_entry.groupid)); insert_values.push_back(std::to_string(raid_members_entry._class)); insert_values.push_back(std::to_string(raid_members_entry.level)); @@ -242,7 +244,7 @@ public: ); if (results.Success()) { - raid_members_entry.id = results.LastInsertedID(); + raid_members_entry.charid = results.LastInsertedID(); return raid_members_entry; } @@ -261,6 +263,7 @@ public: std::vector insert_values; insert_values.push_back(std::to_string(raid_members_entry.raidid)); + insert_values.push_back(std::to_string(raid_members_entry.charid)); insert_values.push_back(std::to_string(raid_members_entry.groupid)); insert_values.push_back(std::to_string(raid_members_entry._class)); insert_values.push_back(std::to_string(raid_members_entry.level)); diff --git a/common/repositories/base/base_reports_repository.h b/common/repositories/base/base_reports_repository.h index 5d61e1d9b..e24c18c8f 100644 --- a/common/repositories/base/base_reports_repository.h +++ b/common/repositories/base/base_reports_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_respawn_times_repository.h b/common/repositories/base/base_respawn_times_repository.h index 86f6c8785..f94896c07 100644 --- a/common/repositories/base/base_respawn_times_repository.h +++ b/common/repositories/base/base_respawn_times_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("instance_id"); + return std::string("id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &respawn_times : respawn_timess) { - if (respawn_times.instance_id == respawn_times_id) { + if (respawn_times.id == respawn_times_id) { return respawn_times; } } @@ -176,8 +176,10 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(respawn_times_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(respawn_times_entry.start)); update_values.push_back(columns[2] + " = " + std::to_string(respawn_times_entry.duration)); + update_values.push_back(columns[3] + " = " + std::to_string(respawn_times_entry.instance_id)); auto results = database.QueryDatabase( fmt::format( @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - respawn_times_entry.instance_id + respawn_times_entry.id ) ); @@ -198,8 +200,10 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(respawn_times_entry.id)); insert_values.push_back(std::to_string(respawn_times_entry.start)); insert_values.push_back(std::to_string(respawn_times_entry.duration)); + insert_values.push_back(std::to_string(respawn_times_entry.instance_id)); auto results = database.QueryDatabase( fmt::format( @@ -228,8 +232,10 @@ public: for (auto &respawn_times_entry: respawn_times_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(respawn_times_entry.id)); insert_values.push_back(std::to_string(respawn_times_entry.start)); insert_values.push_back(std::to_string(respawn_times_entry.duration)); + insert_values.push_back(std::to_string(respawn_times_entry.instance_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_rule_sets_repository.h b/common/repositories/base/base_rule_sets_repository.h index e6a6c5717..76ea63faf 100644 --- a/common/repositories/base/base_rule_sets_repository.h +++ b/common/repositories/base/base_rule_sets_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -200,7 +200,7 @@ public: ); if (results.Success()) { - rule_sets_entry.id = results.LastInsertedID(); + rule_sets_entry.ruleset_id = results.LastInsertedID(); return rule_sets_entry; } diff --git a/common/repositories/base/base_rule_values_repository.h b/common/repositories/base/base_rule_values_repository.h index f6dd33980..5e3038cea 100644 --- a/common/repositories/base/base_rule_values_repository.h +++ b/common/repositories/base/base_rule_values_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("rule_name"); + return std::string("ruleset_id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &rule_values : rule_valuess) { - if (rule_values.rule_name == rule_values_id) { + if (rule_values.ruleset_id == rule_values_id) { return rule_values; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(rule_values_entry.ruleset_id)); + update_values.push_back(columns[1] + " = '" + EscapeString(rule_values_entry.rule_name) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(rule_values_entry.rule_value) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(rule_values_entry.notes) + "'"); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - rule_values_entry.rule_name + rule_values_entry.ruleset_id ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(rule_values_entry.ruleset_id)); + insert_values.push_back("'" + EscapeString(rule_values_entry.rule_name) + "'"); insert_values.push_back("'" + EscapeString(rule_values_entry.rule_value) + "'"); insert_values.push_back("'" + EscapeString(rule_values_entry.notes) + "'"); @@ -210,7 +214,7 @@ public: ); if (results.Success()) { - rule_values_entry.id = results.LastInsertedID(); + rule_values_entry.ruleset_id = results.LastInsertedID(); return rule_values_entry; } @@ -228,6 +232,8 @@ public: for (auto &rule_values_entry: rule_values_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(rule_values_entry.ruleset_id)); + insert_values.push_back("'" + EscapeString(rule_values_entry.rule_name) + "'"); insert_values.push_back("'" + EscapeString(rule_values_entry.rule_value) + "'"); insert_values.push_back("'" + EscapeString(rule_values_entry.notes) + "'"); diff --git a/common/repositories/base/base_saylink_repository.h b/common/repositories/base/base_saylink_repository.h index 2d8da9040..249d93417 100644 --- a/common/repositories/base/base_saylink_repository.h +++ b/common/repositories/base/base_saylink_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_skill_caps_repository.h b/common/repositories/base/base_skill_caps_repository.h index daf293f0a..15d33b3f3 100644 --- a/common/repositories/base/base_skill_caps_repository.h +++ b/common/repositories/base/base_skill_caps_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("class_"); + return std::string("skillID"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &skill_caps : skill_capss) { - if (skill_caps.class_ == skill_caps_id) { + if (skill_caps.skillID == skill_caps_id) { return skill_caps; } } @@ -180,7 +180,11 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(skill_caps_entry.skillID)); + update_values.push_back(columns[1] + " = " + std::to_string(skill_caps_entry.class)); + update_values.push_back(columns[2] + " = " + std::to_string(skill_caps_entry.level)); update_values.push_back(columns[3] + " = " + std::to_string(skill_caps_entry.cap)); + update_values.push_back(columns[4] + " = " + std::to_string(skill_caps_entry.class_)); auto results = content_db.QueryDatabase( fmt::format( @@ -188,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - skill_caps_entry.class_ + skill_caps_entry.skillID ) ); @@ -201,7 +205,11 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(skill_caps_entry.skillID)); + insert_values.push_back(std::to_string(skill_caps_entry.class)); + insert_values.push_back(std::to_string(skill_caps_entry.level)); insert_values.push_back(std::to_string(skill_caps_entry.cap)); + insert_values.push_back(std::to_string(skill_caps_entry.class_)); auto results = content_db.QueryDatabase( fmt::format( @@ -212,7 +220,7 @@ public: ); if (results.Success()) { - skill_caps_entry.id = results.LastInsertedID(); + skill_caps_entry.skillID = results.LastInsertedID(); return skill_caps_entry; } @@ -230,7 +238,11 @@ public: for (auto &skill_caps_entry: skill_caps_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(skill_caps_entry.skillID)); + insert_values.push_back(std::to_string(skill_caps_entry.class)); + insert_values.push_back(std::to_string(skill_caps_entry.level)); insert_values.push_back(std::to_string(skill_caps_entry.cap)); + insert_values.push_back(std::to_string(skill_caps_entry.class_)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_spawn2_repository.h b/common/repositories/base/base_spawn2_repository.h index 423e9798d..35b729a21 100644 --- a/common/repositories/base/base_spawn2_repository.h +++ b/common/repositories/base/base_spawn2_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_spawn_condition_values_repository.h b/common/repositories/base/base_spawn_condition_values_repository.h index de279e9f7..3b00801bf 100644 --- a/common/repositories/base/base_spawn_condition_values_repository.h +++ b/common/repositories/base/base_spawn_condition_values_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("instance_id"); + return std::string("id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &spawn_condition_values : spawn_condition_valuess) { - if (spawn_condition_values.instance_id == spawn_condition_values_id) { + if (spawn_condition_values.id == spawn_condition_values_id) { return spawn_condition_values; } } @@ -176,7 +176,10 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(spawn_condition_values_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(spawn_condition_values_entry.value)); + update_values.push_back(columns[2] + " = '" + EscapeString(spawn_condition_values_entry.zone) + "'"); + update_values.push_back(columns[3] + " = " + std::to_string(spawn_condition_values_entry.instance_id)); auto results = database.QueryDatabase( fmt::format( @@ -184,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - spawn_condition_values_entry.instance_id + spawn_condition_values_entry.id ) ); @@ -197,7 +200,10 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(spawn_condition_values_entry.id)); insert_values.push_back(std::to_string(spawn_condition_values_entry.value)); + insert_values.push_back("'" + EscapeString(spawn_condition_values_entry.zone) + "'"); + insert_values.push_back(std::to_string(spawn_condition_values_entry.instance_id)); auto results = database.QueryDatabase( fmt::format( @@ -226,7 +232,10 @@ public: for (auto &spawn_condition_values_entry: spawn_condition_values_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(spawn_condition_values_entry.id)); insert_values.push_back(std::to_string(spawn_condition_values_entry.value)); + insert_values.push_back("'" + EscapeString(spawn_condition_values_entry.zone) + "'"); + insert_values.push_back(std::to_string(spawn_condition_values_entry.instance_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_spawn_conditions_repository.h b/common/repositories/base/base_spawn_conditions_repository.h index b6671182d..dabb1ff70 100644 --- a/common/repositories/base/base_spawn_conditions_repository.h +++ b/common/repositories/base/base_spawn_conditions_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("id"); + return std::string("zone"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &spawn_conditions : spawn_conditionss) { - if (spawn_conditions.id == spawn_conditions_id) { + if (spawn_conditions.zone == spawn_conditions_id) { return spawn_conditions; } } @@ -180,6 +180,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = '" + EscapeString(spawn_conditions_entry.zone) + "'"); + update_values.push_back(columns[1] + " = " + std::to_string(spawn_conditions_entry.id)); update_values.push_back(columns[2] + " = " + std::to_string(spawn_conditions_entry.value)); update_values.push_back(columns[3] + " = " + std::to_string(spawn_conditions_entry.onchange)); update_values.push_back(columns[4] + " = '" + EscapeString(spawn_conditions_entry.name) + "'"); @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - spawn_conditions_entry.id + spawn_conditions_entry.zone ) ); @@ -203,6 +205,8 @@ public: { std::vector insert_values; + insert_values.push_back("'" + EscapeString(spawn_conditions_entry.zone) + "'"); + insert_values.push_back(std::to_string(spawn_conditions_entry.id)); insert_values.push_back(std::to_string(spawn_conditions_entry.value)); insert_values.push_back(std::to_string(spawn_conditions_entry.onchange)); insert_values.push_back("'" + EscapeString(spawn_conditions_entry.name) + "'"); @@ -216,7 +220,7 @@ public: ); if (results.Success()) { - spawn_conditions_entry.id = results.LastInsertedID(); + spawn_conditions_entry.zone = results.LastInsertedID(); return spawn_conditions_entry; } @@ -234,6 +238,8 @@ public: for (auto &spawn_conditions_entry: spawn_conditions_entries) { std::vector insert_values; + insert_values.push_back("'" + EscapeString(spawn_conditions_entry.zone) + "'"); + insert_values.push_back(std::to_string(spawn_conditions_entry.id)); insert_values.push_back(std::to_string(spawn_conditions_entry.value)); insert_values.push_back(std::to_string(spawn_conditions_entry.onchange)); insert_values.push_back("'" + EscapeString(spawn_conditions_entry.name) + "'"); diff --git a/common/repositories/base/base_spawn_events_repository.h b/common/repositories/base/base_spawn_events_repository.h index 4fa81b0fc..723a670d8 100644 --- a/common/repositories/base/base_spawn_events_repository.h +++ b/common/repositories/base/base_spawn_events_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_spawnentry_repository.h b/common/repositories/base/base_spawnentry_repository.h index 7733ddea0..9392dc45c 100644 --- a/common/repositories/base/base_spawnentry_repository.h +++ b/common/repositories/base/base_spawnentry_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("npcID"); + return std::string("spawngroupID"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &spawnentry : spawnentrys) { - if (spawnentry.npcID == spawnentry_id) { + if (spawnentry.spawngroupID == spawnentry_id) { return spawnentry; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(spawnentry_entry.spawngroupID)); + update_values.push_back(columns[1] + " = " + std::to_string(spawnentry_entry.npcID)); update_values.push_back(columns[2] + " = " + std::to_string(spawnentry_entry.chance)); update_values.push_back(columns[3] + " = " + std::to_string(spawnentry_entry.condition_value_filter)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - spawnentry_entry.npcID + spawnentry_entry.spawngroupID ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(spawnentry_entry.spawngroupID)); + insert_values.push_back(std::to_string(spawnentry_entry.npcID)); insert_values.push_back(std::to_string(spawnentry_entry.chance)); insert_values.push_back(std::to_string(spawnentry_entry.condition_value_filter)); @@ -210,7 +214,7 @@ public: ); if (results.Success()) { - spawnentry_entry.id = results.LastInsertedID(); + spawnentry_entry.spawngroupID = results.LastInsertedID(); return spawnentry_entry; } @@ -228,6 +232,8 @@ public: for (auto &spawnentry_entry: spawnentry_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(spawnentry_entry.spawngroupID)); + insert_values.push_back(std::to_string(spawnentry_entry.npcID)); insert_values.push_back(std::to_string(spawnentry_entry.chance)); insert_values.push_back(std::to_string(spawnentry_entry.condition_value_filter)); diff --git a/common/repositories/base/base_spawngroup_repository.h b/common/repositories/base/base_spawngroup_repository.h index 6f0897d1b..bc55f8dca 100644 --- a/common/repositories/base/base_spawngroup_repository.h +++ b/common/repositories/base/base_spawngroup_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_spell_buckets_repository.h b/common/repositories/base/base_spell_buckets_repository.h index 1c0e9505f..4481e5d74 100644 --- a/common/repositories/base/base_spell_buckets_repository.h +++ b/common/repositories/base/base_spell_buckets_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -172,6 +172,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(spell_buckets_entry.spellid)); update_values.push_back(columns[1] + " = '" + EscapeString(spell_buckets_entry.key) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(spell_buckets_entry.value) + "'"); @@ -194,6 +195,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(spell_buckets_entry.spellid)); insert_values.push_back("'" + EscapeString(spell_buckets_entry.key) + "'"); insert_values.push_back("'" + EscapeString(spell_buckets_entry.value) + "'"); @@ -206,7 +208,7 @@ public: ); if (results.Success()) { - spell_buckets_entry.id = results.LastInsertedID(); + spell_buckets_entry.spellid = results.LastInsertedID(); return spell_buckets_entry; } @@ -224,6 +226,7 @@ public: for (auto &spell_buckets_entry: spell_buckets_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(spell_buckets_entry.spellid)); insert_values.push_back("'" + EscapeString(spell_buckets_entry.key) + "'"); insert_values.push_back("'" + EscapeString(spell_buckets_entry.value) + "'"); diff --git a/common/repositories/base/base_spell_globals_repository.h b/common/repositories/base/base_spell_globals_repository.h index 8350ee3dc..e878cc5c4 100644 --- a/common/repositories/base/base_spell_globals_repository.h +++ b/common/repositories/base/base_spell_globals_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -176,6 +176,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(spell_globals_entry.spellid)); update_values.push_back(columns[1] + " = '" + EscapeString(spell_globals_entry.spell_name) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(spell_globals_entry.qglobal) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(spell_globals_entry.value) + "'"); @@ -199,6 +200,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(spell_globals_entry.spellid)); insert_values.push_back("'" + EscapeString(spell_globals_entry.spell_name) + "'"); insert_values.push_back("'" + EscapeString(spell_globals_entry.qglobal) + "'"); insert_values.push_back("'" + EscapeString(spell_globals_entry.value) + "'"); @@ -212,7 +214,7 @@ public: ); if (results.Success()) { - spell_globals_entry.id = results.LastInsertedID(); + spell_globals_entry.spellid = results.LastInsertedID(); return spell_globals_entry; } @@ -230,6 +232,7 @@ public: for (auto &spell_globals_entry: spell_globals_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(spell_globals_entry.spellid)); insert_values.push_back("'" + EscapeString(spell_globals_entry.spell_name) + "'"); insert_values.push_back("'" + EscapeString(spell_globals_entry.qglobal) + "'"); insert_values.push_back("'" + EscapeString(spell_globals_entry.value) + "'"); diff --git a/common/repositories/base/base_spells_new_repository.h b/common/repositories/base/base_spells_new_repository.h index 4fbdcea1f..2c48a3dbb 100644 --- a/common/repositories/base/base_spells_new_repository.h +++ b/common/repositories/base/base_spells_new_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -1108,6 +1108,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(spells_new_entry.id)); update_values.push_back(columns[1] + " = '" + EscapeString(spells_new_entry.name) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(spells_new_entry.player_1) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(spells_new_entry.teleport_zone) + "'"); @@ -1364,6 +1365,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(spells_new_entry.id)); insert_values.push_back("'" + EscapeString(spells_new_entry.name) + "'"); insert_values.push_back("'" + EscapeString(spells_new_entry.player_1) + "'"); insert_values.push_back("'" + EscapeString(spells_new_entry.teleport_zone) + "'"); @@ -1628,6 +1630,7 @@ public: for (auto &spells_new_entry: spells_new_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(spells_new_entry.id)); insert_values.push_back("'" + EscapeString(spells_new_entry.name) + "'"); insert_values.push_back("'" + EscapeString(spells_new_entry.player_1) + "'"); insert_values.push_back("'" + EscapeString(spells_new_entry.teleport_zone) + "'"); diff --git a/common/repositories/base/base_start_zones_repository.h b/common/repositories/base/base_start_zones_repository.h index c0a8b3c6a..4643b458a 100644 --- a/common/repositories/base/base_start_zones_repository.h +++ b/common/repositories/base/base_start_zones_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -57,7 +57,7 @@ public: static std::string PrimaryKey() { - return std::string("player_race"); + return std::string("player_choice"); } static std::vector Columns() @@ -159,7 +159,7 @@ public: ) { for (auto &start_zones : start_zoness) { - if (start_zones.player_race == start_zones_id) { + if (start_zones.player_choice == start_zones_id) { return start_zones; } } @@ -238,6 +238,10 @@ public: update_values.push_back(columns[3] + " = " + std::to_string(start_zones_entry.heading)); update_values.push_back(columns[4] + " = " + std::to_string(start_zones_entry.zone_id)); update_values.push_back(columns[5] + " = " + std::to_string(start_zones_entry.bind_id)); + update_values.push_back(columns[6] + " = " + std::to_string(start_zones_entry.player_choice)); + update_values.push_back(columns[7] + " = " + std::to_string(start_zones_entry.player_class)); + update_values.push_back(columns[8] + " = " + std::to_string(start_zones_entry.player_deity)); + update_values.push_back(columns[9] + " = " + std::to_string(start_zones_entry.player_race)); update_values.push_back(columns[10] + " = " + std::to_string(start_zones_entry.start_zone)); update_values.push_back(columns[11] + " = " + std::to_string(start_zones_entry.bind_x)); update_values.push_back(columns[12] + " = " + std::to_string(start_zones_entry.bind_y)); @@ -253,7 +257,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - start_zones_entry.player_race + start_zones_entry.player_choice ) ); @@ -272,6 +276,10 @@ public: insert_values.push_back(std::to_string(start_zones_entry.heading)); insert_values.push_back(std::to_string(start_zones_entry.zone_id)); insert_values.push_back(std::to_string(start_zones_entry.bind_id)); + insert_values.push_back(std::to_string(start_zones_entry.player_choice)); + insert_values.push_back(std::to_string(start_zones_entry.player_class)); + insert_values.push_back(std::to_string(start_zones_entry.player_deity)); + insert_values.push_back(std::to_string(start_zones_entry.player_race)); insert_values.push_back(std::to_string(start_zones_entry.start_zone)); insert_values.push_back(std::to_string(start_zones_entry.bind_x)); insert_values.push_back(std::to_string(start_zones_entry.bind_y)); @@ -290,7 +298,7 @@ public: ); if (results.Success()) { - start_zones_entry.id = results.LastInsertedID(); + start_zones_entry.player_choice = results.LastInsertedID(); return start_zones_entry; } @@ -314,6 +322,10 @@ public: insert_values.push_back(std::to_string(start_zones_entry.heading)); insert_values.push_back(std::to_string(start_zones_entry.zone_id)); insert_values.push_back(std::to_string(start_zones_entry.bind_id)); + insert_values.push_back(std::to_string(start_zones_entry.player_choice)); + insert_values.push_back(std::to_string(start_zones_entry.player_class)); + insert_values.push_back(std::to_string(start_zones_entry.player_deity)); + insert_values.push_back(std::to_string(start_zones_entry.player_race)); insert_values.push_back(std::to_string(start_zones_entry.start_zone)); insert_values.push_back(std::to_string(start_zones_entry.bind_x)); insert_values.push_back(std::to_string(start_zones_entry.bind_y)); diff --git a/common/repositories/base/base_starting_items_repository.h b/common/repositories/base/base_starting_items_repository.h index 64bdd124a..e8c45158e 100644 --- a/common/repositories/base/base_starting_items_repository.h +++ b/common/repositories/base/base_starting_items_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -51,7 +51,7 @@ public: static std::string PrimaryKey() { - return std::string("race"); + return std::string("id"); } static std::vector Columns() @@ -141,7 +141,7 @@ public: ) { for (auto &starting_items : starting_itemss) { - if (starting_items.race == starting_items_id) { + if (starting_items.id == starting_items_id) { return starting_items; } } @@ -208,6 +208,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[1] + " = " + std::to_string(starting_items_entry.race)); update_values.push_back(columns[2] + " = " + std::to_string(starting_items_entry.class)); update_values.push_back(columns[3] + " = " + std::to_string(starting_items_entry.deityid)); update_values.push_back(columns[4] + " = " + std::to_string(starting_items_entry.zoneid)); @@ -225,7 +226,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - starting_items_entry.race + starting_items_entry.id ) ); @@ -238,6 +239,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(starting_items_entry.race)); insert_values.push_back(std::to_string(starting_items_entry.class)); insert_values.push_back(std::to_string(starting_items_entry.deityid)); insert_values.push_back(std::to_string(starting_items_entry.zoneid)); @@ -276,6 +278,7 @@ public: for (auto &starting_items_entry: starting_items_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(starting_items_entry.race)); insert_values.push_back(std::to_string(starting_items_entry.class)); insert_values.push_back(std::to_string(starting_items_entry.deityid)); insert_values.push_back(std::to_string(starting_items_entry.zoneid)); diff --git a/common/repositories/base/base_task_activities_repository.h b/common/repositories/base/base_task_activities_repository.h index 2182bf508..86668b17a 100644 --- a/common/repositories/base/base_task_activities_repository.h +++ b/common/repositories/base/base_task_activities_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -54,7 +54,7 @@ public: static std::string PrimaryKey() { - return std::string("activityid"); + return std::string("taskid"); } static std::vector Columns() @@ -150,7 +150,7 @@ public: ) { for (auto &task_activities : task_activitiess) { - if (task_activities.activityid == task_activities_id) { + if (task_activities.taskid == task_activities_id) { return task_activities; } } @@ -220,6 +220,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(task_activities_entry.taskid)); + update_values.push_back(columns[1] + " = " + std::to_string(task_activities_entry.activityid)); update_values.push_back(columns[2] + " = " + std::to_string(task_activities_entry.step)); update_values.push_back(columns[3] + " = " + std::to_string(task_activities_entry.activitytype)); update_values.push_back(columns[4] + " = '" + EscapeString(task_activities_entry.target_name) + "'"); @@ -240,7 +242,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - task_activities_entry.activityid + task_activities_entry.taskid ) ); @@ -253,6 +255,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(task_activities_entry.taskid)); + insert_values.push_back(std::to_string(task_activities_entry.activityid)); insert_values.push_back(std::to_string(task_activities_entry.step)); insert_values.push_back(std::to_string(task_activities_entry.activitytype)); insert_values.push_back("'" + EscapeString(task_activities_entry.target_name) + "'"); @@ -276,7 +280,7 @@ public: ); if (results.Success()) { - task_activities_entry.id = results.LastInsertedID(); + task_activities_entry.taskid = results.LastInsertedID(); return task_activities_entry; } @@ -294,6 +298,8 @@ public: for (auto &task_activities_entry: task_activities_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(task_activities_entry.taskid)); + insert_values.push_back(std::to_string(task_activities_entry.activityid)); insert_values.push_back(std::to_string(task_activities_entry.step)); insert_values.push_back(std::to_string(task_activities_entry.activitytype)); insert_values.push_back("'" + EscapeString(task_activities_entry.target_name) + "'"); diff --git a/common/repositories/base/base_tasks_repository.h b/common/repositories/base/base_tasks_repository.h index 042141d8e..08d887073 100644 --- a/common/repositories/base/base_tasks_repository.h +++ b/common/repositories/base/base_tasks_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -224,6 +224,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(tasks_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(tasks_entry.type)); update_values.push_back(columns[2] + " = " + std::to_string(tasks_entry.duration)); update_values.push_back(columns[3] + " = " + std::to_string(tasks_entry.duration_code)); @@ -259,6 +260,7 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(tasks_entry.id)); insert_values.push_back(std::to_string(tasks_entry.type)); insert_values.push_back(std::to_string(tasks_entry.duration)); insert_values.push_back(std::to_string(tasks_entry.duration_code)); @@ -302,6 +304,7 @@ public: for (auto &tasks_entry: tasks_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(tasks_entry.id)); insert_values.push_back(std::to_string(tasks_entry.type)); insert_values.push_back(std::to_string(tasks_entry.duration)); insert_values.push_back(std::to_string(tasks_entry.duration_code)); diff --git a/common/repositories/base/base_tasksets_repository.h b/common/repositories/base/base_tasksets_repository.h index 84b50f78f..cf4444e31 100644 --- a/common/repositories/base/base_tasksets_repository.h +++ b/common/repositories/base/base_tasksets_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -41,7 +41,7 @@ public: static std::string PrimaryKey() { - return std::string("taskid"); + return std::string("id"); } static std::vector Columns() @@ -111,7 +111,7 @@ public: ) { for (auto &tasksets : tasksetss) { - if (tasksets.taskid == tasksets_id) { + if (tasksets.id == tasksets_id) { return tasksets; } } @@ -168,7 +168,8 @@ public: auto columns = Columns(); - + update_values.push_back(columns[0] + " = " + std::to_string(tasksets_entry.id)); + update_values.push_back(columns[1] + " = " + std::to_string(tasksets_entry.taskid)); auto results = content_db.QueryDatabase( fmt::format( @@ -176,7 +177,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - tasksets_entry.taskid + tasksets_entry.id ) ); @@ -189,7 +190,8 @@ public: { std::vector insert_values; - + insert_values.push_back(std::to_string(tasksets_entry.id)); + insert_values.push_back(std::to_string(tasksets_entry.taskid)); auto results = content_db.QueryDatabase( fmt::format( @@ -218,7 +220,8 @@ public: for (auto &tasksets_entry: tasksets_entries) { std::vector insert_values; - + insert_values.push_back(std::to_string(tasksets_entry.id)); + insert_values.push_back(std::to_string(tasksets_entry.taskid)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_timers_repository.h b/common/repositories/base/base_timers_repository.h index 620a90d7a..e1e60cadb 100644 --- a/common/repositories/base/base_timers_repository.h +++ b/common/repositories/base/base_timers_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("type"); + return std::string("char_id"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &timers : timerss) { - if (timers.type == timers_id) { + if (timers.char_id == timers_id) { return timers; } } @@ -180,6 +180,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(timers_entry.char_id)); + update_values.push_back(columns[1] + " = " + std::to_string(timers_entry.type)); update_values.push_back(columns[2] + " = " + std::to_string(timers_entry.start)); update_values.push_back(columns[3] + " = " + std::to_string(timers_entry.duration)); update_values.push_back(columns[4] + " = " + std::to_string(timers_entry.enable)); @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - timers_entry.type + timers_entry.char_id ) ); @@ -203,6 +205,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(timers_entry.char_id)); + insert_values.push_back(std::to_string(timers_entry.type)); insert_values.push_back(std::to_string(timers_entry.start)); insert_values.push_back(std::to_string(timers_entry.duration)); insert_values.push_back(std::to_string(timers_entry.enable)); @@ -216,7 +220,7 @@ public: ); if (results.Success()) { - timers_entry.id = results.LastInsertedID(); + timers_entry.char_id = results.LastInsertedID(); return timers_entry; } @@ -234,6 +238,8 @@ public: for (auto &timers_entry: timers_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(timers_entry.char_id)); + insert_values.push_back(std::to_string(timers_entry.type)); insert_values.push_back(std::to_string(timers_entry.start)); insert_values.push_back(std::to_string(timers_entry.duration)); insert_values.push_back(std::to_string(timers_entry.enable)); diff --git a/common/repositories/base/base_titles_repository.h b/common/repositories/base/base_titles_repository.h index f0ad144f7..dbe3e282f 100644 --- a/common/repositories/base/base_titles_repository.h +++ b/common/repositories/base/base_titles_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_trader_repository.h b/common/repositories/base/base_trader_repository.h index 49f9da6e0..acfc75194 100644 --- a/common/repositories/base/base_trader_repository.h +++ b/common/repositories/base/base_trader_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -45,7 +45,7 @@ public: static std::string PrimaryKey() { - return std::string("slot_id"); + return std::string("char_id"); } static std::vector Columns() @@ -123,7 +123,7 @@ public: ) { for (auto &trader : traders) { - if (trader.slot_id == trader_id) { + if (trader.char_id == trader_id) { return trader; } } @@ -184,10 +184,12 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(trader_entry.char_id)); update_values.push_back(columns[1] + " = " + std::to_string(trader_entry.item_id)); update_values.push_back(columns[2] + " = " + std::to_string(trader_entry.serialnumber)); update_values.push_back(columns[3] + " = " + std::to_string(trader_entry.charges)); update_values.push_back(columns[4] + " = " + std::to_string(trader_entry.item_cost)); + update_values.push_back(columns[5] + " = " + std::to_string(trader_entry.slot_id)); auto results = database.QueryDatabase( fmt::format( @@ -195,7 +197,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - trader_entry.slot_id + trader_entry.char_id ) ); @@ -208,10 +210,12 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(trader_entry.char_id)); insert_values.push_back(std::to_string(trader_entry.item_id)); insert_values.push_back(std::to_string(trader_entry.serialnumber)); insert_values.push_back(std::to_string(trader_entry.charges)); insert_values.push_back(std::to_string(trader_entry.item_cost)); + insert_values.push_back(std::to_string(trader_entry.slot_id)); auto results = database.QueryDatabase( fmt::format( @@ -222,7 +226,7 @@ public: ); if (results.Success()) { - trader_entry.id = results.LastInsertedID(); + trader_entry.char_id = results.LastInsertedID(); return trader_entry; } @@ -240,10 +244,12 @@ public: for (auto &trader_entry: trader_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(trader_entry.char_id)); insert_values.push_back(std::to_string(trader_entry.item_id)); insert_values.push_back(std::to_string(trader_entry.serialnumber)); insert_values.push_back(std::to_string(trader_entry.charges)); insert_values.push_back(std::to_string(trader_entry.item_cost)); + insert_values.push_back(std::to_string(trader_entry.slot_id)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_tradeskill_recipe_entries_repository.h b/common/repositories/base/base_tradeskill_recipe_entries_repository.h index 23b2afbc2..c089e7e28 100644 --- a/common/repositories/base/base_tradeskill_recipe_entries_repository.h +++ b/common/repositories/base/base_tradeskill_recipe_entries_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_tradeskill_recipe_repository.h b/common/repositories/base/base_tradeskill_recipe_repository.h index 58ca82916..7b768ad6a 100644 --- a/common/repositories/base/base_tradeskill_recipe_repository.h +++ b/common/repositories/base/base_tradeskill_recipe_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_traps_repository.h b/common/repositories/base/base_traps_repository.h index 679083ba8..97817b671 100644 --- a/common/repositories/base/base_traps_repository.h +++ b/common/repositories/base/base_traps_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_tribute_levels_repository.h b/common/repositories/base/base_tribute_levels_repository.h index a821b9055..e430c8798 100644 --- a/common/repositories/base/base_tribute_levels_repository.h +++ b/common/repositories/base/base_tribute_levels_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -43,7 +43,7 @@ public: static std::string PrimaryKey() { - return std::string("level"); + return std::string("tribute_id"); } static std::vector Columns() @@ -117,7 +117,7 @@ public: ) { for (auto &tribute_levels : tribute_levelss) { - if (tribute_levels.level == tribute_levels_id) { + if (tribute_levels.tribute_id == tribute_levels_id) { return tribute_levels; } } @@ -176,6 +176,8 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(tribute_levels_entry.tribute_id)); + update_values.push_back(columns[1] + " = " + std::to_string(tribute_levels_entry.level)); update_values.push_back(columns[2] + " = " + std::to_string(tribute_levels_entry.cost)); update_values.push_back(columns[3] + " = " + std::to_string(tribute_levels_entry.item_id)); @@ -185,7 +187,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - tribute_levels_entry.level + tribute_levels_entry.tribute_id ) ); @@ -198,6 +200,8 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(tribute_levels_entry.tribute_id)); + insert_values.push_back(std::to_string(tribute_levels_entry.level)); insert_values.push_back(std::to_string(tribute_levels_entry.cost)); insert_values.push_back(std::to_string(tribute_levels_entry.item_id)); @@ -210,7 +214,7 @@ public: ); if (results.Success()) { - tribute_levels_entry.id = results.LastInsertedID(); + tribute_levels_entry.tribute_id = results.LastInsertedID(); return tribute_levels_entry; } @@ -228,6 +232,8 @@ public: for (auto &tribute_levels_entry: tribute_levels_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(tribute_levels_entry.tribute_id)); + insert_values.push_back(std::to_string(tribute_levels_entry.level)); insert_values.push_back(std::to_string(tribute_levels_entry.cost)); insert_values.push_back(std::to_string(tribute_levels_entry.item_id)); diff --git a/common/repositories/base/base_tributes_repository.h b/common/repositories/base/base_tributes_repository.h index fe8ac3ed4..69e2c6c9c 100644 --- a/common/repositories/base/base_tributes_repository.h +++ b/common/repositories/base/base_tributes_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("isguild"); + return std::string("id"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &tributes : tributess) { - if (tributes.isguild == tributes_id) { + if (tributes.id == tributes_id) { return tributes; } } @@ -180,9 +180,11 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(tributes_entry.id)); update_values.push_back(columns[1] + " = " + std::to_string(tributes_entry.unknown)); update_values.push_back(columns[2] + " = '" + EscapeString(tributes_entry.name) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(tributes_entry.descr) + "'"); + update_values.push_back(columns[4] + " = " + std::to_string(tributes_entry.isguild)); auto results = content_db.QueryDatabase( fmt::format( @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - tributes_entry.isguild + tributes_entry.id ) ); @@ -203,9 +205,11 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(tributes_entry.id)); insert_values.push_back(std::to_string(tributes_entry.unknown)); insert_values.push_back("'" + EscapeString(tributes_entry.name) + "'"); insert_values.push_back("'" + EscapeString(tributes_entry.descr) + "'"); + insert_values.push_back(std::to_string(tributes_entry.isguild)); auto results = content_db.QueryDatabase( fmt::format( @@ -234,9 +238,11 @@ public: for (auto &tributes_entry: tributes_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(tributes_entry.id)); insert_values.push_back(std::to_string(tributes_entry.unknown)); insert_values.push_back("'" + EscapeString(tributes_entry.name) + "'"); insert_values.push_back("'" + EscapeString(tributes_entry.descr) + "'"); + insert_values.push_back(std::to_string(tributes_entry.isguild)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_variables_repository.h b/common/repositories/base/base_variables_repository.h index a7635a3ae..8c18ded15 100644 --- a/common/repositories/base/base_variables_repository.h +++ b/common/repositories/base/base_variables_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -176,6 +176,7 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = '" + EscapeString(variables_entry.varname) + "'"); update_values.push_back(columns[1] + " = '" + EscapeString(variables_entry.value) + "'"); update_values.push_back(columns[2] + " = '" + EscapeString(variables_entry.information) + "'"); update_values.push_back(columns[3] + " = '" + EscapeString(variables_entry.ts) + "'"); @@ -199,6 +200,7 @@ public: { std::vector insert_values; + insert_values.push_back("'" + EscapeString(variables_entry.varname) + "'"); insert_values.push_back("'" + EscapeString(variables_entry.value) + "'"); insert_values.push_back("'" + EscapeString(variables_entry.information) + "'"); insert_values.push_back("'" + EscapeString(variables_entry.ts) + "'"); @@ -212,7 +214,7 @@ public: ); if (results.Success()) { - variables_entry.id = results.LastInsertedID(); + variables_entry.varname = results.LastInsertedID(); return variables_entry; } @@ -230,6 +232,7 @@ public: for (auto &variables_entry: variables_entries) { std::vector insert_values; + insert_values.push_back("'" + EscapeString(variables_entry.varname) + "'"); insert_values.push_back("'" + EscapeString(variables_entry.value) + "'"); insert_values.push_back("'" + EscapeString(variables_entry.information) + "'"); insert_values.push_back("'" + EscapeString(variables_entry.ts) + "'"); diff --git a/common/repositories/base/base_veteran_reward_templates_repository.h b/common/repositories/base/base_veteran_reward_templates_repository.h index 6ad7e1093..1c81f7e06 100644 --- a/common/repositories/base/base_veteran_reward_templates_repository.h +++ b/common/repositories/base/base_veteran_reward_templates_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -44,7 +44,7 @@ public: static std::string PrimaryKey() { - return std::string("reward_slot"); + return std::string("claim_id"); } static std::vector Columns() @@ -120,7 +120,7 @@ public: ) { for (auto &veteran_reward_templates : veteran_reward_templatess) { - if (veteran_reward_templates.reward_slot == veteran_reward_templates_id) { + if (veteran_reward_templates.claim_id == veteran_reward_templates_id) { return veteran_reward_templates; } } @@ -180,9 +180,11 @@ public: auto columns = Columns(); + update_values.push_back(columns[0] + " = " + std::to_string(veteran_reward_templates_entry.claim_id)); update_values.push_back(columns[1] + " = '" + EscapeString(veteran_reward_templates_entry.name) + "'"); update_values.push_back(columns[2] + " = " + std::to_string(veteran_reward_templates_entry.item_id)); update_values.push_back(columns[3] + " = " + std::to_string(veteran_reward_templates_entry.charges)); + update_values.push_back(columns[4] + " = " + std::to_string(veteran_reward_templates_entry.reward_slot)); auto results = content_db.QueryDatabase( fmt::format( @@ -190,7 +192,7 @@ public: TableName(), implode(", ", update_values), PrimaryKey(), - veteran_reward_templates_entry.reward_slot + veteran_reward_templates_entry.claim_id ) ); @@ -203,9 +205,11 @@ public: { std::vector insert_values; + insert_values.push_back(std::to_string(veteran_reward_templates_entry.claim_id)); insert_values.push_back("'" + EscapeString(veteran_reward_templates_entry.name) + "'"); insert_values.push_back(std::to_string(veteran_reward_templates_entry.item_id)); insert_values.push_back(std::to_string(veteran_reward_templates_entry.charges)); + insert_values.push_back(std::to_string(veteran_reward_templates_entry.reward_slot)); auto results = content_db.QueryDatabase( fmt::format( @@ -216,7 +220,7 @@ public: ); if (results.Success()) { - veteran_reward_templates_entry.id = results.LastInsertedID(); + veteran_reward_templates_entry.claim_id = results.LastInsertedID(); return veteran_reward_templates_entry; } @@ -234,9 +238,11 @@ public: for (auto &veteran_reward_templates_entry: veteran_reward_templates_entries) { std::vector insert_values; + insert_values.push_back(std::to_string(veteran_reward_templates_entry.claim_id)); insert_values.push_back("'" + EscapeString(veteran_reward_templates_entry.name) + "'"); insert_values.push_back(std::to_string(veteran_reward_templates_entry.item_id)); insert_values.push_back(std::to_string(veteran_reward_templates_entry.charges)); + insert_values.push_back(std::to_string(veteran_reward_templates_entry.reward_slot)); insert_chunks.push_back("(" + implode(",", insert_values) + ")"); } diff --git a/common/repositories/base/base_zone_points_repository.h b/common/repositories/base/base_zone_points_repository.h index fbe7c211d..fb2f06b51 100644 --- a/common/repositories/base/base_zone_points_repository.h +++ b/common/repositories/base/base_zone_points_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/base/base_zone_repository.h b/common/repositories/base/base_zone_repository.h index 172c172c2..71ffeaade 100644 --- a/common/repositories/base/base_zone_repository.h +++ b/common/repositories/base/base_zone_repository.h @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on Apr 5, 2020 and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ diff --git a/common/repositories/books_repository.h b/common/repositories/books_repository.h deleted file mode 100644 index a1e6aab98..000000000 --- a/common/repositories/books_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_BOOKS_REPOSITORY_H -#define EQEMU_BOOKS_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_books_repository.h" - -class BooksRepository: public BaseBooksRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * BooksRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * BooksRepository::GetWhereNeverExpires() - * BooksRepository::GetWhereXAndY() - * BooksRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_BOOKS_REPOSITORY_H diff --git a/common/repositories/character_tribute_repository.h b/common/repositories/character_tribute_repository.h deleted file mode 100644 index 30edd2bfb..000000000 --- a/common/repositories/character_tribute_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_CHARACTER_TRIBUTE_REPOSITORY_H -#define EQEMU_CHARACTER_TRIBUTE_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_character_tribute_repository.h" - -class CharacterTributeRepository: public BaseCharacterTributeRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * CharacterTributeRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * CharacterTributeRepository::GetWhereNeverExpires() - * CharacterTributeRepository::GetWhereXAndY() - * CharacterTributeRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_CHARACTER_TRIBUTE_REPOSITORY_H diff --git a/common/repositories/chatchannels_repository.h b/common/repositories/chatchannels_repository.h deleted file mode 100644 index 3fef234f6..000000000 --- a/common/repositories/chatchannels_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_CHATCHANNELS_REPOSITORY_H -#define EQEMU_CHATCHANNELS_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_chatchannels_repository.h" - -class ChatchannelsRepository: public BaseChatchannelsRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * ChatchannelsRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * ChatchannelsRepository::GetWhereNeverExpires() - * ChatchannelsRepository::GetWhereXAndY() - * ChatchannelsRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_CHATCHANNELS_REPOSITORY_H diff --git a/common/repositories/command_settings_repository.h b/common/repositories/command_settings_repository.h deleted file mode 100644 index 34021b399..000000000 --- a/common/repositories/command_settings_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_COMMAND_SETTINGS_REPOSITORY_H -#define EQEMU_COMMAND_SETTINGS_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_command_settings_repository.h" - -class CommandSettingsRepository: public BaseCommandSettingsRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * CommandSettingsRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * CommandSettingsRepository::GetWhereNeverExpires() - * CommandSettingsRepository::GetWhereXAndY() - * CommandSettingsRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_COMMAND_SETTINGS_REPOSITORY_H diff --git a/common/repositories/launcher_repository.h b/common/repositories/launcher_repository.h deleted file mode 100644 index 413167faf..000000000 --- a/common/repositories/launcher_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_LAUNCHER_REPOSITORY_H -#define EQEMU_LAUNCHER_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_launcher_repository.h" - -class LauncherRepository: public BaseLauncherRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * LauncherRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * LauncherRepository::GetWhereNeverExpires() - * LauncherRepository::GetWhereXAndY() - * LauncherRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_LAUNCHER_REPOSITORY_H diff --git a/common/repositories/launcher_zones_repository.h b/common/repositories/launcher_zones_repository.h deleted file mode 100644 index ed0facae4..000000000 --- a/common/repositories/launcher_zones_repository.h +++ /dev/null @@ -1,68 +0,0 @@ -/** - * EQEmulator: Everquest Server Emulator - * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY except by those people which sell it, which - * are required to give you total support for your newly bought product; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR - * A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef EQEMU_LAUNCHER_ZONES_REPOSITORY_H -#define EQEMU_LAUNCHER_ZONES_REPOSITORY_H - -#include "../database.h" -#include "../string_util.h" -#include "base/base_launcher_zones_repository.h" - -class LauncherZonesRepository: public BaseLauncherZonesRepository { -public: - - /** - * This file was auto generated on Apr 5, 2020 and can be modified and extended upon - * - * Base repository methods are automatically - * generated in the "base" version of this repository. The base repository - * is immutable and to be left untouched, while methods in this class - * are used as extension methods for more specific persistence-layer - * accessors or mutators - * - * Base Methods (Subject to be expanded upon in time) - * - * InsertOne - * UpdateOne - * DeleteOne - * FindOne - * GetWhere(std::string where_filter) - * DeleteWhere(std::string where_filter) - * InsertMany - * All - * - * Example custom methods in a repository - * - * LauncherZonesRepository::GetByZoneAndVersion(int zone_id, int zone_version) - * LauncherZonesRepository::GetWhereNeverExpires() - * LauncherZonesRepository::GetWhereXAndY() - * LauncherZonesRepository::DeleteWhereXAndY() - * - * Most of the above could be covered by base methods, but if you as a developer - * find yourself re-using logic for other parts of the code, its best to just make a - * method that can be re-used easily elsewhere especially if it can use a base repository - * method and encapsulate filters there - */ - - // Custom extended repository methods here - -}; - -#endif //EQEMU_LAUNCHER_ZONES_REPOSITORY_H diff --git a/common/repositories/template/base_repository.template b/common/repositories/template/base_repository.template index 67b0322a0..8226d55e5 100644 --- a/common/repositories/template/base_repository.template +++ b/common/repositories/template/base_repository.template @@ -20,8 +20,8 @@ */ /** - * This repository was automatically generated on {{GENERATED_DATE}} and is NOT - * to be modified directly. Any repository modifications are meant to be made to + * This repository was automatically generated and is NOT to be modified directly. + * Any repository modifications are meant to be made to * the repository extending the base. Any modifications to base repositories are to * be made by the generator only */ @@ -195,7 +195,7 @@ public: ); if (results.Success()) { - {{TABLE_NAME_VAR}}_entry.id = results.LastInsertedID(); + {{TABLE_NAME_VAR}}_entry.{{PRIMARY_KEY_STRING}} = results.LastInsertedID(); return {{TABLE_NAME_VAR}}_entry; } diff --git a/common/repositories/template/repository.template b/common/repositories/template/repository.template index 3d49157bd..00d5b6db3 100644 --- a/common/repositories/template/repository.template +++ b/common/repositories/template/repository.template @@ -29,16 +29,18 @@ class {{TABLE_NAME_CLASS}}Repository: public Base{{TABLE_NAME_CLASS}}Repository public: /** - * This file was auto generated on {{GENERATED_DATE}} and can be modified and extended upon + * This file was auto generated and can be modified and extended upon * * Base repository methods are automatically * generated in the "base" version of this repository. The base repository * is immutable and to be left untouched, while methods in this class * are used as extension methods for more specific persistence-layer - * accessors or mutators + * accessors or mutators. * * Base Methods (Subject to be expanded upon in time) * + * Note: Not all tables are designed appropriately to fit functionality with all base methods + * * InsertOne * UpdateOne * DeleteOne diff --git a/utils/scripts/generators/repository-generator.pl b/utils/scripts/generators/repository-generator.pl index 060b6b010..710e91ae4 100644 --- a/utils/scripts/generators/repository-generator.pl +++ b/utils/scripts/generators/repository-generator.pl @@ -79,7 +79,7 @@ my $pass = $config->{"server"}{"database"}{"password"}; my $dsn = "dbi:mysql:$database_name:$host:3306"; my $connect = DBI->connect($dsn, $user, $pass); -my @tables = ($requested_table_to_generate); +my @tables = (); if ($requested_table_to_generate eq "all" || !$requested_table_to_generate) { my $table_names_exec = $connect->prepare( " @@ -120,7 +120,7 @@ foreach my $table_to_generate (@tables) { my @table_ignore_list = ( "character_enabledtasks", # "grid", # Manually created - "grid_entries", # Manually created + "grid_entries", # Manually created # "tradeskill_recipe", # Manually created # "character_recipe_list", # Manually created "guild_bank", @@ -160,7 +160,8 @@ foreach my $table_to_generate (@tables) { COLUMN_TYPE, ORDINAL_POSITION, COLUMN_KEY, - COLUMN_DEFAULT + COLUMN_DEFAULT, + EXTRA FROM INFORMATION_SCHEMA.COLUMNS WHERE @@ -203,8 +204,6 @@ foreach my $table_to_generate (@tables) { my %table_primary_key = (); $ex->execute($database_name, $table_to_generate); - $table_primary_key{$table_to_generate} = "id"; - while (my @row = $ex->fetchrow_array()) { my $column_name = $row[0]; my $table_name = $row[1]; @@ -213,9 +212,12 @@ foreach my $table_to_generate (@tables) { my $ordinal_position = $row[4]; my $column_key = $row[5]; my $column_default = ($row[6] ? $row[6] : ""); + my $extra = ($row[7] ? $row[7] : ""); - if ($column_key eq "PRI" || ($ordinal_position == 0 && $column_name =~ /id/i)) { - $table_primary_key{$table_name} = $column_name; + if (!$table_primary_key{$table_name}) { + if (($column_key eq "PRI" && $data_type =~/int/) || ($ordinal_position == 0 && $column_name =~ /id/i)) { + $table_primary_key{$table_name} = $column_name; + } } my $default_value = 0; @@ -242,7 +244,7 @@ foreach my $table_to_generate (@tables) { $column_names_quoted .= sprintf("\t\t\t\"%s\",\n", $column_name); # update one - if ($column_key ne "PRI") { + if ($extra ne "auto_increment") { my $query_value = sprintf('\'" + EscapeString(%s_entry.%s) + "\'");', $table_name, $column_name); if ($data_type =~ /int|float|double|decimal/) { $query_value = sprintf('" + std::to_string(%s_entry.%s));', $table_name, $column_name); @@ -256,7 +258,7 @@ foreach my $table_to_generate (@tables) { } # insert one - if ($column_key ne "PRI") { + if ($extra ne "auto_increment") { my $value = sprintf("\"'\" + EscapeString(%s_entry.%s) + \"'\"", $table_name, $column_name); if ($data_type =~ /int|float|double|decimal/) { $value = sprintf('std::to_string(%s_entry.%s)', $table_name, $column_name); @@ -285,6 +287,12 @@ foreach my $table_to_generate (@tables) { # print "table_name [$table_name] column_name [$column_name] data_type [$data_type] column_type [$column_type]\n"; $index++; + + } + + if (!$table_primary_key{$table_to_generate}) { + print "Table primary key [$table_to_generate] has no primary key! Skipping... \n"; + next; } ############################################# @@ -303,7 +311,7 @@ foreach my $table_to_generate (@tables) { } if (trim($base_repository_template) eq "") { - print "Base repository template not found! [$repository_template_file]\n"; + print "Base repository template not found! [$base_repository_template_file]\n"; exit; }