Add GetWhere and DeleteWhere repository methods

This commit is contained in:
Akkadius 2020-04-04 04:44:39 -05:00
parent 9faae00d15
commit 15c9b64120
164 changed files with 8806 additions and 594 deletions

View File

@ -268,7 +268,7 @@ public:
return aa_ability_entry;
}
aa_ability_entry = InstanceListRepository::NewEntity();
aa_ability_entry = AaAbilityRepository::NewEntity();
return aa_ability_entry;
}
@ -349,6 +349,58 @@ public:
return all_entries;
}
static std::vector<AaAbility> GetWhere(std::string where_filter)
{
std::vector<AaAbility> 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) {
AaAbility entry{};
entry.id = atoi(row[0]);
entry.name = row[1];
entry.category = atoi(row[2]);
entry.classes = atoi(row[3]);
entry.races = atoi(row[4]);
entry.drakkin_heritage = atoi(row[5]);
entry.deities = atoi(row[6]);
entry.status = atoi(row[7]);
entry.type = atoi(row[8]);
entry.charges = atoi(row[9]);
entry.grant_only = atoi(row[10]);
entry.first_rank_id = atoi(row[11]);
entry.enabled = atoi(row[12]);
entry.reset_on_death = atoi(row[13]);
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_AA_ABILITY_REPOSITORY_H

View File

@ -212,7 +212,7 @@ public:
return aa_rank_effects_entry;
}
aa_rank_effects_entry = InstanceListRepository::NewEntity();
aa_rank_effects_entry = AaRankEffectsRepository::NewEntity();
return aa_rank_effects_entry;
}
@ -274,6 +274,49 @@ public:
return all_entries;
}
static std::vector<AaRankEffects> GetWhere(std::string where_filter)
{
std::vector<AaRankEffects> 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) {
AaRankEffects entry{};
entry.rank_id = atoi(row[0]);
entry.slot = atoi(row[1]);
entry.effect_id = atoi(row[2]);
entry.base1 = atoi(row[3]);
entry.base2 = atoi(row[4]);
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_AA_RANK_EFFECTS_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return aa_rank_prereqs_entry;
}
aa_rank_prereqs_entry = InstanceListRepository::NewEntity();
aa_rank_prereqs_entry = AaRankPrereqsRepository::NewEntity();
return aa_rank_prereqs_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<AaRankPrereqs> GetWhere(std::string where_filter)
{
std::vector<AaRankPrereqs> 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) {
AaRankPrereqs entry{};
entry.rank_id = atoi(row[0]);
entry.aa_id = atoi(row[1]);
entry.points = 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_AA_RANK_PREREQS_REPOSITORY_H

View File

@ -262,7 +262,7 @@ public:
return aa_ranks_entry;
}
aa_ranks_entry = InstanceListRepository::NewEntity();
aa_ranks_entry = AaRanksRepository::NewEntity();
return aa_ranks_entry;
}
@ -341,6 +341,57 @@ public:
return all_entries;
}
static std::vector<AaRanks> GetWhere(std::string where_filter)
{
std::vector<AaRanks> 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) {
AaRanks entry{};
entry.id = atoi(row[0]);
entry.upper_hotkey_sid = atoi(row[1]);
entry.lower_hotkey_sid = atoi(row[2]);
entry.title_sid = atoi(row[3]);
entry.desc_sid = atoi(row[4]);
entry.cost = atoi(row[5]);
entry.level_req = atoi(row[6]);
entry.spell = atoi(row[7]);
entry.spell_type = atoi(row[8]);
entry.recast_time = atoi(row[9]);
entry.expansion = atoi(row[10]);
entry.prev_id = atoi(row[11]);
entry.next_id = atoi(row[12]);
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_AA_RANKS_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return account_flags_entry;
}
account_flags_entry = InstanceListRepository::NewEntity();
account_flags_entry = AccountFlagsRepository::NewEntity();
return account_flags_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<AccountFlags> GetWhere(std::string where_filter)
{
std::vector<AccountFlags> 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) {
AccountFlags entry{};
entry.p_accid = atoi(row[0]);
entry.p_flag = row[1];
entry.p_value = 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_ACCOUNT_FLAGS_REPOSITORY_H

View File

@ -206,7 +206,7 @@ public:
return account_ip_entry;
}
account_ip_entry = InstanceListRepository::NewEntity();
account_ip_entry = AccountIpRepository::NewEntity();
return account_ip_entry;
}
@ -266,6 +266,48 @@ public:
return all_entries;
}
static std::vector<AccountIp> GetWhere(std::string where_filter)
{
std::vector<AccountIp> 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) {
AccountIp entry{};
entry.accid = atoi(row[0]);
entry.ip = row[1];
entry.count = atoi(row[2]);
entry.lastused = 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_ACCOUNT_IP_REPOSITORY_H

View File

@ -298,7 +298,7 @@ public:
return account_entry;
}
account_entry = InstanceListRepository::NewEntity();
account_entry = AccountRepository::NewEntity();
return account_entry;
}
@ -389,6 +389,63 @@ public:
return all_entries;
}
static std::vector<Account> GetWhere(std::string where_filter)
{
std::vector<Account> 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) {
Account entry{};
entry.id = atoi(row[0]);
entry.name = row[1];
entry.charname = row[2];
entry.sharedplat = atoi(row[3]);
entry.password = row[4];
entry.status = atoi(row[5]);
entry.ls_id = row[6];
entry.lsaccount_id = atoi(row[7]);
entry.gmspeed = atoi(row[8]);
entry.revoked = atoi(row[9]);
entry.karma = atoi(row[10]);
entry.minilogin_ip = row[11];
entry.hideme = atoi(row[12]);
entry.rulesflag = atoi(row[13]);
entry.suspendeduntil = row[14];
entry.time_creation = atoi(row[15]);
entry.expansion = atoi(row[16]);
entry.ban_reason = row[17];
entry.suspend_reason = row[18];
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_ACCOUNT_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return account_rewards_entry;
}
account_rewards_entry = InstanceListRepository::NewEntity();
account_rewards_entry = AccountRewardsRepository::NewEntity();
return account_rewards_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<AccountRewards> GetWhere(std::string where_filter)
{
std::vector<AccountRewards> 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) {
AccountRewards entry{};
entry.account_id = atoi(row[0]);
entry.reward_id = atoi(row[1]);
entry.amount = 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_ACCOUNT_REWARDS_REPOSITORY_H

View File

@ -238,7 +238,7 @@ public:
return adventure_details_entry;
}
adventure_details_entry = InstanceListRepository::NewEntity();
adventure_details_entry = AdventureDetailsRepository::NewEntity();
return adventure_details_entry;
}
@ -309,6 +309,53 @@ public:
return all_entries;
}
static std::vector<AdventureDetails> GetWhere(std::string where_filter)
{
std::vector<AdventureDetails> 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) {
AdventureDetails entry{};
entry.id = atoi(row[0]);
entry.adventure_id = atoi(row[1]);
entry.instance_id = atoi(row[2]);
entry.count = atoi(row[3]);
entry.assassinate_count = atoi(row[4]);
entry.status = atoi(row[5]);
entry.time_created = atoi(row[6]);
entry.time_zoned = atoi(row[7]);
entry.time_completed = atoi(row[8]);
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_ADVENTURE_DETAILS_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return adventure_members_entry;
}
adventure_members_entry = InstanceListRepository::NewEntity();
adventure_members_entry = AdventureMembersRepository::NewEntity();
return adventure_members_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<AdventureMembers> GetWhere(std::string where_filter)
{
std::vector<AdventureMembers> 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) {
AdventureMembers entry{};
entry.id = atoi(row[0]);
entry.charid = atoi(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_ADVENTURE_MEMBERS_REPOSITORY_H

View File

@ -250,7 +250,7 @@ public:
return adventure_stats_entry;
}
adventure_stats_entry = InstanceListRepository::NewEntity();
adventure_stats_entry = AdventureStatsRepository::NewEntity();
return adventure_stats_entry;
}
@ -325,6 +325,55 @@ public:
return all_entries;
}
static std::vector<AdventureStats> GetWhere(std::string where_filter)
{
std::vector<AdventureStats> 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) {
AdventureStats entry{};
entry.player_id = atoi(row[0]);
entry.guk_wins = atoi(row[1]);
entry.mir_wins = atoi(row[2]);
entry.mmc_wins = atoi(row[3]);
entry.ruj_wins = atoi(row[4]);
entry.tak_wins = atoi(row[5]);
entry.guk_losses = atoi(row[6]);
entry.mir_losses = atoi(row[7]);
entry.mmc_losses = atoi(row[8]);
entry.ruj_losses = atoi(row[9]);
entry.tak_losses = atoi(row[10]);
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_ADVENTURE_STATS_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return adventure_template_entry_flavor_entry;
}
adventure_template_entry_flavor_entry = InstanceListRepository::NewEntity();
adventure_template_entry_flavor_entry = AdventureTemplateEntryFlavorRepository::NewEntity();
return adventure_template_entry_flavor_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<AdventureTemplateEntryFlavor> GetWhere(std::string where_filter)
{
std::vector<AdventureTemplateEntryFlavor> 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) {
AdventureTemplateEntryFlavor entry{};
entry.id = atoi(row[0]);
entry.text = row[1];
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_ADVENTURE_TEMPLATE_ENTRY_FLAVOR_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return adventure_template_entry_entry;
}
adventure_template_entry_entry = InstanceListRepository::NewEntity();
adventure_template_entry_entry = AdventureTemplateEntryRepository::NewEntity();
return adventure_template_entry_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<AdventureTemplateEntry> GetWhere(std::string where_filter)
{
std::vector<AdventureTemplateEntry> 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) {
AdventureTemplateEntry entry{};
entry.id = atoi(row[0]);
entry.template_id = atoi(row[1]);
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_ADVENTURE_TEMPLATE_ENTRY_REPOSITORY_H

View File

@ -293,10 +293,10 @@ public:
update_values.push_back(columns[7] + " = " + std::to_string(adventure_template_entry.type));
update_values.push_back(columns[8] + " = " + std::to_string(adventure_template_entry.type_data));
update_values.push_back(columns[9] + " = " + std::to_string(adventure_template_entry.type_count));
update_values.push_back(columns[10] + " = '" + EscapeString(adventure_template_entry.assa_x) + "'");
update_values.push_back(columns[11] + " = '" + EscapeString(adventure_template_entry.assa_y) + "'");
update_values.push_back(columns[12] + " = '" + EscapeString(adventure_template_entry.assa_z) + "'");
update_values.push_back(columns[13] + " = '" + EscapeString(adventure_template_entry.assa_h) + "'");
update_values.push_back(columns[10] + " = " + std::to_string(adventure_template_entry.assa_x));
update_values.push_back(columns[11] + " = " + std::to_string(adventure_template_entry.assa_y));
update_values.push_back(columns[12] + " = " + std::to_string(adventure_template_entry.assa_z));
update_values.push_back(columns[13] + " = " + std::to_string(adventure_template_entry.assa_h));
update_values.push_back(columns[14] + " = '" + EscapeString(adventure_template_entry.text) + "'");
update_values.push_back(columns[15] + " = " + std::to_string(adventure_template_entry.duration));
update_values.push_back(columns[16] + " = " + std::to_string(adventure_template_entry.zone_in_time));
@ -304,18 +304,18 @@ public:
update_values.push_back(columns[18] + " = " + std::to_string(adventure_template_entry.lose_points));
update_values.push_back(columns[19] + " = " + std::to_string(adventure_template_entry.theme));
update_values.push_back(columns[20] + " = " + std::to_string(adventure_template_entry.zone_in_zone_id));
update_values.push_back(columns[21] + " = '" + EscapeString(adventure_template_entry.zone_in_x) + "'");
update_values.push_back(columns[22] + " = '" + EscapeString(adventure_template_entry.zone_in_y) + "'");
update_values.push_back(columns[21] + " = " + std::to_string(adventure_template_entry.zone_in_x));
update_values.push_back(columns[22] + " = " + std::to_string(adventure_template_entry.zone_in_y));
update_values.push_back(columns[23] + " = " + std::to_string(adventure_template_entry.zone_in_object_id));
update_values.push_back(columns[24] + " = '" + EscapeString(adventure_template_entry.dest_x) + "'");
update_values.push_back(columns[25] + " = '" + EscapeString(adventure_template_entry.dest_y) + "'");
update_values.push_back(columns[26] + " = '" + EscapeString(adventure_template_entry.dest_z) + "'");
update_values.push_back(columns[27] + " = '" + EscapeString(adventure_template_entry.dest_h) + "'");
update_values.push_back(columns[24] + " = " + std::to_string(adventure_template_entry.dest_x));
update_values.push_back(columns[25] + " = " + std::to_string(adventure_template_entry.dest_y));
update_values.push_back(columns[26] + " = " + std::to_string(adventure_template_entry.dest_z));
update_values.push_back(columns[27] + " = " + std::to_string(adventure_template_entry.dest_h));
update_values.push_back(columns[28] + " = " + std::to_string(adventure_template_entry.graveyard_zone_id));
update_values.push_back(columns[29] + " = '" + EscapeString(adventure_template_entry.graveyard_x) + "'");
update_values.push_back(columns[30] + " = '" + EscapeString(adventure_template_entry.graveyard_y) + "'");
update_values.push_back(columns[31] + " = '" + EscapeString(adventure_template_entry.graveyard_z) + "'");
update_values.push_back(columns[32] + " = '" + EscapeString(adventure_template_entry.graveyard_radius) + "'");
update_values.push_back(columns[29] + " = " + std::to_string(adventure_template_entry.graveyard_x));
update_values.push_back(columns[30] + " = " + std::to_string(adventure_template_entry.graveyard_y));
update_values.push_back(columns[31] + " = " + std::to_string(adventure_template_entry.graveyard_z));
update_values.push_back(columns[32] + " = " + std::to_string(adventure_template_entry.graveyard_radius));
auto results = content_db.QueryDatabase(
fmt::format(
@ -345,10 +345,10 @@ public:
insert_values.push_back(std::to_string(adventure_template_entry.type));
insert_values.push_back(std::to_string(adventure_template_entry.type_data));
insert_values.push_back(std::to_string(adventure_template_entry.type_count));
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_y) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_z) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_h) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.assa_x));
insert_values.push_back(std::to_string(adventure_template_entry.assa_y));
insert_values.push_back(std::to_string(adventure_template_entry.assa_z));
insert_values.push_back(std::to_string(adventure_template_entry.assa_h));
insert_values.push_back("'" + EscapeString(adventure_template_entry.text) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.duration));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_time));
@ -356,18 +356,18 @@ public:
insert_values.push_back(std::to_string(adventure_template_entry.lose_points));
insert_values.push_back(std::to_string(adventure_template_entry.theme));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_zone_id));
insert_values.push_back("'" + EscapeString(adventure_template_entry.zone_in_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.zone_in_y) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_x));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_y));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_object_id));
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_y) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_z) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_h) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.dest_x));
insert_values.push_back(std::to_string(adventure_template_entry.dest_y));
insert_values.push_back(std::to_string(adventure_template_entry.dest_z));
insert_values.push_back(std::to_string(adventure_template_entry.dest_h));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_zone_id));
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_y) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_z) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_radius) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_x));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_y));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_z));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_radius));
auto results = content_db.QueryDatabase(
fmt::format(
@ -382,7 +382,7 @@ public:
return adventure_template_entry;
}
adventure_template_entry = InstanceListRepository::NewEntity();
adventure_template_entry = AdventureTemplateRepository::NewEntity();
return adventure_template_entry;
}
@ -405,10 +405,10 @@ public:
insert_values.push_back(std::to_string(adventure_template_entry.type));
insert_values.push_back(std::to_string(adventure_template_entry.type_data));
insert_values.push_back(std::to_string(adventure_template_entry.type_count));
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_y) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_z) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.assa_h) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.assa_x));
insert_values.push_back(std::to_string(adventure_template_entry.assa_y));
insert_values.push_back(std::to_string(adventure_template_entry.assa_z));
insert_values.push_back(std::to_string(adventure_template_entry.assa_h));
insert_values.push_back("'" + EscapeString(adventure_template_entry.text) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.duration));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_time));
@ -416,18 +416,18 @@ public:
insert_values.push_back(std::to_string(adventure_template_entry.lose_points));
insert_values.push_back(std::to_string(adventure_template_entry.theme));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_zone_id));
insert_values.push_back("'" + EscapeString(adventure_template_entry.zone_in_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.zone_in_y) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_x));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_y));
insert_values.push_back(std::to_string(adventure_template_entry.zone_in_object_id));
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_y) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_z) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.dest_h) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.dest_x));
insert_values.push_back(std::to_string(adventure_template_entry.dest_y));
insert_values.push_back(std::to_string(adventure_template_entry.dest_z));
insert_values.push_back(std::to_string(adventure_template_entry.dest_h));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_zone_id));
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_x) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_y) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_z) + "'");
insert_values.push_back("'" + EscapeString(adventure_template_entry.graveyard_radius) + "'");
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_x));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_y));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_z));
insert_values.push_back(std::to_string(adventure_template_entry.graveyard_radius));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -501,6 +501,77 @@ public:
return all_entries;
}
static std::vector<AdventureTemplate> GetWhere(std::string where_filter)
{
std::vector<AdventureTemplate> 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) {
AdventureTemplate entry{};
entry.id = atoi(row[0]);
entry.zone = row[1];
entry.zone_version = atoi(row[2]);
entry.is_hard = atoi(row[3]);
entry.is_raid = atoi(row[4]);
entry.min_level = atoi(row[5]);
entry.max_level = atoi(row[6]);
entry.type = atoi(row[7]);
entry.type_data = atoi(row[8]);
entry.type_count = atoi(row[9]);
entry.assa_x = atof(row[10]);
entry.assa_y = atof(row[11]);
entry.assa_z = atof(row[12]);
entry.assa_h = atof(row[13]);
entry.text = row[14];
entry.duration = atoi(row[15]);
entry.zone_in_time = atoi(row[16]);
entry.win_points = atoi(row[17]);
entry.lose_points = atoi(row[18]);
entry.theme = atoi(row[19]);
entry.zone_in_zone_id = atoi(row[20]);
entry.zone_in_x = atof(row[21]);
entry.zone_in_y = atof(row[22]);
entry.zone_in_object_id = atoi(row[23]);
entry.dest_x = atof(row[24]);
entry.dest_y = atof(row[25]);
entry.dest_z = atof(row[26]);
entry.dest_h = atof(row[27]);
entry.graveyard_zone_id = atoi(row[28]);
entry.graveyard_x = atof(row[29]);
entry.graveyard_y = atof(row[30]);
entry.graveyard_z = atof(row[31]);
entry.graveyard_radius = atof(row[32]);
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_ADVENTURE_TEMPLATE_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return alternate_currency_entry;
}
alternate_currency_entry = InstanceListRepository::NewEntity();
alternate_currency_entry = AlternateCurrencyRepository::NewEntity();
return alternate_currency_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<AlternateCurrency> GetWhere(std::string where_filter)
{
std::vector<AlternateCurrency> 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) {
AlternateCurrency entry{};
entry.id = atoi(row[0]);
entry.item_id = atoi(row[1]);
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_ALTERNATE_CURRENCY_REPOSITORY_H

View File

@ -250,7 +250,7 @@ public:
return auras_entry;
}
auras_entry = InstanceListRepository::NewEntity();
auras_entry = AurasRepository::NewEntity();
return auras_entry;
}
@ -325,6 +325,55 @@ public:
return all_entries;
}
static std::vector<Auras> GetWhere(std::string where_filter)
{
std::vector<Auras> 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) {
Auras entry{};
entry.type = atoi(row[0]);
entry.npc_type = atoi(row[1]);
entry.name = row[2];
entry.spell_id = atoi(row[3]);
entry.distance = atoi(row[4]);
entry.aura_type = atoi(row[5]);
entry.spawn_type = atoi(row[6]);
entry.movement = atoi(row[7]);
entry.duration = atoi(row[8]);
entry.icon = atoi(row[9]);
entry.cast_time = atoi(row[10]);
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_AURAS_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return banned_ips_entry;
}
banned_ips_entry = InstanceListRepository::NewEntity();
banned_ips_entry = BannedIpsRepository::NewEntity();
return banned_ips_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<BannedIps> GetWhere(std::string where_filter)
{
std::vector<BannedIps> 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];
entry.notes = 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_BANNED_IPS_REPOSITORY_H

View File

@ -192,14 +192,14 @@ public:
auto columns = Columns();
update_values.push_back(columns[2] + " = '" + EscapeString(base_data_entry.hp) + "'");
update_values.push_back(columns[3] + " = '" + EscapeString(base_data_entry.mana) + "'");
update_values.push_back(columns[4] + " = '" + EscapeString(base_data_entry.end) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(base_data_entry.unk1) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(base_data_entry.unk2) + "'");
update_values.push_back(columns[7] + " = '" + EscapeString(base_data_entry.hp_fac) + "'");
update_values.push_back(columns[8] + " = '" + EscapeString(base_data_entry.mana_fac) + "'");
update_values.push_back(columns[9] + " = '" + EscapeString(base_data_entry.end_fac) + "'");
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));
update_values.push_back(columns[5] + " = " + std::to_string(base_data_entry.unk1));
update_values.push_back(columns[6] + " = " + std::to_string(base_data_entry.unk2));
update_values.push_back(columns[7] + " = " + std::to_string(base_data_entry.hp_fac));
update_values.push_back(columns[8] + " = " + std::to_string(base_data_entry.mana_fac));
update_values.push_back(columns[9] + " = " + std::to_string(base_data_entry.end_fac));
auto results = content_db.QueryDatabase(
fmt::format(
@ -220,14 +220,14 @@ public:
{
std::vector<std::string> insert_values;
insert_values.push_back("'" + EscapeString(base_data_entry.hp) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.mana) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.end) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.unk1) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.unk2) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.hp_fac) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.mana_fac) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.end_fac) + "'");
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));
insert_values.push_back(std::to_string(base_data_entry.unk1));
insert_values.push_back(std::to_string(base_data_entry.unk2));
insert_values.push_back(std::to_string(base_data_entry.hp_fac));
insert_values.push_back(std::to_string(base_data_entry.mana_fac));
insert_values.push_back(std::to_string(base_data_entry.end_fac));
auto results = content_db.QueryDatabase(
fmt::format(
@ -242,7 +242,7 @@ public:
return base_data_entry;
}
base_data_entry = InstanceListRepository::NewEntity();
base_data_entry = BaseDataRepository::NewEntity();
return base_data_entry;
}
@ -256,14 +256,14 @@ public:
for (auto &base_data_entry: base_data_entries) {
std::vector<std::string> insert_values;
insert_values.push_back("'" + EscapeString(base_data_entry.hp) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.mana) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.end) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.unk1) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.unk2) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.hp_fac) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.mana_fac) + "'");
insert_values.push_back("'" + EscapeString(base_data_entry.end_fac) + "'");
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));
insert_values.push_back(std::to_string(base_data_entry.unk1));
insert_values.push_back(std::to_string(base_data_entry.unk2));
insert_values.push_back(std::to_string(base_data_entry.hp_fac));
insert_values.push_back(std::to_string(base_data_entry.mana_fac));
insert_values.push_back(std::to_string(base_data_entry.end_fac));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -314,6 +314,54 @@ public:
return all_entries;
}
static std::vector<BaseData> GetWhere(std::string where_filter)
{
std::vector<BaseData> 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) {
BaseData entry{};
entry.level = atoi(row[0]);
entry.class = atoi(row[1]);
entry.hp = atof(row[2]);
entry.mana = atof(row[3]);
entry.end = atof(row[4]);
entry.unk1 = atof(row[5]);
entry.unk2 = atof(row[6]);
entry.hp_fac = atof(row[7]);
entry.mana_fac = atof(row[8]);
entry.end_fac = atof(row[9]);
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_DATA_REPOSITORY_H

View File

@ -203,12 +203,12 @@ public:
update_values.push_back(columns[1] + " = " + std::to_string(blocked_spells_entry.spellid));
update_values.push_back(columns[2] + " = " + std::to_string(blocked_spells_entry.type));
update_values.push_back(columns[3] + " = " + std::to_string(blocked_spells_entry.zoneid));
update_values.push_back(columns[4] + " = '" + EscapeString(blocked_spells_entry.x) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(blocked_spells_entry.y) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(blocked_spells_entry.z) + "'");
update_values.push_back(columns[7] + " = '" + EscapeString(blocked_spells_entry.x_diff) + "'");
update_values.push_back(columns[8] + " = '" + EscapeString(blocked_spells_entry.y_diff) + "'");
update_values.push_back(columns[9] + " = '" + EscapeString(blocked_spells_entry.z_diff) + "'");
update_values.push_back(columns[4] + " = " + std::to_string(blocked_spells_entry.x));
update_values.push_back(columns[5] + " = " + std::to_string(blocked_spells_entry.y));
update_values.push_back(columns[6] + " = " + std::to_string(blocked_spells_entry.z));
update_values.push_back(columns[7] + " = " + std::to_string(blocked_spells_entry.x_diff));
update_values.push_back(columns[8] + " = " + std::to_string(blocked_spells_entry.y_diff));
update_values.push_back(columns[9] + " = " + std::to_string(blocked_spells_entry.z_diff));
update_values.push_back(columns[10] + " = '" + EscapeString(blocked_spells_entry.message) + "'");
update_values.push_back(columns[11] + " = '" + EscapeString(blocked_spells_entry.description) + "'");
@ -234,12 +234,12 @@ public:
insert_values.push_back(std::to_string(blocked_spells_entry.spellid));
insert_values.push_back(std::to_string(blocked_spells_entry.type));
insert_values.push_back(std::to_string(blocked_spells_entry.zoneid));
insert_values.push_back("'" + EscapeString(blocked_spells_entry.x) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.y) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.z) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.x_diff) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.y_diff) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.z_diff) + "'");
insert_values.push_back(std::to_string(blocked_spells_entry.x));
insert_values.push_back(std::to_string(blocked_spells_entry.y));
insert_values.push_back(std::to_string(blocked_spells_entry.z));
insert_values.push_back(std::to_string(blocked_spells_entry.x_diff));
insert_values.push_back(std::to_string(blocked_spells_entry.y_diff));
insert_values.push_back(std::to_string(blocked_spells_entry.z_diff));
insert_values.push_back("'" + EscapeString(blocked_spells_entry.message) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.description) + "'");
@ -256,7 +256,7 @@ public:
return blocked_spells_entry;
}
blocked_spells_entry = InstanceListRepository::NewEntity();
blocked_spells_entry = BlockedSpellsRepository::NewEntity();
return blocked_spells_entry;
}
@ -273,12 +273,12 @@ public:
insert_values.push_back(std::to_string(blocked_spells_entry.spellid));
insert_values.push_back(std::to_string(blocked_spells_entry.type));
insert_values.push_back(std::to_string(blocked_spells_entry.zoneid));
insert_values.push_back("'" + EscapeString(blocked_spells_entry.x) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.y) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.z) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.x_diff) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.y_diff) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.z_diff) + "'");
insert_values.push_back(std::to_string(blocked_spells_entry.x));
insert_values.push_back(std::to_string(blocked_spells_entry.y));
insert_values.push_back(std::to_string(blocked_spells_entry.z));
insert_values.push_back(std::to_string(blocked_spells_entry.x_diff));
insert_values.push_back(std::to_string(blocked_spells_entry.y_diff));
insert_values.push_back(std::to_string(blocked_spells_entry.z_diff));
insert_values.push_back("'" + EscapeString(blocked_spells_entry.message) + "'");
insert_values.push_back("'" + EscapeString(blocked_spells_entry.description) + "'");
@ -333,6 +333,56 @@ public:
return all_entries;
}
static std::vector<BlockedSpells> GetWhere(std::string where_filter)
{
std::vector<BlockedSpells> 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) {
BlockedSpells entry{};
entry.id = atoi(row[0]);
entry.spellid = atoi(row[1]);
entry.type = atoi(row[2]);
entry.zoneid = atoi(row[3]);
entry.x = atof(row[4]);
entry.y = atof(row[5]);
entry.z = atof(row[6]);
entry.x_diff = atof(row[7]);
entry.y_diff = atof(row[8]);
entry.z_diff = atof(row[9]);
entry.message = row[10];
entry.description = row[11];
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_BLOCKED_SPELLS_REPOSITORY_H

View File

@ -202,7 +202,7 @@ public:
return books_entry;
}
books_entry = InstanceListRepository::NewEntity();
books_entry = BooksRepository::NewEntity();
return books_entry;
}
@ -261,6 +261,47 @@ public:
return all_entries;
}
static std::vector<Books> GetWhere(std::string where_filter)
{
std::vector<Books> 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];
entry.txtfile = 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_BOOKS_REPOSITORY_H

View File

@ -291,9 +291,9 @@ public:
update_values.push_back(columns[9] + " = '" + EscapeString(bug_reports_entry.category_name) + "'");
update_values.push_back(columns[10] + " = '" + EscapeString(bug_reports_entry.reporter_name) + "'");
update_values.push_back(columns[11] + " = '" + EscapeString(bug_reports_entry.ui_path) + "'");
update_values.push_back(columns[12] + " = '" + EscapeString(bug_reports_entry.pos_x) + "'");
update_values.push_back(columns[13] + " = '" + EscapeString(bug_reports_entry.pos_y) + "'");
update_values.push_back(columns[14] + " = '" + EscapeString(bug_reports_entry.pos_z) + "'");
update_values.push_back(columns[12] + " = " + std::to_string(bug_reports_entry.pos_x));
update_values.push_back(columns[13] + " = " + std::to_string(bug_reports_entry.pos_y));
update_values.push_back(columns[14] + " = " + std::to_string(bug_reports_entry.pos_z));
update_values.push_back(columns[15] + " = " + std::to_string(bug_reports_entry.heading));
update_values.push_back(columns[16] + " = " + std::to_string(bug_reports_entry.time_played));
update_values.push_back(columns[17] + " = " + std::to_string(bug_reports_entry.target_id));
@ -342,9 +342,9 @@ public:
insert_values.push_back("'" + EscapeString(bug_reports_entry.category_name) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.reporter_name) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.ui_path) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.pos_x) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.pos_y) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.pos_z) + "'");
insert_values.push_back(std::to_string(bug_reports_entry.pos_x));
insert_values.push_back(std::to_string(bug_reports_entry.pos_y));
insert_values.push_back(std::to_string(bug_reports_entry.pos_z));
insert_values.push_back(std::to_string(bug_reports_entry.heading));
insert_values.push_back(std::to_string(bug_reports_entry.time_played));
insert_values.push_back(std::to_string(bug_reports_entry.target_id));
@ -376,7 +376,7 @@ public:
return bug_reports_entry;
}
bug_reports_entry = InstanceListRepository::NewEntity();
bug_reports_entry = BugReportsRepository::NewEntity();
return bug_reports_entry;
}
@ -401,9 +401,9 @@ public:
insert_values.push_back("'" + EscapeString(bug_reports_entry.category_name) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.reporter_name) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.ui_path) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.pos_x) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.pos_y) + "'");
insert_values.push_back("'" + EscapeString(bug_reports_entry.pos_z) + "'");
insert_values.push_back(std::to_string(bug_reports_entry.pos_x));
insert_values.push_back(std::to_string(bug_reports_entry.pos_y));
insert_values.push_back(std::to_string(bug_reports_entry.pos_z));
insert_values.push_back(std::to_string(bug_reports_entry.heading));
insert_values.push_back(std::to_string(bug_reports_entry.time_played));
insert_values.push_back(std::to_string(bug_reports_entry.target_id));
@ -493,6 +493,76 @@ public:
return all_entries;
}
static std::vector<BugReports> GetWhere(std::string where_filter)
{
std::vector<BugReports> 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) {
BugReports entry{};
entry.id = atoi(row[0]);
entry.zone = row[1];
entry.client_version_id = atoi(row[2]);
entry.client_version_name = row[3];
entry.account_id = atoi(row[4]);
entry.character_id = atoi(row[5]);
entry.character_name = row[6];
entry.reporter_spoof = atoi(row[7]);
entry.category_id = atoi(row[8]);
entry.category_name = row[9];
entry.reporter_name = row[10];
entry.ui_path = row[11];
entry.pos_x = atof(row[12]);
entry.pos_y = atof(row[13]);
entry.pos_z = atof(row[14]);
entry.heading = atoi(row[15]);
entry.time_played = atoi(row[16]);
entry.target_id = atoi(row[17]);
entry.target_name = row[18];
entry.optional_info_mask = atoi(row[19]);
entry._can_duplicate = atoi(row[20]);
entry._crash_bug = atoi(row[21]);
entry._target_info = atoi(row[22]);
entry._character_flags = atoi(row[23]);
entry._unknown_value = atoi(row[24]);
entry.bug_report = row[25];
entry.system_info = row[26];
entry.report_datetime = row[27];
entry.bug_status = atoi(row[28]);
entry.last_review = row[29];
entry.last_reviewer = row[30];
entry.reviewer_notes = row[31];
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_BUG_REPORTS_REPOSITORY_H

View File

@ -207,9 +207,9 @@ public:
update_values.push_back(columns[1] + " = '" + EscapeString(bugs_entry.zone) + "'");
update_values.push_back(columns[2] + " = '" + EscapeString(bugs_entry.name) + "'");
update_values.push_back(columns[3] + " = '" + EscapeString(bugs_entry.ui) + "'");
update_values.push_back(columns[4] + " = '" + EscapeString(bugs_entry.x) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(bugs_entry.y) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(bugs_entry.z) + "'");
update_values.push_back(columns[4] + " = " + std::to_string(bugs_entry.x));
update_values.push_back(columns[5] + " = " + std::to_string(bugs_entry.y));
update_values.push_back(columns[6] + " = " + std::to_string(bugs_entry.z));
update_values.push_back(columns[7] + " = '" + EscapeString(bugs_entry.type) + "'");
update_values.push_back(columns[8] + " = " + std::to_string(bugs_entry.flag));
update_values.push_back(columns[9] + " = '" + EscapeString(bugs_entry.target) + "'");
@ -239,9 +239,9 @@ public:
insert_values.push_back("'" + EscapeString(bugs_entry.zone) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.name) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.ui) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.x) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.y) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.z) + "'");
insert_values.push_back(std::to_string(bugs_entry.x));
insert_values.push_back(std::to_string(bugs_entry.y));
insert_values.push_back(std::to_string(bugs_entry.z));
insert_values.push_back("'" + EscapeString(bugs_entry.type) + "'");
insert_values.push_back(std::to_string(bugs_entry.flag));
insert_values.push_back("'" + EscapeString(bugs_entry.target) + "'");
@ -262,7 +262,7 @@ public:
return bugs_entry;
}
bugs_entry = InstanceListRepository::NewEntity();
bugs_entry = BugsRepository::NewEntity();
return bugs_entry;
}
@ -279,9 +279,9 @@ public:
insert_values.push_back("'" + EscapeString(bugs_entry.zone) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.name) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.ui) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.x) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.y) + "'");
insert_values.push_back("'" + EscapeString(bugs_entry.z) + "'");
insert_values.push_back(std::to_string(bugs_entry.x));
insert_values.push_back(std::to_string(bugs_entry.y));
insert_values.push_back(std::to_string(bugs_entry.z));
insert_values.push_back("'" + EscapeString(bugs_entry.type) + "'");
insert_values.push_back(std::to_string(bugs_entry.flag));
insert_values.push_back("'" + EscapeString(bugs_entry.target) + "'");
@ -341,6 +341,57 @@ public:
return all_entries;
}
static std::vector<Bugs> GetWhere(std::string where_filter)
{
std::vector<Bugs> 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) {
Bugs entry{};
entry.id = atoi(row[0]);
entry.zone = row[1];
entry.name = row[2];
entry.ui = row[3];
entry.x = atof(row[4]);
entry.y = atof(row[5]);
entry.z = atof(row[6]);
entry.type = row[7];
entry.flag = atoi(row[8]);
entry.target = row[9];
entry.bug = row[10];
entry.date = row[11];
entry.status = atoi(row[12]);
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_BUGS_REPOSITORY_H

View File

@ -218,7 +218,7 @@ public:
return buyer_entry;
}
buyer_entry = InstanceListRepository::NewEntity();
buyer_entry = BuyerRepository::NewEntity();
return buyer_entry;
}
@ -282,6 +282,50 @@ public:
return all_entries;
}
static std::vector<Buyer> GetWhere(std::string where_filter)
{
std::vector<Buyer> 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) {
Buyer entry{};
entry.charid = atoi(row[0]);
entry.buyslot = atoi(row[1]);
entry.itemid = atoi(row[2]);
entry.itemname = row[3];
entry.quantity = atoi(row[4]);
entry.price = atoi(row[5]);
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_BUYER_REPOSITORY_H

View File

@ -214,7 +214,7 @@ public:
return char_create_combinations_entry;
}
char_create_combinations_entry = InstanceListRepository::NewEntity();
char_create_combinations_entry = CharCreateCombinationsRepository::NewEntity();
return char_create_combinations_entry;
}
@ -276,6 +276,50 @@ public:
return all_entries;
}
static std::vector<CharCreateCombinations> GetWhere(std::string where_filter)
{
std::vector<CharCreateCombinations> 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) {
CharCreateCombinations entry{};
entry.allocation_id = atoi(row[0]);
entry.race = atoi(row[1]);
entry.class = atoi(row[2]);
entry.deity = atoi(row[3]);
entry.start_zone = atoi(row[4]);
entry.expansions_req = atoi(row[5]);
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_CHAR_CREATE_COMBINATIONS_REPOSITORY_H

View File

@ -274,7 +274,7 @@ public:
return char_create_point_allocations_entry;
}
char_create_point_allocations_entry = InstanceListRepository::NewEntity();
char_create_point_allocations_entry = CharCreatePointAllocationsRepository::NewEntity();
return char_create_point_allocations_entry;
}
@ -357,6 +357,59 @@ public:
return all_entries;
}
static std::vector<CharCreatePointAllocations> GetWhere(std::string where_filter)
{
std::vector<CharCreatePointAllocations> 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) {
CharCreatePointAllocations entry{};
entry.id = atoi(row[0]);
entry.base_str = atoi(row[1]);
entry.base_sta = atoi(row[2]);
entry.base_dex = atoi(row[3]);
entry.base_agi = atoi(row[4]);
entry.base_int = atoi(row[5]);
entry.base_wis = atoi(row[6]);
entry.base_cha = atoi(row[7]);
entry.alloc_str = atoi(row[8]);
entry.alloc_sta = atoi(row[9]);
entry.alloc_dex = atoi(row[10]);
entry.alloc_agi = atoi(row[11]);
entry.alloc_int = atoi(row[12]);
entry.alloc_wis = atoi(row[13]);
entry.alloc_cha = atoi(row[14]);
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_CHAR_CREATE_POINT_ALLOCATIONS_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return char_recipe_list_entry;
}
char_recipe_list_entry = InstanceListRepository::NewEntity();
char_recipe_list_entry = CharRecipeListRepository::NewEntity();
return char_recipe_list_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharRecipeList> GetWhere(std::string where_filter)
{
std::vector<CharRecipeList> 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) {
CharRecipeList entry{};
entry.char_id = atoi(row[0]);
entry.recipe_id = atoi(row[1]);
entry.madecount = 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_CHAR_RECIPE_LIST_REPOSITORY_H

View File

@ -210,7 +210,7 @@ public:
return character_activities_entry;
}
character_activities_entry = InstanceListRepository::NewEntity();
character_activities_entry = CharacterActivitiesRepository::NewEntity();
return character_activities_entry;
}
@ -271,6 +271,49 @@ public:
return all_entries;
}
static std::vector<CharacterActivities> GetWhere(std::string where_filter)
{
std::vector<CharacterActivities> 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) {
CharacterActivities entry{};
entry.charid = atoi(row[0]);
entry.taskid = atoi(row[1]);
entry.activityid = atoi(row[2]);
entry.donecount = atoi(row[3]);
entry.completed = atoi(row[4]);
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_CHARACTER_ACTIVITIES_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_alt_currency_entry;
}
character_alt_currency_entry = InstanceListRepository::NewEntity();
character_alt_currency_entry = CharacterAltCurrencyRepository::NewEntity();
return character_alt_currency_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterAltCurrency> GetWhere(std::string where_filter)
{
std::vector<CharacterAltCurrency> 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) {
CharacterAltCurrency entry{};
entry.char_id = atoi(row[0]);
entry.currency_id = atoi(row[1]);
entry.amount = 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_CHARACTER_ALT_CURRENCY_REPOSITORY_H

View File

@ -206,7 +206,7 @@ public:
return character_alternate_abilities_entry;
}
character_alternate_abilities_entry = InstanceListRepository::NewEntity();
character_alternate_abilities_entry = CharacterAlternateAbilitiesRepository::NewEntity();
return character_alternate_abilities_entry;
}
@ -266,6 +266,48 @@ public:
return all_entries;
}
static std::vector<CharacterAlternateAbilities> GetWhere(std::string where_filter)
{
std::vector<CharacterAlternateAbilities> 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) {
CharacterAlternateAbilities entry{};
entry.id = atoi(row[0]);
entry.aa_id = atoi(row[1]);
entry.aa_value = atoi(row[2]);
entry.charges = 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_CHARACTER_ALTERNATE_ABILITIES_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_auras_entry;
}
character_auras_entry = InstanceListRepository::NewEntity();
character_auras_entry = CharacterAurasRepository::NewEntity();
return character_auras_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterAuras> GetWhere(std::string where_filter)
{
std::vector<CharacterAuras> 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) {
CharacterAuras entry{};
entry.id = atoi(row[0]);
entry.slot = atoi(row[1]);
entry.spell_id = 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_CHARACTER_AURAS_REPOSITORY_H

View File

@ -216,7 +216,7 @@ public:
return character_bandolier_entry;
}
character_bandolier_entry = InstanceListRepository::NewEntity();
character_bandolier_entry = CharacterBandolierRepository::NewEntity();
return character_bandolier_entry;
}
@ -279,6 +279,50 @@ public:
return all_entries;
}
static std::vector<CharacterBandolier> GetWhere(std::string where_filter)
{
std::vector<CharacterBandolier> 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) {
CharacterBandolier entry{};
entry.id = atoi(row[0]);
entry.bandolier_id = atoi(row[1]);
entry.bandolier_slot = atoi(row[2]);
entry.item_id = atoi(row[3]);
entry.icon = atoi(row[4]);
entry.bandolier_name = row[5];
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_CHARACTER_BANDOLIER_REPOSITORY_H

View File

@ -186,10 +186,10 @@ public:
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] + " = '" + EscapeString(character_bind_entry.x) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(character_bind_entry.y) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(character_bind_entry.z) + "'");
update_values.push_back(columns[7] + " = '" + EscapeString(character_bind_entry.heading) + "'");
update_values.push_back(columns[4] + " = " + std::to_string(character_bind_entry.x));
update_values.push_back(columns[5] + " = " + std::to_string(character_bind_entry.y));
update_values.push_back(columns[6] + " = " + std::to_string(character_bind_entry.z));
update_values.push_back(columns[7] + " = " + std::to_string(character_bind_entry.heading));
auto results = database.QueryDatabase(
fmt::format(
@ -212,10 +212,10 @@ public:
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("'" + EscapeString(character_bind_entry.x) + "'");
insert_values.push_back("'" + EscapeString(character_bind_entry.y) + "'");
insert_values.push_back("'" + EscapeString(character_bind_entry.z) + "'");
insert_values.push_back("'" + EscapeString(character_bind_entry.heading) + "'");
insert_values.push_back(std::to_string(character_bind_entry.x));
insert_values.push_back(std::to_string(character_bind_entry.y));
insert_values.push_back(std::to_string(character_bind_entry.z));
insert_values.push_back(std::to_string(character_bind_entry.heading));
auto results = database.QueryDatabase(
fmt::format(
@ -230,7 +230,7 @@ public:
return character_bind_entry;
}
character_bind_entry = InstanceListRepository::NewEntity();
character_bind_entry = CharacterBindRepository::NewEntity();
return character_bind_entry;
}
@ -246,10 +246,10 @@ public:
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("'" + EscapeString(character_bind_entry.x) + "'");
insert_values.push_back("'" + EscapeString(character_bind_entry.y) + "'");
insert_values.push_back("'" + EscapeString(character_bind_entry.z) + "'");
insert_values.push_back("'" + EscapeString(character_bind_entry.heading) + "'");
insert_values.push_back(std::to_string(character_bind_entry.x));
insert_values.push_back(std::to_string(character_bind_entry.y));
insert_values.push_back(std::to_string(character_bind_entry.z));
insert_values.push_back(std::to_string(character_bind_entry.heading));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -298,6 +298,52 @@ public:
return all_entries;
}
static std::vector<CharacterBind> GetWhere(std::string where_filter)
{
std::vector<CharacterBind> 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) {
CharacterBind entry{};
entry.id = atoi(row[0]);
entry.slot = atoi(row[1]);
entry.zone_id = atoi(row[2]);
entry.instance_id = atoi(row[3]);
entry.x = atof(row[4]);
entry.y = atof(row[5]);
entry.z = atof(row[6]);
entry.heading = atof(row[7]);
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_CHARACTER_BIND_REPOSITORY_H

View File

@ -284,7 +284,7 @@ public:
return character_buffs_entry;
}
character_buffs_entry = InstanceListRepository::NewEntity();
character_buffs_entry = CharacterBuffsRepository::NewEntity();
return character_buffs_entry;
}
@ -370,6 +370,61 @@ public:
return all_entries;
}
static std::vector<CharacterBuffs> GetWhere(std::string where_filter)
{
std::vector<CharacterBuffs> 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) {
CharacterBuffs entry{};
entry.character_id = atoi(row[0]);
entry.slot_id = atoi(row[1]);
entry.spell_id = atoi(row[2]);
entry.caster_level = atoi(row[3]);
entry.caster_name = row[4];
entry.ticsremaining = atoi(row[5]);
entry.counters = atoi(row[6]);
entry.numhits = atoi(row[7]);
entry.melee_rune = atoi(row[8]);
entry.magic_rune = atoi(row[9]);
entry.persistent = atoi(row[10]);
entry.dot_rune = atoi(row[11]);
entry.caston_x = atoi(row[12]);
entry.caston_y = atoi(row[13]);
entry.caston_z = atoi(row[14]);
entry.ExtraDIChance = atoi(row[15]);
entry.instrument_mod = atoi(row[16]);
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_CHARACTER_BUFFS_REPOSITORY_H

View File

@ -248,7 +248,7 @@ public:
return character_corpse_items_entry;
}
character_corpse_items_entry = InstanceListRepository::NewEntity();
character_corpse_items_entry = CharacterCorpseItemsRepository::NewEntity();
return character_corpse_items_entry;
}
@ -322,6 +322,55 @@ public:
return all_entries;
}
static std::vector<CharacterCorpseItems> GetWhere(std::string where_filter)
{
std::vector<CharacterCorpseItems> 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) {
CharacterCorpseItems entry{};
entry.corpse_id = atoi(row[0]);
entry.equip_slot = atoi(row[1]);
entry.item_id = atoi(row[2]);
entry.charges = atoi(row[3]);
entry.aug_1 = atoi(row[4]);
entry.aug_2 = atoi(row[5]);
entry.aug_3 = atoi(row[6]);
entry.aug_4 = atoi(row[7]);
entry.aug_5 = atoi(row[8]);
entry.aug_6 = atoi(row[9]);
entry.attuned = atoi(row[10]);
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_CHARACTER_CORPSE_ITEMS_REPOSITORY_H

View File

@ -344,10 +344,10 @@ public:
update_values.push_back(columns[2] + " = '" + EscapeString(character_corpses_entry.charname) + "'");
update_values.push_back(columns[3] + " = " + std::to_string(character_corpses_entry.zone_id));
update_values.push_back(columns[4] + " = " + std::to_string(character_corpses_entry.instance_id));
update_values.push_back(columns[5] + " = '" + EscapeString(character_corpses_entry.x) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(character_corpses_entry.y) + "'");
update_values.push_back(columns[7] + " = '" + EscapeString(character_corpses_entry.z) + "'");
update_values.push_back(columns[8] + " = '" + EscapeString(character_corpses_entry.heading) + "'");
update_values.push_back(columns[5] + " = " + std::to_string(character_corpses_entry.x));
update_values.push_back(columns[6] + " = " + std::to_string(character_corpses_entry.y));
update_values.push_back(columns[7] + " = " + std::to_string(character_corpses_entry.z));
update_values.push_back(columns[8] + " = " + std::to_string(character_corpses_entry.heading));
update_values.push_back(columns[9] + " = '" + EscapeString(character_corpses_entry.time_of_death) + "'");
update_values.push_back(columns[10] + " = " + std::to_string(character_corpses_entry.guild_consent_id));
update_values.push_back(columns[11] + " = " + std::to_string(character_corpses_entry.is_rezzed));
@ -410,10 +410,10 @@ public:
insert_values.push_back("'" + EscapeString(character_corpses_entry.charname) + "'");
insert_values.push_back(std::to_string(character_corpses_entry.zone_id));
insert_values.push_back(std::to_string(character_corpses_entry.instance_id));
insert_values.push_back("'" + EscapeString(character_corpses_entry.x) + "'");
insert_values.push_back("'" + EscapeString(character_corpses_entry.y) + "'");
insert_values.push_back("'" + EscapeString(character_corpses_entry.z) + "'");
insert_values.push_back("'" + EscapeString(character_corpses_entry.heading) + "'");
insert_values.push_back(std::to_string(character_corpses_entry.x));
insert_values.push_back(std::to_string(character_corpses_entry.y));
insert_values.push_back(std::to_string(character_corpses_entry.z));
insert_values.push_back(std::to_string(character_corpses_entry.heading));
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
@ -466,7 +466,7 @@ public:
return character_corpses_entry;
}
character_corpses_entry = InstanceListRepository::NewEntity();
character_corpses_entry = CharacterCorpsesRepository::NewEntity();
return character_corpses_entry;
}
@ -484,10 +484,10 @@ public:
insert_values.push_back("'" + EscapeString(character_corpses_entry.charname) + "'");
insert_values.push_back(std::to_string(character_corpses_entry.zone_id));
insert_values.push_back(std::to_string(character_corpses_entry.instance_id));
insert_values.push_back("'" + EscapeString(character_corpses_entry.x) + "'");
insert_values.push_back("'" + EscapeString(character_corpses_entry.y) + "'");
insert_values.push_back("'" + EscapeString(character_corpses_entry.z) + "'");
insert_values.push_back("'" + EscapeString(character_corpses_entry.heading) + "'");
insert_values.push_back(std::to_string(character_corpses_entry.x));
insert_values.push_back(std::to_string(character_corpses_entry.y));
insert_values.push_back(std::to_string(character_corpses_entry.z));
insert_values.push_back(std::to_string(character_corpses_entry.heading));
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
@ -613,6 +613,91 @@ public:
return all_entries;
}
static std::vector<CharacterCorpses> GetWhere(std::string where_filter)
{
std::vector<CharacterCorpses> 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) {
CharacterCorpses entry{};
entry.id = atoi(row[0]);
entry.charid = atoi(row[1]);
entry.charname = row[2];
entry.zone_id = atoi(row[3]);
entry.instance_id = atoi(row[4]);
entry.x = atof(row[5]);
entry.y = atof(row[6]);
entry.z = atof(row[7]);
entry.heading = atof(row[8]);
entry.time_of_death = row[9];
entry.guild_consent_id = atoi(row[10]);
entry.is_rezzed = atoi(row[11]);
entry.is_buried = atoi(row[12]);
entry.was_at_graveyard = atoi(row[13]);
entry.is_locked = atoi(row[14]);
entry.exp = atoi(row[15]);
entry.size = atoi(row[16]);
entry.level = atoi(row[17]);
entry.race = atoi(row[18]);
entry.gender = atoi(row[19]);
entry.class = atoi(row[20]);
entry.deity = atoi(row[21]);
entry.texture = atoi(row[22]);
entry.helm_texture = atoi(row[23]);
entry.copper = atoi(row[24]);
entry.silver = atoi(row[25]);
entry.gold = atoi(row[26]);
entry.platinum = atoi(row[27]);
entry.hair_color = atoi(row[28]);
entry.beard_color = atoi(row[29]);
entry.eye_color_1 = atoi(row[30]);
entry.eye_color_2 = atoi(row[31]);
entry.hair_style = atoi(row[32]);
entry.face = atoi(row[33]);
entry.beard = atoi(row[34]);
entry.drakkin_heritage = atoi(row[35]);
entry.drakkin_tattoo = atoi(row[36]);
entry.drakkin_details = atoi(row[37]);
entry.wc_1 = atoi(row[38]);
entry.wc_2 = atoi(row[39]);
entry.wc_3 = atoi(row[40]);
entry.wc_4 = atoi(row[41]);
entry.wc_5 = atoi(row[42]);
entry.wc_6 = atoi(row[43]);
entry.wc_7 = atoi(row[44]);
entry.wc_8 = atoi(row[45]);
entry.wc_9 = atoi(row[46]);
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_CHARACTER_CORPSES_REPOSITORY_H

View File

@ -286,7 +286,7 @@ public:
return character_currency_entry;
}
character_currency_entry = InstanceListRepository::NewEntity();
character_currency_entry = CharacterCurrencyRepository::NewEntity();
return character_currency_entry;
}
@ -373,6 +373,61 @@ public:
return all_entries;
}
static std::vector<CharacterCurrency> GetWhere(std::string where_filter)
{
std::vector<CharacterCurrency> 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) {
CharacterCurrency entry{};
entry.id = atoi(row[0]);
entry.platinum = atoi(row[1]);
entry.gold = atoi(row[2]);
entry.silver = atoi(row[3]);
entry.copper = atoi(row[4]);
entry.platinum_bank = atoi(row[5]);
entry.gold_bank = atoi(row[6]);
entry.silver_bank = atoi(row[7]);
entry.copper_bank = atoi(row[8]);
entry.platinum_cursor = atoi(row[9]);
entry.gold_cursor = atoi(row[10]);
entry.silver_cursor = atoi(row[11]);
entry.copper_cursor = atoi(row[12]);
entry.radiant_crystals = atoi(row[13]);
entry.career_radiant_crystals = atoi(row[14]);
entry.ebon_crystals = atoi(row[15]);
entry.career_ebon_crystals = atoi(row[16]);
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_CHARACTER_CURRENCY_REPOSITORY_H

View File

@ -567,10 +567,10 @@ public:
update_values.push_back(columns[5] + " = '" + EscapeString(character_data_entry.suffix) + "'");
update_values.push_back(columns[6] + " = " + std::to_string(character_data_entry.zone_id));
update_values.push_back(columns[7] + " = " + std::to_string(character_data_entry.zone_instance));
update_values.push_back(columns[8] + " = '" + EscapeString(character_data_entry.y) + "'");
update_values.push_back(columns[9] + " = '" + EscapeString(character_data_entry.x) + "'");
update_values.push_back(columns[10] + " = '" + EscapeString(character_data_entry.z) + "'");
update_values.push_back(columns[11] + " = '" + EscapeString(character_data_entry.heading) + "'");
update_values.push_back(columns[8] + " = " + std::to_string(character_data_entry.y));
update_values.push_back(columns[9] + " = " + std::to_string(character_data_entry.x));
update_values.push_back(columns[10] + " = " + std::to_string(character_data_entry.z));
update_values.push_back(columns[11] + " = " + std::to_string(character_data_entry.heading));
update_values.push_back(columns[12] + " = " + std::to_string(character_data_entry.gender));
update_values.push_back(columns[13] + " = " + std::to_string(character_data_entry.race));
update_values.push_back(columns[14] + " = " + std::to_string(character_data_entry.class));
@ -688,10 +688,10 @@ public:
insert_values.push_back("'" + EscapeString(character_data_entry.suffix) + "'");
insert_values.push_back(std::to_string(character_data_entry.zone_id));
insert_values.push_back(std::to_string(character_data_entry.zone_instance));
insert_values.push_back("'" + EscapeString(character_data_entry.y) + "'");
insert_values.push_back("'" + EscapeString(character_data_entry.x) + "'");
insert_values.push_back("'" + EscapeString(character_data_entry.z) + "'");
insert_values.push_back("'" + EscapeString(character_data_entry.heading) + "'");
insert_values.push_back(std::to_string(character_data_entry.y));
insert_values.push_back(std::to_string(character_data_entry.x));
insert_values.push_back(std::to_string(character_data_entry.z));
insert_values.push_back(std::to_string(character_data_entry.heading));
insert_values.push_back(std::to_string(character_data_entry.gender));
insert_values.push_back(std::to_string(character_data_entry.race));
insert_values.push_back(std::to_string(character_data_entry.class));
@ -796,7 +796,7 @@ public:
return character_data_entry;
}
character_data_entry = InstanceListRepository::NewEntity();
character_data_entry = CharacterDataRepository::NewEntity();
return character_data_entry;
}
@ -817,10 +817,10 @@ public:
insert_values.push_back("'" + EscapeString(character_data_entry.suffix) + "'");
insert_values.push_back(std::to_string(character_data_entry.zone_id));
insert_values.push_back(std::to_string(character_data_entry.zone_instance));
insert_values.push_back("'" + EscapeString(character_data_entry.y) + "'");
insert_values.push_back("'" + EscapeString(character_data_entry.x) + "'");
insert_values.push_back("'" + EscapeString(character_data_entry.z) + "'");
insert_values.push_back("'" + EscapeString(character_data_entry.heading) + "'");
insert_values.push_back(std::to_string(character_data_entry.y));
insert_values.push_back(std::to_string(character_data_entry.x));
insert_values.push_back(std::to_string(character_data_entry.z));
insert_values.push_back(std::to_string(character_data_entry.heading));
insert_values.push_back(std::to_string(character_data_entry.gender));
insert_values.push_back(std::to_string(character_data_entry.race));
insert_values.push_back(std::to_string(character_data_entry.class));
@ -1053,6 +1053,146 @@ public:
return all_entries;
}
static std::vector<CharacterData> GetWhere(std::string where_filter)
{
std::vector<CharacterData> 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) {
CharacterData entry{};
entry.id = atoi(row[0]);
entry.account_id = atoi(row[1]);
entry.name = row[2];
entry.last_name = row[3];
entry.title = row[4];
entry.suffix = row[5];
entry.zone_id = atoi(row[6]);
entry.zone_instance = atoi(row[7]);
entry.y = atof(row[8]);
entry.x = atof(row[9]);
entry.z = atof(row[10]);
entry.heading = atof(row[11]);
entry.gender = atoi(row[12]);
entry.race = atoi(row[13]);
entry.class = atoi(row[14]);
entry.level = atoi(row[15]);
entry.deity = atoi(row[16]);
entry.birthday = atoi(row[17]);
entry.last_login = atoi(row[18]);
entry.time_played = atoi(row[19]);
entry.level2 = atoi(row[20]);
entry.anon = atoi(row[21]);
entry.gm = atoi(row[22]);
entry.face = atoi(row[23]);
entry.hair_color = atoi(row[24]);
entry.hair_style = atoi(row[25]);
entry.beard = atoi(row[26]);
entry.beard_color = atoi(row[27]);
entry.eye_color_1 = atoi(row[28]);
entry.eye_color_2 = atoi(row[29]);
entry.drakkin_heritage = atoi(row[30]);
entry.drakkin_tattoo = atoi(row[31]);
entry.drakkin_details = atoi(row[32]);
entry.ability_time_seconds = atoi(row[33]);
entry.ability_number = atoi(row[34]);
entry.ability_time_minutes = atoi(row[35]);
entry.ability_time_hours = atoi(row[36]);
entry.exp = atoi(row[37]);
entry.aa_points_spent = atoi(row[38]);
entry.aa_exp = atoi(row[39]);
entry.aa_points = atoi(row[40]);
entry.group_leadership_exp = atoi(row[41]);
entry.raid_leadership_exp = atoi(row[42]);
entry.group_leadership_points = atoi(row[43]);
entry.raid_leadership_points = atoi(row[44]);
entry.points = atoi(row[45]);
entry.cur_hp = atoi(row[46]);
entry.mana = atoi(row[47]);
entry.endurance = atoi(row[48]);
entry.intoxication = atoi(row[49]);
entry.str = atoi(row[50]);
entry.sta = atoi(row[51]);
entry.cha = atoi(row[52]);
entry.dex = atoi(row[53]);
entry.int = atoi(row[54]);
entry.agi = atoi(row[55]);
entry.wis = atoi(row[56]);
entry.zone_change_count = atoi(row[57]);
entry.toxicity = atoi(row[58]);
entry.hunger_level = atoi(row[59]);
entry.thirst_level = atoi(row[60]);
entry.ability_up = atoi(row[61]);
entry.ldon_points_guk = atoi(row[62]);
entry.ldon_points_mir = atoi(row[63]);
entry.ldon_points_mmc = atoi(row[64]);
entry.ldon_points_ruj = atoi(row[65]);
entry.ldon_points_tak = atoi(row[66]);
entry.ldon_points_available = atoi(row[67]);
entry.tribute_time_remaining = atoi(row[68]);
entry.career_tribute_points = atoi(row[69]);
entry.tribute_points = atoi(row[70]);
entry.tribute_active = atoi(row[71]);
entry.pvp_status = atoi(row[72]);
entry.pvp_kills = atoi(row[73]);
entry.pvp_deaths = atoi(row[74]);
entry.pvp_current_points = atoi(row[75]);
entry.pvp_career_points = atoi(row[76]);
entry.pvp_best_kill_streak = atoi(row[77]);
entry.pvp_worst_death_streak = atoi(row[78]);
entry.pvp_current_kill_streak = atoi(row[79]);
entry.pvp2 = atoi(row[80]);
entry.pvp_type = atoi(row[81]);
entry.show_helm = atoi(row[82]);
entry.group_auto_consent = atoi(row[83]);
entry.raid_auto_consent = atoi(row[84]);
entry.guild_auto_consent = atoi(row[85]);
entry.leadership_exp_on = atoi(row[86]);
entry.RestTimer = atoi(row[87]);
entry.air_remaining = atoi(row[88]);
entry.autosplit_enabled = atoi(row[89]);
entry.lfp = atoi(row[90]);
entry.lfg = atoi(row[91]);
entry.mailkey = row[92];
entry.xtargets = atoi(row[93]);
entry.firstlogon = atoi(row[94]);
entry.e_aa_effects = atoi(row[95]);
entry.e_percent_to_aa = atoi(row[96]);
entry.e_expended_aa_spent = atoi(row[97]);
entry.aa_points_spent_old = atoi(row[98]);
entry.aa_points_old = atoi(row[99]);
entry.e_last_invsnapshot = atoi(row[100]);
entry.deleted_at = row[101];
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_CHARACTER_DATA_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_disciplines_entry;
}
character_disciplines_entry = InstanceListRepository::NewEntity();
character_disciplines_entry = CharacterDisciplinesRepository::NewEntity();
return character_disciplines_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterDisciplines> GetWhere(std::string where_filter)
{
std::vector<CharacterDisciplines> 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) {
CharacterDisciplines entry{};
entry.id = atoi(row[0]);
entry.slot_id = atoi(row[1]);
entry.disc_id = 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_CHARACTER_DISCIPLINES_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return character_inspect_messages_entry;
}
character_inspect_messages_entry = InstanceListRepository::NewEntity();
character_inspect_messages_entry = CharacterInspectMessagesRepository::NewEntity();
return character_inspect_messages_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<CharacterInspectMessages> GetWhere(std::string where_filter)
{
std::vector<CharacterInspectMessages> 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) {
CharacterInspectMessages entry{};
entry.id = atoi(row[0]);
entry.inspect_message = 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_CHARACTER_INSPECT_MESSAGES_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_item_recast_entry;
}
character_item_recast_entry = InstanceListRepository::NewEntity();
character_item_recast_entry = CharacterItemRecastRepository::NewEntity();
return character_item_recast_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterItemRecast> GetWhere(std::string where_filter)
{
std::vector<CharacterItemRecast> 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) {
CharacterItemRecast entry{};
entry.id = atoi(row[0]);
entry.recast_type = atoi(row[1]);
entry.timestamp = 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_CHARACTER_ITEM_RECAST_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_languages_entry;
}
character_languages_entry = InstanceListRepository::NewEntity();
character_languages_entry = CharacterLanguagesRepository::NewEntity();
return character_languages_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterLanguages> GetWhere(std::string where_filter)
{
std::vector<CharacterLanguages> 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) {
CharacterLanguages entry{};
entry.id = atoi(row[0]);
entry.lang_id = atoi(row[1]);
entry.value = 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_CHARACTER_LANGUAGES_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_leadership_abilities_entry;
}
character_leadership_abilities_entry = InstanceListRepository::NewEntity();
character_leadership_abilities_entry = CharacterLeadershipAbilitiesRepository::NewEntity();
return character_leadership_abilities_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterLeadershipAbilities> GetWhere(std::string where_filter)
{
std::vector<CharacterLeadershipAbilities> 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) {
CharacterLeadershipAbilities entry{};
entry.id = atoi(row[0]);
entry.slot = atoi(row[1]);
entry.rank = 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_CHARACTER_LEADERSHIP_ABILITIES_REPOSITORY_H

View File

@ -224,7 +224,7 @@ public:
return character_material_entry;
}
character_material_entry = InstanceListRepository::NewEntity();
character_material_entry = CharacterMaterialRepository::NewEntity();
return character_material_entry;
}
@ -290,6 +290,51 @@ public:
return all_entries;
}
static std::vector<CharacterMaterial> GetWhere(std::string where_filter)
{
std::vector<CharacterMaterial> 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) {
CharacterMaterial entry{};
entry.id = atoi(row[0]);
entry.slot = atoi(row[1]);
entry.blue = atoi(row[2]);
entry.green = atoi(row[3]);
entry.red = atoi(row[4]);
entry.use_tint = atoi(row[5]);
entry.color = atoi(row[6]);
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_CHARACTER_MATERIAL_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_memmed_spells_entry;
}
character_memmed_spells_entry = InstanceListRepository::NewEntity();
character_memmed_spells_entry = CharacterMemmedSpellsRepository::NewEntity();
return character_memmed_spells_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterMemmedSpells> GetWhere(std::string where_filter)
{
std::vector<CharacterMemmedSpells> 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) {
CharacterMemmedSpells entry{};
entry.id = atoi(row[0]);
entry.slot_id = atoi(row[1]);
entry.spell_id = 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_CHARACTER_MEMMED_SPELLS_REPOSITORY_H

View File

@ -246,7 +246,7 @@ public:
return character_pet_buffs_entry;
}
character_pet_buffs_entry = InstanceListRepository::NewEntity();
character_pet_buffs_entry = CharacterPetBuffsRepository::NewEntity();
return character_pet_buffs_entry;
}
@ -319,6 +319,55 @@ public:
return all_entries;
}
static std::vector<CharacterPetBuffs> GetWhere(std::string where_filter)
{
std::vector<CharacterPetBuffs> 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) {
CharacterPetBuffs entry{};
entry.char_id = atoi(row[0]);
entry.pet = atoi(row[1]);
entry.slot = atoi(row[2]);
entry.spell_id = atoi(row[3]);
entry.caster_level = atoi(row[4]);
entry.castername = row[5];
entry.ticsremaining = atoi(row[6]);
entry.counters = atoi(row[7]);
entry.numhits = atoi(row[8]);
entry.rune = atoi(row[9]);
entry.instrument_mod = atoi(row[10]);
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_CHARACTER_PET_BUFFS_REPOSITORY_H

View File

@ -189,7 +189,7 @@ public:
update_values.push_back(columns[4] + " = " + std::to_string(character_pet_info_entry.spell_id));
update_values.push_back(columns[5] + " = " + std::to_string(character_pet_info_entry.hp));
update_values.push_back(columns[6] + " = " + std::to_string(character_pet_info_entry.mana));
update_values.push_back(columns[7] + " = '" + EscapeString(character_pet_info_entry.size) + "'");
update_values.push_back(columns[7] + " = " + std::to_string(character_pet_info_entry.size));
auto results = database.QueryDatabase(
fmt::format(
@ -215,7 +215,7 @@ public:
insert_values.push_back(std::to_string(character_pet_info_entry.spell_id));
insert_values.push_back(std::to_string(character_pet_info_entry.hp));
insert_values.push_back(std::to_string(character_pet_info_entry.mana));
insert_values.push_back("'" + EscapeString(character_pet_info_entry.size) + "'");
insert_values.push_back(std::to_string(character_pet_info_entry.size));
auto results = database.QueryDatabase(
fmt::format(
@ -230,7 +230,7 @@ public:
return character_pet_info_entry;
}
character_pet_info_entry = InstanceListRepository::NewEntity();
character_pet_info_entry = CharacterPetInfoRepository::NewEntity();
return character_pet_info_entry;
}
@ -249,7 +249,7 @@ public:
insert_values.push_back(std::to_string(character_pet_info_entry.spell_id));
insert_values.push_back(std::to_string(character_pet_info_entry.hp));
insert_values.push_back(std::to_string(character_pet_info_entry.mana));
insert_values.push_back("'" + EscapeString(character_pet_info_entry.size) + "'");
insert_values.push_back(std::to_string(character_pet_info_entry.size));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -298,6 +298,52 @@ public:
return all_entries;
}
static std::vector<CharacterPetInfo> GetWhere(std::string where_filter)
{
std::vector<CharacterPetInfo> 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) {
CharacterPetInfo entry{};
entry.char_id = atoi(row[0]);
entry.pet = atoi(row[1]);
entry.petname = row[2];
entry.petpower = atoi(row[3]);
entry.spell_id = atoi(row[4]);
entry.hp = atoi(row[5]);
entry.mana = atoi(row[6]);
entry.size = atof(row[7]);
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_CHARACTER_PET_INFO_REPOSITORY_H

View File

@ -204,7 +204,7 @@ public:
return character_pet_inventory_entry;
}
character_pet_inventory_entry = InstanceListRepository::NewEntity();
character_pet_inventory_entry = CharacterPetInventoryRepository::NewEntity();
return character_pet_inventory_entry;
}
@ -263,6 +263,48 @@ public:
return all_entries;
}
static std::vector<CharacterPetInventory> GetWhere(std::string where_filter)
{
std::vector<CharacterPetInventory> 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) {
CharacterPetInventory entry{};
entry.char_id = atoi(row[0]);
entry.pet = atoi(row[1]);
entry.slot = atoi(row[2]);
entry.item_id = 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_CHARACTER_PET_INVENTORY_REPOSITORY_H

View File

@ -206,7 +206,7 @@ public:
return character_potionbelt_entry;
}
character_potionbelt_entry = InstanceListRepository::NewEntity();
character_potionbelt_entry = CharacterPotionbeltRepository::NewEntity();
return character_potionbelt_entry;
}
@ -266,6 +266,48 @@ public:
return all_entries;
}
static std::vector<CharacterPotionbelt> GetWhere(std::string where_filter)
{
std::vector<CharacterPotionbelt> 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) {
CharacterPotionbelt entry{};
entry.id = atoi(row[0]);
entry.potion_id = atoi(row[1]);
entry.item_id = atoi(row[2]);
entry.icon = 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_CHARACTER_POTIONBELT_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_skills_entry;
}
character_skills_entry = InstanceListRepository::NewEntity();
character_skills_entry = CharacterSkillsRepository::NewEntity();
return character_skills_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterSkills> GetWhere(std::string where_filter)
{
std::vector<CharacterSkills> 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) {
CharacterSkills entry{};
entry.id = atoi(row[0]);
entry.skill_id = atoi(row[1]);
entry.value = 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_CHARACTER_SKILLS_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return character_spells_entry;
}
character_spells_entry = InstanceListRepository::NewEntity();
character_spells_entry = CharacterSpellsRepository::NewEntity();
return character_spells_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<CharacterSpells> GetWhere(std::string where_filter)
{
std::vector<CharacterSpells> 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) {
CharacterSpells entry{};
entry.id = atoi(row[0]);
entry.slot_id = atoi(row[1]);
entry.spell_id = 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_CHARACTER_SPELLS_REPOSITORY_H

View File

@ -212,7 +212,7 @@ public:
return character_tasks_entry;
}
character_tasks_entry = InstanceListRepository::NewEntity();
character_tasks_entry = CharacterTasksRepository::NewEntity();
return character_tasks_entry;
}
@ -274,6 +274,49 @@ public:
return all_entries;
}
static std::vector<CharacterTasks> GetWhere(std::string where_filter)
{
std::vector<CharacterTasks> 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) {
CharacterTasks entry{};
entry.charid = atoi(row[0]);
entry.taskid = atoi(row[1]);
entry.slot = atoi(row[2]);
entry.type = atoi(row[3]);
entry.acceptedtime = atoi(row[4]);
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_CHARACTER_TASKS_REPOSITORY_H

View File

@ -204,7 +204,7 @@ public:
return character_tribute_entry;
}
character_tribute_entry = InstanceListRepository::NewEntity();
character_tribute_entry = CharacterTributeRepository::NewEntity();
return character_tribute_entry;
}
@ -264,6 +264,47 @@ public:
return all_entries;
}
static std::vector<CharacterTribute> GetWhere(std::string where_filter)
{
std::vector<CharacterTribute> 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_CHARACTER_TRIBUTE_REPOSITORY_H

View File

@ -208,7 +208,7 @@ public:
return chatchannels_entry;
}
chatchannels_entry = InstanceListRepository::NewEntity();
chatchannels_entry = ChatchannelsRepository::NewEntity();
return chatchannels_entry;
}
@ -269,6 +269,48 @@ public:
return all_entries;
}
static std::vector<Chatchannels> GetWhere(std::string where_filter)
{
std::vector<Chatchannels> 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];
entry.owner = row[1];
entry.password = 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_CHATCHANNELS_REPOSITORY_H

View File

@ -202,7 +202,7 @@ public:
return command_settings_entry;
}
command_settings_entry = InstanceListRepository::NewEntity();
command_settings_entry = CommandSettingsRepository::NewEntity();
return command_settings_entry;
}
@ -261,6 +261,47 @@ public:
return all_entries;
}
static std::vector<CommandSettings> GetWhere(std::string where_filter)
{
std::vector<CommandSettings> 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];
entry.access = atoi(row[1]);
entry.aliases = 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_COMMAND_SETTINGS_REPOSITORY_H

View File

@ -204,7 +204,7 @@ public:
return completed_tasks_entry;
}
completed_tasks_entry = InstanceListRepository::NewEntity();
completed_tasks_entry = CompletedTasksRepository::NewEntity();
return completed_tasks_entry;
}
@ -263,6 +263,48 @@ public:
return all_entries;
}
static std::vector<CompletedTasks> GetWhere(std::string where_filter)
{
std::vector<CompletedTasks> 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) {
CompletedTasks entry{};
entry.charid = atoi(row[0]);
entry.completedtime = atoi(row[1]);
entry.taskid = atoi(row[2]);
entry.activityid = 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_COMPLETED_TASKS_REPOSITORY_H

View File

@ -208,7 +208,7 @@ public:
return data_buckets_entry;
}
data_buckets_entry = InstanceListRepository::NewEntity();
data_buckets_entry = DataBucketsRepository::NewEntity();
return data_buckets_entry;
}
@ -269,6 +269,48 @@ public:
return all_entries;
}
static std::vector<DataBuckets> GetWhere(std::string where_filter)
{
std::vector<DataBuckets> 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) {
DataBuckets entry{};
entry.id = atoi(row[0]);
entry.key = row[1];
entry.value = row[2];
entry.expires = 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_DATA_BUCKETS_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return db_str_entry;
}
db_str_entry = InstanceListRepository::NewEntity();
db_str_entry = DbStrRepository::NewEntity();
return db_str_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<DbStr> GetWhere(std::string where_filter)
{
std::vector<DbStr> 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) {
DbStr entry{};
entry.id = atoi(row[0]);
entry.type = atoi(row[1]);
entry.value = 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_DB_STR_REPOSITORY_H

View File

@ -208,7 +208,7 @@ public:
return discovered_items_entry;
}
discovered_items_entry = InstanceListRepository::NewEntity();
discovered_items_entry = DiscoveredItemsRepository::NewEntity();
return discovered_items_entry;
}
@ -269,6 +269,48 @@ public:
return all_entries;
}
static std::vector<DiscoveredItems> GetWhere(std::string where_filter)
{
std::vector<DiscoveredItems> 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) {
DiscoveredItems entry{};
entry.item_id = atoi(row[0]);
entry.char_name = row[1];
entry.discovered_date = atoi(row[2]);
entry.account_status = 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_DISCOVERED_ITEMS_REPOSITORY_H

View File

@ -280,10 +280,10 @@ public:
update_values.push_back(columns[2] + " = '" + EscapeString(doors_entry.zone) + "'");
update_values.push_back(columns[3] + " = " + std::to_string(doors_entry.version));
update_values.push_back(columns[4] + " = '" + EscapeString(doors_entry.name) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(doors_entry.pos_y) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(doors_entry.pos_x) + "'");
update_values.push_back(columns[7] + " = '" + EscapeString(doors_entry.pos_z) + "'");
update_values.push_back(columns[8] + " = '" + EscapeString(doors_entry.heading) + "'");
update_values.push_back(columns[5] + " = " + std::to_string(doors_entry.pos_y));
update_values.push_back(columns[6] + " = " + std::to_string(doors_entry.pos_x));
update_values.push_back(columns[7] + " = " + std::to_string(doors_entry.pos_z));
update_values.push_back(columns[8] + " = " + std::to_string(doors_entry.heading));
update_values.push_back(columns[9] + " = " + std::to_string(doors_entry.opentype));
update_values.push_back(columns[10] + " = " + std::to_string(doors_entry.guild));
update_values.push_back(columns[11] + " = " + std::to_string(doors_entry.lockpick));
@ -296,14 +296,14 @@ public:
update_values.push_back(columns[18] + " = " + std::to_string(doors_entry.door_param));
update_values.push_back(columns[19] + " = '" + EscapeString(doors_entry.dest_zone) + "'");
update_values.push_back(columns[20] + " = " + std::to_string(doors_entry.dest_instance));
update_values.push_back(columns[21] + " = '" + EscapeString(doors_entry.dest_x) + "'");
update_values.push_back(columns[22] + " = '" + EscapeString(doors_entry.dest_y) + "'");
update_values.push_back(columns[23] + " = '" + EscapeString(doors_entry.dest_z) + "'");
update_values.push_back(columns[24] + " = '" + EscapeString(doors_entry.dest_heading) + "'");
update_values.push_back(columns[21] + " = " + std::to_string(doors_entry.dest_x));
update_values.push_back(columns[22] + " = " + std::to_string(doors_entry.dest_y));
update_values.push_back(columns[23] + " = " + std::to_string(doors_entry.dest_z));
update_values.push_back(columns[24] + " = " + std::to_string(doors_entry.dest_heading));
update_values.push_back(columns[25] + " = " + std::to_string(doors_entry.invert_state));
update_values.push_back(columns[26] + " = " + std::to_string(doors_entry.incline));
update_values.push_back(columns[27] + " = " + std::to_string(doors_entry.size));
update_values.push_back(columns[28] + " = '" + EscapeString(doors_entry.buffer) + "'");
update_values.push_back(columns[28] + " = " + std::to_string(doors_entry.buffer));
update_values.push_back(columns[29] + " = " + std::to_string(doors_entry.client_version_mask));
update_values.push_back(columns[30] + " = " + std::to_string(doors_entry.is_ldon_door));
@ -330,10 +330,10 @@ public:
insert_values.push_back("'" + EscapeString(doors_entry.zone) + "'");
insert_values.push_back(std::to_string(doors_entry.version));
insert_values.push_back("'" + EscapeString(doors_entry.name) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.pos_y) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.pos_x) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.pos_z) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.heading) + "'");
insert_values.push_back(std::to_string(doors_entry.pos_y));
insert_values.push_back(std::to_string(doors_entry.pos_x));
insert_values.push_back(std::to_string(doors_entry.pos_z));
insert_values.push_back(std::to_string(doors_entry.heading));
insert_values.push_back(std::to_string(doors_entry.opentype));
insert_values.push_back(std::to_string(doors_entry.guild));
insert_values.push_back(std::to_string(doors_entry.lockpick));
@ -346,14 +346,14 @@ public:
insert_values.push_back(std::to_string(doors_entry.door_param));
insert_values.push_back("'" + EscapeString(doors_entry.dest_zone) + "'");
insert_values.push_back(std::to_string(doors_entry.dest_instance));
insert_values.push_back("'" + EscapeString(doors_entry.dest_x) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.dest_y) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.dest_z) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.dest_heading) + "'");
insert_values.push_back(std::to_string(doors_entry.dest_x));
insert_values.push_back(std::to_string(doors_entry.dest_y));
insert_values.push_back(std::to_string(doors_entry.dest_z));
insert_values.push_back(std::to_string(doors_entry.dest_heading));
insert_values.push_back(std::to_string(doors_entry.invert_state));
insert_values.push_back(std::to_string(doors_entry.incline));
insert_values.push_back(std::to_string(doors_entry.size));
insert_values.push_back("'" + EscapeString(doors_entry.buffer) + "'");
insert_values.push_back(std::to_string(doors_entry.buffer));
insert_values.push_back(std::to_string(doors_entry.client_version_mask));
insert_values.push_back(std::to_string(doors_entry.is_ldon_door));
@ -370,7 +370,7 @@ public:
return doors_entry;
}
doors_entry = InstanceListRepository::NewEntity();
doors_entry = DoorsRepository::NewEntity();
return doors_entry;
}
@ -388,10 +388,10 @@ public:
insert_values.push_back("'" + EscapeString(doors_entry.zone) + "'");
insert_values.push_back(std::to_string(doors_entry.version));
insert_values.push_back("'" + EscapeString(doors_entry.name) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.pos_y) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.pos_x) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.pos_z) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.heading) + "'");
insert_values.push_back(std::to_string(doors_entry.pos_y));
insert_values.push_back(std::to_string(doors_entry.pos_x));
insert_values.push_back(std::to_string(doors_entry.pos_z));
insert_values.push_back(std::to_string(doors_entry.heading));
insert_values.push_back(std::to_string(doors_entry.opentype));
insert_values.push_back(std::to_string(doors_entry.guild));
insert_values.push_back(std::to_string(doors_entry.lockpick));
@ -404,14 +404,14 @@ public:
insert_values.push_back(std::to_string(doors_entry.door_param));
insert_values.push_back("'" + EscapeString(doors_entry.dest_zone) + "'");
insert_values.push_back(std::to_string(doors_entry.dest_instance));
insert_values.push_back("'" + EscapeString(doors_entry.dest_x) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.dest_y) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.dest_z) + "'");
insert_values.push_back("'" + EscapeString(doors_entry.dest_heading) + "'");
insert_values.push_back(std::to_string(doors_entry.dest_x));
insert_values.push_back(std::to_string(doors_entry.dest_y));
insert_values.push_back(std::to_string(doors_entry.dest_z));
insert_values.push_back(std::to_string(doors_entry.dest_heading));
insert_values.push_back(std::to_string(doors_entry.invert_state));
insert_values.push_back(std::to_string(doors_entry.incline));
insert_values.push_back(std::to_string(doors_entry.size));
insert_values.push_back("'" + EscapeString(doors_entry.buffer) + "'");
insert_values.push_back(std::to_string(doors_entry.buffer));
insert_values.push_back(std::to_string(doors_entry.client_version_mask));
insert_values.push_back(std::to_string(doors_entry.is_ldon_door));
@ -485,6 +485,75 @@ public:
return all_entries;
}
static std::vector<Doors> GetWhere(std::string where_filter)
{
std::vector<Doors> 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) {
Doors entry{};
entry.id = atoi(row[0]);
entry.doorid = atoi(row[1]);
entry.zone = row[2];
entry.version = atoi(row[3]);
entry.name = row[4];
entry.pos_y = atof(row[5]);
entry.pos_x = atof(row[6]);
entry.pos_z = atof(row[7]);
entry.heading = atof(row[8]);
entry.opentype = atoi(row[9]);
entry.guild = atoi(row[10]);
entry.lockpick = atoi(row[11]);
entry.keyitem = atoi(row[12]);
entry.nokeyring = atoi(row[13]);
entry.triggerdoor = atoi(row[14]);
entry.triggertype = atoi(row[15]);
entry.disable_timer = atoi(row[16]);
entry.doorisopen = atoi(row[17]);
entry.door_param = atoi(row[18]);
entry.dest_zone = row[19];
entry.dest_instance = atoi(row[20]);
entry.dest_x = atof(row[21]);
entry.dest_y = atof(row[22]);
entry.dest_z = atof(row[23]);
entry.dest_heading = atof(row[24]);
entry.invert_state = atoi(row[25]);
entry.incline = atoi(row[26]);
entry.size = atoi(row[27]);
entry.buffer = atof(row[28]);
entry.client_version_mask = atoi(row[29]);
entry.is_ldon_door = atoi(row[30]);
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_DOORS_REPOSITORY_H

View File

@ -244,7 +244,7 @@ public:
return eventlog_entry;
}
eventlog_entry = InstanceListRepository::NewEntity();
eventlog_entry = EventlogRepository::NewEntity();
return eventlog_entry;
}
@ -317,6 +317,54 @@ public:
return all_entries;
}
static std::vector<Eventlog> GetWhere(std::string where_filter)
{
std::vector<Eventlog> 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) {
Eventlog entry{};
entry.id = atoi(row[0]);
entry.accountname = row[1];
entry.accountid = atoi(row[2]);
entry.status = atoi(row[3]);
entry.charname = row[4];
entry.target = row[5];
entry.time = row[6];
entry.descriptiontype = row[7];
entry.description = row[8];
entry.event_nid = atoi(row[9]);
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_EVENTLOG_REPOSITORY_H

View File

@ -220,7 +220,7 @@ public:
return faction_base_data_entry;
}
faction_base_data_entry = InstanceListRepository::NewEntity();
faction_base_data_entry = FactionBaseDataRepository::NewEntity();
return faction_base_data_entry;
}
@ -285,6 +285,50 @@ public:
return all_entries;
}
static std::vector<FactionBaseData> GetWhere(std::string where_filter)
{
std::vector<FactionBaseData> 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) {
FactionBaseData entry{};
entry.client_faction_id = atoi(row[0]);
entry.min = atoi(row[1]);
entry.max = atoi(row[2]);
entry.unk_hero1 = atoi(row[3]);
entry.unk_hero2 = atoi(row[4]);
entry.unk_hero3 = atoi(row[5]);
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_FACTION_BASE_DATA_REPOSITORY_H

View File

@ -208,7 +208,7 @@ public:
return faction_list_mod_entry;
}
faction_list_mod_entry = InstanceListRepository::NewEntity();
faction_list_mod_entry = FactionListModRepository::NewEntity();
return faction_list_mod_entry;
}
@ -269,6 +269,48 @@ public:
return all_entries;
}
static std::vector<FactionListMod> GetWhere(std::string where_filter)
{
std::vector<FactionListMod> 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) {
FactionListMod entry{};
entry.id = atoi(row[0]);
entry.faction_id = atoi(row[1]);
entry.mod = atoi(row[2]);
entry.mod_name = row[3];
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_FACTION_LIST_MOD_REPOSITORY_H

View File

@ -202,7 +202,7 @@ public:
return faction_list_entry;
}
faction_list_entry = InstanceListRepository::NewEntity();
faction_list_entry = FactionListRepository::NewEntity();
return faction_list_entry;
}
@ -261,6 +261,47 @@ public:
return all_entries;
}
static std::vector<FactionList> GetWhere(std::string where_filter)
{
std::vector<FactionList> 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) {
FactionList entry{};
entry.id = atoi(row[0]);
entry.name = row[1];
entry.base = 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_FACTION_LIST_REPOSITORY_H

View File

@ -206,7 +206,7 @@ public:
return faction_values_entry;
}
faction_values_entry = InstanceListRepository::NewEntity();
faction_values_entry = FactionValuesRepository::NewEntity();
return faction_values_entry;
}
@ -266,6 +266,48 @@ public:
return all_entries;
}
static std::vector<FactionValues> GetWhere(std::string where_filter)
{
std::vector<FactionValues> 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) {
FactionValues entry{};
entry.char_id = atoi(row[0]);
entry.faction_id = atoi(row[1]);
entry.current_value = atoi(row[2]);
entry.temp = 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_FACTION_VALUES_REPOSITORY_H

View File

@ -226,7 +226,7 @@ public:
return fishing_entry;
}
fishing_entry = InstanceListRepository::NewEntity();
fishing_entry = FishingRepository::NewEntity();
return fishing_entry;
}
@ -293,6 +293,51 @@ public:
return all_entries;
}
static std::vector<Fishing> GetWhere(std::string where_filter)
{
std::vector<Fishing> 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) {
Fishing entry{};
entry.id = atoi(row[0]);
entry.zoneid = atoi(row[1]);
entry.Itemid = atoi(row[2]);
entry.skill_level = atoi(row[3]);
entry.chance = atoi(row[4]);
entry.npc_id = atoi(row[5]);
entry.npc_chance = atoi(row[6]);
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_FISHING_REPOSITORY_H

View File

@ -214,7 +214,7 @@ public:
return forage_entry;
}
forage_entry = InstanceListRepository::NewEntity();
forage_entry = ForageRepository::NewEntity();
return forage_entry;
}
@ -277,6 +277,49 @@ public:
return all_entries;
}
static std::vector<Forage> GetWhere(std::string where_filter)
{
std::vector<Forage> 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) {
Forage entry{};
entry.id = atoi(row[0]);
entry.zoneid = atoi(row[1]);
entry.Itemid = atoi(row[2]);
entry.level = atoi(row[3]);
entry.chance = atoi(row[4]);
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_FORAGE_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return friends_entry;
}
friends_entry = InstanceListRepository::NewEntity();
friends_entry = FriendsRepository::NewEntity();
return friends_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<Friends> GetWhere(std::string where_filter)
{
std::vector<Friends> 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) {
Friends entry{};
entry.charid = atoi(row[0]);
entry.type = atoi(row[1]);
entry.name = 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_FRIENDS_REPOSITORY_H

View File

@ -262,7 +262,7 @@ public:
return global_loot_entry;
}
global_loot_entry = InstanceListRepository::NewEntity();
global_loot_entry = GlobalLootRepository::NewEntity();
return global_loot_entry;
}
@ -341,6 +341,57 @@ public:
return all_entries;
}
static std::vector<GlobalLoot> GetWhere(std::string where_filter)
{
std::vector<GlobalLoot> 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) {
GlobalLoot entry{};
entry.id = atoi(row[0]);
entry.description = row[1];
entry.loottable_id = atoi(row[2]);
entry.enabled = atoi(row[3]);
entry.min_level = atoi(row[4]);
entry.max_level = atoi(row[5]);
entry.rare = atoi(row[6]);
entry.raid = atoi(row[7]);
entry.race = row[8];
entry.class = row[9];
entry.bodytype = row[10];
entry.zone = row[11];
entry.hot_zone = atoi(row[12]);
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_GLOBAL_LOOT_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return gm_ips_entry;
}
gm_ips_entry = InstanceListRepository::NewEntity();
gm_ips_entry = GmIpsRepository::NewEntity();
return gm_ips_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<GmIps> GetWhere(std::string where_filter)
{
std::vector<GmIps> 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) {
GmIps entry{};
entry.name = row[0];
entry.account_id = atoi(row[1]);
entry.ip_address = 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_GM_IPS_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return goallists_entry;
}
goallists_entry = InstanceListRepository::NewEntity();
goallists_entry = GoallistsRepository::NewEntity();
return goallists_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<Goallists> GetWhere(std::string where_filter)
{
std::vector<Goallists> 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) {
Goallists entry{};
entry.listid = atoi(row[0]);
entry.entry = atoi(row[1]);
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_GOALLISTS_REPOSITORY_H

View File

@ -177,10 +177,10 @@ public:
auto columns = Columns();
update_values.push_back(columns[1] + " = " + std::to_string(graveyard_entry.zone_id));
update_values.push_back(columns[2] + " = '" + EscapeString(graveyard_entry.x) + "'");
update_values.push_back(columns[3] + " = '" + EscapeString(graveyard_entry.y) + "'");
update_values.push_back(columns[4] + " = '" + EscapeString(graveyard_entry.z) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(graveyard_entry.heading) + "'");
update_values.push_back(columns[2] + " = " + std::to_string(graveyard_entry.x));
update_values.push_back(columns[3] + " = " + std::to_string(graveyard_entry.y));
update_values.push_back(columns[4] + " = " + std::to_string(graveyard_entry.z));
update_values.push_back(columns[5] + " = " + std::to_string(graveyard_entry.heading));
auto results = content_db.QueryDatabase(
fmt::format(
@ -202,10 +202,10 @@ public:
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(graveyard_entry.zone_id));
insert_values.push_back("'" + EscapeString(graveyard_entry.x) + "'");
insert_values.push_back("'" + EscapeString(graveyard_entry.y) + "'");
insert_values.push_back("'" + EscapeString(graveyard_entry.z) + "'");
insert_values.push_back("'" + EscapeString(graveyard_entry.heading) + "'");
insert_values.push_back(std::to_string(graveyard_entry.x));
insert_values.push_back(std::to_string(graveyard_entry.y));
insert_values.push_back(std::to_string(graveyard_entry.z));
insert_values.push_back(std::to_string(graveyard_entry.heading));
auto results = content_db.QueryDatabase(
fmt::format(
@ -220,7 +220,7 @@ public:
return graveyard_entry;
}
graveyard_entry = InstanceListRepository::NewEntity();
graveyard_entry = GraveyardRepository::NewEntity();
return graveyard_entry;
}
@ -235,10 +235,10 @@ public:
std::vector<std::string> insert_values;
insert_values.push_back(std::to_string(graveyard_entry.zone_id));
insert_values.push_back("'" + EscapeString(graveyard_entry.x) + "'");
insert_values.push_back("'" + EscapeString(graveyard_entry.y) + "'");
insert_values.push_back("'" + EscapeString(graveyard_entry.z) + "'");
insert_values.push_back("'" + EscapeString(graveyard_entry.heading) + "'");
insert_values.push_back(std::to_string(graveyard_entry.x));
insert_values.push_back(std::to_string(graveyard_entry.y));
insert_values.push_back(std::to_string(graveyard_entry.z));
insert_values.push_back(std::to_string(graveyard_entry.heading));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -285,6 +285,50 @@ public:
return all_entries;
}
static std::vector<Graveyard> GetWhere(std::string where_filter)
{
std::vector<Graveyard> 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) {
Graveyard entry{};
entry.id = atoi(row[0]);
entry.zone_id = atoi(row[1]);
entry.x = atof(row[2]);
entry.y = atof(row[3]);
entry.z = atof(row[4]);
entry.heading = atof(row[5]);
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_GRAVEYARD_REPOSITORY_H

View File

@ -210,12 +210,12 @@ public:
update_values.push_back(columns[1] + " = " + std::to_string(ground_spawns_entry.zoneid));
update_values.push_back(columns[2] + " = " + std::to_string(ground_spawns_entry.version));
update_values.push_back(columns[3] + " = '" + EscapeString(ground_spawns_entry.max_x) + "'");
update_values.push_back(columns[4] + " = '" + EscapeString(ground_spawns_entry.max_y) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(ground_spawns_entry.max_z) + "'");
update_values.push_back(columns[6] + " = '" + EscapeString(ground_spawns_entry.min_x) + "'");
update_values.push_back(columns[7] + " = '" + EscapeString(ground_spawns_entry.min_y) + "'");
update_values.push_back(columns[8] + " = '" + EscapeString(ground_spawns_entry.heading) + "'");
update_values.push_back(columns[3] + " = " + std::to_string(ground_spawns_entry.max_x));
update_values.push_back(columns[4] + " = " + std::to_string(ground_spawns_entry.max_y));
update_values.push_back(columns[5] + " = " + std::to_string(ground_spawns_entry.max_z));
update_values.push_back(columns[6] + " = " + std::to_string(ground_spawns_entry.min_x));
update_values.push_back(columns[7] + " = " + std::to_string(ground_spawns_entry.min_y));
update_values.push_back(columns[8] + " = " + std::to_string(ground_spawns_entry.heading));
update_values.push_back(columns[9] + " = '" + EscapeString(ground_spawns_entry.name) + "'");
update_values.push_back(columns[10] + " = " + std::to_string(ground_spawns_entry.item));
update_values.push_back(columns[11] + " = " + std::to_string(ground_spawns_entry.max_allowed));
@ -243,12 +243,12 @@ public:
insert_values.push_back(std::to_string(ground_spawns_entry.zoneid));
insert_values.push_back(std::to_string(ground_spawns_entry.version));
insert_values.push_back("'" + EscapeString(ground_spawns_entry.max_x) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.max_y) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.max_z) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.min_x) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.min_y) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.heading) + "'");
insert_values.push_back(std::to_string(ground_spawns_entry.max_x));
insert_values.push_back(std::to_string(ground_spawns_entry.max_y));
insert_values.push_back(std::to_string(ground_spawns_entry.max_z));
insert_values.push_back(std::to_string(ground_spawns_entry.min_x));
insert_values.push_back(std::to_string(ground_spawns_entry.min_y));
insert_values.push_back(std::to_string(ground_spawns_entry.heading));
insert_values.push_back("'" + EscapeString(ground_spawns_entry.name) + "'");
insert_values.push_back(std::to_string(ground_spawns_entry.item));
insert_values.push_back(std::to_string(ground_spawns_entry.max_allowed));
@ -268,7 +268,7 @@ public:
return ground_spawns_entry;
}
ground_spawns_entry = InstanceListRepository::NewEntity();
ground_spawns_entry = GroundSpawnsRepository::NewEntity();
return ground_spawns_entry;
}
@ -284,12 +284,12 @@ public:
insert_values.push_back(std::to_string(ground_spawns_entry.zoneid));
insert_values.push_back(std::to_string(ground_spawns_entry.version));
insert_values.push_back("'" + EscapeString(ground_spawns_entry.max_x) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.max_y) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.max_z) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.min_x) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.min_y) + "'");
insert_values.push_back("'" + EscapeString(ground_spawns_entry.heading) + "'");
insert_values.push_back(std::to_string(ground_spawns_entry.max_x));
insert_values.push_back(std::to_string(ground_spawns_entry.max_y));
insert_values.push_back(std::to_string(ground_spawns_entry.max_z));
insert_values.push_back(std::to_string(ground_spawns_entry.min_x));
insert_values.push_back(std::to_string(ground_spawns_entry.min_y));
insert_values.push_back(std::to_string(ground_spawns_entry.heading));
insert_values.push_back("'" + EscapeString(ground_spawns_entry.name) + "'");
insert_values.push_back(std::to_string(ground_spawns_entry.item));
insert_values.push_back(std::to_string(ground_spawns_entry.max_allowed));
@ -349,6 +349,58 @@ public:
return all_entries;
}
static std::vector<GroundSpawns> GetWhere(std::string where_filter)
{
std::vector<GroundSpawns> 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) {
GroundSpawns entry{};
entry.id = atoi(row[0]);
entry.zoneid = atoi(row[1]);
entry.version = atoi(row[2]);
entry.max_x = atof(row[3]);
entry.max_y = atof(row[4]);
entry.max_z = atof(row[5]);
entry.min_x = atof(row[6]);
entry.min_y = atof(row[7]);
entry.heading = atof(row[8]);
entry.name = row[9];
entry.item = atoi(row[10]);
entry.max_allowed = atoi(row[11]);
entry.comment = row[12];
entry.respawn_timer = atoi(row[13]);
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_GROUND_SPAWNS_REPOSITORY_H

View File

@ -204,7 +204,7 @@ public:
return group_id_entry;
}
group_id_entry = InstanceListRepository::NewEntity();
group_id_entry = GroupIdRepository::NewEntity();
return group_id_entry;
}
@ -263,6 +263,48 @@ public:
return all_entries;
}
static std::vector<GroupId> GetWhere(std::string where_filter)
{
std::vector<GroupId> 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) {
GroupId entry{};
entry.groupid = atoi(row[0]);
entry.charid = atoi(row[1]);
entry.name = row[2];
entry.ismerc = 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_GROUP_ID_REPOSITORY_H

View File

@ -238,7 +238,7 @@ public:
return group_leaders_entry;
}
group_leaders_entry = InstanceListRepository::NewEntity();
group_leaders_entry = GroupLeadersRepository::NewEntity();
return group_leaders_entry;
}
@ -309,6 +309,53 @@ public:
return all_entries;
}
static std::vector<GroupLeaders> GetWhere(std::string where_filter)
{
std::vector<GroupLeaders> 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) {
GroupLeaders entry{};
entry.gid = atoi(row[0]);
entry.leadername = row[1];
entry.marknpc = row[2];
entry.leadershipaa = row[3];
entry.maintank = row[4];
entry.assist = row[5];
entry.puller = row[6];
entry.mentoree = row[7];
entry.mentor_percent = atoi(row[8]);
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_GROUP_LEADERS_REPOSITORY_H

View File

@ -238,7 +238,7 @@ public:
return guild_members_entry;
}
guild_members_entry = InstanceListRepository::NewEntity();
guild_members_entry = GuildMembersRepository::NewEntity();
return guild_members_entry;
}
@ -309,6 +309,53 @@ public:
return all_entries;
}
static std::vector<GuildMembers> GetWhere(std::string where_filter)
{
std::vector<GuildMembers> 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) {
GuildMembers entry{};
entry.char_id = atoi(row[0]);
entry.guild_id = atoi(row[1]);
entry.rank = atoi(row[2]);
entry.tribute_enable = atoi(row[3]);
entry.total_tribute = atoi(row[4]);
entry.last_tribute = atoi(row[5]);
entry.banker = atoi(row[6]);
entry.public_note = row[7];
entry.alt = atoi(row[8]);
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_GUILD_MEMBERS_REPOSITORY_H

View File

@ -248,7 +248,7 @@ public:
return guild_ranks_entry;
}
guild_ranks_entry = InstanceListRepository::NewEntity();
guild_ranks_entry = GuildRanksRepository::NewEntity();
return guild_ranks_entry;
}
@ -322,6 +322,55 @@ public:
return all_entries;
}
static std::vector<GuildRanks> GetWhere(std::string where_filter)
{
std::vector<GuildRanks> 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) {
GuildRanks entry{};
entry.guild_id = atoi(row[0]);
entry.rank = atoi(row[1]);
entry.title = row[2];
entry.can_hear = atoi(row[3]);
entry.can_speak = atoi(row[4]);
entry.can_invite = atoi(row[5]);
entry.can_remove = atoi(row[6]);
entry.can_promote = atoi(row[7]);
entry.can_demote = atoi(row[8]);
entry.can_motd = atoi(row[9]);
entry.can_warpeace = atoi(row[10]);
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_GUILD_RANKS_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return guild_relations_entry;
}
guild_relations_entry = InstanceListRepository::NewEntity();
guild_relations_entry = GuildRelationsRepository::NewEntity();
return guild_relations_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<GuildRelations> GetWhere(std::string where_filter)
{
std::vector<GuildRelations> 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) {
GuildRelations entry{};
entry.guild1 = atoi(row[0]);
entry.guild2 = atoi(row[1]);
entry.relation = 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_GUILD_RELATIONS_REPOSITORY_H

View File

@ -238,7 +238,7 @@ public:
return guilds_entry;
}
guilds_entry = InstanceListRepository::NewEntity();
guilds_entry = GuildsRepository::NewEntity();
return guilds_entry;
}
@ -309,6 +309,53 @@ public:
return all_entries;
}
static std::vector<Guilds> GetWhere(std::string where_filter)
{
std::vector<Guilds> 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) {
Guilds entry{};
entry.id = atoi(row[0]);
entry.name = row[1];
entry.leader = atoi(row[2]);
entry.minstatus = atoi(row[3]);
entry.motd = row[4];
entry.tribute = atoi(row[5]);
entry.motd_setter = row[6];
entry.channel = row[7];
entry.url = row[8];
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_GUILDS_REPOSITORY_H

View File

@ -220,7 +220,7 @@ public:
return hackers_entry;
}
hackers_entry = InstanceListRepository::NewEntity();
hackers_entry = HackersRepository::NewEntity();
return hackers_entry;
}
@ -285,6 +285,50 @@ public:
return all_entries;
}
static std::vector<Hackers> GetWhere(std::string where_filter)
{
std::vector<Hackers> 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) {
Hackers entry{};
entry.id = atoi(row[0]);
entry.account = row[1];
entry.name = row[2];
entry.hacked = row[3];
entry.zone = row[4];
entry.date = row[5];
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_HACKERS_REPOSITORY_H

View File

@ -179,7 +179,7 @@ public:
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));
update_values.push_back(columns[4] + " = '" + EscapeString(horses_entry.mountspeed) + "'");
update_values.push_back(columns[4] + " = " + std::to_string(horses_entry.mountspeed));
update_values.push_back(columns[5] + " = '" + EscapeString(horses_entry.notes) + "'");
auto results = content_db.QueryDatabase(
@ -204,7 +204,7 @@ public:
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));
insert_values.push_back("'" + EscapeString(horses_entry.mountspeed) + "'");
insert_values.push_back(std::to_string(horses_entry.mountspeed));
insert_values.push_back("'" + EscapeString(horses_entry.notes) + "'");
auto results = content_db.QueryDatabase(
@ -220,7 +220,7 @@ public:
return horses_entry;
}
horses_entry = InstanceListRepository::NewEntity();
horses_entry = HorsesRepository::NewEntity();
return horses_entry;
}
@ -237,7 +237,7 @@ public:
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));
insert_values.push_back("'" + EscapeString(horses_entry.mountspeed) + "'");
insert_values.push_back(std::to_string(horses_entry.mountspeed));
insert_values.push_back("'" + EscapeString(horses_entry.notes) + "'");
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
@ -285,6 +285,50 @@ public:
return all_entries;
}
static std::vector<Horses> GetWhere(std::string where_filter)
{
std::vector<Horses> 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) {
Horses entry{};
entry.filename = row[0];
entry.race = atoi(row[1]);
entry.gender = atoi(row[2]);
entry.texture = atoi(row[3]);
entry.mountspeed = atof(row[4]);
entry.notes = row[5];
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_HORSES_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return instance_list_player_entry;
}
instance_list_player_entry = InstanceListRepository::NewEntity();
instance_list_player_entry = InstanceListPlayerRepository::NewEntity();
return instance_list_player_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<InstanceListPlayer> GetWhere(std::string where_filter)
{
std::vector<InstanceListPlayer> 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) {
InstanceListPlayer entry{};
entry.id = atoi(row[0]);
entry.charid = atoi(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_INSTANCE_LIST_PLAYER_REPOSITORY_H

View File

@ -293,6 +293,51 @@ public:
return all_entries;
}
static std::vector<InstanceList> GetWhere(std::string where_filter)
{
std::vector<InstanceList> 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) {
InstanceList entry{};
entry.id = atoi(row[0]);
entry.zone = atoi(row[1]);
entry.version = atoi(row[2]);
entry.is_global = atoi(row[3]);
entry.start_time = atoi(row[4]);
entry.duration = atoi(row[5]);
entry.never_expires = atoi(row[6]);
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_INSTANCE_LIST_REPOSITORY_H

View File

@ -278,7 +278,7 @@ public:
return inventory_entry;
}
inventory_entry = InstanceListRepository::NewEntity();
inventory_entry = InventoryRepository::NewEntity();
return inventory_entry;
}
@ -362,6 +362,60 @@ public:
return all_entries;
}
static std::vector<Inventory> GetWhere(std::string where_filter)
{
std::vector<Inventory> 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) {
Inventory entry{};
entry.charid = atoi(row[0]);
entry.slotid = atoi(row[1]);
entry.itemid = atoi(row[2]);
entry.charges = atoi(row[3]);
entry.color = atoi(row[4]);
entry.augslot1 = atoi(row[5]);
entry.augslot2 = atoi(row[6]);
entry.augslot3 = atoi(row[7]);
entry.augslot4 = atoi(row[8]);
entry.augslot5 = atoi(row[9]);
entry.augslot6 = atoi(row[10]);
entry.instnodrop = atoi(row[11]);
entry.custom_data = row[12];
entry.ornamenticon = atoi(row[13]);
entry.ornamentidfile = atoi(row[14]);
entry.ornament_hero_model = atoi(row[15]);
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_INVENTORY_REPOSITORY_H

View File

@ -282,7 +282,7 @@ public:
return inventory_snapshots_entry;
}
inventory_snapshots_entry = InstanceListRepository::NewEntity();
inventory_snapshots_entry = InventorySnapshotsRepository::NewEntity();
return inventory_snapshots_entry;
}
@ -367,6 +367,61 @@ public:
return all_entries;
}
static std::vector<InventorySnapshots> GetWhere(std::string where_filter)
{
std::vector<InventorySnapshots> 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) {
InventorySnapshots entry{};
entry.time_index = atoi(row[0]);
entry.charid = atoi(row[1]);
entry.slotid = atoi(row[2]);
entry.itemid = atoi(row[3]);
entry.charges = atoi(row[4]);
entry.color = atoi(row[5]);
entry.augslot1 = atoi(row[6]);
entry.augslot2 = atoi(row[7]);
entry.augslot3 = atoi(row[8]);
entry.augslot4 = atoi(row[9]);
entry.augslot5 = atoi(row[10]);
entry.augslot6 = atoi(row[11]);
entry.instnodrop = atoi(row[12]);
entry.custom_data = row[13];
entry.ornamenticon = atoi(row[14]);
entry.ornamentidfile = atoi(row[15]);
entry.ornament_hero_model = atoi(row[16]);
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_INVENTORY_SNAPSHOTS_REPOSITORY_H

View File

@ -202,7 +202,7 @@ public:
return ip_exemptions_entry;
}
ip_exemptions_entry = InstanceListRepository::NewEntity();
ip_exemptions_entry = IpExemptionsRepository::NewEntity();
return ip_exemptions_entry;
}
@ -261,6 +261,47 @@ public:
return all_entries;
}
static std::vector<IpExemptions> GetWhere(std::string where_filter)
{
std::vector<IpExemptions> 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) {
IpExemptions entry{};
entry.exemption_id = atoi(row[0]);
entry.exemption_ip = row[1];
entry.exemption_amount = 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_IP_EXEMPTIONS_REPOSITORY_H

View File

@ -220,7 +220,7 @@ public:
return item_tick_entry;
}
item_tick_entry = InstanceListRepository::NewEntity();
item_tick_entry = ItemTickRepository::NewEntity();
return item_tick_entry;
}
@ -285,6 +285,50 @@ public:
return all_entries;
}
static std::vector<ItemTick> GetWhere(std::string where_filter)
{
std::vector<ItemTick> 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) {
ItemTick entry{};
entry.it_itemid = atoi(row[0]);
entry.it_chance = atoi(row[1]);
entry.it_level = atoi(row[2]);
entry.it_id = atoi(row[3]);
entry.it_qglobal = row[4];
entry.it_bagslot = atoi(row[5]);
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_ITEM_TICK_REPOSITORY_H

View File

@ -1398,7 +1398,7 @@ public:
update_values.push_back(columns[104] + " = " + std::to_string(items_entry.reclevel));
update_values.push_back(columns[105] + " = " + std::to_string(items_entry.recskill));
update_values.push_back(columns[106] + " = " + std::to_string(items_entry.reqlevel));
update_values.push_back(columns[107] + " = '" + EscapeString(items_entry.sellrate) + "'");
update_values.push_back(columns[107] + " = " + std::to_string(items_entry.sellrate));
update_values.push_back(columns[108] + " = " + std::to_string(items_entry.shielding));
update_values.push_back(columns[109] + " = " + std::to_string(items_entry.size));
update_values.push_back(columns[110] + " = " + std::to_string(items_entry.skillmodtype));
@ -1702,7 +1702,7 @@ public:
insert_values.push_back(std::to_string(items_entry.reclevel));
insert_values.push_back(std::to_string(items_entry.recskill));
insert_values.push_back(std::to_string(items_entry.reqlevel));
insert_values.push_back("'" + EscapeString(items_entry.sellrate) + "'");
insert_values.push_back(std::to_string(items_entry.sellrate));
insert_values.push_back(std::to_string(items_entry.shielding));
insert_values.push_back(std::to_string(items_entry.size));
insert_values.push_back(std::to_string(items_entry.skillmodtype));
@ -1894,7 +1894,7 @@ public:
return items_entry;
}
items_entry = InstanceListRepository::NewEntity();
items_entry = ItemsRepository::NewEntity();
return items_entry;
}
@ -2014,7 +2014,7 @@ public:
insert_values.push_back(std::to_string(items_entry.reclevel));
insert_values.push_back(std::to_string(items_entry.recskill));
insert_values.push_back(std::to_string(items_entry.reqlevel));
insert_values.push_back("'" + EscapeString(items_entry.sellrate) + "'");
insert_values.push_back(std::to_string(items_entry.sellrate));
insert_values.push_back(std::to_string(items_entry.shielding));
insert_values.push_back(std::to_string(items_entry.size));
insert_values.push_back(std::to_string(items_entry.skillmodtype));
@ -2517,6 +2517,329 @@ public:
return all_entries;
}
static std::vector<Items> GetWhere(std::string where_filter)
{
std::vector<Items> 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) {
Items entry{};
entry.id = atoi(row[0]);
entry.minstatus = atoi(row[1]);
entry.Name = row[2];
entry.aagi = atoi(row[3]);
entry.ac = atoi(row[4]);
entry.accuracy = atoi(row[5]);
entry.acha = atoi(row[6]);
entry.adex = atoi(row[7]);
entry.aint = atoi(row[8]);
entry.artifactflag = atoi(row[9]);
entry.asta = atoi(row[10]);
entry.astr = atoi(row[11]);
entry.attack = atoi(row[12]);
entry.augrestrict = atoi(row[13]);
entry.augslot1type = atoi(row[14]);
entry.augslot1visible = atoi(row[15]);
entry.augslot2type = atoi(row[16]);
entry.augslot2visible = atoi(row[17]);
entry.augslot3type = atoi(row[18]);
entry.augslot3visible = atoi(row[19]);
entry.augslot4type = atoi(row[20]);
entry.augslot4visible = atoi(row[21]);
entry.augslot5type = atoi(row[22]);
entry.augslot5visible = atoi(row[23]);
entry.augslot6type = atoi(row[24]);
entry.augslot6visible = atoi(row[25]);
entry.augtype = atoi(row[26]);
entry.avoidance = atoi(row[27]);
entry.awis = atoi(row[28]);
entry.bagsize = atoi(row[29]);
entry.bagslots = atoi(row[30]);
entry.bagtype = atoi(row[31]);
entry.bagwr = atoi(row[32]);
entry.banedmgamt = atoi(row[33]);
entry.banedmgraceamt = atoi(row[34]);
entry.banedmgbody = atoi(row[35]);
entry.banedmgrace = atoi(row[36]);
entry.bardtype = atoi(row[37]);
entry.bardvalue = atoi(row[38]);
entry.book = atoi(row[39]);
entry.casttime = atoi(row[40]);
entry.casttime_ = atoi(row[41]);
entry.charmfile = row[42];
entry.charmfileid = row[43];
entry.classes = atoi(row[44]);
entry.color = atoi(row[45]);
entry.combateffects = row[46];
entry.extradmgskill = atoi(row[47]);
entry.extradmgamt = atoi(row[48]);
entry.price = atoi(row[49]);
entry.cr = atoi(row[50]);
entry.damage = atoi(row[51]);
entry.damageshield = atoi(row[52]);
entry.deity = atoi(row[53]);
entry.delay = atoi(row[54]);
entry.augdistiller = atoi(row[55]);
entry.dotshielding = atoi(row[56]);
entry.dr = atoi(row[57]);
entry.clicktype = atoi(row[58]);
entry.clicklevel2 = atoi(row[59]);
entry.elemdmgtype = atoi(row[60]);
entry.elemdmgamt = atoi(row[61]);
entry.endur = atoi(row[62]);
entry.factionamt1 = atoi(row[63]);
entry.factionamt2 = atoi(row[64]);
entry.factionamt3 = atoi(row[65]);
entry.factionamt4 = atoi(row[66]);
entry.factionmod1 = atoi(row[67]);
entry.factionmod2 = atoi(row[68]);
entry.factionmod3 = atoi(row[69]);
entry.factionmod4 = atoi(row[70]);
entry.filename = row[71];
entry.focuseffect = atoi(row[72]);
entry.fr = atoi(row[73]);
entry.fvnodrop = atoi(row[74]);
entry.haste = atoi(row[75]);
entry.clicklevel = atoi(row[76]);
entry.hp = atoi(row[77]);
entry.regen = atoi(row[78]);
entry.icon = atoi(row[79]);
entry.idfile = row[80];
entry.itemclass = atoi(row[81]);
entry.itemtype = atoi(row[82]);
entry.ldonprice = atoi(row[83]);
entry.ldontheme = atoi(row[84]);
entry.ldonsold = atoi(row[85]);
entry.light = atoi(row[86]);
entry.lore = row[87];
entry.loregroup = atoi(row[88]);
entry.magic = atoi(row[89]);
entry.mana = atoi(row[90]);
entry.manaregen = atoi(row[91]);
entry.enduranceregen = atoi(row[92]);
entry.material = atoi(row[93]);
entry.herosforgemodel = atoi(row[94]);
entry.maxcharges = atoi(row[95]);
entry.mr = atoi(row[96]);
entry.nodrop = atoi(row[97]);
entry.norent = atoi(row[98]);
entry.pendingloreflag = atoi(row[99]);
entry.pr = atoi(row[100]);
entry.procrate = atoi(row[101]);
entry.races = atoi(row[102]);
entry.range = atoi(row[103]);
entry.reclevel = atoi(row[104]);
entry.recskill = atoi(row[105]);
entry.reqlevel = atoi(row[106]);
entry.sellrate = atof(row[107]);
entry.shielding = atoi(row[108]);
entry.size = atoi(row[109]);
entry.skillmodtype = atoi(row[110]);
entry.skillmodvalue = atoi(row[111]);
entry.slots = atoi(row[112]);
entry.clickeffect = atoi(row[113]);
entry.spellshield = atoi(row[114]);
entry.strikethrough = atoi(row[115]);
entry.stunresist = atoi(row[116]);
entry.summonedflag = atoi(row[117]);
entry.tradeskills = atoi(row[118]);
entry.favor = atoi(row[119]);
entry.weight = atoi(row[120]);
entry.UNK012 = atoi(row[121]);
entry.UNK013 = atoi(row[122]);
entry.benefitflag = atoi(row[123]);
entry.UNK054 = atoi(row[124]);
entry.UNK059 = atoi(row[125]);
entry.booktype = atoi(row[126]);
entry.recastdelay = atoi(row[127]);
entry.recasttype = atoi(row[128]);
entry.guildfavor = atoi(row[129]);
entry.UNK123 = atoi(row[130]);
entry.UNK124 = atoi(row[131]);
entry.attuneable = atoi(row[132]);
entry.nopet = atoi(row[133]);
entry.updated = row[134];
entry.comment = row[135];
entry.UNK127 = atoi(row[136]);
entry.pointtype = atoi(row[137]);
entry.potionbelt = atoi(row[138]);
entry.potionbeltslots = atoi(row[139]);
entry.stacksize = atoi(row[140]);
entry.notransfer = atoi(row[141]);
entry.stackable = atoi(row[142]);
entry.UNK134 = row[143];
entry.UNK137 = atoi(row[144]);
entry.proceffect = atoi(row[145]);
entry.proctype = atoi(row[146]);
entry.proclevel2 = atoi(row[147]);
entry.proclevel = atoi(row[148]);
entry.UNK142 = atoi(row[149]);
entry.worneffect = atoi(row[150]);
entry.worntype = atoi(row[151]);
entry.wornlevel2 = atoi(row[152]);
entry.wornlevel = atoi(row[153]);
entry.UNK147 = atoi(row[154]);
entry.focustype = atoi(row[155]);
entry.focuslevel2 = atoi(row[156]);
entry.focuslevel = atoi(row[157]);
entry.UNK152 = atoi(row[158]);
entry.scrolleffect = atoi(row[159]);
entry.scrolltype = atoi(row[160]);
entry.scrolllevel2 = atoi(row[161]);
entry.scrolllevel = atoi(row[162]);
entry.UNK157 = atoi(row[163]);
entry.serialized = row[164];
entry.verified = row[165];
entry.serialization = row[166];
entry.source = row[167];
entry.UNK033 = atoi(row[168]);
entry.lorefile = row[169];
entry.UNK014 = atoi(row[170]);
entry.svcorruption = atoi(row[171]);
entry.skillmodmax = atoi(row[172]);
entry.UNK060 = atoi(row[173]);
entry.augslot1unk2 = atoi(row[174]);
entry.augslot2unk2 = atoi(row[175]);
entry.augslot3unk2 = atoi(row[176]);
entry.augslot4unk2 = atoi(row[177]);
entry.augslot5unk2 = atoi(row[178]);
entry.augslot6unk2 = atoi(row[179]);
entry.UNK120 = atoi(row[180]);
entry.UNK121 = atoi(row[181]);
entry.questitemflag = atoi(row[182]);
entry.UNK132 = row[183];
entry.clickunk5 = atoi(row[184]);
entry.clickunk6 = row[185];
entry.clickunk7 = atoi(row[186]);
entry.procunk1 = atoi(row[187]);
entry.procunk2 = atoi(row[188]);
entry.procunk3 = atoi(row[189]);
entry.procunk4 = atoi(row[190]);
entry.procunk6 = row[191];
entry.procunk7 = atoi(row[192]);
entry.wornunk1 = atoi(row[193]);
entry.wornunk2 = atoi(row[194]);
entry.wornunk3 = atoi(row[195]);
entry.wornunk4 = atoi(row[196]);
entry.wornunk5 = atoi(row[197]);
entry.wornunk6 = row[198];
entry.wornunk7 = atoi(row[199]);
entry.focusunk1 = atoi(row[200]);
entry.focusunk2 = atoi(row[201]);
entry.focusunk3 = atoi(row[202]);
entry.focusunk4 = atoi(row[203]);
entry.focusunk5 = atoi(row[204]);
entry.focusunk6 = row[205];
entry.focusunk7 = atoi(row[206]);
entry.scrollunk1 = atoi(row[207]);
entry.scrollunk2 = atoi(row[208]);
entry.scrollunk3 = atoi(row[209]);
entry.scrollunk4 = atoi(row[210]);
entry.scrollunk5 = atoi(row[211]);
entry.scrollunk6 = row[212];
entry.scrollunk7 = atoi(row[213]);
entry.UNK193 = atoi(row[214]);
entry.purity = atoi(row[215]);
entry.evoitem = atoi(row[216]);
entry.evoid = atoi(row[217]);
entry.evolvinglevel = atoi(row[218]);
entry.evomax = atoi(row[219]);
entry.clickname = row[220];
entry.procname = row[221];
entry.wornname = row[222];
entry.focusname = row[223];
entry.scrollname = row[224];
entry.dsmitigation = atoi(row[225]);
entry.heroic_str = atoi(row[226]);
entry.heroic_int = atoi(row[227]);
entry.heroic_wis = atoi(row[228]);
entry.heroic_agi = atoi(row[229]);
entry.heroic_dex = atoi(row[230]);
entry.heroic_sta = atoi(row[231]);
entry.heroic_cha = atoi(row[232]);
entry.heroic_pr = atoi(row[233]);
entry.heroic_dr = atoi(row[234]);
entry.heroic_fr = atoi(row[235]);
entry.heroic_cr = atoi(row[236]);
entry.heroic_mr = atoi(row[237]);
entry.heroic_svcorrup = atoi(row[238]);
entry.healamt = atoi(row[239]);
entry.spelldmg = atoi(row[240]);
entry.clairvoyance = atoi(row[241]);
entry.backstabdmg = atoi(row[242]);
entry.created = row[243];
entry.elitematerial = atoi(row[244]);
entry.ldonsellbackrate = atoi(row[245]);
entry.scriptfileid = atoi(row[246]);
entry.expendablearrow = atoi(row[247]);
entry.powersourcecapacity = atoi(row[248]);
entry.bardeffect = atoi(row[249]);
entry.bardeffecttype = atoi(row[250]);
entry.bardlevel2 = atoi(row[251]);
entry.bardlevel = atoi(row[252]);
entry.bardunk1 = atoi(row[253]);
entry.bardunk2 = atoi(row[254]);
entry.bardunk3 = atoi(row[255]);
entry.bardunk4 = atoi(row[256]);
entry.bardunk5 = atoi(row[257]);
entry.bardname = row[258];
entry.bardunk7 = atoi(row[259]);
entry.UNK214 = atoi(row[260]);
entry.UNK219 = atoi(row[261]);
entry.UNK220 = atoi(row[262]);
entry.UNK221 = atoi(row[263]);
entry.heirloom = atoi(row[264]);
entry.UNK223 = atoi(row[265]);
entry.UNK224 = atoi(row[266]);
entry.UNK225 = atoi(row[267]);
entry.UNK226 = atoi(row[268]);
entry.UNK227 = atoi(row[269]);
entry.UNK228 = atoi(row[270]);
entry.UNK229 = atoi(row[271]);
entry.UNK230 = atoi(row[272]);
entry.UNK231 = atoi(row[273]);
entry.UNK232 = atoi(row[274]);
entry.UNK233 = atoi(row[275]);
entry.UNK234 = atoi(row[276]);
entry.placeable = atoi(row[277]);
entry.UNK236 = atoi(row[278]);
entry.UNK237 = atoi(row[279]);
entry.UNK238 = atoi(row[280]);
entry.UNK239 = atoi(row[281]);
entry.UNK240 = atoi(row[282]);
entry.UNK241 = atoi(row[283]);
entry.epicitem = atoi(row[284]);
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_ITEMS_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return launcher_entry;
}
launcher_entry = InstanceListRepository::NewEntity();
launcher_entry = LauncherRepository::NewEntity();
return launcher_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<Launcher> GetWhere(std::string where_filter)
{
std::vector<Launcher> 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) {
Launcher entry{};
entry.name = row[0];
entry.dynamics = atoi(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_LAUNCHER_REPOSITORY_H

View File

@ -200,7 +200,7 @@ public:
return launcher_zones_entry;
}
launcher_zones_entry = InstanceListRepository::NewEntity();
launcher_zones_entry = LauncherZonesRepository::NewEntity();
return launcher_zones_entry;
}
@ -258,6 +258,47 @@ public:
return all_entries;
}
static std::vector<LauncherZones> GetWhere(std::string where_filter)
{
std::vector<LauncherZones> 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];
entry.zone = 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_LAUNCHER_ZONES_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return ldon_trap_entries_entry;
}
ldon_trap_entries_entry = InstanceListRepository::NewEntity();
ldon_trap_entries_entry = LdonTrapEntriesRepository::NewEntity();
return ldon_trap_entries_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<LdonTrapEntries> GetWhere(std::string where_filter)
{
std::vector<LdonTrapEntries> 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) {
LdonTrapEntries entry{};
entry.id = atoi(row[0]);
entry.trap_id = atoi(row[1]);
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_LDON_TRAP_ENTRIES_REPOSITORY_H

View File

@ -214,7 +214,7 @@ public:
return ldon_trap_templates_entry;
}
ldon_trap_templates_entry = InstanceListRepository::NewEntity();
ldon_trap_templates_entry = LdonTrapTemplatesRepository::NewEntity();
return ldon_trap_templates_entry;
}
@ -277,6 +277,49 @@ public:
return all_entries;
}
static std::vector<LdonTrapTemplates> GetWhere(std::string where_filter)
{
std::vector<LdonTrapTemplates> 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) {
LdonTrapTemplates entry{};
entry.id = atoi(row[0]);
entry.type = atoi(row[1]);
entry.spell_id = atoi(row[2]);
entry.skill = atoi(row[3]);
entry.locked = atoi(row[4]);
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_LDON_TRAP_TEMPLATES_REPOSITORY_H

View File

@ -164,8 +164,8 @@ public:
auto columns = Columns();
update_values.push_back(columns[1] + " = '" + EscapeString(level_exp_mods_entry.exp_mod) + "'");
update_values.push_back(columns[2] + " = '" + EscapeString(level_exp_mods_entry.aa_exp_mod) + "'");
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));
auto results = database.QueryDatabase(
fmt::format(
@ -186,8 +186,8 @@ public:
{
std::vector<std::string> insert_values;
insert_values.push_back("'" + EscapeString(level_exp_mods_entry.exp_mod) + "'");
insert_values.push_back("'" + EscapeString(level_exp_mods_entry.aa_exp_mod) + "'");
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));
auto results = database.QueryDatabase(
fmt::format(
@ -202,7 +202,7 @@ public:
return level_exp_mods_entry;
}
level_exp_mods_entry = InstanceListRepository::NewEntity();
level_exp_mods_entry = LevelExpModsRepository::NewEntity();
return level_exp_mods_entry;
}
@ -216,8 +216,8 @@ public:
for (auto &level_exp_mods_entry: level_exp_mods_entries) {
std::vector<std::string> insert_values;
insert_values.push_back("'" + EscapeString(level_exp_mods_entry.exp_mod) + "'");
insert_values.push_back("'" + EscapeString(level_exp_mods_entry.aa_exp_mod) + "'");
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));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -261,6 +261,47 @@ public:
return all_entries;
}
static std::vector<LevelExpMods> GetWhere(std::string where_filter)
{
std::vector<LevelExpMods> 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) {
LevelExpMods entry{};
entry.level = atoi(row[0]);
entry.exp_mod = atof(row[1]);
entry.aa_exp_mod = atof(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_LEVEL_EXP_MODS_REPOSITORY_H

View File

@ -236,7 +236,7 @@ public:
return lfguild_entry;
}
lfguild_entry = InstanceListRepository::NewEntity();
lfguild_entry = LfguildRepository::NewEntity();
return lfguild_entry;
}
@ -306,6 +306,53 @@ public:
return all_entries;
}
static std::vector<Lfguild> GetWhere(std::string where_filter)
{
std::vector<Lfguild> 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) {
Lfguild entry{};
entry.type = atoi(row[0]);
entry.name = row[1];
entry.comment = row[2];
entry.fromlevel = atoi(row[3]);
entry.tolevel = atoi(row[4]);
entry.classes = atoi(row[5]);
entry.aacount = atoi(row[6]);
entry.timezone = atoi(row[7]);
entry.timeposted = atoi(row[8]);
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_LFGUILD_REPOSITORY_H

View File

@ -238,7 +238,7 @@ public:
return login_accounts_entry;
}
login_accounts_entry = InstanceListRepository::NewEntity();
login_accounts_entry = LoginAccountsRepository::NewEntity();
return login_accounts_entry;
}
@ -309,6 +309,53 @@ public:
return all_entries;
}
static std::vector<LoginAccounts> GetWhere(std::string where_filter)
{
std::vector<LoginAccounts> 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) {
LoginAccounts entry{};
entry.id = atoi(row[0]);
entry.account_name = row[1];
entry.account_password = row[2];
entry.account_email = row[3];
entry.source_loginserver = row[4];
entry.last_ip_address = row[5];
entry.last_login_date = row[6];
entry.created_at = row[7];
entry.updated_at = row[8];
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_LOGIN_ACCOUNTS_REPOSITORY_H

View File

@ -220,7 +220,7 @@ public:
return login_api_tokens_entry;
}
login_api_tokens_entry = InstanceListRepository::NewEntity();
login_api_tokens_entry = LoginApiTokensRepository::NewEntity();
return login_api_tokens_entry;
}
@ -285,6 +285,50 @@ public:
return all_entries;
}
static std::vector<LoginApiTokens> GetWhere(std::string where_filter)
{
std::vector<LoginApiTokens> 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) {
LoginApiTokens entry{};
entry.id = atoi(row[0]);
entry.token = row[1];
entry.can_write = atoi(row[2]);
entry.can_read = atoi(row[3]);
entry.created_at = row[4];
entry.updated_at = row[5];
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_LOGIN_API_TOKENS_REPOSITORY_H

View File

@ -232,7 +232,7 @@ public:
return login_server_admins_entry;
}
login_server_admins_entry = InstanceListRepository::NewEntity();
login_server_admins_entry = LoginServerAdminsRepository::NewEntity();
return login_server_admins_entry;
}
@ -301,6 +301,52 @@ public:
return all_entries;
}
static std::vector<LoginServerAdmins> GetWhere(std::string where_filter)
{
std::vector<LoginServerAdmins> 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) {
LoginServerAdmins entry{};
entry.id = atoi(row[0]);
entry.account_name = row[1];
entry.account_password = row[2];
entry.first_name = row[3];
entry.last_name = row[4];
entry.email = row[5];
entry.registration_date = row[6];
entry.registration_ip_address = row[7];
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_LOGIN_SERVER_ADMINS_REPOSITORY_H

View File

@ -196,7 +196,7 @@ public:
return login_server_list_types_entry;
}
login_server_list_types_entry = InstanceListRepository::NewEntity();
login_server_list_types_entry = LoginServerListTypesRepository::NewEntity();
return login_server_list_types_entry;
}
@ -253,6 +253,46 @@ public:
return all_entries;
}
static std::vector<LoginServerListTypes> GetWhere(std::string where_filter)
{
std::vector<LoginServerListTypes> 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) {
LoginServerListTypes entry{};
entry.id = atoi(row[0]);
entry.description = 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_LOGIN_SERVER_LIST_TYPES_REPOSITORY_H

View File

@ -244,7 +244,7 @@ public:
return login_world_servers_entry;
}
login_world_servers_entry = InstanceListRepository::NewEntity();
login_world_servers_entry = LoginWorldServersRepository::NewEntity();
return login_world_servers_entry;
}
@ -317,6 +317,54 @@ public:
return all_entries;
}
static std::vector<LoginWorldServers> GetWhere(std::string where_filter)
{
std::vector<LoginWorldServers> 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) {
LoginWorldServers entry{};
entry.id = atoi(row[0]);
entry.long_name = row[1];
entry.short_name = row[2];
entry.tag_description = row[3];
entry.login_server_list_type_id = atoi(row[4]);
entry.last_login_date = row[5];
entry.last_ip_address = row[6];
entry.login_server_admin_id = atoi(row[7]);
entry.is_server_trusted = atoi(row[8]);
entry.note = row[9];
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_LOGIN_WORLD_SERVERS_REPOSITORY_H

View File

@ -214,7 +214,7 @@ public:
return logsys_categories_entry;
}
logsys_categories_entry = InstanceListRepository::NewEntity();
logsys_categories_entry = LogsysCategoriesRepository::NewEntity();
return logsys_categories_entry;
}
@ -277,6 +277,49 @@ public:
return all_entries;
}
static std::vector<LogsysCategories> GetWhere(std::string where_filter)
{
std::vector<LogsysCategories> 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) {
LogsysCategories entry{};
entry.log_category_id = atoi(row[0]);
entry.log_category_description = row[1];
entry.log_to_console = atoi(row[2]);
entry.log_to_file = atoi(row[3]);
entry.log_to_gmsay = atoi(row[4]);
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_LOGSYS_CATEGORIES_REPOSITORY_H

View File

@ -190,8 +190,8 @@ public:
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] + " = '" + EscapeString(lootdrop_entries_entry.chance) + "'");
update_values.push_back(columns[5] + " = '" + EscapeString(lootdrop_entries_entry.disabled_chance) + "'");
update_values.push_back(columns[4] + " = " + std::to_string(lootdrop_entries_entry.chance));
update_values.push_back(columns[5] + " = " + std::to_string(lootdrop_entries_entry.disabled_chance));
update_values.push_back(columns[6] + " = " + std::to_string(lootdrop_entries_entry.minlevel));
update_values.push_back(columns[7] + " = " + std::to_string(lootdrop_entries_entry.maxlevel));
update_values.push_back(columns[8] + " = " + std::to_string(lootdrop_entries_entry.multiplier));
@ -217,8 +217,8 @@ public:
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("'" + EscapeString(lootdrop_entries_entry.chance) + "'");
insert_values.push_back("'" + EscapeString(lootdrop_entries_entry.disabled_chance) + "'");
insert_values.push_back(std::to_string(lootdrop_entries_entry.chance));
insert_values.push_back(std::to_string(lootdrop_entries_entry.disabled_chance));
insert_values.push_back(std::to_string(lootdrop_entries_entry.minlevel));
insert_values.push_back(std::to_string(lootdrop_entries_entry.maxlevel));
insert_values.push_back(std::to_string(lootdrop_entries_entry.multiplier));
@ -236,7 +236,7 @@ public:
return lootdrop_entries_entry;
}
lootdrop_entries_entry = InstanceListRepository::NewEntity();
lootdrop_entries_entry = LootdropEntriesRepository::NewEntity();
return lootdrop_entries_entry;
}
@ -252,8 +252,8 @@ public:
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("'" + EscapeString(lootdrop_entries_entry.chance) + "'");
insert_values.push_back("'" + EscapeString(lootdrop_entries_entry.disabled_chance) + "'");
insert_values.push_back(std::to_string(lootdrop_entries_entry.chance));
insert_values.push_back(std::to_string(lootdrop_entries_entry.disabled_chance));
insert_values.push_back(std::to_string(lootdrop_entries_entry.minlevel));
insert_values.push_back(std::to_string(lootdrop_entries_entry.maxlevel));
insert_values.push_back(std::to_string(lootdrop_entries_entry.multiplier));
@ -306,6 +306,53 @@ public:
return all_entries;
}
static std::vector<LootdropEntries> GetWhere(std::string where_filter)
{
std::vector<LootdropEntries> 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) {
LootdropEntries entry{};
entry.lootdrop_id = atoi(row[0]);
entry.item_id = atoi(row[1]);
entry.item_charges = atoi(row[2]);
entry.equip_item = atoi(row[3]);
entry.chance = atof(row[4]);
entry.disabled_chance = atof(row[5]);
entry.minlevel = atoi(row[6]);
entry.maxlevel = atoi(row[7]);
entry.multiplier = atoi(row[8]);
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_LOOTDROP_ENTRIES_REPOSITORY_H

Some files were not shown because too many files have changed in this diff Show More