diff --git a/common/repositories/base/base_character_data_repository.h b/common/repositories/base/base_character_data_repository.h index 7914d50c4..16a69da14 100644 --- a/common/repositories/base/base_character_data_repository.h +++ b/common/repositories/base/base_character_data_repository.h @@ -16,6 +16,7 @@ #include "../../strings.h" #include + class BaseCharacterDataRepository { public: struct CharacterData { @@ -57,6 +58,7 @@ public: uint8_t ability_time_minutes; uint8_t ability_time_hours; uint32_t exp; + uint8_t exp_enabled; uint32_t aa_points_spent; uint32_t aa_exp; uint32_t aa_points; @@ -169,6 +171,7 @@ public: "ability_time_minutes", "ability_time_hours", "exp", + "exp_enabled", "aa_points_spent", "aa_exp", "aa_points", @@ -277,6 +280,7 @@ public: "ability_time_minutes", "ability_time_hours", "exp", + "exp_enabled", "aa_points_spent", "aa_exp", "aa_points", @@ -419,6 +423,7 @@ public: e.ability_time_minutes = 0; e.ability_time_hours = 0; e.exp = 0; + e.exp_enabled = 1; e.aa_points_spent = 0; e.aa_exp = 0; e.aa_points = 0; @@ -508,8 +513,9 @@ public: { auto results = db.QueryDatabase( fmt::format( - "{} WHERE id = {} LIMIT 1", + "{} WHERE {} = {} LIMIT 1", BaseSelect(), + PrimaryKey(), character_data_id ) ); @@ -556,70 +562,71 @@ public: e.ability_time_minutes = static_cast(strtoul(row[35], nullptr, 10)); e.ability_time_hours = static_cast(strtoul(row[36], nullptr, 10)); e.exp = static_cast(strtoul(row[37], nullptr, 10)); - e.aa_points_spent = static_cast(strtoul(row[38], nullptr, 10)); - e.aa_exp = static_cast(strtoul(row[39], nullptr, 10)); - e.aa_points = static_cast(strtoul(row[40], nullptr, 10)); - e.group_leadership_exp = static_cast(strtoul(row[41], nullptr, 10)); - e.raid_leadership_exp = static_cast(strtoul(row[42], nullptr, 10)); - e.group_leadership_points = static_cast(strtoul(row[43], nullptr, 10)); - e.raid_leadership_points = static_cast(strtoul(row[44], nullptr, 10)); - e.points = static_cast(strtoul(row[45], nullptr, 10)); - e.cur_hp = static_cast(strtoul(row[46], nullptr, 10)); - e.mana = static_cast(strtoul(row[47], nullptr, 10)); - e.endurance = static_cast(strtoul(row[48], nullptr, 10)); - e.intoxication = static_cast(strtoul(row[49], nullptr, 10)); - e.str = static_cast(strtoul(row[50], nullptr, 10)); - e.sta = static_cast(strtoul(row[51], nullptr, 10)); - e.cha = static_cast(strtoul(row[52], nullptr, 10)); - e.dex = static_cast(strtoul(row[53], nullptr, 10)); - e.int_ = static_cast(strtoul(row[54], nullptr, 10)); - e.agi = static_cast(strtoul(row[55], nullptr, 10)); - e.wis = static_cast(strtoul(row[56], nullptr, 10)); - e.zone_change_count = static_cast(strtoul(row[57], nullptr, 10)); - e.toxicity = static_cast(strtoul(row[58], nullptr, 10)); - e.hunger_level = static_cast(strtoul(row[59], nullptr, 10)); - e.thirst_level = static_cast(strtoul(row[60], nullptr, 10)); - e.ability_up = static_cast(strtoul(row[61], nullptr, 10)); - e.ldon_points_guk = static_cast(strtoul(row[62], nullptr, 10)); - e.ldon_points_mir = static_cast(strtoul(row[63], nullptr, 10)); - e.ldon_points_mmc = static_cast(strtoul(row[64], nullptr, 10)); - e.ldon_points_ruj = static_cast(strtoul(row[65], nullptr, 10)); - e.ldon_points_tak = static_cast(strtoul(row[66], nullptr, 10)); - e.ldon_points_available = static_cast(strtoul(row[67], nullptr, 10)); - e.tribute_time_remaining = static_cast(strtoul(row[68], nullptr, 10)); - e.career_tribute_points = static_cast(strtoul(row[69], nullptr, 10)); - e.tribute_points = static_cast(strtoul(row[70], nullptr, 10)); - e.tribute_active = static_cast(strtoul(row[71], nullptr, 10)); - e.pvp_status = static_cast(strtoul(row[72], nullptr, 10)); - e.pvp_kills = static_cast(strtoul(row[73], nullptr, 10)); - e.pvp_deaths = static_cast(strtoul(row[74], nullptr, 10)); - e.pvp_current_points = static_cast(strtoul(row[75], nullptr, 10)); - e.pvp_career_points = static_cast(strtoul(row[76], nullptr, 10)); - e.pvp_best_kill_streak = static_cast(strtoul(row[77], nullptr, 10)); - e.pvp_worst_death_streak = static_cast(strtoul(row[78], nullptr, 10)); - e.pvp_current_kill_streak = static_cast(strtoul(row[79], nullptr, 10)); - e.pvp2 = static_cast(strtoul(row[80], nullptr, 10)); - e.pvp_type = static_cast(strtoul(row[81], nullptr, 10)); - e.show_helm = static_cast(strtoul(row[82], nullptr, 10)); - e.group_auto_consent = static_cast(strtoul(row[83], nullptr, 10)); - e.raid_auto_consent = static_cast(strtoul(row[84], nullptr, 10)); - e.guild_auto_consent = static_cast(strtoul(row[85], nullptr, 10)); - e.leadership_exp_on = static_cast(strtoul(row[86], nullptr, 10)); - e.RestTimer = static_cast(strtoul(row[87], nullptr, 10)); - e.air_remaining = static_cast(strtoul(row[88], nullptr, 10)); - e.autosplit_enabled = static_cast(strtoul(row[89], nullptr, 10)); - e.lfp = static_cast(strtoul(row[90], nullptr, 10)); - e.lfg = static_cast(strtoul(row[91], nullptr, 10)); - e.mailkey = row[92] ? row[92] : ""; - e.xtargets = static_cast(strtoul(row[93], nullptr, 10)); - e.firstlogon = static_cast(atoi(row[94])); - e.e_aa_effects = static_cast(strtoul(row[95], nullptr, 10)); - e.e_percent_to_aa = static_cast(strtoul(row[96], nullptr, 10)); - e.e_expended_aa_spent = static_cast(strtoul(row[97], nullptr, 10)); - e.aa_points_spent_old = static_cast(strtoul(row[98], nullptr, 10)); - e.aa_points_old = static_cast(strtoul(row[99], nullptr, 10)); - e.e_last_invsnapshot = static_cast(strtoul(row[100], nullptr, 10)); - e.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10); + e.exp_enabled = static_cast(strtoul(row[38], nullptr, 10)); + e.aa_points_spent = static_cast(strtoul(row[39], nullptr, 10)); + e.aa_exp = static_cast(strtoul(row[40], nullptr, 10)); + e.aa_points = static_cast(strtoul(row[41], nullptr, 10)); + e.group_leadership_exp = static_cast(strtoul(row[42], nullptr, 10)); + e.raid_leadership_exp = static_cast(strtoul(row[43], nullptr, 10)); + e.group_leadership_points = static_cast(strtoul(row[44], nullptr, 10)); + e.raid_leadership_points = static_cast(strtoul(row[45], nullptr, 10)); + e.points = static_cast(strtoul(row[46], nullptr, 10)); + e.cur_hp = static_cast(strtoul(row[47], nullptr, 10)); + e.mana = static_cast(strtoul(row[48], nullptr, 10)); + e.endurance = static_cast(strtoul(row[49], nullptr, 10)); + e.intoxication = static_cast(strtoul(row[50], nullptr, 10)); + e.str = static_cast(strtoul(row[51], nullptr, 10)); + e.sta = static_cast(strtoul(row[52], nullptr, 10)); + e.cha = static_cast(strtoul(row[53], nullptr, 10)); + e.dex = static_cast(strtoul(row[54], nullptr, 10)); + e.int_ = static_cast(strtoul(row[55], nullptr, 10)); + e.agi = static_cast(strtoul(row[56], nullptr, 10)); + e.wis = static_cast(strtoul(row[57], nullptr, 10)); + e.zone_change_count = static_cast(strtoul(row[58], nullptr, 10)); + e.toxicity = static_cast(strtoul(row[59], nullptr, 10)); + e.hunger_level = static_cast(strtoul(row[60], nullptr, 10)); + e.thirst_level = static_cast(strtoul(row[61], nullptr, 10)); + e.ability_up = static_cast(strtoul(row[62], nullptr, 10)); + e.ldon_points_guk = static_cast(strtoul(row[63], nullptr, 10)); + e.ldon_points_mir = static_cast(strtoul(row[64], nullptr, 10)); + e.ldon_points_mmc = static_cast(strtoul(row[65], nullptr, 10)); + e.ldon_points_ruj = static_cast(strtoul(row[66], nullptr, 10)); + e.ldon_points_tak = static_cast(strtoul(row[67], nullptr, 10)); + e.ldon_points_available = static_cast(strtoul(row[68], nullptr, 10)); + e.tribute_time_remaining = static_cast(strtoul(row[69], nullptr, 10)); + e.career_tribute_points = static_cast(strtoul(row[70], nullptr, 10)); + e.tribute_points = static_cast(strtoul(row[71], nullptr, 10)); + e.tribute_active = static_cast(strtoul(row[72], nullptr, 10)); + e.pvp_status = static_cast(strtoul(row[73], nullptr, 10)); + e.pvp_kills = static_cast(strtoul(row[74], nullptr, 10)); + e.pvp_deaths = static_cast(strtoul(row[75], nullptr, 10)); + e.pvp_current_points = static_cast(strtoul(row[76], nullptr, 10)); + e.pvp_career_points = static_cast(strtoul(row[77], nullptr, 10)); + e.pvp_best_kill_streak = static_cast(strtoul(row[78], nullptr, 10)); + e.pvp_worst_death_streak = static_cast(strtoul(row[79], nullptr, 10)); + e.pvp_current_kill_streak = static_cast(strtoul(row[80], nullptr, 10)); + e.pvp2 = static_cast(strtoul(row[81], nullptr, 10)); + e.pvp_type = static_cast(strtoul(row[82], nullptr, 10)); + e.show_helm = static_cast(strtoul(row[83], nullptr, 10)); + e.group_auto_consent = static_cast(strtoul(row[84], nullptr, 10)); + e.raid_auto_consent = static_cast(strtoul(row[85], nullptr, 10)); + e.guild_auto_consent = static_cast(strtoul(row[86], nullptr, 10)); + e.leadership_exp_on = static_cast(strtoul(row[87], nullptr, 10)); + e.RestTimer = static_cast(strtoul(row[88], nullptr, 10)); + e.air_remaining = static_cast(strtoul(row[89], nullptr, 10)); + e.autosplit_enabled = static_cast(strtoul(row[90], nullptr, 10)); + e.lfp = static_cast(strtoul(row[91], nullptr, 10)); + e.lfg = static_cast(strtoul(row[92], nullptr, 10)); + e.mailkey = row[93] ? row[93] : ""; + e.xtargets = static_cast(strtoul(row[94], nullptr, 10)); + e.firstlogon = static_cast(atoi(row[95])); + e.e_aa_effects = static_cast(strtoul(row[96], nullptr, 10)); + e.e_percent_to_aa = static_cast(strtoul(row[97], nullptr, 10)); + e.e_expended_aa_spent = static_cast(strtoul(row[98], nullptr, 10)); + e.aa_points_spent_old = static_cast(strtoul(row[99], nullptr, 10)); + e.aa_points_old = static_cast(strtoul(row[100], nullptr, 10)); + e.e_last_invsnapshot = static_cast(strtoul(row[101], nullptr, 10)); + e.deleted_at = strtoll(row[102] ? row[102] : "-1", nullptr, 10); return e; } @@ -690,70 +697,71 @@ public: v.push_back(columns[35] + " = " + std::to_string(e.ability_time_minutes)); v.push_back(columns[36] + " = " + std::to_string(e.ability_time_hours)); v.push_back(columns[37] + " = " + std::to_string(e.exp)); - v.push_back(columns[38] + " = " + std::to_string(e.aa_points_spent)); - v.push_back(columns[39] + " = " + std::to_string(e.aa_exp)); - v.push_back(columns[40] + " = " + std::to_string(e.aa_points)); - v.push_back(columns[41] + " = " + std::to_string(e.group_leadership_exp)); - v.push_back(columns[42] + " = " + std::to_string(e.raid_leadership_exp)); - v.push_back(columns[43] + " = " + std::to_string(e.group_leadership_points)); - v.push_back(columns[44] + " = " + std::to_string(e.raid_leadership_points)); - v.push_back(columns[45] + " = " + std::to_string(e.points)); - v.push_back(columns[46] + " = " + std::to_string(e.cur_hp)); - v.push_back(columns[47] + " = " + std::to_string(e.mana)); - v.push_back(columns[48] + " = " + std::to_string(e.endurance)); - v.push_back(columns[49] + " = " + std::to_string(e.intoxication)); - v.push_back(columns[50] + " = " + std::to_string(e.str)); - v.push_back(columns[51] + " = " + std::to_string(e.sta)); - v.push_back(columns[52] + " = " + std::to_string(e.cha)); - v.push_back(columns[53] + " = " + std::to_string(e.dex)); - v.push_back(columns[54] + " = " + std::to_string(e.int_)); - v.push_back(columns[55] + " = " + std::to_string(e.agi)); - v.push_back(columns[56] + " = " + std::to_string(e.wis)); - v.push_back(columns[57] + " = " + std::to_string(e.zone_change_count)); - v.push_back(columns[58] + " = " + std::to_string(e.toxicity)); - v.push_back(columns[59] + " = " + std::to_string(e.hunger_level)); - v.push_back(columns[60] + " = " + std::to_string(e.thirst_level)); - v.push_back(columns[61] + " = " + std::to_string(e.ability_up)); - v.push_back(columns[62] + " = " + std::to_string(e.ldon_points_guk)); - v.push_back(columns[63] + " = " + std::to_string(e.ldon_points_mir)); - v.push_back(columns[64] + " = " + std::to_string(e.ldon_points_mmc)); - v.push_back(columns[65] + " = " + std::to_string(e.ldon_points_ruj)); - v.push_back(columns[66] + " = " + std::to_string(e.ldon_points_tak)); - v.push_back(columns[67] + " = " + std::to_string(e.ldon_points_available)); - v.push_back(columns[68] + " = " + std::to_string(e.tribute_time_remaining)); - v.push_back(columns[69] + " = " + std::to_string(e.career_tribute_points)); - v.push_back(columns[70] + " = " + std::to_string(e.tribute_points)); - v.push_back(columns[71] + " = " + std::to_string(e.tribute_active)); - v.push_back(columns[72] + " = " + std::to_string(e.pvp_status)); - v.push_back(columns[73] + " = " + std::to_string(e.pvp_kills)); - v.push_back(columns[74] + " = " + std::to_string(e.pvp_deaths)); - v.push_back(columns[75] + " = " + std::to_string(e.pvp_current_points)); - v.push_back(columns[76] + " = " + std::to_string(e.pvp_career_points)); - v.push_back(columns[77] + " = " + std::to_string(e.pvp_best_kill_streak)); - v.push_back(columns[78] + " = " + std::to_string(e.pvp_worst_death_streak)); - v.push_back(columns[79] + " = " + std::to_string(e.pvp_current_kill_streak)); - v.push_back(columns[80] + " = " + std::to_string(e.pvp2)); - v.push_back(columns[81] + " = " + std::to_string(e.pvp_type)); - v.push_back(columns[82] + " = " + std::to_string(e.show_helm)); - v.push_back(columns[83] + " = " + std::to_string(e.group_auto_consent)); - v.push_back(columns[84] + " = " + std::to_string(e.raid_auto_consent)); - v.push_back(columns[85] + " = " + std::to_string(e.guild_auto_consent)); - v.push_back(columns[86] + " = " + std::to_string(e.leadership_exp_on)); - v.push_back(columns[87] + " = " + std::to_string(e.RestTimer)); - v.push_back(columns[88] + " = " + std::to_string(e.air_remaining)); - v.push_back(columns[89] + " = " + std::to_string(e.autosplit_enabled)); - v.push_back(columns[90] + " = " + std::to_string(e.lfp)); - v.push_back(columns[91] + " = " + std::to_string(e.lfg)); - v.push_back(columns[92] + " = '" + Strings::Escape(e.mailkey) + "'"); - v.push_back(columns[93] + " = " + std::to_string(e.xtargets)); - v.push_back(columns[94] + " = " + std::to_string(e.firstlogon)); - v.push_back(columns[95] + " = " + std::to_string(e.e_aa_effects)); - v.push_back(columns[96] + " = " + std::to_string(e.e_percent_to_aa)); - v.push_back(columns[97] + " = " + std::to_string(e.e_expended_aa_spent)); - v.push_back(columns[98] + " = " + std::to_string(e.aa_points_spent_old)); - v.push_back(columns[99] + " = " + std::to_string(e.aa_points_old)); - v.push_back(columns[100] + " = " + std::to_string(e.e_last_invsnapshot)); - v.push_back(columns[101] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")"); + v.push_back(columns[38] + " = " + std::to_string(e.exp_enabled)); + v.push_back(columns[39] + " = " + std::to_string(e.aa_points_spent)); + v.push_back(columns[40] + " = " + std::to_string(e.aa_exp)); + v.push_back(columns[41] + " = " + std::to_string(e.aa_points)); + v.push_back(columns[42] + " = " + std::to_string(e.group_leadership_exp)); + v.push_back(columns[43] + " = " + std::to_string(e.raid_leadership_exp)); + v.push_back(columns[44] + " = " + std::to_string(e.group_leadership_points)); + v.push_back(columns[45] + " = " + std::to_string(e.raid_leadership_points)); + v.push_back(columns[46] + " = " + std::to_string(e.points)); + v.push_back(columns[47] + " = " + std::to_string(e.cur_hp)); + v.push_back(columns[48] + " = " + std::to_string(e.mana)); + v.push_back(columns[49] + " = " + std::to_string(e.endurance)); + v.push_back(columns[50] + " = " + std::to_string(e.intoxication)); + v.push_back(columns[51] + " = " + std::to_string(e.str)); + v.push_back(columns[52] + " = " + std::to_string(e.sta)); + v.push_back(columns[53] + " = " + std::to_string(e.cha)); + v.push_back(columns[54] + " = " + std::to_string(e.dex)); + v.push_back(columns[55] + " = " + std::to_string(e.int_)); + v.push_back(columns[56] + " = " + std::to_string(e.agi)); + v.push_back(columns[57] + " = " + std::to_string(e.wis)); + v.push_back(columns[58] + " = " + std::to_string(e.zone_change_count)); + v.push_back(columns[59] + " = " + std::to_string(e.toxicity)); + v.push_back(columns[60] + " = " + std::to_string(e.hunger_level)); + v.push_back(columns[61] + " = " + std::to_string(e.thirst_level)); + v.push_back(columns[62] + " = " + std::to_string(e.ability_up)); + v.push_back(columns[63] + " = " + std::to_string(e.ldon_points_guk)); + v.push_back(columns[64] + " = " + std::to_string(e.ldon_points_mir)); + v.push_back(columns[65] + " = " + std::to_string(e.ldon_points_mmc)); + v.push_back(columns[66] + " = " + std::to_string(e.ldon_points_ruj)); + v.push_back(columns[67] + " = " + std::to_string(e.ldon_points_tak)); + v.push_back(columns[68] + " = " + std::to_string(e.ldon_points_available)); + v.push_back(columns[69] + " = " + std::to_string(e.tribute_time_remaining)); + v.push_back(columns[70] + " = " + std::to_string(e.career_tribute_points)); + v.push_back(columns[71] + " = " + std::to_string(e.tribute_points)); + v.push_back(columns[72] + " = " + std::to_string(e.tribute_active)); + v.push_back(columns[73] + " = " + std::to_string(e.pvp_status)); + v.push_back(columns[74] + " = " + std::to_string(e.pvp_kills)); + v.push_back(columns[75] + " = " + std::to_string(e.pvp_deaths)); + v.push_back(columns[76] + " = " + std::to_string(e.pvp_current_points)); + v.push_back(columns[77] + " = " + std::to_string(e.pvp_career_points)); + v.push_back(columns[78] + " = " + std::to_string(e.pvp_best_kill_streak)); + v.push_back(columns[79] + " = " + std::to_string(e.pvp_worst_death_streak)); + v.push_back(columns[80] + " = " + std::to_string(e.pvp_current_kill_streak)); + v.push_back(columns[81] + " = " + std::to_string(e.pvp2)); + v.push_back(columns[82] + " = " + std::to_string(e.pvp_type)); + v.push_back(columns[83] + " = " + std::to_string(e.show_helm)); + v.push_back(columns[84] + " = " + std::to_string(e.group_auto_consent)); + v.push_back(columns[85] + " = " + std::to_string(e.raid_auto_consent)); + v.push_back(columns[86] + " = " + std::to_string(e.guild_auto_consent)); + v.push_back(columns[87] + " = " + std::to_string(e.leadership_exp_on)); + v.push_back(columns[88] + " = " + std::to_string(e.RestTimer)); + v.push_back(columns[89] + " = " + std::to_string(e.air_remaining)); + v.push_back(columns[90] + " = " + std::to_string(e.autosplit_enabled)); + v.push_back(columns[91] + " = " + std::to_string(e.lfp)); + v.push_back(columns[92] + " = " + std::to_string(e.lfg)); + v.push_back(columns[93] + " = '" + Strings::Escape(e.mailkey) + "'"); + v.push_back(columns[94] + " = " + std::to_string(e.xtargets)); + v.push_back(columns[95] + " = " + std::to_string(e.firstlogon)); + v.push_back(columns[96] + " = " + std::to_string(e.e_aa_effects)); + v.push_back(columns[97] + " = " + std::to_string(e.e_percent_to_aa)); + v.push_back(columns[98] + " = " + std::to_string(e.e_expended_aa_spent)); + v.push_back(columns[99] + " = " + std::to_string(e.aa_points_spent_old)); + v.push_back(columns[100] + " = " + std::to_string(e.aa_points_old)); + v.push_back(columns[101] + " = " + std::to_string(e.e_last_invsnapshot)); + v.push_back(columns[102] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")"); auto results = db.QueryDatabase( fmt::format( @@ -813,6 +821,7 @@ public: v.push_back(std::to_string(e.ability_time_minutes)); v.push_back(std::to_string(e.ability_time_hours)); v.push_back(std::to_string(e.exp)); + v.push_back(std::to_string(e.exp_enabled)); v.push_back(std::to_string(e.aa_points_spent)); v.push_back(std::to_string(e.aa_exp)); v.push_back(std::to_string(e.aa_points)); @@ -944,6 +953,7 @@ public: v.push_back(std::to_string(e.ability_time_minutes)); v.push_back(std::to_string(e.ability_time_hours)); v.push_back(std::to_string(e.exp)); + v.push_back(std::to_string(e.exp_enabled)); v.push_back(std::to_string(e.aa_points_spent)); v.push_back(std::to_string(e.aa_exp)); v.push_back(std::to_string(e.aa_points)); @@ -1079,70 +1089,71 @@ public: e.ability_time_minutes = static_cast(strtoul(row[35], nullptr, 10)); e.ability_time_hours = static_cast(strtoul(row[36], nullptr, 10)); e.exp = static_cast(strtoul(row[37], nullptr, 10)); - e.aa_points_spent = static_cast(strtoul(row[38], nullptr, 10)); - e.aa_exp = static_cast(strtoul(row[39], nullptr, 10)); - e.aa_points = static_cast(strtoul(row[40], nullptr, 10)); - e.group_leadership_exp = static_cast(strtoul(row[41], nullptr, 10)); - e.raid_leadership_exp = static_cast(strtoul(row[42], nullptr, 10)); - e.group_leadership_points = static_cast(strtoul(row[43], nullptr, 10)); - e.raid_leadership_points = static_cast(strtoul(row[44], nullptr, 10)); - e.points = static_cast(strtoul(row[45], nullptr, 10)); - e.cur_hp = static_cast(strtoul(row[46], nullptr, 10)); - e.mana = static_cast(strtoul(row[47], nullptr, 10)); - e.endurance = static_cast(strtoul(row[48], nullptr, 10)); - e.intoxication = static_cast(strtoul(row[49], nullptr, 10)); - e.str = static_cast(strtoul(row[50], nullptr, 10)); - e.sta = static_cast(strtoul(row[51], nullptr, 10)); - e.cha = static_cast(strtoul(row[52], nullptr, 10)); - e.dex = static_cast(strtoul(row[53], nullptr, 10)); - e.int_ = static_cast(strtoul(row[54], nullptr, 10)); - e.agi = static_cast(strtoul(row[55], nullptr, 10)); - e.wis = static_cast(strtoul(row[56], nullptr, 10)); - e.zone_change_count = static_cast(strtoul(row[57], nullptr, 10)); - e.toxicity = static_cast(strtoul(row[58], nullptr, 10)); - e.hunger_level = static_cast(strtoul(row[59], nullptr, 10)); - e.thirst_level = static_cast(strtoul(row[60], nullptr, 10)); - e.ability_up = static_cast(strtoul(row[61], nullptr, 10)); - e.ldon_points_guk = static_cast(strtoul(row[62], nullptr, 10)); - e.ldon_points_mir = static_cast(strtoul(row[63], nullptr, 10)); - e.ldon_points_mmc = static_cast(strtoul(row[64], nullptr, 10)); - e.ldon_points_ruj = static_cast(strtoul(row[65], nullptr, 10)); - e.ldon_points_tak = static_cast(strtoul(row[66], nullptr, 10)); - e.ldon_points_available = static_cast(strtoul(row[67], nullptr, 10)); - e.tribute_time_remaining = static_cast(strtoul(row[68], nullptr, 10)); - e.career_tribute_points = static_cast(strtoul(row[69], nullptr, 10)); - e.tribute_points = static_cast(strtoul(row[70], nullptr, 10)); - e.tribute_active = static_cast(strtoul(row[71], nullptr, 10)); - e.pvp_status = static_cast(strtoul(row[72], nullptr, 10)); - e.pvp_kills = static_cast(strtoul(row[73], nullptr, 10)); - e.pvp_deaths = static_cast(strtoul(row[74], nullptr, 10)); - e.pvp_current_points = static_cast(strtoul(row[75], nullptr, 10)); - e.pvp_career_points = static_cast(strtoul(row[76], nullptr, 10)); - e.pvp_best_kill_streak = static_cast(strtoul(row[77], nullptr, 10)); - e.pvp_worst_death_streak = static_cast(strtoul(row[78], nullptr, 10)); - e.pvp_current_kill_streak = static_cast(strtoul(row[79], nullptr, 10)); - e.pvp2 = static_cast(strtoul(row[80], nullptr, 10)); - e.pvp_type = static_cast(strtoul(row[81], nullptr, 10)); - e.show_helm = static_cast(strtoul(row[82], nullptr, 10)); - e.group_auto_consent = static_cast(strtoul(row[83], nullptr, 10)); - e.raid_auto_consent = static_cast(strtoul(row[84], nullptr, 10)); - e.guild_auto_consent = static_cast(strtoul(row[85], nullptr, 10)); - e.leadership_exp_on = static_cast(strtoul(row[86], nullptr, 10)); - e.RestTimer = static_cast(strtoul(row[87], nullptr, 10)); - e.air_remaining = static_cast(strtoul(row[88], nullptr, 10)); - e.autosplit_enabled = static_cast(strtoul(row[89], nullptr, 10)); - e.lfp = static_cast(strtoul(row[90], nullptr, 10)); - e.lfg = static_cast(strtoul(row[91], nullptr, 10)); - e.mailkey = row[92] ? row[92] : ""; - e.xtargets = static_cast(strtoul(row[93], nullptr, 10)); - e.firstlogon = static_cast(atoi(row[94])); - e.e_aa_effects = static_cast(strtoul(row[95], nullptr, 10)); - e.e_percent_to_aa = static_cast(strtoul(row[96], nullptr, 10)); - e.e_expended_aa_spent = static_cast(strtoul(row[97], nullptr, 10)); - e.aa_points_spent_old = static_cast(strtoul(row[98], nullptr, 10)); - e.aa_points_old = static_cast(strtoul(row[99], nullptr, 10)); - e.e_last_invsnapshot = static_cast(strtoul(row[100], nullptr, 10)); - e.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10); + e.exp_enabled = static_cast(strtoul(row[38], nullptr, 10)); + e.aa_points_spent = static_cast(strtoul(row[39], nullptr, 10)); + e.aa_exp = static_cast(strtoul(row[40], nullptr, 10)); + e.aa_points = static_cast(strtoul(row[41], nullptr, 10)); + e.group_leadership_exp = static_cast(strtoul(row[42], nullptr, 10)); + e.raid_leadership_exp = static_cast(strtoul(row[43], nullptr, 10)); + e.group_leadership_points = static_cast(strtoul(row[44], nullptr, 10)); + e.raid_leadership_points = static_cast(strtoul(row[45], nullptr, 10)); + e.points = static_cast(strtoul(row[46], nullptr, 10)); + e.cur_hp = static_cast(strtoul(row[47], nullptr, 10)); + e.mana = static_cast(strtoul(row[48], nullptr, 10)); + e.endurance = static_cast(strtoul(row[49], nullptr, 10)); + e.intoxication = static_cast(strtoul(row[50], nullptr, 10)); + e.str = static_cast(strtoul(row[51], nullptr, 10)); + e.sta = static_cast(strtoul(row[52], nullptr, 10)); + e.cha = static_cast(strtoul(row[53], nullptr, 10)); + e.dex = static_cast(strtoul(row[54], nullptr, 10)); + e.int_ = static_cast(strtoul(row[55], nullptr, 10)); + e.agi = static_cast(strtoul(row[56], nullptr, 10)); + e.wis = static_cast(strtoul(row[57], nullptr, 10)); + e.zone_change_count = static_cast(strtoul(row[58], nullptr, 10)); + e.toxicity = static_cast(strtoul(row[59], nullptr, 10)); + e.hunger_level = static_cast(strtoul(row[60], nullptr, 10)); + e.thirst_level = static_cast(strtoul(row[61], nullptr, 10)); + e.ability_up = static_cast(strtoul(row[62], nullptr, 10)); + e.ldon_points_guk = static_cast(strtoul(row[63], nullptr, 10)); + e.ldon_points_mir = static_cast(strtoul(row[64], nullptr, 10)); + e.ldon_points_mmc = static_cast(strtoul(row[65], nullptr, 10)); + e.ldon_points_ruj = static_cast(strtoul(row[66], nullptr, 10)); + e.ldon_points_tak = static_cast(strtoul(row[67], nullptr, 10)); + e.ldon_points_available = static_cast(strtoul(row[68], nullptr, 10)); + e.tribute_time_remaining = static_cast(strtoul(row[69], nullptr, 10)); + e.career_tribute_points = static_cast(strtoul(row[70], nullptr, 10)); + e.tribute_points = static_cast(strtoul(row[71], nullptr, 10)); + e.tribute_active = static_cast(strtoul(row[72], nullptr, 10)); + e.pvp_status = static_cast(strtoul(row[73], nullptr, 10)); + e.pvp_kills = static_cast(strtoul(row[74], nullptr, 10)); + e.pvp_deaths = static_cast(strtoul(row[75], nullptr, 10)); + e.pvp_current_points = static_cast(strtoul(row[76], nullptr, 10)); + e.pvp_career_points = static_cast(strtoul(row[77], nullptr, 10)); + e.pvp_best_kill_streak = static_cast(strtoul(row[78], nullptr, 10)); + e.pvp_worst_death_streak = static_cast(strtoul(row[79], nullptr, 10)); + e.pvp_current_kill_streak = static_cast(strtoul(row[80], nullptr, 10)); + e.pvp2 = static_cast(strtoul(row[81], nullptr, 10)); + e.pvp_type = static_cast(strtoul(row[82], nullptr, 10)); + e.show_helm = static_cast(strtoul(row[83], nullptr, 10)); + e.group_auto_consent = static_cast(strtoul(row[84], nullptr, 10)); + e.raid_auto_consent = static_cast(strtoul(row[85], nullptr, 10)); + e.guild_auto_consent = static_cast(strtoul(row[86], nullptr, 10)); + e.leadership_exp_on = static_cast(strtoul(row[87], nullptr, 10)); + e.RestTimer = static_cast(strtoul(row[88], nullptr, 10)); + e.air_remaining = static_cast(strtoul(row[89], nullptr, 10)); + e.autosplit_enabled = static_cast(strtoul(row[90], nullptr, 10)); + e.lfp = static_cast(strtoul(row[91], nullptr, 10)); + e.lfg = static_cast(strtoul(row[92], nullptr, 10)); + e.mailkey = row[93] ? row[93] : ""; + e.xtargets = static_cast(strtoul(row[94], nullptr, 10)); + e.firstlogon = static_cast(atoi(row[95])); + e.e_aa_effects = static_cast(strtoul(row[96], nullptr, 10)); + e.e_percent_to_aa = static_cast(strtoul(row[97], nullptr, 10)); + e.e_expended_aa_spent = static_cast(strtoul(row[98], nullptr, 10)); + e.aa_points_spent_old = static_cast(strtoul(row[99], nullptr, 10)); + e.aa_points_old = static_cast(strtoul(row[100], nullptr, 10)); + e.e_last_invsnapshot = static_cast(strtoul(row[101], nullptr, 10)); + e.deleted_at = strtoll(row[102] ? row[102] : "-1", nullptr, 10); all_entries.push_back(e); } @@ -1205,70 +1216,71 @@ public: e.ability_time_minutes = static_cast(strtoul(row[35], nullptr, 10)); e.ability_time_hours = static_cast(strtoul(row[36], nullptr, 10)); e.exp = static_cast(strtoul(row[37], nullptr, 10)); - e.aa_points_spent = static_cast(strtoul(row[38], nullptr, 10)); - e.aa_exp = static_cast(strtoul(row[39], nullptr, 10)); - e.aa_points = static_cast(strtoul(row[40], nullptr, 10)); - e.group_leadership_exp = static_cast(strtoul(row[41], nullptr, 10)); - e.raid_leadership_exp = static_cast(strtoul(row[42], nullptr, 10)); - e.group_leadership_points = static_cast(strtoul(row[43], nullptr, 10)); - e.raid_leadership_points = static_cast(strtoul(row[44], nullptr, 10)); - e.points = static_cast(strtoul(row[45], nullptr, 10)); - e.cur_hp = static_cast(strtoul(row[46], nullptr, 10)); - e.mana = static_cast(strtoul(row[47], nullptr, 10)); - e.endurance = static_cast(strtoul(row[48], nullptr, 10)); - e.intoxication = static_cast(strtoul(row[49], nullptr, 10)); - e.str = static_cast(strtoul(row[50], nullptr, 10)); - e.sta = static_cast(strtoul(row[51], nullptr, 10)); - e.cha = static_cast(strtoul(row[52], nullptr, 10)); - e.dex = static_cast(strtoul(row[53], nullptr, 10)); - e.int_ = static_cast(strtoul(row[54], nullptr, 10)); - e.agi = static_cast(strtoul(row[55], nullptr, 10)); - e.wis = static_cast(strtoul(row[56], nullptr, 10)); - e.zone_change_count = static_cast(strtoul(row[57], nullptr, 10)); - e.toxicity = static_cast(strtoul(row[58], nullptr, 10)); - e.hunger_level = static_cast(strtoul(row[59], nullptr, 10)); - e.thirst_level = static_cast(strtoul(row[60], nullptr, 10)); - e.ability_up = static_cast(strtoul(row[61], nullptr, 10)); - e.ldon_points_guk = static_cast(strtoul(row[62], nullptr, 10)); - e.ldon_points_mir = static_cast(strtoul(row[63], nullptr, 10)); - e.ldon_points_mmc = static_cast(strtoul(row[64], nullptr, 10)); - e.ldon_points_ruj = static_cast(strtoul(row[65], nullptr, 10)); - e.ldon_points_tak = static_cast(strtoul(row[66], nullptr, 10)); - e.ldon_points_available = static_cast(strtoul(row[67], nullptr, 10)); - e.tribute_time_remaining = static_cast(strtoul(row[68], nullptr, 10)); - e.career_tribute_points = static_cast(strtoul(row[69], nullptr, 10)); - e.tribute_points = static_cast(strtoul(row[70], nullptr, 10)); - e.tribute_active = static_cast(strtoul(row[71], nullptr, 10)); - e.pvp_status = static_cast(strtoul(row[72], nullptr, 10)); - e.pvp_kills = static_cast(strtoul(row[73], nullptr, 10)); - e.pvp_deaths = static_cast(strtoul(row[74], nullptr, 10)); - e.pvp_current_points = static_cast(strtoul(row[75], nullptr, 10)); - e.pvp_career_points = static_cast(strtoul(row[76], nullptr, 10)); - e.pvp_best_kill_streak = static_cast(strtoul(row[77], nullptr, 10)); - e.pvp_worst_death_streak = static_cast(strtoul(row[78], nullptr, 10)); - e.pvp_current_kill_streak = static_cast(strtoul(row[79], nullptr, 10)); - e.pvp2 = static_cast(strtoul(row[80], nullptr, 10)); - e.pvp_type = static_cast(strtoul(row[81], nullptr, 10)); - e.show_helm = static_cast(strtoul(row[82], nullptr, 10)); - e.group_auto_consent = static_cast(strtoul(row[83], nullptr, 10)); - e.raid_auto_consent = static_cast(strtoul(row[84], nullptr, 10)); - e.guild_auto_consent = static_cast(strtoul(row[85], nullptr, 10)); - e.leadership_exp_on = static_cast(strtoul(row[86], nullptr, 10)); - e.RestTimer = static_cast(strtoul(row[87], nullptr, 10)); - e.air_remaining = static_cast(strtoul(row[88], nullptr, 10)); - e.autosplit_enabled = static_cast(strtoul(row[89], nullptr, 10)); - e.lfp = static_cast(strtoul(row[90], nullptr, 10)); - e.lfg = static_cast(strtoul(row[91], nullptr, 10)); - e.mailkey = row[92] ? row[92] : ""; - e.xtargets = static_cast(strtoul(row[93], nullptr, 10)); - e.firstlogon = static_cast(atoi(row[94])); - e.e_aa_effects = static_cast(strtoul(row[95], nullptr, 10)); - e.e_percent_to_aa = static_cast(strtoul(row[96], nullptr, 10)); - e.e_expended_aa_spent = static_cast(strtoul(row[97], nullptr, 10)); - e.aa_points_spent_old = static_cast(strtoul(row[98], nullptr, 10)); - e.aa_points_old = static_cast(strtoul(row[99], nullptr, 10)); - e.e_last_invsnapshot = static_cast(strtoul(row[100], nullptr, 10)); - e.deleted_at = strtoll(row[101] ? row[101] : "-1", nullptr, 10); + e.exp_enabled = static_cast(strtoul(row[38], nullptr, 10)); + e.aa_points_spent = static_cast(strtoul(row[39], nullptr, 10)); + e.aa_exp = static_cast(strtoul(row[40], nullptr, 10)); + e.aa_points = static_cast(strtoul(row[41], nullptr, 10)); + e.group_leadership_exp = static_cast(strtoul(row[42], nullptr, 10)); + e.raid_leadership_exp = static_cast(strtoul(row[43], nullptr, 10)); + e.group_leadership_points = static_cast(strtoul(row[44], nullptr, 10)); + e.raid_leadership_points = static_cast(strtoul(row[45], nullptr, 10)); + e.points = static_cast(strtoul(row[46], nullptr, 10)); + e.cur_hp = static_cast(strtoul(row[47], nullptr, 10)); + e.mana = static_cast(strtoul(row[48], nullptr, 10)); + e.endurance = static_cast(strtoul(row[49], nullptr, 10)); + e.intoxication = static_cast(strtoul(row[50], nullptr, 10)); + e.str = static_cast(strtoul(row[51], nullptr, 10)); + e.sta = static_cast(strtoul(row[52], nullptr, 10)); + e.cha = static_cast(strtoul(row[53], nullptr, 10)); + e.dex = static_cast(strtoul(row[54], nullptr, 10)); + e.int_ = static_cast(strtoul(row[55], nullptr, 10)); + e.agi = static_cast(strtoul(row[56], nullptr, 10)); + e.wis = static_cast(strtoul(row[57], nullptr, 10)); + e.zone_change_count = static_cast(strtoul(row[58], nullptr, 10)); + e.toxicity = static_cast(strtoul(row[59], nullptr, 10)); + e.hunger_level = static_cast(strtoul(row[60], nullptr, 10)); + e.thirst_level = static_cast(strtoul(row[61], nullptr, 10)); + e.ability_up = static_cast(strtoul(row[62], nullptr, 10)); + e.ldon_points_guk = static_cast(strtoul(row[63], nullptr, 10)); + e.ldon_points_mir = static_cast(strtoul(row[64], nullptr, 10)); + e.ldon_points_mmc = static_cast(strtoul(row[65], nullptr, 10)); + e.ldon_points_ruj = static_cast(strtoul(row[66], nullptr, 10)); + e.ldon_points_tak = static_cast(strtoul(row[67], nullptr, 10)); + e.ldon_points_available = static_cast(strtoul(row[68], nullptr, 10)); + e.tribute_time_remaining = static_cast(strtoul(row[69], nullptr, 10)); + e.career_tribute_points = static_cast(strtoul(row[70], nullptr, 10)); + e.tribute_points = static_cast(strtoul(row[71], nullptr, 10)); + e.tribute_active = static_cast(strtoul(row[72], nullptr, 10)); + e.pvp_status = static_cast(strtoul(row[73], nullptr, 10)); + e.pvp_kills = static_cast(strtoul(row[74], nullptr, 10)); + e.pvp_deaths = static_cast(strtoul(row[75], nullptr, 10)); + e.pvp_current_points = static_cast(strtoul(row[76], nullptr, 10)); + e.pvp_career_points = static_cast(strtoul(row[77], nullptr, 10)); + e.pvp_best_kill_streak = static_cast(strtoul(row[78], nullptr, 10)); + e.pvp_worst_death_streak = static_cast(strtoul(row[79], nullptr, 10)); + e.pvp_current_kill_streak = static_cast(strtoul(row[80], nullptr, 10)); + e.pvp2 = static_cast(strtoul(row[81], nullptr, 10)); + e.pvp_type = static_cast(strtoul(row[82], nullptr, 10)); + e.show_helm = static_cast(strtoul(row[83], nullptr, 10)); + e.group_auto_consent = static_cast(strtoul(row[84], nullptr, 10)); + e.raid_auto_consent = static_cast(strtoul(row[85], nullptr, 10)); + e.guild_auto_consent = static_cast(strtoul(row[86], nullptr, 10)); + e.leadership_exp_on = static_cast(strtoul(row[87], nullptr, 10)); + e.RestTimer = static_cast(strtoul(row[88], nullptr, 10)); + e.air_remaining = static_cast(strtoul(row[89], nullptr, 10)); + e.autosplit_enabled = static_cast(strtoul(row[90], nullptr, 10)); + e.lfp = static_cast(strtoul(row[91], nullptr, 10)); + e.lfg = static_cast(strtoul(row[92], nullptr, 10)); + e.mailkey = row[93] ? row[93] : ""; + e.xtargets = static_cast(strtoul(row[94], nullptr, 10)); + e.firstlogon = static_cast(atoi(row[95])); + e.e_aa_effects = static_cast(strtoul(row[96], nullptr, 10)); + e.e_percent_to_aa = static_cast(strtoul(row[97], nullptr, 10)); + e.e_expended_aa_spent = static_cast(strtoul(row[98], nullptr, 10)); + e.aa_points_spent_old = static_cast(strtoul(row[99], nullptr, 10)); + e.aa_points_old = static_cast(strtoul(row[100], nullptr, 10)); + e.e_last_invsnapshot = static_cast(strtoul(row[101], nullptr, 10)); + e.deleted_at = strtoll(row[102] ? row[102] : "-1", nullptr, 10); all_entries.push_back(e); } diff --git a/common/version.h b/common/version.h index 3fe574ff2..a919e9a1d 100644 --- a/common/version.h +++ b/common/version.h @@ -34,7 +34,7 @@ * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9213 +#define CURRENT_BINARY_DATABASE_VERSION 9214 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9035 diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index bb9c093f6..7ba51588e 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -467,6 +467,7 @@ 9211|2022_10_14_fix_neriak_pok_stone.sql|select * from doors where id = 2057 and `name` = 'POKNRKPORT500' and client_version_mask = 4294967232|empty| 9212|2022_10_14_fix_misty_pok_stone.sql|select * from doors where id = 2040 and `name` = 'POKRVPORT500' and dest_zone = 'misty'|empty| 9213|2022_12_24_npc_keeps_sold_items.sql|SHOW COLUMNS FROM `npc_types` LIKE 'keeps_sold_items'|empty| +9214|2022_12_24_character_exp_toggle.sql|SHOW COLUMNS FROM `character_data` LIKE 'exp_enabled'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2022_12_15_character_exp_toggle.sql b/utils/sql/git/required/2022_12_15_character_exp_toggle.sql new file mode 100644 index 000000000..9ed26ef8f --- /dev/null +++ b/utils/sql/git/required/2022_12_15_character_exp_toggle.sql @@ -0,0 +1,2 @@ +ALTER TABLE `character_data` +ADD COLUMN `exp_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `exp`; diff --git a/zone/client.cpp b/zone/client.cpp index 1f30d5471..3e511bb50 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -738,7 +738,7 @@ bool Client::Save(uint8 iCommitNow) { } } - database.SaveCharacterData(CharacterID(), AccountID(), &m_pp, &m_epp); /* Save Character Data */ + database.SaveCharacterData(this, &m_pp, &m_epp); /* Save Character Data */ return true; } @@ -9136,6 +9136,25 @@ void Client::SetDevToolsEnabled(bool in_dev_tools_enabled) Client::dev_tools_enabled = in_dev_tools_enabled; } +bool Client::IsEXPEnabled() const { + return m_exp_enabled; +} + +void Client::SetEXPEnabled(bool is_exp_enabled) +{ + auto c = CharacterDataRepository::FindOne(database, CharacterID()); + + c.exp_enabled = is_exp_enabled; + + auto updated = CharacterDataRepository::UpdateOne(database, c); + + if (!updated) { + return; + } + + m_exp_enabled = is_exp_enabled; +} + /** * @param model_id */ diff --git a/zone/client.h b/zone/client.h index 16c38dfa8..ee4806319 100644 --- a/zone/client.h +++ b/zone/client.h @@ -239,6 +239,9 @@ public: bool IsDevToolsEnabled() const; void SetDevToolsEnabled(bool in_dev_tools_enabled); + bool IsEXPEnabled() const; + void SetEXPEnabled(bool is_exp_enabled); + void SetPrimaryWeaponOrnamentation(uint32 model_id); void SetSecondaryWeaponOrnamentation(uint32 model_id); @@ -1963,6 +1966,8 @@ public: int64 GetSharedTaskId() const; private: + bool m_exp_enabled; + //Anti Spam Stuff Timer *KarmaUpdateTimer; uint32 TotalKarma; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 3df7cbea2..22aad8692 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1217,15 +1217,19 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) } /* Load Character Data */ - query = StringFormat("SELECT `lfp`, `lfg`, `xtargets`, `firstlogon`, `guild_id`, `rank` FROM `character_data` LEFT JOIN `guild_members` ON `id` = `char_id` WHERE `id` = %i", cid); + query = fmt::format( + "SELECT `lfp`, `lfg`, `xtargets`, `firstlogon`, `guild_id`, `rank`, `exp_enabled` FROM `character_data` LEFT JOIN `guild_members` ON `id` = `char_id` WHERE `id` = {}", + cid + ); auto results = database.QueryDatabase(query); - for (auto row = results.begin(); row != results.end(); ++row) { + for (auto row : results) { if (row[4] && atoi(row[4]) > 0) { guild_id = atoi(row[4]); - if (row[5] != nullptr) { guildrank = atoi(row[5]); } - else { guildrank = GUILD_RANK_NONE; } + guildrank = row[5] ? atoi(row[5]) : GUILD_RANK_NONE; } + SetEXPEnabled(atobool(row[6])); + if (LFP) { LFP = atoi(row[0]); } if (LFG) { LFG = atoi(row[1]); } if (row[3]) diff --git a/zone/command.cpp b/zone/command.cpp index 9ab5db87a..446387b48 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -140,6 +140,7 @@ int command_init(void) command_add("enablerecipe", "[Recipe ID] - Enables a Recipe", AccountStatus::QuestTroupe, command_enablerecipe) || command_add("endurance", "Restores your or your target's endurance.", AccountStatus::Guide, command_endurance) || command_add("equipitem", "[slotid(0-21)] - Equip the item on your cursor into the specified slot", AccountStatus::Guide, command_equipitem) || + command_add("exptoggle", "[Toggle] - Toggle your or your target's experience gain.", AccountStatus::QuestTroupe, command_exptoggle) || command_add("faction", "[Find (criteria | all ) | Review (criteria | all) | Reset (id)] - Resets Player's Faction", AccountStatus::QuestTroupe, command_faction) || command_add("factionassociation", "[factionid] [amount] - triggers a faction hits via association", AccountStatus::GMLeadAdmin, command_faction_association) || command_add("feature", "Change your or your target's feature's temporarily", AccountStatus::QuestTroupe, command_feature) || @@ -977,6 +978,7 @@ void command_bot(Client *c, const Seperator *sep) #include "gm_commands/enablerecipe.cpp" #include "gm_commands/endurance.cpp" #include "gm_commands/equipitem.cpp" +#include "gm_commands/exptoggle.cpp" #include "gm_commands/faction.cpp" #include "gm_commands/feature.cpp" #include "gm_commands/findaa.cpp" diff --git a/zone/command.h b/zone/command.h index 224741679..535f7ce74 100644 --- a/zone/command.h +++ b/zone/command.h @@ -82,6 +82,7 @@ void command_emptyinventory(Client *c, const Seperator *sep); void command_enablerecipe(Client *c, const Seperator *sep); void command_endurance(Client *c, const Seperator *sep); void command_equipitem(Client *c, const Seperator *sep); +void command_exptoggle(Client *c, const Seperator *sep); void command_faction(Client *c, const Seperator *sep); void command_faction_association(Client *c, const Seperator *sep); void command_feature(Client *c, const Seperator *sep); diff --git a/zone/exp.cpp b/zone/exp.cpp index 9fa7e1a94..c4c07093a 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -496,7 +496,7 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, } add_exp = GetEXP() + add_exp; - + //Enforce Percent XP Cap per kill, if rule is enabled int kill_percent_xp_cap = RuleI(Character, ExperiencePercentCapPerKill); if (kill_percent_xp_cap >= 0) { @@ -509,6 +509,9 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, } void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { + if (!IsEXPEnabled()) { + return; + } EVENT_ITEM_ScriptStopReturn(); diff --git a/zone/gm_commands/exptoggle.cpp b/zone/gm_commands/exptoggle.cpp new file mode 100644 index 000000000..b267b4f7e --- /dev/null +++ b/zone/gm_commands/exptoggle.cpp @@ -0,0 +1,28 @@ +#include "../client.h" + +void command_exptoggle(Client *c, const Seperator *sep) +{ + auto arguments = sep->argnum; + if (!arguments || arguments > 1) { + c->Message(Chat::White, "Usage: #exptoggle [Toggle] - Toggle your or your target's experience gain."); + return; + } + + auto t = c; + if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) { + t = c->GetTarget()->CastToClient(); + } + + const auto is_exp_enabled = Strings::ToBool(sep->arg[1]); + + t->SetEXPEnabled(is_exp_enabled); + + c->Message( + Chat::White, + fmt::format( + "Experience gain for {} is now {}abled.", + c->GetTargetDescription(t, TargetDescriptionType::LCSelf), + is_exp_enabled ? "en" : "dis" + ).c_str() + ); +} diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 28deb5120..c86df5a89 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -2906,6 +2906,16 @@ luabind::object Lua_Client::GetAugmentIDsBySlotID(lua_State* L, int16 slot_id) { return lua_table; } +bool Lua_Client::IsEXPEnabled() { + Lua_Safe_Call_Bool(); + return self->IsEXPEnabled(); +} + +void Lua_Client::SetEXPEnabled(bool is_exp_enabled) { + Lua_Safe_Call_Void(); + self->SetEXPEnabled(is_exp_enabled); +} + #ifdef BOTS int Lua_Client::GetBotRequiredLevel() @@ -3248,6 +3258,7 @@ luabind::scope lua_register_client() { .def("IsCrouching", (bool(Lua_Client::*)(void))&Lua_Client::IsCrouching) .def("IsDead", &Lua_Client::IsDead) .def("IsDueling", (bool(Lua_Client::*)(void))&Lua_Client::IsDueling) + .def("IsEXPEnabled", (bool(Lua_Client::*)(void))&Lua_Client::IsEXPEnabled) .def("IsGrouped", (bool(Lua_Client::*)(void))&Lua_Client::IsGrouped) .def("IsLD", (bool(Lua_Client::*)(void))&Lua_Client::IsLD) .def("IsMedding", (bool(Lua_Client::*)(void))&Lua_Client::IsMedding) @@ -3409,6 +3420,7 @@ luabind::scope lua_register_client() { .def("SetDueling", (void(Lua_Client::*)(bool))&Lua_Client::SetDueling) .def("SetEXP", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::SetEXP) .def("SetEXP", (void(Lua_Client::*)(uint32,uint32,bool))&Lua_Client::SetEXP) + .def("SetEXPEnabled", (void(Lua_Client::*)(bool))&Lua_Client::SetEXPEnabled) .def("SetEXPModifier", (void(Lua_Client::*)(uint32,double))&Lua_Client::SetEXPModifier) .def("SetEXPModifier", (void(Lua_Client::*)(uint32,double,int16))&Lua_Client::SetEXPModifier) .def("SetEbonCrystals", (void(Lua_Client::*)(uint32))&Lua_Client::SetEbonCrystals) diff --git a/zone/lua_client.h b/zone/lua_client.h index 770c89afd..f9d534e4a 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -455,6 +455,8 @@ public: std::string GetGuildPublicNote(); void MaxSkills(); luabind::object GetAugmentIDsBySlotID(lua_State* L, int16 slot_id); + bool IsEXPEnabled(); + void SetEXPEnabled(bool is_exp_enabled); void ApplySpell(int spell_id); void ApplySpell(int spell_id, int duration); diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 6de9fc08b..f5b8e8152 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -2784,6 +2784,16 @@ perl::array Perl_Client_GetAugmentIDsBySlotID(Client* self, int16 slot_id) return result; } +bool Perl_Client_IsEXPEnabled(Client* self) +{ + return self->IsEXPEnabled(); +} + +void Perl_Client_SetEXPEnabled(Client* self, bool is_exp_enabled) +{ + self->SetEXPEnabled(is_exp_enabled); +} + #ifdef BOTS int Perl_Client_GetBotRequiredLevel(Client* self) @@ -3119,6 +3129,7 @@ void perl_register_client() package.add("IsBecomeNPC", &Perl_Client_IsBecomeNPC); package.add("IsCrouching", &Perl_Client_IsCrouching); package.add("IsDueling", &Perl_Client_IsDueling); + package.add("IsEXPEnabled", &Perl_Client_IsEXPEnabled); package.add("IsGrouped", &Perl_Client_IsGrouped); package.add("IsLD", &Perl_Client_IsLD); package.add("IsMedding", &Perl_Client_IsMedding); @@ -3282,6 +3293,7 @@ void perl_register_client() package.add("SetEbonCrystals", &Perl_Client_SetEbonCrystals); package.add("SetEndurance", &Perl_Client_SetEndurance); package.add("SetEnvironmentDamageModifier", &Perl_Client_SetEnvironmentDamageModifier); + package.add("SetEXPEnabled", &Perl_Client_SetEXPEnabled); package.add("SetFactionLevel", &Perl_Client_SetFactionLevel); package.add("SetFactionLevel2", (void(*)(Client*, uint32, int32, uint8, uint8, uint8, int32))&Perl_Client_SetFactionLevel2); package.add("SetFactionLevel2", (void(*)(Client*, uint32, int32, uint8, uint8, uint8, int32, uint8))&Perl_Client_SetFactionLevel2); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 3ab638f7b..9e97ef925 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1144,16 +1144,24 @@ bool ZoneDatabase::SaveCharacterLeadershipAA(uint32 character_id, PlayerProfile_ return true; } -bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp){ +bool ZoneDatabase::SaveCharacterData( + Client* c, + PlayerProfile_Struct* pp, + ExtendedProfile_Struct* m_epp +) { + if (!c) { + return false; + } /* If this is ever zero - the client hasn't fully loaded and potentially crashed during zone */ - if (account_id <= 0) + if (c->AccountID() <= 0) { return false; + } - std::string mail_key = database.GetMailKey(character_id); + const auto mail_key = database.GetMailKey(c->CharacterID()); clock_t t = std::clock(); /* Function timer start */ - std::string query = StringFormat( + const auto query = fmt::format( "REPLACE INTO `character_data` (" " id, " " account_id, " @@ -1185,6 +1193,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla " title, " " suffix, " " exp, " + " exp_enabled, " " points, " " mana, " " cur_hp, " @@ -1252,106 +1261,107 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla " mailkey " ") " "VALUES (" - "%u," // id " id, " - "%u," // account_id " account_id, " - "'%s'," // `name` pp->name, " `name`, " - "'%s'," // last_name pp->last_name, " last_name, " - "%u," // gender pp->gender, " gender, " - "%u," // race pp->race, " race, " - "%u," // class pp->class_, " class, " - "%u," // `level` pp->level, " `level`, " - "%u," // deity pp->deity, " deity, " - "%u," // birthday pp->birthday, " birthday, " - "%u," // last_login pp->lastlogin, " last_login, " - "%u," // time_played pp->timePlayedMin, " time_played, " - "%u," // pvp_status pp->pvp, " pvp_status, " - "%u," // level2 pp->level2, " level2, " - "%u," // anon pp->anon, " anon, " - "%u," // gm pp->gm, " gm, " - "%u," // intoxication pp->intoxication, " intoxication, " - "%u," // hair_color pp->haircolor, " hair_color, " - "%u," // beard_color pp->beardcolor, " beard_color, " - "%u," // eye_color_1 pp->eyecolor1, " eye_color_1, " - "%u," // eye_color_2 pp->eyecolor2, " eye_color_2, " - "%u," // hair_style pp->hairstyle, " hair_style, " - "%u," // beard pp->beard, " beard, " - "%u," // ability_time_seconds pp->ability_time_seconds, " ability_time_seconds, " - "%u," // ability_number pp->ability_number, " ability_number, " - "%u," // ability_time_minutes pp->ability_time_minutes, " ability_time_minutes, " - "%u," // ability_time_hours pp->ability_time_hours, " ability_time_hours, " - "'%s'," // title pp->title, " title, " " - "'%s'," // suffix pp->suffix, " suffix, " - "%u," // exp pp->exp, " exp, " - "%u," // points pp->points, " points, " - "%u," // mana pp->mana, " mana, " - "%u," // cur_hp pp->cur_hp, " cur_hp, " - "%u," // str pp->STR, " str, " - "%u," // sta pp->STA, " sta, " - "%u," // cha pp->CHA, " cha, " - "%u," // dex pp->DEX, " dex, " - "%u," // `int` pp->INT, " `int`, " - "%u," // agi pp->AGI, " agi, " - "%u," // wis pp->WIS, " wis, " - "%u," // face pp->face, " face, " - "%f," // y pp->y, " y, " - "%f," // x pp->x, " x, " - "%f," // z pp->z, " z, " - "%f," // heading pp->heading, " heading, " - "%u," // pvp2 pp->pvp2, " pvp2, " - "%u," // pvp_type pp->pvptype, " pvp_type, " - "%u," // autosplit_enabled pp->autosplit, " autosplit_enabled, " - "%u," // zone_change_count pp->zone_change_count, " zone_change_count, " - "%u," // drakkin_heritage pp->drakkin_heritage, " drakkin_heritage, " - "%u," // drakkin_tattoo pp->drakkin_tattoo, " drakkin_tattoo, " - "%u," // drakkin_details pp->drakkin_details, " drakkin_details, " - "%i," // toxicity pp->toxicity, " toxicity, " - "%i," // hunger_level pp->hunger_level, " hunger_level, " - "%i," // thirst_level pp->thirst_level, " thirst_level, " - "%u," // ability_up pp->ability_up, " ability_up, " - "%u," // zone_id pp->zone_id, " zone_id, " - "%u," // zone_instance pp->zoneInstance, " zone_instance, " - "%u," // leadership_exp_on pp->leadAAActive, " leadership_exp_on, " - "%u," // ldon_points_guk pp->ldon_points_guk, " ldon_points_guk, " - "%u," // ldon_points_mir pp->ldon_points_mir, " ldon_points_mir, " - "%u," // ldon_points_mmc pp->ldon_points_mmc, " ldon_points_mmc, " - "%u," // ldon_points_ruj pp->ldon_points_ruj, " ldon_points_ruj, " - "%u," // ldon_points_tak pp->ldon_points_tak, " ldon_points_tak, " - "%u," // ldon_points_available pp->ldon_points_available, " ldon_points_available, " - "%u," // tribute_time_remaining pp->tribute_time_remaining, " tribute_time_remaining, " - "%u," // show_helm pp->showhelm, " show_helm, " - "%u," // career_tribute_points pp->career_tribute_points, " career_tribute_points, " - "%u," // tribute_points pp->tribute_points, " tribute_points, " - "%u," // tribute_active pp->tribute_active, " tribute_active, " - "%u," // endurance pp->endurance, " endurance, " - "%u," // group_leadership_exp pp->group_leadership_exp, " group_leadership_exp, " - "%u," // raid_leadership_exp pp->raid_leadership_exp, " raid_leadership_exp, " - "%u," // group_leadership_points pp->group_leadership_points, " group_leadership_points, " - "%u," // raid_leadership_points pp->raid_leadership_points, " raid_leadership_points, " - "%u," // air_remaining pp->air_remaining, " air_remaining, " - "%u," // pvp_kills pp->PVPKills, " pvp_kills, " - "%u," // pvp_deaths pp->PVPDeaths, " pvp_deaths, " - "%u," // pvp_current_points pp->PVPCurrentPoints, " pvp_current_points, " - "%u," // pvp_career_points pp->PVPCareerPoints, " pvp_career_points, " - "%u," // pvp_best_kill_streak pp->PVPBestKillStreak, " pvp_best_kill_streak, " - "%u," // pvp_worst_death_streak pp->PVPWorstDeathStreak, " pvp_worst_death_streak, " - "%u," // pvp_current_kill_streak pp->PVPCurrentKillStreak, " pvp_current_kill_streak, " - "%u," // aa_points_spent pp->aapoints_spent, " aa_points_spent, " - "%u," // aa_exp pp->expAA, " aa_exp, " - "%u," // aa_points pp->aapoints, " aa_points, " - "%u," // group_auto_consent pp->groupAutoconsent, " group_auto_consent, " - "%u," // raid_auto_consent pp->raidAutoconsent, " raid_auto_consent, " - "%u," // guild_auto_consent pp->guildAutoconsent, " guild_auto_consent, " - "%u," // RestTimer pp->RestTimer, " RestTimer) " - "%u," // e_aa_effects - "%u," // e_percent_to_aa - "%u," // e_expended_aa_spent - "%u," // e_last_invsnapshot - "'%s'" // mailkey mail_key + "{}," // id " id, " + "{}," // account_id " account_id, " + "'{}'," // `name` pp->name, " `name`, " + "'{}'," // last_name pp->last_name, " last_name, " + "{}," // gender pp->gender, " gender, " + "{}," // race pp->race, " race, " + "{}," // class pp->class_, " class, " + "{}," // `level` pp->level, " `level`, " + "{}," // deity pp->deity, " deity, " + "{}," // birthday pp->birthday, " birthday, " + "{}," // last_login pp->lastlogin, " last_login, " + "{}," // time_played pp->timePlayedMin, " time_played, " + "{}," // pvp_status pp->pvp, " pvp_status, " + "{}," // level2 pp->level2, " level2, " + "{}," // anon pp->anon, " anon, " + "{}," // gm pp->gm, " gm, " + "{}," // intoxication pp->intoxication, " intoxication, " + "{}," // hair_color pp->haircolor, " hair_color, " + "{}," // beard_color pp->beardcolor, " beard_color, " + "{}," // eye_color_1 pp->eyecolor1, " eye_color_1, " + "{}," // eye_color_2 pp->eyecolor2, " eye_color_2, " + "{}," // hair_style pp->hairstyle, " hair_style, " + "{}," // beard pp->beard, " beard, " + "{}," // ability_time_seconds pp->ability_time_seconds, " ability_time_seconds, " + "{}," // ability_number pp->ability_number, " ability_number, " + "{}," // ability_time_minutes pp->ability_time_minutes, " ability_time_minutes, " + "{}," // ability_time_hours pp->ability_time_hours, " ability_time_hours, " + "'{}'," // title pp->title, " title, " " + "'{}'," // suffix pp->suffix, " suffix, " + "{}," // exp pp->exp, " exp, " + "{}," // exp_enabled epp->exp_enabled, " exp_enabled, " + "{}," // points pp->points, " points, " + "{}," // mana pp->mana, " mana, " + "{}," // cur_hp pp->cur_hp, " cur_hp, " + "{}," // str pp->STR, " str, " + "{}," // sta pp->STA, " sta, " + "{}," // cha pp->CHA, " cha, " + "{}," // dex pp->DEX, " dex, " + "{}," // `int` pp->INT, " `int`, " + "{}," // agi pp->AGI, " agi, " + "{}," // wis pp->WIS, " wis, " + "{}," // face pp->face, " face, " + "{:.2f}," // y pp->y, " y, " + "{:.2f}," // x pp->x, " x, " + "{:.2f}," // z pp->z, " z, " + "{:.2f}," // heading pp->heading, " heading, " + "{}," // pvp2 pp->pvp2, " pvp2, " + "{}," // pvp_type pp->pvptype, " pvp_type, " + "{}," // autosplit_enabled pp->autosplit, " autosplit_enabled, " + "{}," // zone_change_count pp->zone_change_count, " zone_change_count, " + "{}," // drakkin_heritage pp->drakkin_heritage, " drakkin_heritage, " + "{}," // drakkin_tattoo pp->drakkin_tattoo, " drakkin_tattoo, " + "{}," // drakkin_details pp->drakkin_details, " drakkin_details, " + "{}," // toxicity pp->toxicity, " toxicity, " + "{}," // hunger_level pp->hunger_level, " hunger_level, " + "{}," // thirst_level pp->thirst_level, " thirst_level, " + "{}," // ability_up pp->ability_up, " ability_up, " + "{}," // zone_id pp->zone_id, " zone_id, " + "{}," // zone_instance pp->zoneInstance, " zone_instance, " + "{}," // leadership_exp_on pp->leadAAActive, " leadership_exp_on, " + "{}," // ldon_points_guk pp->ldon_points_guk, " ldon_points_guk, " + "{}," // ldon_points_mir pp->ldon_points_mir, " ldon_points_mir, " + "{}," // ldon_points_mmc pp->ldon_points_mmc, " ldon_points_mmc, " + "{}," // ldon_points_ruj pp->ldon_points_ruj, " ldon_points_ruj, " + "{}," // ldon_points_tak pp->ldon_points_tak, " ldon_points_tak, " + "{}," // ldon_points_available pp->ldon_points_available, " ldon_points_available, " + "{}," // tribute_time_remaining pp->tribute_time_remaining, " tribute_time_remaining, " + "{}," // show_helm pp->showhelm, " show_helm, " + "{}," // career_tribute_points pp->career_tribute_points, " career_tribute_points, " + "{}," // tribute_points pp->tribute_points, " tribute_points, " + "{}," // tribute_active pp->tribute_active, " tribute_active, " + "{}," // endurance pp->endurance, " endurance, " + "{}," // group_leadership_exp pp->group_leadership_exp, " group_leadership_exp, " + "{}," // raid_leadership_exp pp->raid_leadership_exp, " raid_leadership_exp, " + "{}," // group_leadership_points pp->group_leadership_points, " group_leadership_points, " + "{}," // raid_leadership_points pp->raid_leadership_points, " raid_leadership_points, " + "{}," // air_remaining pp->air_remaining, " air_remaining, " + "{}," // pvp_kills pp->PVPKills, " pvp_kills, " + "{}," // pvp_deaths pp->PVPDeaths, " pvp_deaths, " + "{}," // pvp_current_points pp->PVPCurrentPoints, " pvp_current_points, " + "{}," // pvp_career_points pp->PVPCareerPoints, " pvp_career_points, " + "{}," // pvp_best_kill_streak pp->PVPBestKillStreak, " pvp_best_kill_streak, " + "{}," // pvp_worst_death_streak pp->PVPWorstDeathStreak, " pvp_worst_death_streak, " + "{}," // pvp_current_kill_streak pp->PVPCurrentKillStreak, " pvp_current_kill_streak, " + "{}," // aa_points_spent pp->aapoints_spent, " aa_points_spent, " + "{}," // aa_exp pp->expAA, " aa_exp, " + "{}," // aa_points pp->aapoints, " aa_points, " + "{}," // group_auto_consent pp->groupAutoconsent, " group_auto_consent, " + "{}," // raid_auto_consent pp->raidAutoconsent, " raid_auto_consent, " + "{}," // guild_auto_consent pp->guildAutoconsent, " guild_auto_consent, " + "{}," // RestTimer pp->RestTimer, " RestTimer) " + "{}," // e_aa_effects + "{}," // e_percent_to_aa + "{}," // e_expended_aa_spent + "{}," // e_last_invsnapshot + "'{}'" // mailkey mail_key ")", - character_id, // " id, " - account_id, // " account_id, " - Strings::Escape(pp->name).c_str(), // " `name`, " - Strings::Escape(pp->last_name).c_str(), // " last_name, " + c->CharacterID(), // " id, " + c->AccountID(), // " account_id, " + Strings::Escape(pp->name), // " `name`, " + Strings::Escape(pp->last_name), // " last_name, " pp->gender, // " gender, " pp->race, // " race, " pp->class_, // " class, " @@ -1375,9 +1385,10 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla pp->ability_number, // " ability_number, " pp->ability_time_minutes, // " ability_time_minutes, " pp->ability_time_hours, // " ability_time_hours, " - Strings::Escape(pp->title).c_str(), // " title, " - Strings::Escape(pp->suffix).c_str(), // " suffix, " + Strings::Escape(pp->title), // " title, " + Strings::Escape(pp->suffix), // " suffix, " pp->exp, // " exp, " + c->IsEXPEnabled(), // " exp_enabled, " pp->points, // " points, " pp->mana, // " mana, " pp->cur_hp, // " cur_hp, " @@ -1445,7 +1456,11 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla mail_key.c_str() ); auto results = database.QueryDatabase(query); - LogDebug("ZoneDatabase::SaveCharacterData [{}], done Took [{}] seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + LogDebug( + "ZoneDatabase::SaveCharacterData [{}], done Took [{}] seconds", + c->CharacterID(), + ((float)(std::clock() - t)) / CLOCKS_PER_SEC + ); return true; } diff --git a/zone/zonedb.h b/zone/zonedb.h index 94e55e92d..e5f5f69f5 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -400,7 +400,7 @@ public: bool SaveCharacterBandolier(uint32 character_id, uint8 bandolier_id, uint8 bandolier_slot, uint32 item_id, uint32 icon, const char* bandolier_name); bool SaveCharacterBindPoint(uint32 character_id, const BindStruct &bind, uint32 bind_number); bool SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp); - bool SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp); + bool SaveCharacterData(Client* c, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp); bool SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id); bool SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value); bool SaveCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp);