diff --git a/common/repositories/base/base_aa_ability_repository.h b/common/repositories/base/base_aa_ability_repository.h index 5b451e8fd..293087871 100644 --- a/common/repositories/base/base_aa_ability_repository.h +++ b/common/repositories/base/base_aa_ability_repository.h @@ -19,20 +19,20 @@ class BaseAaAbilityRepository { public: struct AaAbility { - int id; + uint32_t id; std::string name; - int category; - int classes; - int races; - int drakkin_heritage; - int deities; - int status; - int type; - int charges; - int grant_only; - int first_rank_id; - int enabled; - int reset_on_death; + int32_t category; + int32_t classes; + int32_t races; + int32_t drakkin_heritage; + int32_t deities; + int32_t status; + int32_t type; + int32_t charges; + int8_t grant_only; + int32_t first_rank_id; + uint8_t enabled; + int8_t reset_on_death; }; static std::string PrimaryKey() @@ -166,20 +166,20 @@ public: if (results.RowCount() == 1) { AaAbility e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.category = atoi(row[2]); - e.classes = atoi(row[3]); - e.races = atoi(row[4]); - e.drakkin_heritage = atoi(row[5]); - e.deities = atoi(row[6]); - e.status = atoi(row[7]); - e.type = atoi(row[8]); - e.charges = atoi(row[9]); - e.grant_only = atoi(row[10]); - e.first_rank_id = atoi(row[11]); - e.enabled = atoi(row[12]); - e.reset_on_death = atoi(row[13]); + e.category = static_cast(atoi(row[2])); + e.classes = static_cast(atoi(row[3])); + e.races = static_cast(atoi(row[4])); + e.drakkin_heritage = static_cast(atoi(row[5])); + e.deities = static_cast(atoi(row[6])); + e.status = static_cast(atoi(row[7])); + e.type = static_cast(atoi(row[8])); + e.charges = static_cast(atoi(row[9])); + e.grant_only = static_cast(atoi(row[10])); + e.first_rank_id = static_cast(atoi(row[11])); + e.enabled = static_cast(strtoul(row[12], nullptr, 10)); + e.reset_on_death = static_cast(atoi(row[13])); return e; } @@ -338,20 +338,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaAbility e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.category = atoi(row[2]); - e.classes = atoi(row[3]); - e.races = atoi(row[4]); - e.drakkin_heritage = atoi(row[5]); - e.deities = atoi(row[6]); - e.status = atoi(row[7]); - e.type = atoi(row[8]); - e.charges = atoi(row[9]); - e.grant_only = atoi(row[10]); - e.first_rank_id = atoi(row[11]); - e.enabled = atoi(row[12]); - e.reset_on_death = atoi(row[13]); + e.category = static_cast(atoi(row[2])); + e.classes = static_cast(atoi(row[3])); + e.races = static_cast(atoi(row[4])); + e.drakkin_heritage = static_cast(atoi(row[5])); + e.deities = static_cast(atoi(row[6])); + e.status = static_cast(atoi(row[7])); + e.type = static_cast(atoi(row[8])); + e.charges = static_cast(atoi(row[9])); + e.grant_only = static_cast(atoi(row[10])); + e.first_rank_id = static_cast(atoi(row[11])); + e.enabled = static_cast(strtoul(row[12], nullptr, 10)); + e.reset_on_death = static_cast(atoi(row[13])); all_entries.push_back(e); } @@ -376,20 +376,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaAbility e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.category = atoi(row[2]); - e.classes = atoi(row[3]); - e.races = atoi(row[4]); - e.drakkin_heritage = atoi(row[5]); - e.deities = atoi(row[6]); - e.status = atoi(row[7]); - e.type = atoi(row[8]); - e.charges = atoi(row[9]); - e.grant_only = atoi(row[10]); - e.first_rank_id = atoi(row[11]); - e.enabled = atoi(row[12]); - e.reset_on_death = atoi(row[13]); + e.category = static_cast(atoi(row[2])); + e.classes = static_cast(atoi(row[3])); + e.races = static_cast(atoi(row[4])); + e.drakkin_heritage = static_cast(atoi(row[5])); + e.deities = static_cast(atoi(row[6])); + e.status = static_cast(atoi(row[7])); + e.type = static_cast(atoi(row[8])); + e.charges = static_cast(atoi(row[9])); + e.grant_only = static_cast(atoi(row[10])); + e.first_rank_id = static_cast(atoi(row[11])); + e.enabled = static_cast(strtoul(row[12], nullptr, 10)); + e.reset_on_death = static_cast(atoi(row[13])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_aa_rank_effects_repository.h b/common/repositories/base/base_aa_rank_effects_repository.h index a9d90ebad..b2f3b70cf 100644 --- a/common/repositories/base/base_aa_rank_effects_repository.h +++ b/common/repositories/base/base_aa_rank_effects_repository.h @@ -19,11 +19,11 @@ class BaseAaRankEffectsRepository { public: struct AaRankEffects { - int rank_id; - int slot; - int effect_id; - int base1; - int base2; + uint32_t rank_id; + uint32_t slot; + int32_t effect_id; + int32_t base1; + int32_t base2; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { AaRankEffects e{}; - e.rank_id = atoi(row[0]); - e.slot = atoi(row[1]); - e.effect_id = atoi(row[2]); - e.base1 = atoi(row[3]); - e.base2 = atoi(row[4]); + e.rank_id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.effect_id = static_cast(atoi(row[2])); + e.base1 = static_cast(atoi(row[3])); + e.base2 = static_cast(atoi(row[4])); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaRankEffects e{}; - e.rank_id = atoi(row[0]); - e.slot = atoi(row[1]); - e.effect_id = atoi(row[2]); - e.base1 = atoi(row[3]); - e.base2 = atoi(row[4]); + e.rank_id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.effect_id = static_cast(atoi(row[2])); + e.base1 = static_cast(atoi(row[3])); + e.base2 = static_cast(atoi(row[4])); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaRankEffects e{}; - e.rank_id = atoi(row[0]); - e.slot = atoi(row[1]); - e.effect_id = atoi(row[2]); - e.base1 = atoi(row[3]); - e.base2 = atoi(row[4]); + e.rank_id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.effect_id = static_cast(atoi(row[2])); + e.base1 = static_cast(atoi(row[3])); + e.base2 = static_cast(atoi(row[4])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_aa_rank_prereqs_repository.h b/common/repositories/base/base_aa_rank_prereqs_repository.h index 429133872..0d00e2eea 100644 --- a/common/repositories/base/base_aa_rank_prereqs_repository.h +++ b/common/repositories/base/base_aa_rank_prereqs_repository.h @@ -19,9 +19,9 @@ class BaseAaRankPrereqsRepository { public: struct AaRankPrereqs { - int rank_id; - int aa_id; - int points; + uint32_t rank_id; + int32_t aa_id; + int32_t points; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { AaRankPrereqs e{}; - e.rank_id = atoi(row[0]); - e.aa_id = atoi(row[1]); - e.points = atoi(row[2]); + e.rank_id = static_cast(strtoul(row[0], nullptr, 10)); + e.aa_id = static_cast(atoi(row[1])); + e.points = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaRankPrereqs e{}; - e.rank_id = atoi(row[0]); - e.aa_id = atoi(row[1]); - e.points = atoi(row[2]); + e.rank_id = static_cast(strtoul(row[0], nullptr, 10)); + e.aa_id = static_cast(atoi(row[1])); + e.points = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaRankPrereqs e{}; - e.rank_id = atoi(row[0]); - e.aa_id = atoi(row[1]); - e.points = atoi(row[2]); + e.rank_id = static_cast(strtoul(row[0], nullptr, 10)); + e.aa_id = static_cast(atoi(row[1])); + e.points = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_aa_ranks_repository.h b/common/repositories/base/base_aa_ranks_repository.h index 48ca172df..d744fe731 100644 --- a/common/repositories/base/base_aa_ranks_repository.h +++ b/common/repositories/base/base_aa_ranks_repository.h @@ -19,19 +19,19 @@ class BaseAaRanksRepository { public: struct AaRanks { - int id; - int upper_hotkey_sid; - int lower_hotkey_sid; - int title_sid; - int desc_sid; - int cost; - int level_req; - int spell; - int spell_type; - int recast_time; - int expansion; - int prev_id; - int next_id; + uint32_t id; + int32_t upper_hotkey_sid; + int32_t lower_hotkey_sid; + int32_t title_sid; + int32_t desc_sid; + int32_t cost; + int32_t level_req; + int32_t spell; + int32_t spell_type; + int32_t recast_time; + int32_t expansion; + int32_t prev_id; + int32_t next_id; }; static std::string PrimaryKey() @@ -162,19 +162,19 @@ public: if (results.RowCount() == 1) { AaRanks e{}; - e.id = atoi(row[0]); - e.upper_hotkey_sid = atoi(row[1]); - e.lower_hotkey_sid = atoi(row[2]); - e.title_sid = atoi(row[3]); - e.desc_sid = atoi(row[4]); - e.cost = atoi(row[5]); - e.level_req = atoi(row[6]); - e.spell = atoi(row[7]); - e.spell_type = atoi(row[8]); - e.recast_time = atoi(row[9]); - e.expansion = atoi(row[10]); - e.prev_id = atoi(row[11]); - e.next_id = atoi(row[12]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.upper_hotkey_sid = static_cast(atoi(row[1])); + e.lower_hotkey_sid = static_cast(atoi(row[2])); + e.title_sid = static_cast(atoi(row[3])); + e.desc_sid = static_cast(atoi(row[4])); + e.cost = static_cast(atoi(row[5])); + e.level_req = static_cast(atoi(row[6])); + e.spell = static_cast(atoi(row[7])); + e.spell_type = static_cast(atoi(row[8])); + e.recast_time = static_cast(atoi(row[9])); + e.expansion = static_cast(atoi(row[10])); + e.prev_id = static_cast(atoi(row[11])); + e.next_id = static_cast(atoi(row[12])); return e; } @@ -330,19 +330,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaRanks e{}; - e.id = atoi(row[0]); - e.upper_hotkey_sid = atoi(row[1]); - e.lower_hotkey_sid = atoi(row[2]); - e.title_sid = atoi(row[3]); - e.desc_sid = atoi(row[4]); - e.cost = atoi(row[5]); - e.level_req = atoi(row[6]); - e.spell = atoi(row[7]); - e.spell_type = atoi(row[8]); - e.recast_time = atoi(row[9]); - e.expansion = atoi(row[10]); - e.prev_id = atoi(row[11]); - e.next_id = atoi(row[12]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.upper_hotkey_sid = static_cast(atoi(row[1])); + e.lower_hotkey_sid = static_cast(atoi(row[2])); + e.title_sid = static_cast(atoi(row[3])); + e.desc_sid = static_cast(atoi(row[4])); + e.cost = static_cast(atoi(row[5])); + e.level_req = static_cast(atoi(row[6])); + e.spell = static_cast(atoi(row[7])); + e.spell_type = static_cast(atoi(row[8])); + e.recast_time = static_cast(atoi(row[9])); + e.expansion = static_cast(atoi(row[10])); + e.prev_id = static_cast(atoi(row[11])); + e.next_id = static_cast(atoi(row[12])); all_entries.push_back(e); } @@ -367,19 +367,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AaRanks e{}; - e.id = atoi(row[0]); - e.upper_hotkey_sid = atoi(row[1]); - e.lower_hotkey_sid = atoi(row[2]); - e.title_sid = atoi(row[3]); - e.desc_sid = atoi(row[4]); - e.cost = atoi(row[5]); - e.level_req = atoi(row[6]); - e.spell = atoi(row[7]); - e.spell_type = atoi(row[8]); - e.recast_time = atoi(row[9]); - e.expansion = atoi(row[10]); - e.prev_id = atoi(row[11]); - e.next_id = atoi(row[12]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.upper_hotkey_sid = static_cast(atoi(row[1])); + e.lower_hotkey_sid = static_cast(atoi(row[2])); + e.title_sid = static_cast(atoi(row[3])); + e.desc_sid = static_cast(atoi(row[4])); + e.cost = static_cast(atoi(row[5])); + e.level_req = static_cast(atoi(row[6])); + e.spell = static_cast(atoi(row[7])); + e.spell_type = static_cast(atoi(row[8])); + e.recast_time = static_cast(atoi(row[9])); + e.expansion = static_cast(atoi(row[10])); + e.prev_id = static_cast(atoi(row[11])); + e.next_id = static_cast(atoi(row[12])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_account_flags_repository.h b/common/repositories/base/base_account_flags_repository.h index 47639dd5d..52deedc55 100644 --- a/common/repositories/base/base_account_flags_repository.h +++ b/common/repositories/base/base_account_flags_repository.h @@ -19,7 +19,7 @@ class BaseAccountFlagsRepository { public: struct AccountFlags { - int p_accid; + uint32_t p_accid; std::string p_flag; std::string p_value; }; @@ -122,7 +122,7 @@ public: if (results.RowCount() == 1) { AccountFlags e{}; - e.p_accid = atoi(row[0]); + e.p_accid = static_cast(strtoul(row[0], nullptr, 10)); e.p_flag = row[1] ? row[1] : ""; e.p_value = row[2] ? row[2] : ""; @@ -250,7 +250,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AccountFlags e{}; - e.p_accid = atoi(row[0]); + e.p_accid = static_cast(strtoul(row[0], nullptr, 10)); e.p_flag = row[1] ? row[1] : ""; e.p_value = row[2] ? row[2] : ""; @@ -277,7 +277,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AccountFlags e{}; - e.p_accid = atoi(row[0]); + e.p_accid = static_cast(strtoul(row[0], nullptr, 10)); e.p_flag = row[1] ? row[1] : ""; e.p_value = row[2] ? row[2] : ""; diff --git a/common/repositories/base/base_account_ip_repository.h b/common/repositories/base/base_account_ip_repository.h index b9030f355..9b53cd5f2 100644 --- a/common/repositories/base/base_account_ip_repository.h +++ b/common/repositories/base/base_account_ip_repository.h @@ -19,9 +19,9 @@ class BaseAccountIpRepository { public: struct AccountIp { - int accid; + int32_t accid; std::string ip; - int count; + int32_t count; std::string lastused; }; @@ -126,9 +126,9 @@ public: if (results.RowCount() == 1) { AccountIp e{}; - e.accid = atoi(row[0]); + e.accid = static_cast(atoi(row[0])); e.ip = row[1] ? row[1] : ""; - e.count = atoi(row[2]); + e.count = static_cast(atoi(row[2])); e.lastused = row[3] ? row[3] : ""; return e; @@ -258,9 +258,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AccountIp e{}; - e.accid = atoi(row[0]); + e.accid = static_cast(atoi(row[0])); e.ip = row[1] ? row[1] : ""; - e.count = atoi(row[2]); + e.count = static_cast(atoi(row[2])); e.lastused = row[3] ? row[3] : ""; all_entries.push_back(e); @@ -286,9 +286,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AccountIp e{}; - e.accid = atoi(row[0]); + e.accid = static_cast(atoi(row[0])); e.ip = row[1] ? row[1] : ""; - e.count = atoi(row[2]); + e.count = static_cast(atoi(row[2])); e.lastused = row[3] ? row[3] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_account_repository.h b/common/repositories/base/base_account_repository.h index 57a5c2ab5..92cf5b64a 100644 --- a/common/repositories/base/base_account_repository.h +++ b/common/repositories/base/base_account_repository.h @@ -19,25 +19,25 @@ class BaseAccountRepository { public: struct Account { - int id; + int32_t id; std::string name; std::string charname; - int sharedplat; + uint32_t sharedplat; std::string password; - int status; + int32_t status; std::string ls_id; - int lsaccount_id; - int gmspeed; - int invulnerable; - int flymode; - int ignore_tells; - int revoked; - int karma; + uint32_t lsaccount_id; + uint8_t gmspeed; + int8_t invulnerable; + int8_t flymode; + int8_t ignore_tells; + uint8_t revoked; + uint32_t karma; std::string minilogin_ip; - int hideme; - int rulesflag; + int8_t hideme; + uint8_t rulesflag; time_t suspendeduntil; - int time_creation; + uint32_t time_creation; std::string ban_reason; std::string suspend_reason; std::string crc_eqgame; @@ -206,25 +206,25 @@ public: if (results.RowCount() == 1) { Account e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.charname = row[2] ? row[2] : ""; - e.sharedplat = atoi(row[3]); + e.sharedplat = static_cast(strtoul(row[3], nullptr, 10)); e.password = row[4] ? row[4] : ""; - e.status = atoi(row[5]); + e.status = static_cast(atoi(row[5])); e.ls_id = row[6] ? row[6] : ""; - e.lsaccount_id = atoi(row[7]); - e.gmspeed = atoi(row[8]); - e.invulnerable = atoi(row[9]); - e.flymode = atoi(row[10]); - e.ignore_tells = atoi(row[11]); - e.revoked = atoi(row[12]); - e.karma = atoi(row[13]); + e.lsaccount_id = static_cast(strtoul(row[7], nullptr, 10)); + e.gmspeed = static_cast(strtoul(row[8], nullptr, 10)); + e.invulnerable = static_cast(atoi(row[9])); + e.flymode = static_cast(atoi(row[10])); + e.ignore_tells = static_cast(atoi(row[11])); + e.revoked = static_cast(strtoul(row[12], nullptr, 10)); + e.karma = static_cast(strtoul(row[13], nullptr, 10)); e.minilogin_ip = row[14] ? row[14] : ""; - e.hideme = atoi(row[15]); - e.rulesflag = atoi(row[16]); + e.hideme = static_cast(atoi(row[15])); + e.rulesflag = static_cast(strtoul(row[16], nullptr, 10)); e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10); - e.time_creation = atoi(row[18]); + e.time_creation = static_cast(strtoul(row[18], nullptr, 10)); e.ban_reason = row[19] ? row[19] : ""; e.suspend_reason = row[20] ? row[20] : ""; e.crc_eqgame = row[21] ? row[21] : ""; @@ -417,25 +417,25 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Account e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.charname = row[2] ? row[2] : ""; - e.sharedplat = atoi(row[3]); + e.sharedplat = static_cast(strtoul(row[3], nullptr, 10)); e.password = row[4] ? row[4] : ""; - e.status = atoi(row[5]); + e.status = static_cast(atoi(row[5])); e.ls_id = row[6] ? row[6] : ""; - e.lsaccount_id = atoi(row[7]); - e.gmspeed = atoi(row[8]); - e.invulnerable = atoi(row[9]); - e.flymode = atoi(row[10]); - e.ignore_tells = atoi(row[11]); - e.revoked = atoi(row[12]); - e.karma = atoi(row[13]); + e.lsaccount_id = static_cast(strtoul(row[7], nullptr, 10)); + e.gmspeed = static_cast(strtoul(row[8], nullptr, 10)); + e.invulnerable = static_cast(atoi(row[9])); + e.flymode = static_cast(atoi(row[10])); + e.ignore_tells = static_cast(atoi(row[11])); + e.revoked = static_cast(strtoul(row[12], nullptr, 10)); + e.karma = static_cast(strtoul(row[13], nullptr, 10)); e.minilogin_ip = row[14] ? row[14] : ""; - e.hideme = atoi(row[15]); - e.rulesflag = atoi(row[16]); + e.hideme = static_cast(atoi(row[15])); + e.rulesflag = static_cast(strtoul(row[16], nullptr, 10)); e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10); - e.time_creation = atoi(row[18]); + e.time_creation = static_cast(strtoul(row[18], nullptr, 10)); e.ban_reason = row[19] ? row[19] : ""; e.suspend_reason = row[20] ? row[20] : ""; e.crc_eqgame = row[21] ? row[21] : ""; @@ -465,25 +465,25 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Account e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.charname = row[2] ? row[2] : ""; - e.sharedplat = atoi(row[3]); + e.sharedplat = static_cast(strtoul(row[3], nullptr, 10)); e.password = row[4] ? row[4] : ""; - e.status = atoi(row[5]); + e.status = static_cast(atoi(row[5])); e.ls_id = row[6] ? row[6] : ""; - e.lsaccount_id = atoi(row[7]); - e.gmspeed = atoi(row[8]); - e.invulnerable = atoi(row[9]); - e.flymode = atoi(row[10]); - e.ignore_tells = atoi(row[11]); - e.revoked = atoi(row[12]); - e.karma = atoi(row[13]); + e.lsaccount_id = static_cast(strtoul(row[7], nullptr, 10)); + e.gmspeed = static_cast(strtoul(row[8], nullptr, 10)); + e.invulnerable = static_cast(atoi(row[9])); + e.flymode = static_cast(atoi(row[10])); + e.ignore_tells = static_cast(atoi(row[11])); + e.revoked = static_cast(strtoul(row[12], nullptr, 10)); + e.karma = static_cast(strtoul(row[13], nullptr, 10)); e.minilogin_ip = row[14] ? row[14] : ""; - e.hideme = atoi(row[15]); - e.rulesflag = atoi(row[16]); + e.hideme = static_cast(atoi(row[15])); + e.rulesflag = static_cast(strtoul(row[16], nullptr, 10)); e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10); - e.time_creation = atoi(row[18]); + e.time_creation = static_cast(strtoul(row[18], nullptr, 10)); e.ban_reason = row[19] ? row[19] : ""; e.suspend_reason = row[20] ? row[20] : ""; e.crc_eqgame = row[21] ? row[21] : ""; diff --git a/common/repositories/base/base_account_rewards_repository.h b/common/repositories/base/base_account_rewards_repository.h index d6687576d..008a2b165 100644 --- a/common/repositories/base/base_account_rewards_repository.h +++ b/common/repositories/base/base_account_rewards_repository.h @@ -19,9 +19,9 @@ class BaseAccountRewardsRepository { public: struct AccountRewards { - int account_id; - int reward_id; - int amount; + uint32_t account_id; + uint32_t reward_id; + uint32_t amount; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { AccountRewards e{}; - e.account_id = atoi(row[0]); - e.reward_id = atoi(row[1]); - e.amount = atoi(row[2]); + e.account_id = static_cast(strtoul(row[0], nullptr, 10)); + e.reward_id = static_cast(strtoul(row[1], nullptr, 10)); + e.amount = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AccountRewards e{}; - e.account_id = atoi(row[0]); - e.reward_id = atoi(row[1]); - e.amount = atoi(row[2]); + e.account_id = static_cast(strtoul(row[0], nullptr, 10)); + e.reward_id = static_cast(strtoul(row[1], nullptr, 10)); + e.amount = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AccountRewards e{}; - e.account_id = atoi(row[0]); - e.reward_id = atoi(row[1]); - e.amount = atoi(row[2]); + e.account_id = static_cast(strtoul(row[0], nullptr, 10)); + e.reward_id = static_cast(strtoul(row[1], nullptr, 10)); + e.amount = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_adventure_details_repository.h b/common/repositories/base/base_adventure_details_repository.h index 32f39761d..e82accdef 100644 --- a/common/repositories/base/base_adventure_details_repository.h +++ b/common/repositories/base/base_adventure_details_repository.h @@ -19,15 +19,15 @@ class BaseAdventureDetailsRepository { public: struct AdventureDetails { - int id; - int adventure_id; - int instance_id; - int count; - int assassinate_count; - int status; - int time_created; - int time_zoned; - int time_completed; + uint32_t id; + uint16_t adventure_id; + int32_t instance_id; + uint16_t count; + uint16_t assassinate_count; + uint8_t status; + uint32_t time_created; + uint32_t time_zoned; + uint32_t time_completed; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { AdventureDetails e{}; - e.id = atoi(row[0]); - e.adventure_id = atoi(row[1]); - e.instance_id = atoi(row[2]); - e.count = atoi(row[3]); - e.assassinate_count = atoi(row[4]); - e.status = atoi(row[5]); - e.time_created = atoi(row[6]); - e.time_zoned = atoi(row[7]); - e.time_completed = atoi(row[8]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.adventure_id = static_cast(strtoul(row[1], nullptr, 10)); + e.instance_id = static_cast(atoi(row[2])); + e.count = static_cast(strtoul(row[3], nullptr, 10)); + e.assassinate_count = static_cast(strtoul(row[4], nullptr, 10)); + e.status = static_cast(strtoul(row[5], nullptr, 10)); + e.time_created = static_cast(strtoul(row[6], nullptr, 10)); + e.time_zoned = static_cast(strtoul(row[7], nullptr, 10)); + e.time_completed = static_cast(strtoul(row[8], nullptr, 10)); return e; } @@ -297,15 +297,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureDetails e{}; - e.id = atoi(row[0]); - e.adventure_id = atoi(row[1]); - e.instance_id = atoi(row[2]); - e.count = atoi(row[3]); - e.assassinate_count = atoi(row[4]); - e.status = atoi(row[5]); - e.time_created = atoi(row[6]); - e.time_zoned = atoi(row[7]); - e.time_completed = atoi(row[8]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.adventure_id = static_cast(strtoul(row[1], nullptr, 10)); + e.instance_id = static_cast(atoi(row[2])); + e.count = static_cast(strtoul(row[3], nullptr, 10)); + e.assassinate_count = static_cast(strtoul(row[4], nullptr, 10)); + e.status = static_cast(strtoul(row[5], nullptr, 10)); + e.time_created = static_cast(strtoul(row[6], nullptr, 10)); + e.time_zoned = static_cast(strtoul(row[7], nullptr, 10)); + e.time_completed = static_cast(strtoul(row[8], nullptr, 10)); all_entries.push_back(e); } @@ -330,15 +330,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureDetails e{}; - e.id = atoi(row[0]); - e.adventure_id = atoi(row[1]); - e.instance_id = atoi(row[2]); - e.count = atoi(row[3]); - e.assassinate_count = atoi(row[4]); - e.status = atoi(row[5]); - e.time_created = atoi(row[6]); - e.time_zoned = atoi(row[7]); - e.time_completed = atoi(row[8]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.adventure_id = static_cast(strtoul(row[1], nullptr, 10)); + e.instance_id = static_cast(atoi(row[2])); + e.count = static_cast(strtoul(row[3], nullptr, 10)); + e.assassinate_count = static_cast(strtoul(row[4], nullptr, 10)); + e.status = static_cast(strtoul(row[5], nullptr, 10)); + e.time_created = static_cast(strtoul(row[6], nullptr, 10)); + e.time_zoned = static_cast(strtoul(row[7], nullptr, 10)); + e.time_completed = static_cast(strtoul(row[8], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_adventure_members_repository.h b/common/repositories/base/base_adventure_members_repository.h index c854583be..1abf23b5b 100644 --- a/common/repositories/base/base_adventure_members_repository.h +++ b/common/repositories/base/base_adventure_members_repository.h @@ -19,8 +19,8 @@ class BaseAdventureMembersRepository { public: struct AdventureMembers { - int id; - int charid; + uint32_t id; + uint32_t charid; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { AdventureMembers e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureMembers e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureMembers e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_adventure_stats_repository.h b/common/repositories/base/base_adventure_stats_repository.h index 3a900a95c..5a25d5126 100644 --- a/common/repositories/base/base_adventure_stats_repository.h +++ b/common/repositories/base/base_adventure_stats_repository.h @@ -19,17 +19,17 @@ class BaseAdventureStatsRepository { public: struct AdventureStats { - int player_id; - int guk_wins; - int mir_wins; - int mmc_wins; - int ruj_wins; - int tak_wins; - int guk_losses; - int mir_losses; - int mmc_losses; - int ruj_losses; - int tak_losses; + uint32_t player_id; + uint32_t guk_wins; + uint32_t mir_wins; + uint32_t mmc_wins; + uint32_t ruj_wins; + uint32_t tak_wins; + uint32_t guk_losses; + uint32_t mir_losses; + uint32_t mmc_losses; + uint32_t ruj_losses; + uint32_t tak_losses; }; static std::string PrimaryKey() @@ -154,17 +154,17 @@ public: if (results.RowCount() == 1) { AdventureStats e{}; - e.player_id = atoi(row[0]); - e.guk_wins = atoi(row[1]); - e.mir_wins = atoi(row[2]); - e.mmc_wins = atoi(row[3]); - e.ruj_wins = atoi(row[4]); - e.tak_wins = atoi(row[5]); - e.guk_losses = atoi(row[6]); - e.mir_losses = atoi(row[7]); - e.mmc_losses = atoi(row[8]); - e.ruj_losses = atoi(row[9]); - e.tak_losses = atoi(row[10]); + e.player_id = static_cast(strtoul(row[0], nullptr, 10)); + e.guk_wins = static_cast(strtoul(row[1], nullptr, 10)); + e.mir_wins = static_cast(strtoul(row[2], nullptr, 10)); + e.mmc_wins = static_cast(strtoul(row[3], nullptr, 10)); + e.ruj_wins = static_cast(strtoul(row[4], nullptr, 10)); + e.tak_wins = static_cast(strtoul(row[5], nullptr, 10)); + e.guk_losses = static_cast(strtoul(row[6], nullptr, 10)); + e.mir_losses = static_cast(strtoul(row[7], nullptr, 10)); + e.mmc_losses = static_cast(strtoul(row[8], nullptr, 10)); + e.ruj_losses = static_cast(strtoul(row[9], nullptr, 10)); + e.tak_losses = static_cast(strtoul(row[10], nullptr, 10)); return e; } @@ -314,17 +314,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureStats e{}; - e.player_id = atoi(row[0]); - e.guk_wins = atoi(row[1]); - e.mir_wins = atoi(row[2]); - e.mmc_wins = atoi(row[3]); - e.ruj_wins = atoi(row[4]); - e.tak_wins = atoi(row[5]); - e.guk_losses = atoi(row[6]); - e.mir_losses = atoi(row[7]); - e.mmc_losses = atoi(row[8]); - e.ruj_losses = atoi(row[9]); - e.tak_losses = atoi(row[10]); + e.player_id = static_cast(strtoul(row[0], nullptr, 10)); + e.guk_wins = static_cast(strtoul(row[1], nullptr, 10)); + e.mir_wins = static_cast(strtoul(row[2], nullptr, 10)); + e.mmc_wins = static_cast(strtoul(row[3], nullptr, 10)); + e.ruj_wins = static_cast(strtoul(row[4], nullptr, 10)); + e.tak_wins = static_cast(strtoul(row[5], nullptr, 10)); + e.guk_losses = static_cast(strtoul(row[6], nullptr, 10)); + e.mir_losses = static_cast(strtoul(row[7], nullptr, 10)); + e.mmc_losses = static_cast(strtoul(row[8], nullptr, 10)); + e.ruj_losses = static_cast(strtoul(row[9], nullptr, 10)); + e.tak_losses = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } @@ -349,17 +349,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureStats e{}; - e.player_id = atoi(row[0]); - e.guk_wins = atoi(row[1]); - e.mir_wins = atoi(row[2]); - e.mmc_wins = atoi(row[3]); - e.ruj_wins = atoi(row[4]); - e.tak_wins = atoi(row[5]); - e.guk_losses = atoi(row[6]); - e.mir_losses = atoi(row[7]); - e.mmc_losses = atoi(row[8]); - e.ruj_losses = atoi(row[9]); - e.tak_losses = atoi(row[10]); + e.player_id = static_cast(strtoul(row[0], nullptr, 10)); + e.guk_wins = static_cast(strtoul(row[1], nullptr, 10)); + e.mir_wins = static_cast(strtoul(row[2], nullptr, 10)); + e.mmc_wins = static_cast(strtoul(row[3], nullptr, 10)); + e.ruj_wins = static_cast(strtoul(row[4], nullptr, 10)); + e.tak_wins = static_cast(strtoul(row[5], nullptr, 10)); + e.guk_losses = static_cast(strtoul(row[6], nullptr, 10)); + e.mir_losses = static_cast(strtoul(row[7], nullptr, 10)); + e.mmc_losses = static_cast(strtoul(row[8], nullptr, 10)); + e.ruj_losses = static_cast(strtoul(row[9], nullptr, 10)); + e.tak_losses = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_adventure_template_entry_flavor_repository.h b/common/repositories/base/base_adventure_template_entry_flavor_repository.h index 9dfdd24a1..0507f7e85 100644 --- a/common/repositories/base/base_adventure_template_entry_flavor_repository.h +++ b/common/repositories/base/base_adventure_template_entry_flavor_repository.h @@ -19,7 +19,7 @@ class BaseAdventureTemplateEntryFlavorRepository { public: struct AdventureTemplateEntryFlavor { - int id; + uint32_t id; std::string text; }; @@ -118,7 +118,7 @@ public: if (results.RowCount() == 1) { AdventureTemplateEntryFlavor e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.text = row[1] ? row[1] : ""; return e; @@ -242,7 +242,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureTemplateEntryFlavor e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.text = row[1] ? row[1] : ""; all_entries.push_back(e); @@ -268,7 +268,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureTemplateEntryFlavor e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.text = row[1] ? row[1] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_adventure_template_entry_repository.h b/common/repositories/base/base_adventure_template_entry_repository.h index 33f4359eb..aad89b1d3 100644 --- a/common/repositories/base/base_adventure_template_entry_repository.h +++ b/common/repositories/base/base_adventure_template_entry_repository.h @@ -19,8 +19,8 @@ class BaseAdventureTemplateEntryRepository { public: struct AdventureTemplateEntry { - int id; - int template_id; + uint32_t id; + uint32_t template_id; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { AdventureTemplateEntry e{}; - e.id = atoi(row[0]); - e.template_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.template_id = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureTemplateEntry e{}; - e.id = atoi(row[0]); - e.template_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.template_id = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureTemplateEntry e{}; - e.id = atoi(row[0]); - e.template_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.template_id = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_adventure_template_repository.h b/common/repositories/base/base_adventure_template_repository.h index 38096f4b4..ce6540ce2 100644 --- a/common/repositories/base/base_adventure_template_repository.h +++ b/common/repositories/base/base_adventure_template_repository.h @@ -19,39 +19,39 @@ class BaseAdventureTemplateRepository { public: struct AdventureTemplate { - int id; + uint32_t id; std::string zone; - int zone_version; - int is_hard; - int is_raid; - int min_level; - int max_level; - int type; - int type_data; - int type_count; + uint8_t zone_version; + uint8_t is_hard; + uint8_t is_raid; + uint8_t min_level; + uint8_t max_level; + uint8_t type; + uint32_t type_data; + uint16_t type_count; float assa_x; float assa_y; float assa_z; float assa_h; std::string text; - int duration; - int zone_in_time; - int win_points; - int lose_points; - int theme; - int zone_in_zone_id; + uint32_t duration; + uint32_t zone_in_time; + uint16_t win_points; + uint16_t lose_points; + uint8_t theme; + uint16_t zone_in_zone_id; float zone_in_x; float zone_in_y; - int zone_in_object_id; + int16_t zone_in_object_id; float dest_x; float dest_y; float dest_z; float dest_h; - int graveyard_zone_id; + uint32_t graveyard_zone_id; float graveyard_x; float graveyard_y; float graveyard_z; - float graveyard_radius; + std::string graveyard_radius; }; static std::string PrimaryKey() @@ -242,39 +242,38 @@ public: if (results.RowCount() == 1) { AdventureTemplate e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.zone_version = atoi(row[2]); - e.is_hard = atoi(row[3]); - e.is_raid = atoi(row[4]); - e.min_level = atoi(row[5]); - e.max_level = atoi(row[6]); - e.type = atoi(row[7]); - e.type_data = atoi(row[8]); - e.type_count = atoi(row[9]); - e.assa_x = static_cast(atof(row[10])); - e.assa_y = static_cast(atof(row[11])); - e.assa_z = static_cast(atof(row[12])); - e.assa_h = static_cast(atof(row[13])); + e.zone_version = static_cast(strtoul(row[2], nullptr, 10)); + e.is_hard = static_cast(strtoul(row[3], nullptr, 10)); + e.is_raid = static_cast(strtoul(row[4], nullptr, 10)); + e.min_level = static_cast(strtoul(row[5], nullptr, 10)); + e.max_level = static_cast(strtoul(row[6], nullptr, 10)); + e.type = static_cast(strtoul(row[7], nullptr, 10)); + e.type_data = static_cast(strtoul(row[8], nullptr, 10)); + e.type_count = static_cast(strtoul(row[9], nullptr, 10)); + e.assa_x = strtof(row[10], nullptr); + e.assa_y = strtof(row[11], nullptr); + e.assa_z = strtof(row[12], nullptr); + e.assa_h = strtof(row[13], nullptr); e.text = row[14] ? row[14] : ""; - e.duration = atoi(row[15]); - e.zone_in_time = atoi(row[16]); - e.win_points = atoi(row[17]); - e.lose_points = atoi(row[18]); - e.theme = atoi(row[19]); - e.zone_in_zone_id = atoi(row[20]); - e.zone_in_x = static_cast(atof(row[21])); - e.zone_in_y = static_cast(atof(row[22])); - e.zone_in_object_id = atoi(row[23]); - e.dest_x = static_cast(atof(row[24])); - e.dest_y = static_cast(atof(row[25])); - e.dest_z = static_cast(atof(row[26])); - e.dest_h = static_cast(atof(row[27])); - e.graveyard_zone_id = atoi(row[28]); - e.graveyard_x = static_cast(atof(row[29])); - e.graveyard_y = static_cast(atof(row[30])); - e.graveyard_z = static_cast(atof(row[31])); - e.graveyard_radius = static_cast(atof(row[32])); + e.duration = static_cast(strtoul(row[15], nullptr, 10)); + e.zone_in_time = static_cast(strtoul(row[16], nullptr, 10)); + e.win_points = static_cast(strtoul(row[17], nullptr, 10)); + e.lose_points = static_cast(strtoul(row[18], nullptr, 10)); + e.theme = static_cast(strtoul(row[19], nullptr, 10)); + e.zone_in_zone_id = static_cast(strtoul(row[20], nullptr, 10)); + e.zone_in_x = strtof(row[21], nullptr); + e.zone_in_y = strtof(row[22], nullptr); + e.zone_in_object_id = static_cast(atoi(row[23])); + e.dest_x = strtof(row[24], nullptr); + e.dest_y = strtof(row[25], nullptr); + e.dest_z = strtof(row[26], nullptr); + e.dest_h = strtof(row[27], nullptr); + e.graveyard_zone_id = static_cast(strtoul(row[28], nullptr, 10)); + e.graveyard_x = strtof(row[29], nullptr); + e.graveyard_y = strtof(row[30], nullptr); + e.graveyard_z = strtof(row[31], nullptr); return e; } @@ -490,39 +489,38 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureTemplate e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.zone_version = atoi(row[2]); - e.is_hard = atoi(row[3]); - e.is_raid = atoi(row[4]); - e.min_level = atoi(row[5]); - e.max_level = atoi(row[6]); - e.type = atoi(row[7]); - e.type_data = atoi(row[8]); - e.type_count = atoi(row[9]); - e.assa_x = static_cast(atof(row[10])); - e.assa_y = static_cast(atof(row[11])); - e.assa_z = static_cast(atof(row[12])); - e.assa_h = static_cast(atof(row[13])); + e.zone_version = static_cast(strtoul(row[2], nullptr, 10)); + e.is_hard = static_cast(strtoul(row[3], nullptr, 10)); + e.is_raid = static_cast(strtoul(row[4], nullptr, 10)); + e.min_level = static_cast(strtoul(row[5], nullptr, 10)); + e.max_level = static_cast(strtoul(row[6], nullptr, 10)); + e.type = static_cast(strtoul(row[7], nullptr, 10)); + e.type_data = static_cast(strtoul(row[8], nullptr, 10)); + e.type_count = static_cast(strtoul(row[9], nullptr, 10)); + e.assa_x = strtof(row[10], nullptr); + e.assa_y = strtof(row[11], nullptr); + e.assa_z = strtof(row[12], nullptr); + e.assa_h = strtof(row[13], nullptr); e.text = row[14] ? row[14] : ""; - e.duration = atoi(row[15]); - e.zone_in_time = atoi(row[16]); - e.win_points = atoi(row[17]); - e.lose_points = atoi(row[18]); - e.theme = atoi(row[19]); - e.zone_in_zone_id = atoi(row[20]); - e.zone_in_x = static_cast(atof(row[21])); - e.zone_in_y = static_cast(atof(row[22])); - e.zone_in_object_id = atoi(row[23]); - e.dest_x = static_cast(atof(row[24])); - e.dest_y = static_cast(atof(row[25])); - e.dest_z = static_cast(atof(row[26])); - e.dest_h = static_cast(atof(row[27])); - e.graveyard_zone_id = atoi(row[28]); - e.graveyard_x = static_cast(atof(row[29])); - e.graveyard_y = static_cast(atof(row[30])); - e.graveyard_z = static_cast(atof(row[31])); - e.graveyard_radius = static_cast(atof(row[32])); + e.duration = static_cast(strtoul(row[15], nullptr, 10)); + e.zone_in_time = static_cast(strtoul(row[16], nullptr, 10)); + e.win_points = static_cast(strtoul(row[17], nullptr, 10)); + e.lose_points = static_cast(strtoul(row[18], nullptr, 10)); + e.theme = static_cast(strtoul(row[19], nullptr, 10)); + e.zone_in_zone_id = static_cast(strtoul(row[20], nullptr, 10)); + e.zone_in_x = strtof(row[21], nullptr); + e.zone_in_y = strtof(row[22], nullptr); + e.zone_in_object_id = static_cast(atoi(row[23])); + e.dest_x = strtof(row[24], nullptr); + e.dest_y = strtof(row[25], nullptr); + e.dest_z = strtof(row[26], nullptr); + e.dest_h = strtof(row[27], nullptr); + e.graveyard_zone_id = static_cast(strtoul(row[28], nullptr, 10)); + e.graveyard_x = strtof(row[29], nullptr); + e.graveyard_y = strtof(row[30], nullptr); + e.graveyard_z = strtof(row[31], nullptr); all_entries.push_back(e); } @@ -547,39 +545,38 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AdventureTemplate e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.zone_version = atoi(row[2]); - e.is_hard = atoi(row[3]); - e.is_raid = atoi(row[4]); - e.min_level = atoi(row[5]); - e.max_level = atoi(row[6]); - e.type = atoi(row[7]); - e.type_data = atoi(row[8]); - e.type_count = atoi(row[9]); - e.assa_x = static_cast(atof(row[10])); - e.assa_y = static_cast(atof(row[11])); - e.assa_z = static_cast(atof(row[12])); - e.assa_h = static_cast(atof(row[13])); + e.zone_version = static_cast(strtoul(row[2], nullptr, 10)); + e.is_hard = static_cast(strtoul(row[3], nullptr, 10)); + e.is_raid = static_cast(strtoul(row[4], nullptr, 10)); + e.min_level = static_cast(strtoul(row[5], nullptr, 10)); + e.max_level = static_cast(strtoul(row[6], nullptr, 10)); + e.type = static_cast(strtoul(row[7], nullptr, 10)); + e.type_data = static_cast(strtoul(row[8], nullptr, 10)); + e.type_count = static_cast(strtoul(row[9], nullptr, 10)); + e.assa_x = strtof(row[10], nullptr); + e.assa_y = strtof(row[11], nullptr); + e.assa_z = strtof(row[12], nullptr); + e.assa_h = strtof(row[13], nullptr); e.text = row[14] ? row[14] : ""; - e.duration = atoi(row[15]); - e.zone_in_time = atoi(row[16]); - e.win_points = atoi(row[17]); - e.lose_points = atoi(row[18]); - e.theme = atoi(row[19]); - e.zone_in_zone_id = atoi(row[20]); - e.zone_in_x = static_cast(atof(row[21])); - e.zone_in_y = static_cast(atof(row[22])); - e.zone_in_object_id = atoi(row[23]); - e.dest_x = static_cast(atof(row[24])); - e.dest_y = static_cast(atof(row[25])); - e.dest_z = static_cast(atof(row[26])); - e.dest_h = static_cast(atof(row[27])); - e.graveyard_zone_id = atoi(row[28]); - e.graveyard_x = static_cast(atof(row[29])); - e.graveyard_y = static_cast(atof(row[30])); - e.graveyard_z = static_cast(atof(row[31])); - e.graveyard_radius = static_cast(atof(row[32])); + e.duration = static_cast(strtoul(row[15], nullptr, 10)); + e.zone_in_time = static_cast(strtoul(row[16], nullptr, 10)); + e.win_points = static_cast(strtoul(row[17], nullptr, 10)); + e.lose_points = static_cast(strtoul(row[18], nullptr, 10)); + e.theme = static_cast(strtoul(row[19], nullptr, 10)); + e.zone_in_zone_id = static_cast(strtoul(row[20], nullptr, 10)); + e.zone_in_x = strtof(row[21], nullptr); + e.zone_in_y = strtof(row[22], nullptr); + e.zone_in_object_id = static_cast(atoi(row[23])); + e.dest_x = strtof(row[24], nullptr); + e.dest_y = strtof(row[25], nullptr); + e.dest_z = strtof(row[26], nullptr); + e.dest_h = strtof(row[27], nullptr); + e.graveyard_zone_id = static_cast(strtoul(row[28], nullptr, 10)); + e.graveyard_x = strtof(row[29], nullptr); + e.graveyard_y = strtof(row[30], nullptr); + e.graveyard_z = strtof(row[31], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_alternate_currency_repository.h b/common/repositories/base/base_alternate_currency_repository.h index 2cedf8473..10798b859 100644 --- a/common/repositories/base/base_alternate_currency_repository.h +++ b/common/repositories/base/base_alternate_currency_repository.h @@ -19,8 +19,8 @@ class BaseAlternateCurrencyRepository { public: struct AlternateCurrency { - int id; - int item_id; + int32_t id; + int32_t item_id; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { AlternateCurrency e{}; - e.id = atoi(row[0]); - e.item_id = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.item_id = static_cast(atoi(row[1])); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AlternateCurrency e{}; - e.id = atoi(row[0]); - e.item_id = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.item_id = static_cast(atoi(row[1])); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { AlternateCurrency e{}; - e.id = atoi(row[0]); - e.item_id = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.item_id = static_cast(atoi(row[1])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_auras_repository.h b/common/repositories/base/base_auras_repository.h index 4078717ec..e527fa8aa 100644 --- a/common/repositories/base/base_auras_repository.h +++ b/common/repositories/base/base_auras_repository.h @@ -19,17 +19,17 @@ class BaseAurasRepository { public: struct Auras { - int type; - int npc_type; + int32_t type; + int32_t npc_type; std::string name; - int spell_id; - int distance; - int aura_type; - int spawn_type; - int movement; - int duration; - int icon; - int cast_time; + int32_t spell_id; + int32_t distance; + int32_t aura_type; + int32_t spawn_type; + int32_t movement; + int32_t duration; + int32_t icon; + int32_t cast_time; }; static std::string PrimaryKey() @@ -154,17 +154,17 @@ public: if (results.RowCount() == 1) { Auras e{}; - e.type = atoi(row[0]); - e.npc_type = atoi(row[1]); + e.type = static_cast(atoi(row[0])); + e.npc_type = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; - e.spell_id = atoi(row[3]); - e.distance = atoi(row[4]); - e.aura_type = atoi(row[5]); - e.spawn_type = atoi(row[6]); - e.movement = atoi(row[7]); - e.duration = atoi(row[8]); - e.icon = atoi(row[9]); - e.cast_time = atoi(row[10]); + e.spell_id = static_cast(atoi(row[3])); + e.distance = static_cast(atoi(row[4])); + e.aura_type = static_cast(atoi(row[5])); + e.spawn_type = static_cast(atoi(row[6])); + e.movement = static_cast(atoi(row[7])); + e.duration = static_cast(atoi(row[8])); + e.icon = static_cast(atoi(row[9])); + e.cast_time = static_cast(atoi(row[10])); return e; } @@ -314,17 +314,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Auras e{}; - e.type = atoi(row[0]); - e.npc_type = atoi(row[1]); + e.type = static_cast(atoi(row[0])); + e.npc_type = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; - e.spell_id = atoi(row[3]); - e.distance = atoi(row[4]); - e.aura_type = atoi(row[5]); - e.spawn_type = atoi(row[6]); - e.movement = atoi(row[7]); - e.duration = atoi(row[8]); - e.icon = atoi(row[9]); - e.cast_time = atoi(row[10]); + e.spell_id = static_cast(atoi(row[3])); + e.distance = static_cast(atoi(row[4])); + e.aura_type = static_cast(atoi(row[5])); + e.spawn_type = static_cast(atoi(row[6])); + e.movement = static_cast(atoi(row[7])); + e.duration = static_cast(atoi(row[8])); + e.icon = static_cast(atoi(row[9])); + e.cast_time = static_cast(atoi(row[10])); all_entries.push_back(e); } @@ -349,17 +349,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Auras e{}; - e.type = atoi(row[0]); - e.npc_type = atoi(row[1]); + e.type = static_cast(atoi(row[0])); + e.npc_type = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; - e.spell_id = atoi(row[3]); - e.distance = atoi(row[4]); - e.aura_type = atoi(row[5]); - e.spawn_type = atoi(row[6]); - e.movement = atoi(row[7]); - e.duration = atoi(row[8]); - e.icon = atoi(row[9]); - e.cast_time = atoi(row[10]); + e.spell_id = static_cast(atoi(row[3])); + e.distance = static_cast(atoi(row[4])); + e.aura_type = static_cast(atoi(row[5])); + e.spawn_type = static_cast(atoi(row[6])); + e.movement = static_cast(atoi(row[7])); + e.duration = static_cast(atoi(row[8])); + e.icon = static_cast(atoi(row[9])); + e.cast_time = static_cast(atoi(row[10])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_base_data_repository.h b/common/repositories/base/base_base_data_repository.h index 9c4ec52b1..8b41d99a8 100644 --- a/common/repositories/base/base_base_data_repository.h +++ b/common/repositories/base/base_base_data_repository.h @@ -19,16 +19,16 @@ class BaseBaseDataRepository { public: struct BaseData { - int level; - int class_; - float hp; - float mana; - float end; - float unk1; - float unk2; - float hp_fac; - float mana_fac; - float end_fac; + uint32_t level; + uint32_t class_; + double hp; + double mana; + double end; + double unk1; + double unk2; + double hp_fac; + double mana_fac; + double end_fac; }; static std::string PrimaryKey() @@ -150,16 +150,16 @@ public: if (results.RowCount() == 1) { BaseData e{}; - e.level = atoi(row[0]); - e.class_ = atoi(row[1]); - e.hp = static_cast(atof(row[2])); - e.mana = static_cast(atof(row[3])); - e.end = static_cast(atof(row[4])); - e.unk1 = static_cast(atof(row[5])); - e.unk2 = static_cast(atof(row[6])); - e.hp_fac = static_cast(atof(row[7])); - e.mana_fac = static_cast(atof(row[8])); - e.end_fac = static_cast(atof(row[9])); + e.level = static_cast(strtoul(row[0], nullptr, 10)); + e.class_ = static_cast(strtoul(row[1], nullptr, 10)); + e.hp = strtod(row[2], nullptr); + e.mana = strtod(row[3], nullptr); + e.end = strtod(row[4], nullptr); + e.unk1 = strtod(row[5], nullptr); + e.unk2 = strtod(row[6], nullptr); + e.hp_fac = strtod(row[7], nullptr); + e.mana_fac = strtod(row[8], nullptr); + e.end_fac = strtod(row[9], nullptr); return e; } @@ -306,16 +306,16 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { BaseData e{}; - e.level = atoi(row[0]); - e.class_ = atoi(row[1]); - e.hp = static_cast(atof(row[2])); - e.mana = static_cast(atof(row[3])); - e.end = static_cast(atof(row[4])); - e.unk1 = static_cast(atof(row[5])); - e.unk2 = static_cast(atof(row[6])); - e.hp_fac = static_cast(atof(row[7])); - e.mana_fac = static_cast(atof(row[8])); - e.end_fac = static_cast(atof(row[9])); + e.level = static_cast(strtoul(row[0], nullptr, 10)); + e.class_ = static_cast(strtoul(row[1], nullptr, 10)); + e.hp = strtod(row[2], nullptr); + e.mana = strtod(row[3], nullptr); + e.end = strtod(row[4], nullptr); + e.unk1 = strtod(row[5], nullptr); + e.unk2 = strtod(row[6], nullptr); + e.hp_fac = strtod(row[7], nullptr); + e.mana_fac = strtod(row[8], nullptr); + e.end_fac = strtod(row[9], nullptr); all_entries.push_back(e); } @@ -340,16 +340,16 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { BaseData e{}; - e.level = atoi(row[0]); - e.class_ = atoi(row[1]); - e.hp = static_cast(atof(row[2])); - e.mana = static_cast(atof(row[3])); - e.end = static_cast(atof(row[4])); - e.unk1 = static_cast(atof(row[5])); - e.unk2 = static_cast(atof(row[6])); - e.hp_fac = static_cast(atof(row[7])); - e.mana_fac = static_cast(atof(row[8])); - e.end_fac = static_cast(atof(row[9])); + e.level = static_cast(strtoul(row[0], nullptr, 10)); + e.class_ = static_cast(strtoul(row[1], nullptr, 10)); + e.hp = strtod(row[2], nullptr); + e.mana = strtod(row[3], nullptr); + e.end = strtod(row[4], nullptr); + e.unk1 = strtod(row[5], nullptr); + e.unk2 = strtod(row[6], nullptr); + e.hp_fac = strtod(row[7], nullptr); + e.mana_fac = strtod(row[8], nullptr); + e.end_fac = strtod(row[9], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_blocked_spells_repository.h b/common/repositories/base/base_blocked_spells_repository.h index e2e31e8f0..822849d90 100644 --- a/common/repositories/base/base_blocked_spells_repository.h +++ b/common/repositories/base/base_blocked_spells_repository.h @@ -19,10 +19,10 @@ class BaseBlockedSpellsRepository { public: struct BlockedSpells { - int id; - int spellid; - int type; - int zoneid; + int32_t id; + uint32_t spellid; + int8_t type; + int32_t zoneid; float x; float y; float z; @@ -158,16 +158,16 @@ public: if (results.RowCount() == 1) { BlockedSpells e{}; - e.id = atoi(row[0]); - e.spellid = atoi(row[1]); - e.type = atoi(row[2]); - e.zoneid = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.x_diff = static_cast(atof(row[7])); - e.y_diff = static_cast(atof(row[8])); - e.z_diff = static_cast(atof(row[9])); + e.id = static_cast(atoi(row[0])); + e.spellid = static_cast(strtoul(row[1], nullptr, 10)); + e.type = static_cast(atoi(row[2])); + e.zoneid = static_cast(atoi(row[3])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.x_diff = strtof(row[7], nullptr); + e.y_diff = strtof(row[8], nullptr); + e.z_diff = strtof(row[9], nullptr); e.message = row[10] ? row[10] : ""; e.description = row[11] ? row[11] : ""; @@ -321,16 +321,16 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { BlockedSpells e{}; - e.id = atoi(row[0]); - e.spellid = atoi(row[1]); - e.type = atoi(row[2]); - e.zoneid = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.x_diff = static_cast(atof(row[7])); - e.y_diff = static_cast(atof(row[8])); - e.z_diff = static_cast(atof(row[9])); + e.id = static_cast(atoi(row[0])); + e.spellid = static_cast(strtoul(row[1], nullptr, 10)); + e.type = static_cast(atoi(row[2])); + e.zoneid = static_cast(atoi(row[3])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.x_diff = strtof(row[7], nullptr); + e.y_diff = strtof(row[8], nullptr); + e.z_diff = strtof(row[9], nullptr); e.message = row[10] ? row[10] : ""; e.description = row[11] ? row[11] : ""; @@ -357,16 +357,16 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { BlockedSpells e{}; - e.id = atoi(row[0]); - e.spellid = atoi(row[1]); - e.type = atoi(row[2]); - e.zoneid = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.x_diff = static_cast(atof(row[7])); - e.y_diff = static_cast(atof(row[8])); - e.z_diff = static_cast(atof(row[9])); + e.id = static_cast(atoi(row[0])); + e.spellid = static_cast(strtoul(row[1], nullptr, 10)); + e.type = static_cast(atoi(row[2])); + e.zoneid = static_cast(atoi(row[3])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.x_diff = strtof(row[7], nullptr); + e.y_diff = strtof(row[8], nullptr); + e.z_diff = strtof(row[9], nullptr); e.message = row[10] ? row[10] : ""; e.description = row[11] ? row[11] : ""; diff --git a/common/repositories/base/base_books_repository.h b/common/repositories/base/base_books_repository.h index f0ddebe0d..badbb2e7b 100644 --- a/common/repositories/base/base_books_repository.h +++ b/common/repositories/base/base_books_repository.h @@ -19,10 +19,10 @@ class BaseBooksRepository { public: struct Books { - int id; + int32_t id; std::string name; std::string txtfile; - int language; + int32_t language; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { Books e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.txtfile = row[2] ? row[2] : ""; - e.language = atoi(row[3]); + e.language = static_cast(atoi(row[3])); return e; } @@ -257,10 +257,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Books e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.txtfile = row[2] ? row[2] : ""; - e.language = atoi(row[3]); + e.language = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -285,10 +285,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Books e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.txtfile = row[2] ? row[2] : ""; - e.language = atoi(row[3]); + e.language = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_bug_reports_repository.h b/common/repositories/base/base_bug_reports_repository.h index 9e068b184..5e38742fa 100644 --- a/common/repositories/base/base_bug_reports_repository.h +++ b/common/repositories/base/base_bug_reports_repository.h @@ -19,35 +19,35 @@ class BaseBugReportsRepository { public: struct BugReports { - int id; + uint32_t id; std::string zone; - int client_version_id; + uint32_t client_version_id; std::string client_version_name; - int account_id; - int character_id; + uint32_t account_id; + uint32_t character_id; std::string character_name; - int reporter_spoof; - int category_id; + int8_t reporter_spoof; + uint32_t category_id; std::string category_name; std::string reporter_name; std::string ui_path; float pos_x; float pos_y; float pos_z; - int heading; - int time_played; - int target_id; + uint32_t heading; + uint32_t time_played; + uint32_t target_id; std::string target_name; - int optional_info_mask; - int _can_duplicate; - int _crash_bug; - int _target_info; - int _character_flags; - int _unknown_value; + uint32_t optional_info_mask; + int8_t _can_duplicate; + int8_t _crash_bug; + int8_t _target_info; + int8_t _character_flags; + int8_t _unknown_value; std::string bug_report; std::string system_info; time_t report_datetime; - int bug_status; + uint8_t bug_status; time_t last_review; std::string last_reviewer; std::string reviewer_notes; @@ -238,35 +238,35 @@ public: if (results.RowCount() == 1) { BugReports e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.client_version_id = atoi(row[2]); + e.client_version_id = static_cast(strtoul(row[2], nullptr, 10)); e.client_version_name = row[3] ? row[3] : ""; - e.account_id = atoi(row[4]); - e.character_id = atoi(row[5]); + e.account_id = static_cast(strtoul(row[4], nullptr, 10)); + e.character_id = static_cast(strtoul(row[5], nullptr, 10)); e.character_name = row[6] ? row[6] : ""; - e.reporter_spoof = atoi(row[7]); - e.category_id = atoi(row[8]); + e.reporter_spoof = static_cast(atoi(row[7])); + e.category_id = static_cast(strtoul(row[8], nullptr, 10)); e.category_name = row[9] ? row[9] : ""; e.reporter_name = row[10] ? row[10] : ""; e.ui_path = row[11] ? row[11] : ""; - e.pos_x = static_cast(atof(row[12])); - e.pos_y = static_cast(atof(row[13])); - e.pos_z = static_cast(atof(row[14])); - e.heading = atoi(row[15]); - e.time_played = atoi(row[16]); - e.target_id = atoi(row[17]); + e.pos_x = strtof(row[12], nullptr); + e.pos_y = strtof(row[13], nullptr); + e.pos_z = strtof(row[14], nullptr); + e.heading = static_cast(strtoul(row[15], nullptr, 10)); + e.time_played = static_cast(strtoul(row[16], nullptr, 10)); + e.target_id = static_cast(strtoul(row[17], nullptr, 10)); e.target_name = row[18] ? row[18] : ""; - e.optional_info_mask = atoi(row[19]); - e._can_duplicate = atoi(row[20]); - e._crash_bug = atoi(row[21]); - e._target_info = atoi(row[22]); - e._character_flags = atoi(row[23]); - e._unknown_value = atoi(row[24]); + e.optional_info_mask = static_cast(strtoul(row[19], nullptr, 10)); + e._can_duplicate = static_cast(atoi(row[20])); + e._crash_bug = static_cast(atoi(row[21])); + e._target_info = static_cast(atoi(row[22])); + e._character_flags = static_cast(atoi(row[23])); + e._unknown_value = static_cast(atoi(row[24])); e.bug_report = row[25] ? row[25] : ""; e.system_info = row[26] ? row[26] : ""; e.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10); - e.bug_status = atoi(row[28]); + e.bug_status = static_cast(strtoul(row[28], nullptr, 10)); e.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10); e.last_reviewer = row[30] ? row[30] : ""; e.reviewer_notes = row[31] ? row[31] : ""; @@ -481,35 +481,35 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { BugReports e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.client_version_id = atoi(row[2]); + e.client_version_id = static_cast(strtoul(row[2], nullptr, 10)); e.client_version_name = row[3] ? row[3] : ""; - e.account_id = atoi(row[4]); - e.character_id = atoi(row[5]); + e.account_id = static_cast(strtoul(row[4], nullptr, 10)); + e.character_id = static_cast(strtoul(row[5], nullptr, 10)); e.character_name = row[6] ? row[6] : ""; - e.reporter_spoof = atoi(row[7]); - e.category_id = atoi(row[8]); + e.reporter_spoof = static_cast(atoi(row[7])); + e.category_id = static_cast(strtoul(row[8], nullptr, 10)); e.category_name = row[9] ? row[9] : ""; e.reporter_name = row[10] ? row[10] : ""; e.ui_path = row[11] ? row[11] : ""; - e.pos_x = static_cast(atof(row[12])); - e.pos_y = static_cast(atof(row[13])); - e.pos_z = static_cast(atof(row[14])); - e.heading = atoi(row[15]); - e.time_played = atoi(row[16]); - e.target_id = atoi(row[17]); + e.pos_x = strtof(row[12], nullptr); + e.pos_y = strtof(row[13], nullptr); + e.pos_z = strtof(row[14], nullptr); + e.heading = static_cast(strtoul(row[15], nullptr, 10)); + e.time_played = static_cast(strtoul(row[16], nullptr, 10)); + e.target_id = static_cast(strtoul(row[17], nullptr, 10)); e.target_name = row[18] ? row[18] : ""; - e.optional_info_mask = atoi(row[19]); - e._can_duplicate = atoi(row[20]); - e._crash_bug = atoi(row[21]); - e._target_info = atoi(row[22]); - e._character_flags = atoi(row[23]); - e._unknown_value = atoi(row[24]); + e.optional_info_mask = static_cast(strtoul(row[19], nullptr, 10)); + e._can_duplicate = static_cast(atoi(row[20])); + e._crash_bug = static_cast(atoi(row[21])); + e._target_info = static_cast(atoi(row[22])); + e._character_flags = static_cast(atoi(row[23])); + e._unknown_value = static_cast(atoi(row[24])); e.bug_report = row[25] ? row[25] : ""; e.system_info = row[26] ? row[26] : ""; e.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10); - e.bug_status = atoi(row[28]); + e.bug_status = static_cast(strtoul(row[28], nullptr, 10)); e.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10); e.last_reviewer = row[30] ? row[30] : ""; e.reviewer_notes = row[31] ? row[31] : ""; @@ -537,35 +537,35 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { BugReports e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.client_version_id = atoi(row[2]); + e.client_version_id = static_cast(strtoul(row[2], nullptr, 10)); e.client_version_name = row[3] ? row[3] : ""; - e.account_id = atoi(row[4]); - e.character_id = atoi(row[5]); + e.account_id = static_cast(strtoul(row[4], nullptr, 10)); + e.character_id = static_cast(strtoul(row[5], nullptr, 10)); e.character_name = row[6] ? row[6] : ""; - e.reporter_spoof = atoi(row[7]); - e.category_id = atoi(row[8]); + e.reporter_spoof = static_cast(atoi(row[7])); + e.category_id = static_cast(strtoul(row[8], nullptr, 10)); e.category_name = row[9] ? row[9] : ""; e.reporter_name = row[10] ? row[10] : ""; e.ui_path = row[11] ? row[11] : ""; - e.pos_x = static_cast(atof(row[12])); - e.pos_y = static_cast(atof(row[13])); - e.pos_z = static_cast(atof(row[14])); - e.heading = atoi(row[15]); - e.time_played = atoi(row[16]); - e.target_id = atoi(row[17]); + e.pos_x = strtof(row[12], nullptr); + e.pos_y = strtof(row[13], nullptr); + e.pos_z = strtof(row[14], nullptr); + e.heading = static_cast(strtoul(row[15], nullptr, 10)); + e.time_played = static_cast(strtoul(row[16], nullptr, 10)); + e.target_id = static_cast(strtoul(row[17], nullptr, 10)); e.target_name = row[18] ? row[18] : ""; - e.optional_info_mask = atoi(row[19]); - e._can_duplicate = atoi(row[20]); - e._crash_bug = atoi(row[21]); - e._target_info = atoi(row[22]); - e._character_flags = atoi(row[23]); - e._unknown_value = atoi(row[24]); + e.optional_info_mask = static_cast(strtoul(row[19], nullptr, 10)); + e._can_duplicate = static_cast(atoi(row[20])); + e._crash_bug = static_cast(atoi(row[21])); + e._target_info = static_cast(atoi(row[22])); + e._character_flags = static_cast(atoi(row[23])); + e._unknown_value = static_cast(atoi(row[24])); e.bug_report = row[25] ? row[25] : ""; e.system_info = row[26] ? row[26] : ""; e.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10); - e.bug_status = atoi(row[28]); + e.bug_status = static_cast(strtoul(row[28], nullptr, 10)); e.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10); e.last_reviewer = row[30] ? row[30] : ""; e.reviewer_notes = row[31] ? row[31] : ""; diff --git a/common/repositories/base/base_bugs_repository.h b/common/repositories/base/base_bugs_repository.h index 795e368aa..381fc4d01 100644 --- a/common/repositories/base/base_bugs_repository.h +++ b/common/repositories/base/base_bugs_repository.h @@ -19,7 +19,7 @@ class BaseBugsRepository { public: struct Bugs { - int id; + uint32_t id; std::string zone; std::string name; std::string ui; @@ -27,11 +27,11 @@ public: float y; float z; std::string type; - int flag; + uint8_t flag; std::string target; std::string bug; std::string date; - int status; + uint8_t status; }; static std::string PrimaryKey() @@ -162,19 +162,19 @@ public: if (results.RowCount() == 1) { Bugs e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; e.name = row[2] ? row[2] : ""; e.ui = row[3] ? row[3] : ""; - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); e.type = row[7] ? row[7] : ""; - e.flag = atoi(row[8]); + e.flag = static_cast(strtoul(row[8], nullptr, 10)); e.target = row[9] ? row[9] : ""; e.bug = row[10] ? row[10] : ""; e.date = row[11] ? row[11] : ""; - e.status = atoi(row[12]); + e.status = static_cast(strtoul(row[12], nullptr, 10)); return e; } @@ -329,19 +329,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Bugs e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; e.name = row[2] ? row[2] : ""; e.ui = row[3] ? row[3] : ""; - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); e.type = row[7] ? row[7] : ""; - e.flag = atoi(row[8]); + e.flag = static_cast(strtoul(row[8], nullptr, 10)); e.target = row[9] ? row[9] : ""; e.bug = row[10] ? row[10] : ""; e.date = row[11] ? row[11] : ""; - e.status = atoi(row[12]); + e.status = static_cast(strtoul(row[12], nullptr, 10)); all_entries.push_back(e); } @@ -366,19 +366,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Bugs e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; e.name = row[2] ? row[2] : ""; e.ui = row[3] ? row[3] : ""; - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); e.type = row[7] ? row[7] : ""; - e.flag = atoi(row[8]); + e.flag = static_cast(strtoul(row[8], nullptr, 10)); e.target = row[9] ? row[9] : ""; e.bug = row[10] ? row[10] : ""; e.date = row[11] ? row[11] : ""; - e.status = atoi(row[12]); + e.status = static_cast(strtoul(row[12], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_buyer_repository.h b/common/repositories/base/base_buyer_repository.h index da497d910..1e365481f 100644 --- a/common/repositories/base/base_buyer_repository.h +++ b/common/repositories/base/base_buyer_repository.h @@ -19,12 +19,12 @@ class BaseBuyerRepository { public: struct Buyer { - int charid; - int buyslot; - int itemid; + int32_t charid; + int32_t buyslot; + int32_t itemid; std::string itemname; - int quantity; - int price; + int32_t quantity; + int32_t price; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { Buyer e{}; - e.charid = atoi(row[0]); - e.buyslot = atoi(row[1]); - e.itemid = atoi(row[2]); + e.charid = static_cast(atoi(row[0])); + e.buyslot = static_cast(atoi(row[1])); + e.itemid = static_cast(atoi(row[2])); e.itemname = row[3] ? row[3] : ""; - e.quantity = atoi(row[4]); - e.price = atoi(row[5]); + e.quantity = static_cast(atoi(row[4])); + e.price = static_cast(atoi(row[5])); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Buyer e{}; - e.charid = atoi(row[0]); - e.buyslot = atoi(row[1]); - e.itemid = atoi(row[2]); + e.charid = static_cast(atoi(row[0])); + e.buyslot = static_cast(atoi(row[1])); + e.itemid = static_cast(atoi(row[2])); e.itemname = row[3] ? row[3] : ""; - e.quantity = atoi(row[4]); - e.price = atoi(row[5]); + e.quantity = static_cast(atoi(row[4])); + e.price = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Buyer e{}; - e.charid = atoi(row[0]); - e.buyslot = atoi(row[1]); - e.itemid = atoi(row[2]); + e.charid = static_cast(atoi(row[0])); + e.buyslot = static_cast(atoi(row[1])); + e.itemid = static_cast(atoi(row[2])); e.itemname = row[3] ? row[3] : ""; - e.quantity = atoi(row[4]); - e.price = atoi(row[5]); + e.quantity = static_cast(atoi(row[4])); + e.price = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_char_create_combinations_repository.h b/common/repositories/base/base_char_create_combinations_repository.h index f922ef4c7..98eae33a9 100644 --- a/common/repositories/base/base_char_create_combinations_repository.h +++ b/common/repositories/base/base_char_create_combinations_repository.h @@ -19,12 +19,12 @@ class BaseCharCreateCombinationsRepository { public: struct CharCreateCombinations { - int allocation_id; - int race; - int class_; - int deity; - int start_zone; - int expansions_req; + uint32_t allocation_id; + uint32_t race; + uint32_t class_; + uint32_t deity; + uint32_t start_zone; + uint32_t expansions_req; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { CharCreateCombinations e{}; - e.allocation_id = atoi(row[0]); - e.race = atoi(row[1]); - e.class_ = atoi(row[2]); - e.deity = atoi(row[3]); - e.start_zone = atoi(row[4]); - e.expansions_req = atoi(row[5]); + e.allocation_id = static_cast(strtoul(row[0], nullptr, 10)); + e.race = static_cast(strtoul(row[1], nullptr, 10)); + e.class_ = static_cast(strtoul(row[2], nullptr, 10)); + e.deity = static_cast(strtoul(row[3], nullptr, 10)); + e.start_zone = static_cast(strtoul(row[4], nullptr, 10)); + e.expansions_req = static_cast(strtoul(row[5], nullptr, 10)); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharCreateCombinations e{}; - e.allocation_id = atoi(row[0]); - e.race = atoi(row[1]); - e.class_ = atoi(row[2]); - e.deity = atoi(row[3]); - e.start_zone = atoi(row[4]); - e.expansions_req = atoi(row[5]); + e.allocation_id = static_cast(strtoul(row[0], nullptr, 10)); + e.race = static_cast(strtoul(row[1], nullptr, 10)); + e.class_ = static_cast(strtoul(row[2], nullptr, 10)); + e.deity = static_cast(strtoul(row[3], nullptr, 10)); + e.start_zone = static_cast(strtoul(row[4], nullptr, 10)); + e.expansions_req = static_cast(strtoul(row[5], nullptr, 10)); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharCreateCombinations e{}; - e.allocation_id = atoi(row[0]); - e.race = atoi(row[1]); - e.class_ = atoi(row[2]); - e.deity = atoi(row[3]); - e.start_zone = atoi(row[4]); - e.expansions_req = atoi(row[5]); + e.allocation_id = static_cast(strtoul(row[0], nullptr, 10)); + e.race = static_cast(strtoul(row[1], nullptr, 10)); + e.class_ = static_cast(strtoul(row[2], nullptr, 10)); + e.deity = static_cast(strtoul(row[3], nullptr, 10)); + e.start_zone = static_cast(strtoul(row[4], nullptr, 10)); + e.expansions_req = static_cast(strtoul(row[5], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_char_create_point_allocations_repository.h b/common/repositories/base/base_char_create_point_allocations_repository.h index 80aa317f1..4573a025b 100644 --- a/common/repositories/base/base_char_create_point_allocations_repository.h +++ b/common/repositories/base/base_char_create_point_allocations_repository.h @@ -19,21 +19,21 @@ class BaseCharCreatePointAllocationsRepository { public: struct CharCreatePointAllocations { - int id; - int base_str; - int base_sta; - int base_dex; - int base_agi; - int base_int; - int base_wis; - int base_cha; - int alloc_str; - int alloc_sta; - int alloc_dex; - int alloc_agi; - int alloc_int; - int alloc_wis; - int alloc_cha; + uint32_t id; + uint32_t base_str; + uint32_t base_sta; + uint32_t base_dex; + uint32_t base_agi; + uint32_t base_int; + uint32_t base_wis; + uint32_t base_cha; + uint32_t alloc_str; + uint32_t alloc_sta; + uint32_t alloc_dex; + uint32_t alloc_agi; + uint32_t alloc_int; + uint32_t alloc_wis; + uint32_t alloc_cha; }; static std::string PrimaryKey() @@ -170,21 +170,21 @@ public: if (results.RowCount() == 1) { CharCreatePointAllocations e{}; - e.id = atoi(row[0]); - e.base_str = atoi(row[1]); - e.base_sta = atoi(row[2]); - e.base_dex = atoi(row[3]); - e.base_agi = atoi(row[4]); - e.base_int = atoi(row[5]); - e.base_wis = atoi(row[6]); - e.base_cha = atoi(row[7]); - e.alloc_str = atoi(row[8]); - e.alloc_sta = atoi(row[9]); - e.alloc_dex = atoi(row[10]); - e.alloc_agi = atoi(row[11]); - e.alloc_int = atoi(row[12]); - e.alloc_wis = atoi(row[13]); - e.alloc_cha = atoi(row[14]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.base_str = static_cast(strtoul(row[1], nullptr, 10)); + e.base_sta = static_cast(strtoul(row[2], nullptr, 10)); + e.base_dex = static_cast(strtoul(row[3], nullptr, 10)); + e.base_agi = static_cast(strtoul(row[4], nullptr, 10)); + e.base_int = static_cast(strtoul(row[5], nullptr, 10)); + e.base_wis = static_cast(strtoul(row[6], nullptr, 10)); + e.base_cha = static_cast(strtoul(row[7], nullptr, 10)); + e.alloc_str = static_cast(strtoul(row[8], nullptr, 10)); + e.alloc_sta = static_cast(strtoul(row[9], nullptr, 10)); + e.alloc_dex = static_cast(strtoul(row[10], nullptr, 10)); + e.alloc_agi = static_cast(strtoul(row[11], nullptr, 10)); + e.alloc_int = static_cast(strtoul(row[12], nullptr, 10)); + e.alloc_wis = static_cast(strtoul(row[13], nullptr, 10)); + e.alloc_cha = static_cast(strtoul(row[14], nullptr, 10)); return e; } @@ -346,21 +346,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharCreatePointAllocations e{}; - e.id = atoi(row[0]); - e.base_str = atoi(row[1]); - e.base_sta = atoi(row[2]); - e.base_dex = atoi(row[3]); - e.base_agi = atoi(row[4]); - e.base_int = atoi(row[5]); - e.base_wis = atoi(row[6]); - e.base_cha = atoi(row[7]); - e.alloc_str = atoi(row[8]); - e.alloc_sta = atoi(row[9]); - e.alloc_dex = atoi(row[10]); - e.alloc_agi = atoi(row[11]); - e.alloc_int = atoi(row[12]); - e.alloc_wis = atoi(row[13]); - e.alloc_cha = atoi(row[14]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.base_str = static_cast(strtoul(row[1], nullptr, 10)); + e.base_sta = static_cast(strtoul(row[2], nullptr, 10)); + e.base_dex = static_cast(strtoul(row[3], nullptr, 10)); + e.base_agi = static_cast(strtoul(row[4], nullptr, 10)); + e.base_int = static_cast(strtoul(row[5], nullptr, 10)); + e.base_wis = static_cast(strtoul(row[6], nullptr, 10)); + e.base_cha = static_cast(strtoul(row[7], nullptr, 10)); + e.alloc_str = static_cast(strtoul(row[8], nullptr, 10)); + e.alloc_sta = static_cast(strtoul(row[9], nullptr, 10)); + e.alloc_dex = static_cast(strtoul(row[10], nullptr, 10)); + e.alloc_agi = static_cast(strtoul(row[11], nullptr, 10)); + e.alloc_int = static_cast(strtoul(row[12], nullptr, 10)); + e.alloc_wis = static_cast(strtoul(row[13], nullptr, 10)); + e.alloc_cha = static_cast(strtoul(row[14], nullptr, 10)); all_entries.push_back(e); } @@ -385,21 +385,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharCreatePointAllocations e{}; - e.id = atoi(row[0]); - e.base_str = atoi(row[1]); - e.base_sta = atoi(row[2]); - e.base_dex = atoi(row[3]); - e.base_agi = atoi(row[4]); - e.base_int = atoi(row[5]); - e.base_wis = atoi(row[6]); - e.base_cha = atoi(row[7]); - e.alloc_str = atoi(row[8]); - e.alloc_sta = atoi(row[9]); - e.alloc_dex = atoi(row[10]); - e.alloc_agi = atoi(row[11]); - e.alloc_int = atoi(row[12]); - e.alloc_wis = atoi(row[13]); - e.alloc_cha = atoi(row[14]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.base_str = static_cast(strtoul(row[1], nullptr, 10)); + e.base_sta = static_cast(strtoul(row[2], nullptr, 10)); + e.base_dex = static_cast(strtoul(row[3], nullptr, 10)); + e.base_agi = static_cast(strtoul(row[4], nullptr, 10)); + e.base_int = static_cast(strtoul(row[5], nullptr, 10)); + e.base_wis = static_cast(strtoul(row[6], nullptr, 10)); + e.base_cha = static_cast(strtoul(row[7], nullptr, 10)); + e.alloc_str = static_cast(strtoul(row[8], nullptr, 10)); + e.alloc_sta = static_cast(strtoul(row[9], nullptr, 10)); + e.alloc_dex = static_cast(strtoul(row[10], nullptr, 10)); + e.alloc_agi = static_cast(strtoul(row[11], nullptr, 10)); + e.alloc_int = static_cast(strtoul(row[12], nullptr, 10)); + e.alloc_wis = static_cast(strtoul(row[13], nullptr, 10)); + e.alloc_cha = static_cast(strtoul(row[14], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_char_recipe_list_repository.h b/common/repositories/base/base_char_recipe_list_repository.h index 2d23d2101..5ae76ef4f 100644 --- a/common/repositories/base/base_char_recipe_list_repository.h +++ b/common/repositories/base/base_char_recipe_list_repository.h @@ -19,9 +19,9 @@ class BaseCharRecipeListRepository { public: struct CharRecipeList { - int char_id; - int recipe_id; - int madecount; + int32_t char_id; + int32_t recipe_id; + int32_t madecount; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharRecipeList e{}; - e.char_id = atoi(row[0]); - e.recipe_id = atoi(row[1]); - e.madecount = atoi(row[2]); + e.char_id = static_cast(atoi(row[0])); + e.recipe_id = static_cast(atoi(row[1])); + e.madecount = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharRecipeList e{}; - e.char_id = atoi(row[0]); - e.recipe_id = atoi(row[1]); - e.madecount = atoi(row[2]); + e.char_id = static_cast(atoi(row[0])); + e.recipe_id = static_cast(atoi(row[1])); + e.madecount = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharRecipeList e{}; - e.char_id = atoi(row[0]); - e.recipe_id = atoi(row[1]); - e.madecount = atoi(row[2]); + e.char_id = static_cast(atoi(row[0])); + e.recipe_id = static_cast(atoi(row[1])); + e.madecount = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_activities_repository.h b/common/repositories/base/base_character_activities_repository.h index 20733d6b5..b365bd81a 100644 --- a/common/repositories/base/base_character_activities_repository.h +++ b/common/repositories/base/base_character_activities_repository.h @@ -19,11 +19,11 @@ class BaseCharacterActivitiesRepository { public: struct CharacterActivities { - int charid; - int taskid; - int activityid; - int donecount; - int completed; + uint32_t charid; + uint32_t taskid; + uint32_t activityid; + uint32_t donecount; + int8_t completed; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { CharacterActivities e{}; - e.charid = atoi(row[0]); - e.taskid = atoi(row[1]); - e.activityid = atoi(row[2]); - e.donecount = atoi(row[3]); - e.completed = atoi(row[4]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); + e.activityid = static_cast(strtoul(row[2], nullptr, 10)); + e.donecount = static_cast(strtoul(row[3], nullptr, 10)); + e.completed = static_cast(atoi(row[4])); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterActivities e{}; - e.charid = atoi(row[0]); - e.taskid = atoi(row[1]); - e.activityid = atoi(row[2]); - e.donecount = atoi(row[3]); - e.completed = atoi(row[4]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); + e.activityid = static_cast(strtoul(row[2], nullptr, 10)); + e.donecount = static_cast(strtoul(row[3], nullptr, 10)); + e.completed = static_cast(atoi(row[4])); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterActivities e{}; - e.charid = atoi(row[0]); - e.taskid = atoi(row[1]); - e.activityid = atoi(row[2]); - e.donecount = atoi(row[3]); - e.completed = atoi(row[4]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); + e.activityid = static_cast(strtoul(row[2], nullptr, 10)); + e.donecount = static_cast(strtoul(row[3], nullptr, 10)); + e.completed = static_cast(atoi(row[4])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_alt_currency_repository.h b/common/repositories/base/base_character_alt_currency_repository.h index f0c1f036c..054bf0b01 100644 --- a/common/repositories/base/base_character_alt_currency_repository.h +++ b/common/repositories/base/base_character_alt_currency_repository.h @@ -19,9 +19,9 @@ class BaseCharacterAltCurrencyRepository { public: struct CharacterAltCurrency { - int char_id; - int currency_id; - int amount; + uint32_t char_id; + uint32_t currency_id; + uint32_t amount; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterAltCurrency e{}; - e.char_id = atoi(row[0]); - e.currency_id = atoi(row[1]); - e.amount = atoi(row[2]); + e.char_id = static_cast(strtoul(row[0], nullptr, 10)); + e.currency_id = static_cast(strtoul(row[1], nullptr, 10)); + e.amount = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterAltCurrency e{}; - e.char_id = atoi(row[0]); - e.currency_id = atoi(row[1]); - e.amount = atoi(row[2]); + e.char_id = static_cast(strtoul(row[0], nullptr, 10)); + e.currency_id = static_cast(strtoul(row[1], nullptr, 10)); + e.amount = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterAltCurrency e{}; - e.char_id = atoi(row[0]); - e.currency_id = atoi(row[1]); - e.amount = atoi(row[2]); + e.char_id = static_cast(strtoul(row[0], nullptr, 10)); + e.currency_id = static_cast(strtoul(row[1], nullptr, 10)); + e.amount = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_alternate_abilities_repository.h b/common/repositories/base/base_character_alternate_abilities_repository.h index 5499c1ecf..c7009e487 100644 --- a/common/repositories/base/base_character_alternate_abilities_repository.h +++ b/common/repositories/base/base_character_alternate_abilities_repository.h @@ -19,10 +19,10 @@ class BaseCharacterAlternateAbilitiesRepository { public: struct CharacterAlternateAbilities { - int id; - int aa_id; - int aa_value; - int charges; + uint32_t id; + uint16_t aa_id; + uint16_t aa_value; + uint16_t charges; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { CharacterAlternateAbilities e{}; - e.id = atoi(row[0]); - e.aa_id = atoi(row[1]); - e.aa_value = atoi(row[2]); - e.charges = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.aa_id = static_cast(strtoul(row[1], nullptr, 10)); + e.aa_value = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterAlternateAbilities e{}; - e.id = atoi(row[0]); - e.aa_id = atoi(row[1]); - e.aa_value = atoi(row[2]); - e.charges = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.aa_id = static_cast(strtoul(row[1], nullptr, 10)); + e.aa_value = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterAlternateAbilities e{}; - e.id = atoi(row[0]); - e.aa_id = atoi(row[1]); - e.aa_value = atoi(row[2]); - e.charges = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.aa_id = static_cast(strtoul(row[1], nullptr, 10)); + e.aa_value = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_auras_repository.h b/common/repositories/base/base_character_auras_repository.h index 1092713e8..b2334e5ce 100644 --- a/common/repositories/base/base_character_auras_repository.h +++ b/common/repositories/base/base_character_auras_repository.h @@ -19,9 +19,9 @@ class BaseCharacterAurasRepository { public: struct CharacterAuras { - int id; - int slot; - int spell_id; + int32_t id; + int8_t slot; + int32_t spell_id; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterAuras e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.spell_id = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterAuras e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.spell_id = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterAuras e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.spell_id = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_bandolier_repository.h b/common/repositories/base/base_character_bandolier_repository.h index fa5e2db5c..2aca3aedf 100644 --- a/common/repositories/base/base_character_bandolier_repository.h +++ b/common/repositories/base/base_character_bandolier_repository.h @@ -19,11 +19,11 @@ class BaseCharacterBandolierRepository { public: struct CharacterBandolier { - int id; - int bandolier_id; - int bandolier_slot; - int item_id; - int icon; + uint32_t id; + uint8_t bandolier_id; + uint8_t bandolier_slot; + uint32_t item_id; + uint32_t icon; std::string bandolier_name; }; @@ -134,11 +134,11 @@ public: if (results.RowCount() == 1) { CharacterBandolier e{}; - e.id = atoi(row[0]); - e.bandolier_id = atoi(row[1]); - e.bandolier_slot = atoi(row[2]); - e.item_id = atoi(row[3]); - e.icon = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.bandolier_id = static_cast(strtoul(row[1], nullptr, 10)); + e.bandolier_slot = static_cast(strtoul(row[2], nullptr, 10)); + e.item_id = static_cast(strtoul(row[3], nullptr, 10)); + e.icon = static_cast(strtoul(row[4], nullptr, 10)); e.bandolier_name = row[5] ? row[5] : ""; return e; @@ -274,11 +274,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterBandolier e{}; - e.id = atoi(row[0]); - e.bandolier_id = atoi(row[1]); - e.bandolier_slot = atoi(row[2]); - e.item_id = atoi(row[3]); - e.icon = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.bandolier_id = static_cast(strtoul(row[1], nullptr, 10)); + e.bandolier_slot = static_cast(strtoul(row[2], nullptr, 10)); + e.item_id = static_cast(strtoul(row[3], nullptr, 10)); + e.icon = static_cast(strtoul(row[4], nullptr, 10)); e.bandolier_name = row[5] ? row[5] : ""; all_entries.push_back(e); @@ -304,11 +304,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterBandolier e{}; - e.id = atoi(row[0]); - e.bandolier_id = atoi(row[1]); - e.bandolier_slot = atoi(row[2]); - e.item_id = atoi(row[3]); - e.icon = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.bandolier_id = static_cast(strtoul(row[1], nullptr, 10)); + e.bandolier_slot = static_cast(strtoul(row[2], nullptr, 10)); + e.item_id = static_cast(strtoul(row[3], nullptr, 10)); + e.icon = static_cast(strtoul(row[4], nullptr, 10)); e.bandolier_name = row[5] ? row[5] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_character_bind_repository.h b/common/repositories/base/base_character_bind_repository.h index 1b9f83f86..12ce7d52e 100644 --- a/common/repositories/base/base_character_bind_repository.h +++ b/common/repositories/base/base_character_bind_repository.h @@ -19,14 +19,14 @@ class BaseCharacterBindRepository { public: struct CharacterBind { - int id; - int slot; - int zone_id; - int instance_id; - float x; - float y; - float z; - float heading; + uint32_t id; + int32_t slot; + uint16_t zone_id; + uint32_t instance_id; + float x; + float y; + float z; + float heading; }; static std::string PrimaryKey() @@ -142,14 +142,14 @@ public: if (results.RowCount() == 1) { CharacterBind e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(atoi(row[1])); + e.zone_id = static_cast(strtoul(row[2], nullptr, 10)); + e.instance_id = static_cast(strtoul(row[3], nullptr, 10)); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); return e; } @@ -289,14 +289,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterBind e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(atoi(row[1])); + e.zone_id = static_cast(strtoul(row[2], nullptr, 10)); + e.instance_id = static_cast(strtoul(row[3], nullptr, 10)); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); all_entries.push_back(e); } @@ -321,14 +321,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterBind e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(atoi(row[1])); + e.zone_id = static_cast(strtoul(row[2], nullptr, 10)); + e.instance_id = static_cast(strtoul(row[3], nullptr, 10)); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_buffs_repository.h b/common/repositories/base/base_character_buffs_repository.h index b9f200a17..e4de463a3 100644 --- a/common/repositories/base/base_character_buffs_repository.h +++ b/common/repositories/base/base_character_buffs_repository.h @@ -19,23 +19,23 @@ class BaseCharacterBuffsRepository { public: struct CharacterBuffs { - int character_id; - int slot_id; - int spell_id; - int caster_level; + uint32_t character_id; + uint8_t slot_id; + uint16_t spell_id; + uint8_t caster_level; std::string caster_name; - int ticsremaining; - int counters; - int numhits; - int melee_rune; - int magic_rune; - int persistent; - int dot_rune; - int caston_x; - int caston_y; - int caston_z; - int ExtraDIChance; - int instrument_mod; + int32_t ticsremaining; + uint32_t counters; + uint32_t numhits; + uint32_t melee_rune; + uint32_t magic_rune; + uint8_t persistent; + int32_t dot_rune; + int32_t caston_x; + int32_t caston_y; + int32_t caston_z; + int32_t ExtraDIChance; + int32_t instrument_mod; }; static std::string PrimaryKey() @@ -178,23 +178,23 @@ public: if (results.RowCount() == 1) { CharacterBuffs e{}; - e.character_id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); - e.caster_level = atoi(row[3]); + e.character_id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); + e.caster_level = static_cast(strtoul(row[3], nullptr, 10)); e.caster_name = row[4] ? row[4] : ""; - e.ticsremaining = atoi(row[5]); - e.counters = atoi(row[6]); - e.numhits = atoi(row[7]); - e.melee_rune = atoi(row[8]); - e.magic_rune = atoi(row[9]); - e.persistent = atoi(row[10]); - e.dot_rune = atoi(row[11]); - e.caston_x = atoi(row[12]); - e.caston_y = atoi(row[13]); - e.caston_z = atoi(row[14]); - e.ExtraDIChance = atoi(row[15]); - e.instrument_mod = atoi(row[16]); + e.ticsremaining = static_cast(atoi(row[5])); + e.counters = static_cast(strtoul(row[6], nullptr, 10)); + e.numhits = static_cast(strtoul(row[7], nullptr, 10)); + e.melee_rune = static_cast(strtoul(row[8], nullptr, 10)); + e.magic_rune = static_cast(strtoul(row[9], nullptr, 10)); + e.persistent = static_cast(strtoul(row[10], nullptr, 10)); + e.dot_rune = static_cast(atoi(row[11])); + e.caston_x = static_cast(atoi(row[12])); + e.caston_y = static_cast(atoi(row[13])); + e.caston_z = static_cast(atoi(row[14])); + e.ExtraDIChance = static_cast(atoi(row[15])); + e.instrument_mod = static_cast(atoi(row[16])); return e; } @@ -362,23 +362,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterBuffs e{}; - e.character_id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); - e.caster_level = atoi(row[3]); + e.character_id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); + e.caster_level = static_cast(strtoul(row[3], nullptr, 10)); e.caster_name = row[4] ? row[4] : ""; - e.ticsremaining = atoi(row[5]); - e.counters = atoi(row[6]); - e.numhits = atoi(row[7]); - e.melee_rune = atoi(row[8]); - e.magic_rune = atoi(row[9]); - e.persistent = atoi(row[10]); - e.dot_rune = atoi(row[11]); - e.caston_x = atoi(row[12]); - e.caston_y = atoi(row[13]); - e.caston_z = atoi(row[14]); - e.ExtraDIChance = atoi(row[15]); - e.instrument_mod = atoi(row[16]); + e.ticsremaining = static_cast(atoi(row[5])); + e.counters = static_cast(strtoul(row[6], nullptr, 10)); + e.numhits = static_cast(strtoul(row[7], nullptr, 10)); + e.melee_rune = static_cast(strtoul(row[8], nullptr, 10)); + e.magic_rune = static_cast(strtoul(row[9], nullptr, 10)); + e.persistent = static_cast(strtoul(row[10], nullptr, 10)); + e.dot_rune = static_cast(atoi(row[11])); + e.caston_x = static_cast(atoi(row[12])); + e.caston_y = static_cast(atoi(row[13])); + e.caston_z = static_cast(atoi(row[14])); + e.ExtraDIChance = static_cast(atoi(row[15])); + e.instrument_mod = static_cast(atoi(row[16])); all_entries.push_back(e); } @@ -403,23 +403,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterBuffs e{}; - e.character_id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); - e.caster_level = atoi(row[3]); + e.character_id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); + e.caster_level = static_cast(strtoul(row[3], nullptr, 10)); e.caster_name = row[4] ? row[4] : ""; - e.ticsremaining = atoi(row[5]); - e.counters = atoi(row[6]); - e.numhits = atoi(row[7]); - e.melee_rune = atoi(row[8]); - e.magic_rune = atoi(row[9]); - e.persistent = atoi(row[10]); - e.dot_rune = atoi(row[11]); - e.caston_x = atoi(row[12]); - e.caston_y = atoi(row[13]); - e.caston_z = atoi(row[14]); - e.ExtraDIChance = atoi(row[15]); - e.instrument_mod = atoi(row[16]); + e.ticsremaining = static_cast(atoi(row[5])); + e.counters = static_cast(strtoul(row[6], nullptr, 10)); + e.numhits = static_cast(strtoul(row[7], nullptr, 10)); + e.melee_rune = static_cast(strtoul(row[8], nullptr, 10)); + e.magic_rune = static_cast(strtoul(row[9], nullptr, 10)); + e.persistent = static_cast(strtoul(row[10], nullptr, 10)); + e.dot_rune = static_cast(atoi(row[11])); + e.caston_x = static_cast(atoi(row[12])); + e.caston_y = static_cast(atoi(row[13])); + e.caston_z = static_cast(atoi(row[14])); + e.ExtraDIChance = static_cast(atoi(row[15])); + e.instrument_mod = static_cast(atoi(row[16])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_corpse_items_repository.h b/common/repositories/base/base_character_corpse_items_repository.h index 61830ef63..fbee91a78 100644 --- a/common/repositories/base/base_character_corpse_items_repository.h +++ b/common/repositories/base/base_character_corpse_items_repository.h @@ -19,17 +19,17 @@ class BaseCharacterCorpseItemsRepository { public: struct CharacterCorpseItems { - int corpse_id; - int equip_slot; - int item_id; - int charges; - int aug_1; - int aug_2; - int aug_3; - int aug_4; - int aug_5; - int aug_6; - int attuned; + uint32_t corpse_id; + uint32_t equip_slot; + uint32_t item_id; + uint32_t charges; + uint32_t aug_1; + uint32_t aug_2; + uint32_t aug_3; + uint32_t aug_4; + uint32_t aug_5; + int32_t aug_6; + int16_t attuned; }; static std::string PrimaryKey() @@ -154,17 +154,17 @@ public: if (results.RowCount() == 1) { CharacterCorpseItems e{}; - e.corpse_id = atoi(row[0]); - e.equip_slot = atoi(row[1]); - e.item_id = atoi(row[2]); - e.charges = atoi(row[3]); - e.aug_1 = atoi(row[4]); - e.aug_2 = atoi(row[5]); - e.aug_3 = atoi(row[6]); - e.aug_4 = atoi(row[7]); - e.aug_5 = atoi(row[8]); - e.aug_6 = atoi(row[9]); - e.attuned = atoi(row[10]); + e.corpse_id = static_cast(strtoul(row[0], nullptr, 10)); + e.equip_slot = static_cast(strtoul(row[1], nullptr, 10)); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.aug_1 = static_cast(strtoul(row[4], nullptr, 10)); + e.aug_2 = static_cast(strtoul(row[5], nullptr, 10)); + e.aug_3 = static_cast(strtoul(row[6], nullptr, 10)); + e.aug_4 = static_cast(strtoul(row[7], nullptr, 10)); + e.aug_5 = static_cast(strtoul(row[8], nullptr, 10)); + e.aug_6 = static_cast(atoi(row[9])); + e.attuned = static_cast(atoi(row[10])); return e; } @@ -314,17 +314,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterCorpseItems e{}; - e.corpse_id = atoi(row[0]); - e.equip_slot = atoi(row[1]); - e.item_id = atoi(row[2]); - e.charges = atoi(row[3]); - e.aug_1 = atoi(row[4]); - e.aug_2 = atoi(row[5]); - e.aug_3 = atoi(row[6]); - e.aug_4 = atoi(row[7]); - e.aug_5 = atoi(row[8]); - e.aug_6 = atoi(row[9]); - e.attuned = atoi(row[10]); + e.corpse_id = static_cast(strtoul(row[0], nullptr, 10)); + e.equip_slot = static_cast(strtoul(row[1], nullptr, 10)); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.aug_1 = static_cast(strtoul(row[4], nullptr, 10)); + e.aug_2 = static_cast(strtoul(row[5], nullptr, 10)); + e.aug_3 = static_cast(strtoul(row[6], nullptr, 10)); + e.aug_4 = static_cast(strtoul(row[7], nullptr, 10)); + e.aug_5 = static_cast(strtoul(row[8], nullptr, 10)); + e.aug_6 = static_cast(atoi(row[9])); + e.attuned = static_cast(atoi(row[10])); all_entries.push_back(e); } @@ -349,17 +349,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterCorpseItems e{}; - e.corpse_id = atoi(row[0]); - e.equip_slot = atoi(row[1]); - e.item_id = atoi(row[2]); - e.charges = atoi(row[3]); - e.aug_1 = atoi(row[4]); - e.aug_2 = atoi(row[5]); - e.aug_3 = atoi(row[6]); - e.aug_4 = atoi(row[7]); - e.aug_5 = atoi(row[8]); - e.aug_6 = atoi(row[9]); - e.attuned = atoi(row[10]); + e.corpse_id = static_cast(strtoul(row[0], nullptr, 10)); + e.equip_slot = static_cast(strtoul(row[1], nullptr, 10)); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.aug_1 = static_cast(strtoul(row[4], nullptr, 10)); + e.aug_2 = static_cast(strtoul(row[5], nullptr, 10)); + e.aug_3 = static_cast(strtoul(row[6], nullptr, 10)); + e.aug_4 = static_cast(strtoul(row[7], nullptr, 10)); + e.aug_5 = static_cast(strtoul(row[8], nullptr, 10)); + e.aug_6 = static_cast(atoi(row[9])); + e.attuned = static_cast(atoi(row[10])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_corpses_repository.h b/common/repositories/base/base_character_corpses_repository.h index ef34a8c48..1e4de5d8d 100644 --- a/common/repositories/base/base_character_corpses_repository.h +++ b/common/repositories/base/base_character_corpses_repository.h @@ -19,53 +19,53 @@ class BaseCharacterCorpsesRepository { public: struct CharacterCorpses { - int id; - int charid; + uint32_t id; + uint32_t charid; std::string charname; - int zone_id; - int instance_id; + int16_t zone_id; + uint16_t instance_id; float x; float y; float z; float heading; time_t time_of_death; - int guild_consent_id; - int is_rezzed; - int is_buried; - int was_at_graveyard; - int is_locked; - int exp; - int size; - int level; - int race; - int gender; - int class_; - int deity; - int texture; - int helm_texture; - int copper; - int silver; - int gold; - int platinum; - int hair_color; - int beard_color; - int eye_color_1; - int eye_color_2; - int hair_style; - int face; - int beard; - int drakkin_heritage; - int drakkin_tattoo; - int drakkin_details; - int wc_1; - int wc_2; - int wc_3; - int wc_4; - int wc_5; - int wc_6; - int wc_7; - int wc_8; - int wc_9; + uint32_t guild_consent_id; + uint8_t is_rezzed; + int8_t is_buried; + int8_t was_at_graveyard; + int8_t is_locked; + uint32_t exp; + uint32_t size; + uint32_t level; + uint32_t race; + uint32_t gender; + uint32_t class_; + uint32_t deity; + uint32_t texture; + uint32_t helm_texture; + uint32_t copper; + uint32_t silver; + uint32_t gold; + uint32_t platinum; + uint32_t hair_color; + uint32_t beard_color; + uint32_t eye_color_1; + uint32_t eye_color_2; + uint32_t hair_style; + uint32_t face; + uint32_t beard; + uint32_t drakkin_heritage; + uint32_t drakkin_tattoo; + uint32_t drakkin_details; + uint32_t wc_1; + uint32_t wc_2; + uint32_t wc_3; + uint32_t wc_4; + uint32_t wc_5; + uint32_t wc_6; + uint32_t wc_7; + uint32_t wc_8; + uint32_t wc_9; }; static std::string PrimaryKey() @@ -298,53 +298,53 @@ public: if (results.RowCount() == 1) { CharacterCorpses e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); e.charname = row[2] ? row[2] : ""; - e.zone_id = atoi(row[3]); - e.instance_id = atoi(row[4]); - e.x = static_cast(atof(row[5])); - e.y = static_cast(atof(row[6])); - e.z = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); + e.zone_id = static_cast(atoi(row[3])); + e.instance_id = static_cast(strtoul(row[4], nullptr, 10)); + e.x = strtof(row[5], nullptr); + e.y = strtof(row[6], nullptr); + e.z = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); e.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10); - e.guild_consent_id = atoi(row[10]); - e.is_rezzed = atoi(row[11]); - e.is_buried = atoi(row[12]); - e.was_at_graveyard = atoi(row[13]); - e.is_locked = atoi(row[14]); - e.exp = atoi(row[15]); - e.size = atoi(row[16]); - e.level = atoi(row[17]); - e.race = atoi(row[18]); - e.gender = atoi(row[19]); - e.class_ = atoi(row[20]); - e.deity = atoi(row[21]); - e.texture = atoi(row[22]); - e.helm_texture = atoi(row[23]); - e.copper = atoi(row[24]); - e.silver = atoi(row[25]); - e.gold = atoi(row[26]); - e.platinum = atoi(row[27]); - e.hair_color = atoi(row[28]); - e.beard_color = atoi(row[29]); - e.eye_color_1 = atoi(row[30]); - e.eye_color_2 = atoi(row[31]); - e.hair_style = atoi(row[32]); - e.face = atoi(row[33]); - e.beard = atoi(row[34]); - e.drakkin_heritage = atoi(row[35]); - e.drakkin_tattoo = atoi(row[36]); - e.drakkin_details = atoi(row[37]); - e.wc_1 = atoi(row[38]); - e.wc_2 = atoi(row[39]); - e.wc_3 = atoi(row[40]); - e.wc_4 = atoi(row[41]); - e.wc_5 = atoi(row[42]); - e.wc_6 = atoi(row[43]); - e.wc_7 = atoi(row[44]); - e.wc_8 = atoi(row[45]); - e.wc_9 = atoi(row[46]); + e.guild_consent_id = static_cast(strtoul(row[10], nullptr, 10)); + e.is_rezzed = static_cast(strtoul(row[11], nullptr, 10)); + e.is_buried = static_cast(atoi(row[12])); + e.was_at_graveyard = static_cast(atoi(row[13])); + e.is_locked = static_cast(atoi(row[14])); + e.exp = static_cast(strtoul(row[15], nullptr, 10)); + e.size = static_cast(strtoul(row[16], nullptr, 10)); + e.level = static_cast(strtoul(row[17], nullptr, 10)); + e.race = static_cast(strtoul(row[18], nullptr, 10)); + e.gender = static_cast(strtoul(row[19], nullptr, 10)); + e.class_ = static_cast(strtoul(row[20], nullptr, 10)); + e.deity = static_cast(strtoul(row[21], nullptr, 10)); + e.texture = static_cast(strtoul(row[22], nullptr, 10)); + e.helm_texture = static_cast(strtoul(row[23], nullptr, 10)); + e.copper = static_cast(strtoul(row[24], nullptr, 10)); + e.silver = static_cast(strtoul(row[25], nullptr, 10)); + e.gold = static_cast(strtoul(row[26], nullptr, 10)); + e.platinum = static_cast(strtoul(row[27], nullptr, 10)); + e.hair_color = static_cast(strtoul(row[28], nullptr, 10)); + e.beard_color = static_cast(strtoul(row[29], nullptr, 10)); + e.eye_color_1 = static_cast(strtoul(row[30], nullptr, 10)); + e.eye_color_2 = static_cast(strtoul(row[31], nullptr, 10)); + e.hair_style = static_cast(strtoul(row[32], nullptr, 10)); + e.face = static_cast(strtoul(row[33], nullptr, 10)); + e.beard = static_cast(strtoul(row[34], nullptr, 10)); + e.drakkin_heritage = static_cast(strtoul(row[35], nullptr, 10)); + e.drakkin_tattoo = static_cast(strtoul(row[36], nullptr, 10)); + e.drakkin_details = static_cast(strtoul(row[37], nullptr, 10)); + e.wc_1 = static_cast(strtoul(row[38], nullptr, 10)); + e.wc_2 = static_cast(strtoul(row[39], nullptr, 10)); + e.wc_3 = static_cast(strtoul(row[40], nullptr, 10)); + e.wc_4 = static_cast(strtoul(row[41], nullptr, 10)); + e.wc_5 = static_cast(strtoul(row[42], nullptr, 10)); + e.wc_6 = static_cast(strtoul(row[43], nullptr, 10)); + e.wc_7 = static_cast(strtoul(row[44], nullptr, 10)); + e.wc_8 = static_cast(strtoul(row[45], nullptr, 10)); + e.wc_9 = static_cast(strtoul(row[46], nullptr, 10)); return e; } @@ -601,53 +601,53 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterCorpses e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); e.charname = row[2] ? row[2] : ""; - e.zone_id = atoi(row[3]); - e.instance_id = atoi(row[4]); - e.x = static_cast(atof(row[5])); - e.y = static_cast(atof(row[6])); - e.z = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); + e.zone_id = static_cast(atoi(row[3])); + e.instance_id = static_cast(strtoul(row[4], nullptr, 10)); + e.x = strtof(row[5], nullptr); + e.y = strtof(row[6], nullptr); + e.z = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); e.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10); - e.guild_consent_id = atoi(row[10]); - e.is_rezzed = atoi(row[11]); - e.is_buried = atoi(row[12]); - e.was_at_graveyard = atoi(row[13]); - e.is_locked = atoi(row[14]); - e.exp = atoi(row[15]); - e.size = atoi(row[16]); - e.level = atoi(row[17]); - e.race = atoi(row[18]); - e.gender = atoi(row[19]); - e.class_ = atoi(row[20]); - e.deity = atoi(row[21]); - e.texture = atoi(row[22]); - e.helm_texture = atoi(row[23]); - e.copper = atoi(row[24]); - e.silver = atoi(row[25]); - e.gold = atoi(row[26]); - e.platinum = atoi(row[27]); - e.hair_color = atoi(row[28]); - e.beard_color = atoi(row[29]); - e.eye_color_1 = atoi(row[30]); - e.eye_color_2 = atoi(row[31]); - e.hair_style = atoi(row[32]); - e.face = atoi(row[33]); - e.beard = atoi(row[34]); - e.drakkin_heritage = atoi(row[35]); - e.drakkin_tattoo = atoi(row[36]); - e.drakkin_details = atoi(row[37]); - e.wc_1 = atoi(row[38]); - e.wc_2 = atoi(row[39]); - e.wc_3 = atoi(row[40]); - e.wc_4 = atoi(row[41]); - e.wc_5 = atoi(row[42]); - e.wc_6 = atoi(row[43]); - e.wc_7 = atoi(row[44]); - e.wc_8 = atoi(row[45]); - e.wc_9 = atoi(row[46]); + e.guild_consent_id = static_cast(strtoul(row[10], nullptr, 10)); + e.is_rezzed = static_cast(strtoul(row[11], nullptr, 10)); + e.is_buried = static_cast(atoi(row[12])); + e.was_at_graveyard = static_cast(atoi(row[13])); + e.is_locked = static_cast(atoi(row[14])); + e.exp = static_cast(strtoul(row[15], nullptr, 10)); + e.size = static_cast(strtoul(row[16], nullptr, 10)); + e.level = static_cast(strtoul(row[17], nullptr, 10)); + e.race = static_cast(strtoul(row[18], nullptr, 10)); + e.gender = static_cast(strtoul(row[19], nullptr, 10)); + e.class_ = static_cast(strtoul(row[20], nullptr, 10)); + e.deity = static_cast(strtoul(row[21], nullptr, 10)); + e.texture = static_cast(strtoul(row[22], nullptr, 10)); + e.helm_texture = static_cast(strtoul(row[23], nullptr, 10)); + e.copper = static_cast(strtoul(row[24], nullptr, 10)); + e.silver = static_cast(strtoul(row[25], nullptr, 10)); + e.gold = static_cast(strtoul(row[26], nullptr, 10)); + e.platinum = static_cast(strtoul(row[27], nullptr, 10)); + e.hair_color = static_cast(strtoul(row[28], nullptr, 10)); + e.beard_color = static_cast(strtoul(row[29], nullptr, 10)); + e.eye_color_1 = static_cast(strtoul(row[30], nullptr, 10)); + e.eye_color_2 = static_cast(strtoul(row[31], nullptr, 10)); + e.hair_style = static_cast(strtoul(row[32], nullptr, 10)); + e.face = static_cast(strtoul(row[33], nullptr, 10)); + e.beard = static_cast(strtoul(row[34], nullptr, 10)); + e.drakkin_heritage = static_cast(strtoul(row[35], nullptr, 10)); + e.drakkin_tattoo = static_cast(strtoul(row[36], nullptr, 10)); + e.drakkin_details = static_cast(strtoul(row[37], nullptr, 10)); + e.wc_1 = static_cast(strtoul(row[38], nullptr, 10)); + e.wc_2 = static_cast(strtoul(row[39], nullptr, 10)); + e.wc_3 = static_cast(strtoul(row[40], nullptr, 10)); + e.wc_4 = static_cast(strtoul(row[41], nullptr, 10)); + e.wc_5 = static_cast(strtoul(row[42], nullptr, 10)); + e.wc_6 = static_cast(strtoul(row[43], nullptr, 10)); + e.wc_7 = static_cast(strtoul(row[44], nullptr, 10)); + e.wc_8 = static_cast(strtoul(row[45], nullptr, 10)); + e.wc_9 = static_cast(strtoul(row[46], nullptr, 10)); all_entries.push_back(e); } @@ -672,53 +672,53 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterCorpses e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); e.charname = row[2] ? row[2] : ""; - e.zone_id = atoi(row[3]); - e.instance_id = atoi(row[4]); - e.x = static_cast(atof(row[5])); - e.y = static_cast(atof(row[6])); - e.z = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); + e.zone_id = static_cast(atoi(row[3])); + e.instance_id = static_cast(strtoul(row[4], nullptr, 10)); + e.x = strtof(row[5], nullptr); + e.y = strtof(row[6], nullptr); + e.z = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); e.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10); - e.guild_consent_id = atoi(row[10]); - e.is_rezzed = atoi(row[11]); - e.is_buried = atoi(row[12]); - e.was_at_graveyard = atoi(row[13]); - e.is_locked = atoi(row[14]); - e.exp = atoi(row[15]); - e.size = atoi(row[16]); - e.level = atoi(row[17]); - e.race = atoi(row[18]); - e.gender = atoi(row[19]); - e.class_ = atoi(row[20]); - e.deity = atoi(row[21]); - e.texture = atoi(row[22]); - e.helm_texture = atoi(row[23]); - e.copper = atoi(row[24]); - e.silver = atoi(row[25]); - e.gold = atoi(row[26]); - e.platinum = atoi(row[27]); - e.hair_color = atoi(row[28]); - e.beard_color = atoi(row[29]); - e.eye_color_1 = atoi(row[30]); - e.eye_color_2 = atoi(row[31]); - e.hair_style = atoi(row[32]); - e.face = atoi(row[33]); - e.beard = atoi(row[34]); - e.drakkin_heritage = atoi(row[35]); - e.drakkin_tattoo = atoi(row[36]); - e.drakkin_details = atoi(row[37]); - e.wc_1 = atoi(row[38]); - e.wc_2 = atoi(row[39]); - e.wc_3 = atoi(row[40]); - e.wc_4 = atoi(row[41]); - e.wc_5 = atoi(row[42]); - e.wc_6 = atoi(row[43]); - e.wc_7 = atoi(row[44]); - e.wc_8 = atoi(row[45]); - e.wc_9 = atoi(row[46]); + e.guild_consent_id = static_cast(strtoul(row[10], nullptr, 10)); + e.is_rezzed = static_cast(strtoul(row[11], nullptr, 10)); + e.is_buried = static_cast(atoi(row[12])); + e.was_at_graveyard = static_cast(atoi(row[13])); + e.is_locked = static_cast(atoi(row[14])); + e.exp = static_cast(strtoul(row[15], nullptr, 10)); + e.size = static_cast(strtoul(row[16], nullptr, 10)); + e.level = static_cast(strtoul(row[17], nullptr, 10)); + e.race = static_cast(strtoul(row[18], nullptr, 10)); + e.gender = static_cast(strtoul(row[19], nullptr, 10)); + e.class_ = static_cast(strtoul(row[20], nullptr, 10)); + e.deity = static_cast(strtoul(row[21], nullptr, 10)); + e.texture = static_cast(strtoul(row[22], nullptr, 10)); + e.helm_texture = static_cast(strtoul(row[23], nullptr, 10)); + e.copper = static_cast(strtoul(row[24], nullptr, 10)); + e.silver = static_cast(strtoul(row[25], nullptr, 10)); + e.gold = static_cast(strtoul(row[26], nullptr, 10)); + e.platinum = static_cast(strtoul(row[27], nullptr, 10)); + e.hair_color = static_cast(strtoul(row[28], nullptr, 10)); + e.beard_color = static_cast(strtoul(row[29], nullptr, 10)); + e.eye_color_1 = static_cast(strtoul(row[30], nullptr, 10)); + e.eye_color_2 = static_cast(strtoul(row[31], nullptr, 10)); + e.hair_style = static_cast(strtoul(row[32], nullptr, 10)); + e.face = static_cast(strtoul(row[33], nullptr, 10)); + e.beard = static_cast(strtoul(row[34], nullptr, 10)); + e.drakkin_heritage = static_cast(strtoul(row[35], nullptr, 10)); + e.drakkin_tattoo = static_cast(strtoul(row[36], nullptr, 10)); + e.drakkin_details = static_cast(strtoul(row[37], nullptr, 10)); + e.wc_1 = static_cast(strtoul(row[38], nullptr, 10)); + e.wc_2 = static_cast(strtoul(row[39], nullptr, 10)); + e.wc_3 = static_cast(strtoul(row[40], nullptr, 10)); + e.wc_4 = static_cast(strtoul(row[41], nullptr, 10)); + e.wc_5 = static_cast(strtoul(row[42], nullptr, 10)); + e.wc_6 = static_cast(strtoul(row[43], nullptr, 10)); + e.wc_7 = static_cast(strtoul(row[44], nullptr, 10)); + e.wc_8 = static_cast(strtoul(row[45], nullptr, 10)); + e.wc_9 = static_cast(strtoul(row[46], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_currency_repository.h b/common/repositories/base/base_character_currency_repository.h index bf5a9407f..5e83e4697 100644 --- a/common/repositories/base/base_character_currency_repository.h +++ b/common/repositories/base/base_character_currency_repository.h @@ -19,23 +19,23 @@ class BaseCharacterCurrencyRepository { public: struct CharacterCurrency { - int id; - int platinum; - int gold; - int silver; - int copper; - int platinum_bank; - int gold_bank; - int silver_bank; - int copper_bank; - int platinum_cursor; - int gold_cursor; - int silver_cursor; - int copper_cursor; - int radiant_crystals; - int career_radiant_crystals; - int ebon_crystals; - int career_ebon_crystals; + uint32_t id; + uint32_t platinum; + uint32_t gold; + uint32_t silver; + uint32_t copper; + uint32_t platinum_bank; + uint32_t gold_bank; + uint32_t silver_bank; + uint32_t copper_bank; + uint32_t platinum_cursor; + uint32_t gold_cursor; + uint32_t silver_cursor; + uint32_t copper_cursor; + uint32_t radiant_crystals; + uint32_t career_radiant_crystals; + uint32_t ebon_crystals; + uint32_t career_ebon_crystals; }; static std::string PrimaryKey() @@ -178,23 +178,23 @@ public: if (results.RowCount() == 1) { CharacterCurrency e{}; - e.id = atoi(row[0]); - e.platinum = atoi(row[1]); - e.gold = atoi(row[2]); - e.silver = atoi(row[3]); - e.copper = atoi(row[4]); - e.platinum_bank = atoi(row[5]); - e.gold_bank = atoi(row[6]); - e.silver_bank = atoi(row[7]); - e.copper_bank = atoi(row[8]); - e.platinum_cursor = atoi(row[9]); - e.gold_cursor = atoi(row[10]); - e.silver_cursor = atoi(row[11]); - e.copper_cursor = atoi(row[12]); - e.radiant_crystals = atoi(row[13]); - e.career_radiant_crystals = atoi(row[14]); - e.ebon_crystals = atoi(row[15]); - e.career_ebon_crystals = atoi(row[16]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.platinum = static_cast(strtoul(row[1], nullptr, 10)); + e.gold = static_cast(strtoul(row[2], nullptr, 10)); + e.silver = static_cast(strtoul(row[3], nullptr, 10)); + e.copper = static_cast(strtoul(row[4], nullptr, 10)); + e.platinum_bank = static_cast(strtoul(row[5], nullptr, 10)); + e.gold_bank = static_cast(strtoul(row[6], nullptr, 10)); + e.silver_bank = static_cast(strtoul(row[7], nullptr, 10)); + e.copper_bank = static_cast(strtoul(row[8], nullptr, 10)); + e.platinum_cursor = static_cast(strtoul(row[9], nullptr, 10)); + e.gold_cursor = static_cast(strtoul(row[10], nullptr, 10)); + e.silver_cursor = static_cast(strtoul(row[11], nullptr, 10)); + e.copper_cursor = static_cast(strtoul(row[12], nullptr, 10)); + e.radiant_crystals = static_cast(strtoul(row[13], nullptr, 10)); + e.career_radiant_crystals = static_cast(strtoul(row[14], nullptr, 10)); + e.ebon_crystals = static_cast(strtoul(row[15], nullptr, 10)); + e.career_ebon_crystals = static_cast(strtoul(row[16], nullptr, 10)); return e; } @@ -362,23 +362,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterCurrency e{}; - e.id = atoi(row[0]); - e.platinum = atoi(row[1]); - e.gold = atoi(row[2]); - e.silver = atoi(row[3]); - e.copper = atoi(row[4]); - e.platinum_bank = atoi(row[5]); - e.gold_bank = atoi(row[6]); - e.silver_bank = atoi(row[7]); - e.copper_bank = atoi(row[8]); - e.platinum_cursor = atoi(row[9]); - e.gold_cursor = atoi(row[10]); - e.silver_cursor = atoi(row[11]); - e.copper_cursor = atoi(row[12]); - e.radiant_crystals = atoi(row[13]); - e.career_radiant_crystals = atoi(row[14]); - e.ebon_crystals = atoi(row[15]); - e.career_ebon_crystals = atoi(row[16]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.platinum = static_cast(strtoul(row[1], nullptr, 10)); + e.gold = static_cast(strtoul(row[2], nullptr, 10)); + e.silver = static_cast(strtoul(row[3], nullptr, 10)); + e.copper = static_cast(strtoul(row[4], nullptr, 10)); + e.platinum_bank = static_cast(strtoul(row[5], nullptr, 10)); + e.gold_bank = static_cast(strtoul(row[6], nullptr, 10)); + e.silver_bank = static_cast(strtoul(row[7], nullptr, 10)); + e.copper_bank = static_cast(strtoul(row[8], nullptr, 10)); + e.platinum_cursor = static_cast(strtoul(row[9], nullptr, 10)); + e.gold_cursor = static_cast(strtoul(row[10], nullptr, 10)); + e.silver_cursor = static_cast(strtoul(row[11], nullptr, 10)); + e.copper_cursor = static_cast(strtoul(row[12], nullptr, 10)); + e.radiant_crystals = static_cast(strtoul(row[13], nullptr, 10)); + e.career_radiant_crystals = static_cast(strtoul(row[14], nullptr, 10)); + e.ebon_crystals = static_cast(strtoul(row[15], nullptr, 10)); + e.career_ebon_crystals = static_cast(strtoul(row[16], nullptr, 10)); all_entries.push_back(e); } @@ -403,23 +403,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterCurrency e{}; - e.id = atoi(row[0]); - e.platinum = atoi(row[1]); - e.gold = atoi(row[2]); - e.silver = atoi(row[3]); - e.copper = atoi(row[4]); - e.platinum_bank = atoi(row[5]); - e.gold_bank = atoi(row[6]); - e.silver_bank = atoi(row[7]); - e.copper_bank = atoi(row[8]); - e.platinum_cursor = atoi(row[9]); - e.gold_cursor = atoi(row[10]); - e.silver_cursor = atoi(row[11]); - e.copper_cursor = atoi(row[12]); - e.radiant_crystals = atoi(row[13]); - e.career_radiant_crystals = atoi(row[14]); - e.ebon_crystals = atoi(row[15]); - e.career_ebon_crystals = atoi(row[16]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.platinum = static_cast(strtoul(row[1], nullptr, 10)); + e.gold = static_cast(strtoul(row[2], nullptr, 10)); + e.silver = static_cast(strtoul(row[3], nullptr, 10)); + e.copper = static_cast(strtoul(row[4], nullptr, 10)); + e.platinum_bank = static_cast(strtoul(row[5], nullptr, 10)); + e.gold_bank = static_cast(strtoul(row[6], nullptr, 10)); + e.silver_bank = static_cast(strtoul(row[7], nullptr, 10)); + e.copper_bank = static_cast(strtoul(row[8], nullptr, 10)); + e.platinum_cursor = static_cast(strtoul(row[9], nullptr, 10)); + e.gold_cursor = static_cast(strtoul(row[10], nullptr, 10)); + e.silver_cursor = static_cast(strtoul(row[11], nullptr, 10)); + e.copper_cursor = static_cast(strtoul(row[12], nullptr, 10)); + e.radiant_crystals = static_cast(strtoul(row[13], nullptr, 10)); + e.career_radiant_crystals = static_cast(strtoul(row[14], nullptr, 10)); + e.ebon_crystals = static_cast(strtoul(row[15], nullptr, 10)); + e.career_ebon_crystals = static_cast(strtoul(row[16], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_data_repository.h b/common/repositories/base/base_character_data_repository.h index 1ed94e402..7914d50c4 100644 --- a/common/repositories/base/base_character_data_repository.h +++ b/common/repositories/base/base_character_data_repository.h @@ -19,107 +19,107 @@ class BaseCharacterDataRepository { public: struct CharacterData { - int id; - int account_id; + uint32_t id; + int32_t account_id; std::string name; std::string last_name; std::string title; std::string suffix; - int zone_id; - int zone_instance; + uint32_t zone_id; + uint32_t zone_instance; float y; float x; float z; float heading; - int gender; - int race; - int class_; - int level; - int deity; - int birthday; - int last_login; - int time_played; - int level2; - int anon; - int gm; - int face; - int hair_color; - int hair_style; - int beard; - int beard_color; - int eye_color_1; - int eye_color_2; - int drakkin_heritage; - int drakkin_tattoo; - int drakkin_details; - int ability_time_seconds; - int ability_number; - int ability_time_minutes; - int ability_time_hours; - int exp; - int aa_points_spent; - int aa_exp; - int aa_points; - int group_leadership_exp; - int raid_leadership_exp; - int group_leadership_points; - int raid_leadership_points; - int points; - int cur_hp; - int mana; - int endurance; - int intoxication; - int str; - int sta; - int cha; - int dex; - int int_; - int agi; - int wis; - int zone_change_count; - int toxicity; - int hunger_level; - int thirst_level; - int ability_up; - int ldon_points_guk; - int ldon_points_mir; - int ldon_points_mmc; - int ldon_points_ruj; - int ldon_points_tak; - int ldon_points_available; - int tribute_time_remaining; - int career_tribute_points; - int tribute_points; - int tribute_active; - int pvp_status; - int pvp_kills; - int pvp_deaths; - int pvp_current_points; - int pvp_career_points; - int pvp_best_kill_streak; - int pvp_worst_death_streak; - int pvp_current_kill_streak; - int pvp2; - int pvp_type; - int show_helm; - int group_auto_consent; - int raid_auto_consent; - int guild_auto_consent; - int leadership_exp_on; - int RestTimer; - int air_remaining; - int autosplit_enabled; - int lfp; - int lfg; + uint8_t gender; + uint16_t race; + uint8_t class_; + uint32_t level; + uint32_t deity; + uint32_t birthday; + uint32_t last_login; + uint32_t time_played; + uint8_t level2; + uint8_t anon; + uint8_t gm; + uint32_t face; + uint8_t hair_color; + uint8_t hair_style; + uint8_t beard; + uint8_t beard_color; + uint8_t eye_color_1; + uint8_t eye_color_2; + uint32_t drakkin_heritage; + uint32_t drakkin_tattoo; + uint32_t drakkin_details; + uint8_t ability_time_seconds; + uint8_t ability_number; + uint8_t ability_time_minutes; + uint8_t ability_time_hours; + uint32_t exp; + uint32_t aa_points_spent; + uint32_t aa_exp; + uint32_t aa_points; + uint32_t group_leadership_exp; + uint32_t raid_leadership_exp; + uint32_t group_leadership_points; + uint32_t raid_leadership_points; + uint32_t points; + uint32_t cur_hp; + uint32_t mana; + uint32_t endurance; + uint32_t intoxication; + uint32_t str; + uint32_t sta; + uint32_t cha; + uint32_t dex; + uint32_t int_; + uint32_t agi; + uint32_t wis; + uint32_t zone_change_count; + uint32_t toxicity; + uint32_t hunger_level; + uint32_t thirst_level; + uint32_t ability_up; + uint32_t ldon_points_guk; + uint32_t ldon_points_mir; + uint32_t ldon_points_mmc; + uint32_t ldon_points_ruj; + uint32_t ldon_points_tak; + uint32_t ldon_points_available; + uint32_t tribute_time_remaining; + uint32_t career_tribute_points; + uint32_t tribute_points; + uint32_t tribute_active; + uint8_t pvp_status; + uint32_t pvp_kills; + uint32_t pvp_deaths; + uint32_t pvp_current_points; + uint32_t pvp_career_points; + uint32_t pvp_best_kill_streak; + uint32_t pvp_worst_death_streak; + uint32_t pvp_current_kill_streak; + uint32_t pvp2; + uint32_t pvp_type; + uint32_t show_helm; + uint8_t group_auto_consent; + uint8_t raid_auto_consent; + uint8_t guild_auto_consent; + uint8_t leadership_exp_on; + uint32_t RestTimer; + uint32_t air_remaining; + uint32_t autosplit_enabled; + uint8_t lfp; + uint8_t lfg; std::string mailkey; - int xtargets; - int firstlogon; - int e_aa_effects; - int e_percent_to_aa; - int e_expended_aa_spent; - int aa_points_spent_old; - int aa_points_old; - int e_last_invsnapshot; + uint8_t xtargets; + int8_t firstlogon; + uint32_t e_aa_effects; + uint32_t e_percent_to_aa; + uint32_t e_expended_aa_spent; + uint32_t aa_points_spent_old; + uint32_t aa_points_old; + uint32_t e_last_invsnapshot; time_t deleted_at; }; @@ -518,107 +518,107 @@ public: if (results.RowCount() == 1) { CharacterData e{}; - e.id = atoi(row[0]); - e.account_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.account_id = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; e.last_name = row[3] ? row[3] : ""; e.title = row[4] ? row[4] : ""; e.suffix = row[5] ? row[5] : ""; - e.zone_id = atoi(row[6]); - e.zone_instance = atoi(row[7]); - e.y = static_cast(atof(row[8])); - e.x = static_cast(atof(row[9])); - e.z = static_cast(atof(row[10])); - e.heading = static_cast(atof(row[11])); - e.gender = atoi(row[12]); - e.race = atoi(row[13]); - e.class_ = atoi(row[14]); - e.level = atoi(row[15]); - e.deity = atoi(row[16]); - e.birthday = atoi(row[17]); - e.last_login = atoi(row[18]); - e.time_played = atoi(row[19]); - e.level2 = atoi(row[20]); - e.anon = atoi(row[21]); - e.gm = atoi(row[22]); - e.face = atoi(row[23]); - e.hair_color = atoi(row[24]); - e.hair_style = atoi(row[25]); - e.beard = atoi(row[26]); - e.beard_color = atoi(row[27]); - e.eye_color_1 = atoi(row[28]); - e.eye_color_2 = atoi(row[29]); - e.drakkin_heritage = atoi(row[30]); - e.drakkin_tattoo = atoi(row[31]); - e.drakkin_details = atoi(row[32]); - e.ability_time_seconds = atoi(row[33]); - e.ability_number = atoi(row[34]); - e.ability_time_minutes = atoi(row[35]); - e.ability_time_hours = atoi(row[36]); - e.exp = atoi(row[37]); - e.aa_points_spent = atoi(row[38]); - e.aa_exp = atoi(row[39]); - e.aa_points = atoi(row[40]); - e.group_leadership_exp = atoi(row[41]); - e.raid_leadership_exp = atoi(row[42]); - e.group_leadership_points = atoi(row[43]); - e.raid_leadership_points = atoi(row[44]); - e.points = atoi(row[45]); - e.cur_hp = atoi(row[46]); - e.mana = atoi(row[47]); - e.endurance = atoi(row[48]); - e.intoxication = atoi(row[49]); - e.str = atoi(row[50]); - e.sta = atoi(row[51]); - e.cha = atoi(row[52]); - e.dex = atoi(row[53]); - e.int_ = atoi(row[54]); - e.agi = atoi(row[55]); - e.wis = atoi(row[56]); - e.zone_change_count = atoi(row[57]); - e.toxicity = atoi(row[58]); - e.hunger_level = atoi(row[59]); - e.thirst_level = atoi(row[60]); - e.ability_up = atoi(row[61]); - e.ldon_points_guk = atoi(row[62]); - e.ldon_points_mir = atoi(row[63]); - e.ldon_points_mmc = atoi(row[64]); - e.ldon_points_ruj = atoi(row[65]); - e.ldon_points_tak = atoi(row[66]); - e.ldon_points_available = atoi(row[67]); - e.tribute_time_remaining = atoi(row[68]); - e.career_tribute_points = atoi(row[69]); - e.tribute_points = atoi(row[70]); - e.tribute_active = atoi(row[71]); - e.pvp_status = atoi(row[72]); - e.pvp_kills = atoi(row[73]); - e.pvp_deaths = atoi(row[74]); - e.pvp_current_points = atoi(row[75]); - e.pvp_career_points = atoi(row[76]); - e.pvp_best_kill_streak = atoi(row[77]); - e.pvp_worst_death_streak = atoi(row[78]); - e.pvp_current_kill_streak = atoi(row[79]); - e.pvp2 = atoi(row[80]); - e.pvp_type = atoi(row[81]); - e.show_helm = atoi(row[82]); - e.group_auto_consent = atoi(row[83]); - e.raid_auto_consent = atoi(row[84]); - e.guild_auto_consent = atoi(row[85]); - e.leadership_exp_on = atoi(row[86]); - e.RestTimer = atoi(row[87]); - e.air_remaining = atoi(row[88]); - e.autosplit_enabled = atoi(row[89]); - e.lfp = atoi(row[90]); - e.lfg = atoi(row[91]); + e.zone_id = static_cast(strtoul(row[6], nullptr, 10)); + e.zone_instance = static_cast(strtoul(row[7], nullptr, 10)); + e.y = strtof(row[8], nullptr); + e.x = strtof(row[9], nullptr); + e.z = strtof(row[10], nullptr); + e.heading = strtof(row[11], nullptr); + e.gender = static_cast(strtoul(row[12], nullptr, 10)); + e.race = static_cast(strtoul(row[13], nullptr, 10)); + e.class_ = static_cast(strtoul(row[14], nullptr, 10)); + e.level = static_cast(strtoul(row[15], nullptr, 10)); + e.deity = static_cast(strtoul(row[16], nullptr, 10)); + e.birthday = static_cast(strtoul(row[17], nullptr, 10)); + e.last_login = static_cast(strtoul(row[18], nullptr, 10)); + e.time_played = static_cast(strtoul(row[19], nullptr, 10)); + e.level2 = static_cast(strtoul(row[20], nullptr, 10)); + e.anon = static_cast(strtoul(row[21], nullptr, 10)); + e.gm = static_cast(strtoul(row[22], nullptr, 10)); + e.face = static_cast(strtoul(row[23], nullptr, 10)); + e.hair_color = static_cast(strtoul(row[24], nullptr, 10)); + e.hair_style = static_cast(strtoul(row[25], nullptr, 10)); + e.beard = static_cast(strtoul(row[26], nullptr, 10)); + e.beard_color = static_cast(strtoul(row[27], nullptr, 10)); + e.eye_color_1 = static_cast(strtoul(row[28], nullptr, 10)); + e.eye_color_2 = static_cast(strtoul(row[29], nullptr, 10)); + e.drakkin_heritage = static_cast(strtoul(row[30], nullptr, 10)); + e.drakkin_tattoo = static_cast(strtoul(row[31], nullptr, 10)); + e.drakkin_details = static_cast(strtoul(row[32], nullptr, 10)); + e.ability_time_seconds = static_cast(strtoul(row[33], nullptr, 10)); + e.ability_number = static_cast(strtoul(row[34], nullptr, 10)); + 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 = atoi(row[93]); - e.firstlogon = atoi(row[94]); - e.e_aa_effects = atoi(row[95]); - e.e_percent_to_aa = atoi(row[96]); - e.e_expended_aa_spent = atoi(row[97]); - e.aa_points_spent_old = atoi(row[98]); - e.aa_points_old = atoi(row[99]); - e.e_last_invsnapshot = atoi(row[100]); + 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); return e; @@ -1041,107 +1041,107 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterData e{}; - e.id = atoi(row[0]); - e.account_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.account_id = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; e.last_name = row[3] ? row[3] : ""; e.title = row[4] ? row[4] : ""; e.suffix = row[5] ? row[5] : ""; - e.zone_id = atoi(row[6]); - e.zone_instance = atoi(row[7]); - e.y = static_cast(atof(row[8])); - e.x = static_cast(atof(row[9])); - e.z = static_cast(atof(row[10])); - e.heading = static_cast(atof(row[11])); - e.gender = atoi(row[12]); - e.race = atoi(row[13]); - e.class_ = atoi(row[14]); - e.level = atoi(row[15]); - e.deity = atoi(row[16]); - e.birthday = atoi(row[17]); - e.last_login = atoi(row[18]); - e.time_played = atoi(row[19]); - e.level2 = atoi(row[20]); - e.anon = atoi(row[21]); - e.gm = atoi(row[22]); - e.face = atoi(row[23]); - e.hair_color = atoi(row[24]); - e.hair_style = atoi(row[25]); - e.beard = atoi(row[26]); - e.beard_color = atoi(row[27]); - e.eye_color_1 = atoi(row[28]); - e.eye_color_2 = atoi(row[29]); - e.drakkin_heritage = atoi(row[30]); - e.drakkin_tattoo = atoi(row[31]); - e.drakkin_details = atoi(row[32]); - e.ability_time_seconds = atoi(row[33]); - e.ability_number = atoi(row[34]); - e.ability_time_minutes = atoi(row[35]); - e.ability_time_hours = atoi(row[36]); - e.exp = atoi(row[37]); - e.aa_points_spent = atoi(row[38]); - e.aa_exp = atoi(row[39]); - e.aa_points = atoi(row[40]); - e.group_leadership_exp = atoi(row[41]); - e.raid_leadership_exp = atoi(row[42]); - e.group_leadership_points = atoi(row[43]); - e.raid_leadership_points = atoi(row[44]); - e.points = atoi(row[45]); - e.cur_hp = atoi(row[46]); - e.mana = atoi(row[47]); - e.endurance = atoi(row[48]); - e.intoxication = atoi(row[49]); - e.str = atoi(row[50]); - e.sta = atoi(row[51]); - e.cha = atoi(row[52]); - e.dex = atoi(row[53]); - e.int_ = atoi(row[54]); - e.agi = atoi(row[55]); - e.wis = atoi(row[56]); - e.zone_change_count = atoi(row[57]); - e.toxicity = atoi(row[58]); - e.hunger_level = atoi(row[59]); - e.thirst_level = atoi(row[60]); - e.ability_up = atoi(row[61]); - e.ldon_points_guk = atoi(row[62]); - e.ldon_points_mir = atoi(row[63]); - e.ldon_points_mmc = atoi(row[64]); - e.ldon_points_ruj = atoi(row[65]); - e.ldon_points_tak = atoi(row[66]); - e.ldon_points_available = atoi(row[67]); - e.tribute_time_remaining = atoi(row[68]); - e.career_tribute_points = atoi(row[69]); - e.tribute_points = atoi(row[70]); - e.tribute_active = atoi(row[71]); - e.pvp_status = atoi(row[72]); - e.pvp_kills = atoi(row[73]); - e.pvp_deaths = atoi(row[74]); - e.pvp_current_points = atoi(row[75]); - e.pvp_career_points = atoi(row[76]); - e.pvp_best_kill_streak = atoi(row[77]); - e.pvp_worst_death_streak = atoi(row[78]); - e.pvp_current_kill_streak = atoi(row[79]); - e.pvp2 = atoi(row[80]); - e.pvp_type = atoi(row[81]); - e.show_helm = atoi(row[82]); - e.group_auto_consent = atoi(row[83]); - e.raid_auto_consent = atoi(row[84]); - e.guild_auto_consent = atoi(row[85]); - e.leadership_exp_on = atoi(row[86]); - e.RestTimer = atoi(row[87]); - e.air_remaining = atoi(row[88]); - e.autosplit_enabled = atoi(row[89]); - e.lfp = atoi(row[90]); - e.lfg = atoi(row[91]); + e.zone_id = static_cast(strtoul(row[6], nullptr, 10)); + e.zone_instance = static_cast(strtoul(row[7], nullptr, 10)); + e.y = strtof(row[8], nullptr); + e.x = strtof(row[9], nullptr); + e.z = strtof(row[10], nullptr); + e.heading = strtof(row[11], nullptr); + e.gender = static_cast(strtoul(row[12], nullptr, 10)); + e.race = static_cast(strtoul(row[13], nullptr, 10)); + e.class_ = static_cast(strtoul(row[14], nullptr, 10)); + e.level = static_cast(strtoul(row[15], nullptr, 10)); + e.deity = static_cast(strtoul(row[16], nullptr, 10)); + e.birthday = static_cast(strtoul(row[17], nullptr, 10)); + e.last_login = static_cast(strtoul(row[18], nullptr, 10)); + e.time_played = static_cast(strtoul(row[19], nullptr, 10)); + e.level2 = static_cast(strtoul(row[20], nullptr, 10)); + e.anon = static_cast(strtoul(row[21], nullptr, 10)); + e.gm = static_cast(strtoul(row[22], nullptr, 10)); + e.face = static_cast(strtoul(row[23], nullptr, 10)); + e.hair_color = static_cast(strtoul(row[24], nullptr, 10)); + e.hair_style = static_cast(strtoul(row[25], nullptr, 10)); + e.beard = static_cast(strtoul(row[26], nullptr, 10)); + e.beard_color = static_cast(strtoul(row[27], nullptr, 10)); + e.eye_color_1 = static_cast(strtoul(row[28], nullptr, 10)); + e.eye_color_2 = static_cast(strtoul(row[29], nullptr, 10)); + e.drakkin_heritage = static_cast(strtoul(row[30], nullptr, 10)); + e.drakkin_tattoo = static_cast(strtoul(row[31], nullptr, 10)); + e.drakkin_details = static_cast(strtoul(row[32], nullptr, 10)); + e.ability_time_seconds = static_cast(strtoul(row[33], nullptr, 10)); + e.ability_number = static_cast(strtoul(row[34], nullptr, 10)); + 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 = atoi(row[93]); - e.firstlogon = atoi(row[94]); - e.e_aa_effects = atoi(row[95]); - e.e_percent_to_aa = atoi(row[96]); - e.e_expended_aa_spent = atoi(row[97]); - e.aa_points_spent_old = atoi(row[98]); - e.aa_points_old = atoi(row[99]); - e.e_last_invsnapshot = atoi(row[100]); + 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); all_entries.push_back(e); @@ -1167,107 +1167,107 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterData e{}; - e.id = atoi(row[0]); - e.account_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.account_id = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; e.last_name = row[3] ? row[3] : ""; e.title = row[4] ? row[4] : ""; e.suffix = row[5] ? row[5] : ""; - e.zone_id = atoi(row[6]); - e.zone_instance = atoi(row[7]); - e.y = static_cast(atof(row[8])); - e.x = static_cast(atof(row[9])); - e.z = static_cast(atof(row[10])); - e.heading = static_cast(atof(row[11])); - e.gender = atoi(row[12]); - e.race = atoi(row[13]); - e.class_ = atoi(row[14]); - e.level = atoi(row[15]); - e.deity = atoi(row[16]); - e.birthday = atoi(row[17]); - e.last_login = atoi(row[18]); - e.time_played = atoi(row[19]); - e.level2 = atoi(row[20]); - e.anon = atoi(row[21]); - e.gm = atoi(row[22]); - e.face = atoi(row[23]); - e.hair_color = atoi(row[24]); - e.hair_style = atoi(row[25]); - e.beard = atoi(row[26]); - e.beard_color = atoi(row[27]); - e.eye_color_1 = atoi(row[28]); - e.eye_color_2 = atoi(row[29]); - e.drakkin_heritage = atoi(row[30]); - e.drakkin_tattoo = atoi(row[31]); - e.drakkin_details = atoi(row[32]); - e.ability_time_seconds = atoi(row[33]); - e.ability_number = atoi(row[34]); - e.ability_time_minutes = atoi(row[35]); - e.ability_time_hours = atoi(row[36]); - e.exp = atoi(row[37]); - e.aa_points_spent = atoi(row[38]); - e.aa_exp = atoi(row[39]); - e.aa_points = atoi(row[40]); - e.group_leadership_exp = atoi(row[41]); - e.raid_leadership_exp = atoi(row[42]); - e.group_leadership_points = atoi(row[43]); - e.raid_leadership_points = atoi(row[44]); - e.points = atoi(row[45]); - e.cur_hp = atoi(row[46]); - e.mana = atoi(row[47]); - e.endurance = atoi(row[48]); - e.intoxication = atoi(row[49]); - e.str = atoi(row[50]); - e.sta = atoi(row[51]); - e.cha = atoi(row[52]); - e.dex = atoi(row[53]); - e.int_ = atoi(row[54]); - e.agi = atoi(row[55]); - e.wis = atoi(row[56]); - e.zone_change_count = atoi(row[57]); - e.toxicity = atoi(row[58]); - e.hunger_level = atoi(row[59]); - e.thirst_level = atoi(row[60]); - e.ability_up = atoi(row[61]); - e.ldon_points_guk = atoi(row[62]); - e.ldon_points_mir = atoi(row[63]); - e.ldon_points_mmc = atoi(row[64]); - e.ldon_points_ruj = atoi(row[65]); - e.ldon_points_tak = atoi(row[66]); - e.ldon_points_available = atoi(row[67]); - e.tribute_time_remaining = atoi(row[68]); - e.career_tribute_points = atoi(row[69]); - e.tribute_points = atoi(row[70]); - e.tribute_active = atoi(row[71]); - e.pvp_status = atoi(row[72]); - e.pvp_kills = atoi(row[73]); - e.pvp_deaths = atoi(row[74]); - e.pvp_current_points = atoi(row[75]); - e.pvp_career_points = atoi(row[76]); - e.pvp_best_kill_streak = atoi(row[77]); - e.pvp_worst_death_streak = atoi(row[78]); - e.pvp_current_kill_streak = atoi(row[79]); - e.pvp2 = atoi(row[80]); - e.pvp_type = atoi(row[81]); - e.show_helm = atoi(row[82]); - e.group_auto_consent = atoi(row[83]); - e.raid_auto_consent = atoi(row[84]); - e.guild_auto_consent = atoi(row[85]); - e.leadership_exp_on = atoi(row[86]); - e.RestTimer = atoi(row[87]); - e.air_remaining = atoi(row[88]); - e.autosplit_enabled = atoi(row[89]); - e.lfp = atoi(row[90]); - e.lfg = atoi(row[91]); + e.zone_id = static_cast(strtoul(row[6], nullptr, 10)); + e.zone_instance = static_cast(strtoul(row[7], nullptr, 10)); + e.y = strtof(row[8], nullptr); + e.x = strtof(row[9], nullptr); + e.z = strtof(row[10], nullptr); + e.heading = strtof(row[11], nullptr); + e.gender = static_cast(strtoul(row[12], nullptr, 10)); + e.race = static_cast(strtoul(row[13], nullptr, 10)); + e.class_ = static_cast(strtoul(row[14], nullptr, 10)); + e.level = static_cast(strtoul(row[15], nullptr, 10)); + e.deity = static_cast(strtoul(row[16], nullptr, 10)); + e.birthday = static_cast(strtoul(row[17], nullptr, 10)); + e.last_login = static_cast(strtoul(row[18], nullptr, 10)); + e.time_played = static_cast(strtoul(row[19], nullptr, 10)); + e.level2 = static_cast(strtoul(row[20], nullptr, 10)); + e.anon = static_cast(strtoul(row[21], nullptr, 10)); + e.gm = static_cast(strtoul(row[22], nullptr, 10)); + e.face = static_cast(strtoul(row[23], nullptr, 10)); + e.hair_color = static_cast(strtoul(row[24], nullptr, 10)); + e.hair_style = static_cast(strtoul(row[25], nullptr, 10)); + e.beard = static_cast(strtoul(row[26], nullptr, 10)); + e.beard_color = static_cast(strtoul(row[27], nullptr, 10)); + e.eye_color_1 = static_cast(strtoul(row[28], nullptr, 10)); + e.eye_color_2 = static_cast(strtoul(row[29], nullptr, 10)); + e.drakkin_heritage = static_cast(strtoul(row[30], nullptr, 10)); + e.drakkin_tattoo = static_cast(strtoul(row[31], nullptr, 10)); + e.drakkin_details = static_cast(strtoul(row[32], nullptr, 10)); + e.ability_time_seconds = static_cast(strtoul(row[33], nullptr, 10)); + e.ability_number = static_cast(strtoul(row[34], nullptr, 10)); + 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 = atoi(row[93]); - e.firstlogon = atoi(row[94]); - e.e_aa_effects = atoi(row[95]); - e.e_percent_to_aa = atoi(row[96]); - e.e_expended_aa_spent = atoi(row[97]); - e.aa_points_spent_old = atoi(row[98]); - e.aa_points_old = atoi(row[99]); - e.e_last_invsnapshot = atoi(row[100]); + 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); all_entries.push_back(e); diff --git a/common/repositories/base/base_character_disciplines_repository.h b/common/repositories/base/base_character_disciplines_repository.h index 7ddbe63bb..882c32165 100644 --- a/common/repositories/base/base_character_disciplines_repository.h +++ b/common/repositories/base/base_character_disciplines_repository.h @@ -19,9 +19,9 @@ class BaseCharacterDisciplinesRepository { public: struct CharacterDisciplines { - int id; - int slot_id; - int disc_id; + uint32_t id; + uint16_t slot_id; + uint16_t disc_id; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterDisciplines e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.disc_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.disc_id = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterDisciplines e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.disc_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.disc_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterDisciplines e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.disc_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.disc_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_exp_modifiers_repository.h b/common/repositories/base/base_character_exp_modifiers_repository.h index 7be708d36..2b84e9255 100644 --- a/common/repositories/base/base_character_exp_modifiers_repository.h +++ b/common/repositories/base/base_character_exp_modifiers_repository.h @@ -19,10 +19,10 @@ class BaseCharacterExpModifiersRepository { public: struct CharacterExpModifiers { - int character_id; - int zone_id; - float aa_modifier; - float exp_modifier; + int32_t character_id; + int32_t zone_id; + float aa_modifier; + float exp_modifier; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { CharacterExpModifiers e{}; - e.character_id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.aa_modifier = static_cast(atof(row[2])); - e.exp_modifier = static_cast(atof(row[3])); + e.character_id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); + e.aa_modifier = strtof(row[2], nullptr); + e.exp_modifier = strtof(row[3], nullptr); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterExpModifiers e{}; - e.character_id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.aa_modifier = static_cast(atof(row[2])); - e.exp_modifier = static_cast(atof(row[3])); + e.character_id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); + e.aa_modifier = strtof(row[2], nullptr); + e.exp_modifier = strtof(row[3], nullptr); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterExpModifiers e{}; - e.character_id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.aa_modifier = static_cast(atof(row[2])); - e.exp_modifier = static_cast(atof(row[3])); + e.character_id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); + e.aa_modifier = strtof(row[2], nullptr); + e.exp_modifier = strtof(row[3], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_expedition_lockouts_repository.h b/common/repositories/base/base_character_expedition_lockouts_repository.h index 47b619736..1a5489b87 100644 --- a/common/repositories/base/base_character_expedition_lockouts_repository.h +++ b/common/repositories/base/base_character_expedition_lockouts_repository.h @@ -19,12 +19,12 @@ class BaseCharacterExpeditionLockoutsRepository { public: struct CharacterExpeditionLockouts { - int id; - int character_id; + uint32_t id; + uint32_t character_id; std::string expedition_name; std::string event_name; time_t expire_time; - int duration; + uint32_t duration; std::string from_expedition_uuid; }; @@ -138,12 +138,12 @@ public: if (results.RowCount() == 1) { CharacterExpeditionLockouts e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); e.expedition_name = row[2] ? row[2] : ""; e.event_name = row[3] ? row[3] : ""; e.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.duration = atoi(row[5]); + e.duration = static_cast(strtoul(row[5], nullptr, 10)); e.from_expedition_uuid = row[6] ? row[6] : ""; return e; @@ -281,12 +281,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterExpeditionLockouts e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); e.expedition_name = row[2] ? row[2] : ""; e.event_name = row[3] ? row[3] : ""; e.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.duration = atoi(row[5]); + e.duration = static_cast(strtoul(row[5], nullptr, 10)); e.from_expedition_uuid = row[6] ? row[6] : ""; all_entries.push_back(e); @@ -312,12 +312,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterExpeditionLockouts e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); e.expedition_name = row[2] ? row[2] : ""; e.event_name = row[3] ? row[3] : ""; e.expire_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.duration = atoi(row[5]); + e.duration = static_cast(strtoul(row[5], nullptr, 10)); e.from_expedition_uuid = row[6] ? row[6] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_character_inspect_messages_repository.h b/common/repositories/base/base_character_inspect_messages_repository.h index 94234b65b..78d2ea904 100644 --- a/common/repositories/base/base_character_inspect_messages_repository.h +++ b/common/repositories/base/base_character_inspect_messages_repository.h @@ -19,7 +19,7 @@ class BaseCharacterInspectMessagesRepository { public: struct CharacterInspectMessages { - int id; + uint32_t id; std::string inspect_message; }; @@ -118,7 +118,7 @@ public: if (results.RowCount() == 1) { CharacterInspectMessages e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.inspect_message = row[1] ? row[1] : ""; return e; @@ -242,7 +242,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterInspectMessages e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.inspect_message = row[1] ? row[1] : ""; all_entries.push_back(e); @@ -268,7 +268,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterInspectMessages e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.inspect_message = row[1] ? row[1] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_character_instance_safereturns_repository.h b/common/repositories/base/base_character_instance_safereturns_repository.h index ba4c9249f..e8f7faa4b 100644 --- a/common/repositories/base/base_character_instance_safereturns_repository.h +++ b/common/repositories/base/base_character_instance_safereturns_repository.h @@ -19,15 +19,15 @@ class BaseCharacterInstanceSafereturnsRepository { public: struct CharacterInstanceSafereturns { - int id; - int character_id; - int instance_zone_id; - int instance_id; - int safe_zone_id; - float safe_x; - float safe_y; - float safe_z; - float safe_heading; + uint32_t id; + uint32_t character_id; + int32_t instance_zone_id; + int32_t instance_id; + int32_t safe_zone_id; + float safe_x; + float safe_y; + float safe_z; + float safe_heading; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { CharacterInstanceSafereturns e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); - e.instance_zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.safe_zone_id = atoi(row[4]); - e.safe_x = static_cast(atof(row[5])); - e.safe_y = static_cast(atof(row[6])); - e.safe_z = static_cast(atof(row[7])); - e.safe_heading = static_cast(atof(row[8])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); + e.instance_zone_id = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); + e.safe_zone_id = static_cast(atoi(row[4])); + e.safe_x = strtof(row[5], nullptr); + e.safe_y = strtof(row[6], nullptr); + e.safe_z = strtof(row[7], nullptr); + e.safe_heading = strtof(row[8], nullptr); return e; } @@ -297,15 +297,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterInstanceSafereturns e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); - e.instance_zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.safe_zone_id = atoi(row[4]); - e.safe_x = static_cast(atof(row[5])); - e.safe_y = static_cast(atof(row[6])); - e.safe_z = static_cast(atof(row[7])); - e.safe_heading = static_cast(atof(row[8])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); + e.instance_zone_id = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); + e.safe_zone_id = static_cast(atoi(row[4])); + e.safe_x = strtof(row[5], nullptr); + e.safe_y = strtof(row[6], nullptr); + e.safe_z = strtof(row[7], nullptr); + e.safe_heading = strtof(row[8], nullptr); all_entries.push_back(e); } @@ -330,15 +330,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterInstanceSafereturns e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); - e.instance_zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.safe_zone_id = atoi(row[4]); - e.safe_x = static_cast(atof(row[5])); - e.safe_y = static_cast(atof(row[6])); - e.safe_z = static_cast(atof(row[7])); - e.safe_heading = static_cast(atof(row[8])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); + e.instance_zone_id = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); + e.safe_zone_id = static_cast(atoi(row[4])); + e.safe_x = strtof(row[5], nullptr); + e.safe_y = strtof(row[6], nullptr); + e.safe_z = strtof(row[7], nullptr); + e.safe_heading = strtof(row[8], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_item_recast_repository.h b/common/repositories/base/base_character_item_recast_repository.h index 781db36aa..929705ff8 100644 --- a/common/repositories/base/base_character_item_recast_repository.h +++ b/common/repositories/base/base_character_item_recast_repository.h @@ -19,9 +19,9 @@ class BaseCharacterItemRecastRepository { public: struct CharacterItemRecast { - int id; - int recast_type; - int timestamp; + uint32_t id; + uint16_t recast_type; + uint32_t timestamp; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterItemRecast e{}; - e.id = atoi(row[0]); - e.recast_type = atoi(row[1]); - e.timestamp = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.recast_type = static_cast(strtoul(row[1], nullptr, 10)); + e.timestamp = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterItemRecast e{}; - e.id = atoi(row[0]); - e.recast_type = atoi(row[1]); - e.timestamp = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.recast_type = static_cast(strtoul(row[1], nullptr, 10)); + e.timestamp = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterItemRecast e{}; - e.id = atoi(row[0]); - e.recast_type = atoi(row[1]); - e.timestamp = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.recast_type = static_cast(strtoul(row[1], nullptr, 10)); + e.timestamp = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_languages_repository.h b/common/repositories/base/base_character_languages_repository.h index 023b6458e..dc25de339 100644 --- a/common/repositories/base/base_character_languages_repository.h +++ b/common/repositories/base/base_character_languages_repository.h @@ -19,9 +19,9 @@ class BaseCharacterLanguagesRepository { public: struct CharacterLanguages { - int id; - int lang_id; - int value; + uint32_t id; + uint16_t lang_id; + uint16_t value; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterLanguages e{}; - e.id = atoi(row[0]); - e.lang_id = atoi(row[1]); - e.value = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.lang_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterLanguages e{}; - e.id = atoi(row[0]); - e.lang_id = atoi(row[1]); - e.value = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.lang_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterLanguages e{}; - e.id = atoi(row[0]); - e.lang_id = atoi(row[1]); - e.value = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.lang_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_leadership_abilities_repository.h b/common/repositories/base/base_character_leadership_abilities_repository.h index a1727323d..a58f0ba23 100644 --- a/common/repositories/base/base_character_leadership_abilities_repository.h +++ b/common/repositories/base/base_character_leadership_abilities_repository.h @@ -19,9 +19,9 @@ class BaseCharacterLeadershipAbilitiesRepository { public: struct CharacterLeadershipAbilities { - int id; - int slot; - int rank; + uint32_t id; + uint16_t slot; + uint16_t rank; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterLeadershipAbilities e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.rank = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.rank = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterLeadershipAbilities e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.rank = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.rank = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterLeadershipAbilities e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.rank = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.rank = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_material_repository.h b/common/repositories/base/base_character_material_repository.h index ec28a25cb..80506693c 100644 --- a/common/repositories/base/base_character_material_repository.h +++ b/common/repositories/base/base_character_material_repository.h @@ -19,13 +19,13 @@ class BaseCharacterMaterialRepository { public: struct CharacterMaterial { - int id; - int slot; - int blue; - int green; - int red; - int use_tint; - int color; + uint32_t id; + uint8_t slot; + uint8_t blue; + uint8_t green; + uint8_t red; + uint8_t use_tint; + uint32_t color; }; static std::string PrimaryKey() @@ -138,13 +138,13 @@ public: if (results.RowCount() == 1) { CharacterMaterial e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.blue = atoi(row[2]); - e.green = atoi(row[3]); - e.red = atoi(row[4]); - e.use_tint = atoi(row[5]); - e.color = atoi(row[6]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.blue = static_cast(strtoul(row[2], nullptr, 10)); + e.green = static_cast(strtoul(row[3], nullptr, 10)); + e.red = static_cast(strtoul(row[4], nullptr, 10)); + e.use_tint = static_cast(strtoul(row[5], nullptr, 10)); + e.color = static_cast(strtoul(row[6], nullptr, 10)); return e; } @@ -281,13 +281,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterMaterial e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.blue = atoi(row[2]); - e.green = atoi(row[3]); - e.red = atoi(row[4]); - e.use_tint = atoi(row[5]); - e.color = atoi(row[6]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.blue = static_cast(strtoul(row[2], nullptr, 10)); + e.green = static_cast(strtoul(row[3], nullptr, 10)); + e.red = static_cast(strtoul(row[4], nullptr, 10)); + e.use_tint = static_cast(strtoul(row[5], nullptr, 10)); + e.color = static_cast(strtoul(row[6], nullptr, 10)); all_entries.push_back(e); } @@ -312,13 +312,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterMaterial e{}; - e.id = atoi(row[0]); - e.slot = atoi(row[1]); - e.blue = atoi(row[2]); - e.green = atoi(row[3]); - e.red = atoi(row[4]); - e.use_tint = atoi(row[5]); - e.color = atoi(row[6]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.blue = static_cast(strtoul(row[2], nullptr, 10)); + e.green = static_cast(strtoul(row[3], nullptr, 10)); + e.red = static_cast(strtoul(row[4], nullptr, 10)); + e.use_tint = static_cast(strtoul(row[5], nullptr, 10)); + e.color = static_cast(strtoul(row[6], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_memmed_spells_repository.h b/common/repositories/base/base_character_memmed_spells_repository.h index 5875326ff..4716e120f 100644 --- a/common/repositories/base/base_character_memmed_spells_repository.h +++ b/common/repositories/base/base_character_memmed_spells_repository.h @@ -19,9 +19,9 @@ class BaseCharacterMemmedSpellsRepository { public: struct CharacterMemmedSpells { - int id; - int slot_id; - int spell_id; + uint32_t id; + uint16_t slot_id; + uint16_t spell_id; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterMemmedSpells e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterMemmedSpells e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterMemmedSpells e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_peqzone_flags_repository.h b/common/repositories/base/base_character_peqzone_flags_repository.h index 912064fba..fc83278b1 100644 --- a/common/repositories/base/base_character_peqzone_flags_repository.h +++ b/common/repositories/base/base_character_peqzone_flags_repository.h @@ -19,8 +19,8 @@ class BaseCharacterPeqzoneFlagsRepository { public: struct CharacterPeqzoneFlags { - int id; - int zone_id; + int32_t id; + int32_t zone_id; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { CharacterPeqzoneFlags e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPeqzoneFlags e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPeqzoneFlags e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_pet_buffs_repository.h b/common/repositories/base/base_character_pet_buffs_repository.h index cbc441e1b..87fc3a286 100644 --- a/common/repositories/base/base_character_pet_buffs_repository.h +++ b/common/repositories/base/base_character_pet_buffs_repository.h @@ -19,17 +19,17 @@ class BaseCharacterPetBuffsRepository { public: struct CharacterPetBuffs { - int char_id; - int pet; - int slot; - int spell_id; - int caster_level; + int32_t char_id; + int32_t pet; + int32_t slot; + int32_t spell_id; + int8_t caster_level; std::string castername; - int ticsremaining; - int counters; - int numhits; - int rune; - int instrument_mod; + int32_t ticsremaining; + int32_t counters; + int32_t numhits; + int32_t rune; + uint8_t instrument_mod; }; static std::string PrimaryKey() @@ -154,17 +154,17 @@ public: if (results.RowCount() == 1) { CharacterPetBuffs e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); - e.slot = atoi(row[2]); - e.spell_id = atoi(row[3]); - e.caster_level = atoi(row[4]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); + e.slot = static_cast(atoi(row[2])); + e.spell_id = static_cast(atoi(row[3])); + e.caster_level = static_cast(atoi(row[4])); e.castername = row[5] ? row[5] : ""; - e.ticsremaining = atoi(row[6]); - e.counters = atoi(row[7]); - e.numhits = atoi(row[8]); - e.rune = atoi(row[9]); - e.instrument_mod = atoi(row[10]); + e.ticsremaining = static_cast(atoi(row[6])); + e.counters = static_cast(atoi(row[7])); + e.numhits = static_cast(atoi(row[8])); + e.rune = static_cast(atoi(row[9])); + e.instrument_mod = static_cast(strtoul(row[10], nullptr, 10)); return e; } @@ -314,17 +314,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPetBuffs e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); - e.slot = atoi(row[2]); - e.spell_id = atoi(row[3]); - e.caster_level = atoi(row[4]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); + e.slot = static_cast(atoi(row[2])); + e.spell_id = static_cast(atoi(row[3])); + e.caster_level = static_cast(atoi(row[4])); e.castername = row[5] ? row[5] : ""; - e.ticsremaining = atoi(row[6]); - e.counters = atoi(row[7]); - e.numhits = atoi(row[8]); - e.rune = atoi(row[9]); - e.instrument_mod = atoi(row[10]); + e.ticsremaining = static_cast(atoi(row[6])); + e.counters = static_cast(atoi(row[7])); + e.numhits = static_cast(atoi(row[8])); + e.rune = static_cast(atoi(row[9])); + e.instrument_mod = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } @@ -349,17 +349,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPetBuffs e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); - e.slot = atoi(row[2]); - e.spell_id = atoi(row[3]); - e.caster_level = atoi(row[4]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); + e.slot = static_cast(atoi(row[2])); + e.spell_id = static_cast(atoi(row[3])); + e.caster_level = static_cast(atoi(row[4])); e.castername = row[5] ? row[5] : ""; - e.ticsremaining = atoi(row[6]); - e.counters = atoi(row[7]); - e.numhits = atoi(row[8]); - e.rune = atoi(row[9]); - e.instrument_mod = atoi(row[10]); + e.ticsremaining = static_cast(atoi(row[6])); + e.counters = static_cast(atoi(row[7])); + e.numhits = static_cast(atoi(row[8])); + e.rune = static_cast(atoi(row[9])); + e.instrument_mod = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_pet_info_repository.h b/common/repositories/base/base_character_pet_info_repository.h index 0083916ac..dfb5c1ea2 100644 --- a/common/repositories/base/base_character_pet_info_repository.h +++ b/common/repositories/base/base_character_pet_info_repository.h @@ -19,15 +19,15 @@ class BaseCharacterPetInfoRepository { public: struct CharacterPetInfo { - int char_id; - int pet; + int32_t char_id; + int32_t pet; std::string petname; - int petpower; - int spell_id; - int hp; - int mana; + int32_t petpower; + int32_t spell_id; + int32_t hp; + int32_t mana; float size; - int taunting; + int8_t taunting; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { CharacterPetInfo e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); e.petname = row[2] ? row[2] : ""; - e.petpower = atoi(row[3]); - e.spell_id = atoi(row[4]); - e.hp = atoi(row[5]); - e.mana = atoi(row[6]); - e.size = static_cast(atof(row[7])); - e.taunting = atoi(row[8]); + e.petpower = static_cast(atoi(row[3])); + e.spell_id = static_cast(atoi(row[4])); + e.hp = static_cast(atoi(row[5])); + e.mana = static_cast(atoi(row[6])); + e.size = strtof(row[7], nullptr); + e.taunting = static_cast(atoi(row[8])); return e; } @@ -298,15 +298,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPetInfo e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); e.petname = row[2] ? row[2] : ""; - e.petpower = atoi(row[3]); - e.spell_id = atoi(row[4]); - e.hp = atoi(row[5]); - e.mana = atoi(row[6]); - e.size = static_cast(atof(row[7])); - e.taunting = atoi(row[8]); + e.petpower = static_cast(atoi(row[3])); + e.spell_id = static_cast(atoi(row[4])); + e.hp = static_cast(atoi(row[5])); + e.mana = static_cast(atoi(row[6])); + e.size = strtof(row[7], nullptr); + e.taunting = static_cast(atoi(row[8])); all_entries.push_back(e); } @@ -331,15 +331,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPetInfo e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); e.petname = row[2] ? row[2] : ""; - e.petpower = atoi(row[3]); - e.spell_id = atoi(row[4]); - e.hp = atoi(row[5]); - e.mana = atoi(row[6]); - e.size = static_cast(atof(row[7])); - e.taunting = atoi(row[8]); + e.petpower = static_cast(atoi(row[3])); + e.spell_id = static_cast(atoi(row[4])); + e.hp = static_cast(atoi(row[5])); + e.mana = static_cast(atoi(row[6])); + e.size = strtof(row[7], nullptr); + e.taunting = static_cast(atoi(row[8])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_pet_inventory_repository.h b/common/repositories/base/base_character_pet_inventory_repository.h index 52dcfaac3..cb364d97c 100644 --- a/common/repositories/base/base_character_pet_inventory_repository.h +++ b/common/repositories/base/base_character_pet_inventory_repository.h @@ -19,10 +19,10 @@ class BaseCharacterPetInventoryRepository { public: struct CharacterPetInventory { - int char_id; - int pet; - int slot; - int item_id; + int32_t char_id; + int32_t pet; + int32_t slot; + int32_t item_id; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { CharacterPetInventory e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); - e.slot = atoi(row[2]); - e.item_id = atoi(row[3]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); + e.slot = static_cast(atoi(row[2])); + e.item_id = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPetInventory e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); - e.slot = atoi(row[2]); - e.item_id = atoi(row[3]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); + e.slot = static_cast(atoi(row[2])); + e.item_id = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPetInventory e{}; - e.char_id = atoi(row[0]); - e.pet = atoi(row[1]); - e.slot = atoi(row[2]); - e.item_id = atoi(row[3]); + e.char_id = static_cast(atoi(row[0])); + e.pet = static_cast(atoi(row[1])); + e.slot = static_cast(atoi(row[2])); + e.item_id = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_potionbelt_repository.h b/common/repositories/base/base_character_potionbelt_repository.h index a4882c566..c31fef642 100644 --- a/common/repositories/base/base_character_potionbelt_repository.h +++ b/common/repositories/base/base_character_potionbelt_repository.h @@ -19,10 +19,10 @@ class BaseCharacterPotionbeltRepository { public: struct CharacterPotionbelt { - int id; - int potion_id; - int item_id; - int icon; + uint32_t id; + uint8_t potion_id; + uint32_t item_id; + uint32_t icon; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { CharacterPotionbelt e{}; - e.id = atoi(row[0]); - e.potion_id = atoi(row[1]); - e.item_id = atoi(row[2]); - e.icon = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.potion_id = static_cast(strtoul(row[1], nullptr, 10)); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.icon = static_cast(strtoul(row[3], nullptr, 10)); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPotionbelt e{}; - e.id = atoi(row[0]); - e.potion_id = atoi(row[1]); - e.item_id = atoi(row[2]); - e.icon = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.potion_id = static_cast(strtoul(row[1], nullptr, 10)); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.icon = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterPotionbelt e{}; - e.id = atoi(row[0]); - e.potion_id = atoi(row[1]); - e.item_id = atoi(row[2]); - e.icon = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.potion_id = static_cast(strtoul(row[1], nullptr, 10)); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.icon = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_skills_repository.h b/common/repositories/base/base_character_skills_repository.h index cb659832d..87c3c1778 100644 --- a/common/repositories/base/base_character_skills_repository.h +++ b/common/repositories/base/base_character_skills_repository.h @@ -19,9 +19,9 @@ class BaseCharacterSkillsRepository { public: struct CharacterSkills { - int id; - int skill_id; - int value; + uint32_t id; + uint16_t skill_id; + uint16_t value; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterSkills e{}; - e.id = atoi(row[0]); - e.skill_id = atoi(row[1]); - e.value = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.skill_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterSkills e{}; - e.id = atoi(row[0]); - e.skill_id = atoi(row[1]); - e.value = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.skill_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterSkills e{}; - e.id = atoi(row[0]); - e.skill_id = atoi(row[1]); - e.value = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.skill_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_spells_repository.h b/common/repositories/base/base_character_spells_repository.h index af5d0d8ed..11514f84b 100644 --- a/common/repositories/base/base_character_spells_repository.h +++ b/common/repositories/base/base_character_spells_repository.h @@ -19,9 +19,9 @@ class BaseCharacterSpellsRepository { public: struct CharacterSpells { - int id; - int slot_id; - int spell_id; + uint32_t id; + uint16_t slot_id; + uint16_t spell_id; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { CharacterSpells e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterSpells e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterSpells e{}; - e.id = atoi(row[0]); - e.slot_id = atoi(row[1]); - e.spell_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_character_task_timers_repository.h b/common/repositories/base/base_character_task_timers_repository.h index 5a4cee395..6c9e76b19 100644 --- a/common/repositories/base/base_character_task_timers_repository.h +++ b/common/repositories/base/base_character_task_timers_repository.h @@ -19,12 +19,12 @@ class BaseCharacterTaskTimersRepository { public: struct CharacterTaskTimers { - int id; - int character_id; - int task_id; - int timer_type; - int timer_group; - time_t expire_time; + uint32_t id; + uint32_t character_id; + uint32_t task_id; + int32_t timer_type; + int32_t timer_group; + time_t expire_time; }; static std::string PrimaryKey() @@ -134,11 +134,11 @@ public: if (results.RowCount() == 1) { CharacterTaskTimers e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); - e.task_id = atoi(row[2]); - e.timer_type = atoi(row[3]); - e.timer_group = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); + e.task_id = static_cast(strtoul(row[2], nullptr, 10)); + e.timer_type = static_cast(atoi(row[3])); + e.timer_group = static_cast(atoi(row[4])); e.expire_time = strtoll(row[5] ? row[5] : "-1", nullptr, 10); return e; @@ -273,11 +273,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterTaskTimers e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); - e.task_id = atoi(row[2]); - e.timer_type = atoi(row[3]); - e.timer_group = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); + e.task_id = static_cast(strtoul(row[2], nullptr, 10)); + e.timer_type = static_cast(atoi(row[3])); + e.timer_group = static_cast(atoi(row[4])); e.expire_time = strtoll(row[5] ? row[5] : "-1", nullptr, 10); all_entries.push_back(e); @@ -303,11 +303,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterTaskTimers e{}; - e.id = atoi(row[0]); - e.character_id = atoi(row[1]); - e.task_id = atoi(row[2]); - e.timer_type = atoi(row[3]); - e.timer_group = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.character_id = static_cast(strtoul(row[1], nullptr, 10)); + e.task_id = static_cast(strtoul(row[2], nullptr, 10)); + e.timer_type = static_cast(atoi(row[3])); + e.timer_group = static_cast(atoi(row[4])); e.expire_time = strtoll(row[5] ? row[5] : "-1", nullptr, 10); all_entries.push_back(e); diff --git a/common/repositories/base/base_character_tasks_repository.h b/common/repositories/base/base_character_tasks_repository.h index f18bc73f9..070767ff0 100644 --- a/common/repositories/base/base_character_tasks_repository.h +++ b/common/repositories/base/base_character_tasks_repository.h @@ -19,12 +19,12 @@ class BaseCharacterTasksRepository { public: struct CharacterTasks { - int charid; - int taskid; - int slot; - int type; - int acceptedtime; - int was_rewarded; + uint32_t charid; + uint32_t taskid; + uint32_t slot; + int8_t type; + uint32_t acceptedtime; + int8_t was_rewarded; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { CharacterTasks e{}; - e.charid = atoi(row[0]); - e.taskid = atoi(row[1]); - e.slot = atoi(row[2]); - e.type = atoi(row[3]); - e.acceptedtime = atoi(row[4]); - e.was_rewarded = atoi(row[5]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); + e.slot = static_cast(strtoul(row[2], nullptr, 10)); + e.type = static_cast(atoi(row[3])); + e.acceptedtime = static_cast(strtoul(row[4], nullptr, 10)); + e.was_rewarded = static_cast(atoi(row[5])); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterTasks e{}; - e.charid = atoi(row[0]); - e.taskid = atoi(row[1]); - e.slot = atoi(row[2]); - e.type = atoi(row[3]); - e.acceptedtime = atoi(row[4]); - e.was_rewarded = atoi(row[5]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); + e.slot = static_cast(strtoul(row[2], nullptr, 10)); + e.type = static_cast(atoi(row[3])); + e.acceptedtime = static_cast(strtoul(row[4], nullptr, 10)); + e.was_rewarded = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterTasks e{}; - e.charid = atoi(row[0]); - e.taskid = atoi(row[1]); - e.slot = atoi(row[2]); - e.type = atoi(row[3]); - e.acceptedtime = atoi(row[4]); - e.was_rewarded = atoi(row[5]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); + e.slot = static_cast(strtoul(row[2], nullptr, 10)); + e.type = static_cast(atoi(row[3])); + e.acceptedtime = static_cast(strtoul(row[4], nullptr, 10)); + e.was_rewarded = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_completed_shared_task_activity_state_repository.h b/common/repositories/base/base_completed_shared_task_activity_state_repository.h index 0d89bd955..e2225e8ea 100644 --- a/common/repositories/base/base_completed_shared_task_activity_state_repository.h +++ b/common/repositories/base/base_completed_shared_task_activity_state_repository.h @@ -19,11 +19,11 @@ class BaseCompletedSharedTaskActivityStateRepository { public: struct CompletedSharedTaskActivityState { - int64 shared_task_id; - int activity_id; - int done_count; - time_t updated_time; - time_t completed_time; + int64_t shared_task_id; + int32_t activity_id; + int32_t done_count; + time_t updated_time; + time_t completed_time; }; static std::string PrimaryKey() @@ -131,8 +131,8 @@ public: CompletedSharedTaskActivityState e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.activity_id = atoi(row[1]); - e.done_count = atoi(row[2]); + e.activity_id = static_cast(atoi(row[1])); + e.done_count = static_cast(atoi(row[2])); e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); @@ -267,8 +267,8 @@ public: CompletedSharedTaskActivityState e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.activity_id = atoi(row[1]); - e.done_count = atoi(row[2]); + e.activity_id = static_cast(atoi(row[1])); + e.done_count = static_cast(atoi(row[2])); e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); @@ -296,8 +296,8 @@ public: CompletedSharedTaskActivityState e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.activity_id = atoi(row[1]); - e.done_count = atoi(row[2]); + e.activity_id = static_cast(atoi(row[1])); + e.done_count = static_cast(atoi(row[2])); e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); diff --git a/common/repositories/base/base_completed_shared_task_members_repository.h b/common/repositories/base/base_completed_shared_task_members_repository.h index 3054320c9..a58dc0f00 100644 --- a/common/repositories/base/base_completed_shared_task_members_repository.h +++ b/common/repositories/base/base_completed_shared_task_members_repository.h @@ -19,9 +19,9 @@ class BaseCompletedSharedTaskMembersRepository { public: struct CompletedSharedTaskMembers { - int64 shared_task_id; - int64 character_id; - int is_leader; + int64_t shared_task_id; + int64_t character_id; + int8_t is_leader; }; static std::string PrimaryKey() @@ -124,7 +124,7 @@ public: e.shared_task_id = strtoll(row[0], nullptr, 10); e.character_id = strtoll(row[1], nullptr, 10); - e.is_leader = atoi(row[2]); + e.is_leader = static_cast(atoi(row[2])); return e; } @@ -252,7 +252,7 @@ public: e.shared_task_id = strtoll(row[0], nullptr, 10); e.character_id = strtoll(row[1], nullptr, 10); - e.is_leader = atoi(row[2]); + e.is_leader = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -279,7 +279,7 @@ public: e.shared_task_id = strtoll(row[0], nullptr, 10); e.character_id = strtoll(row[1], nullptr, 10); - e.is_leader = atoi(row[2]); + e.is_leader = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_completed_shared_tasks_repository.h b/common/repositories/base/base_completed_shared_tasks_repository.h index 594ff61dd..6ba398908 100644 --- a/common/repositories/base/base_completed_shared_tasks_repository.h +++ b/common/repositories/base/base_completed_shared_tasks_repository.h @@ -19,12 +19,12 @@ class BaseCompletedSharedTasksRepository { public: struct CompletedSharedTasks { - int64 id; - int task_id; - time_t accepted_time; - time_t expire_time; - time_t completion_time; - int is_locked; + int64_t id; + int32_t task_id; + time_t accepted_time; + time_t expire_time; + time_t completion_time; + int8_t is_locked; }; static std::string PrimaryKey() @@ -135,11 +135,11 @@ public: CompletedSharedTasks e{}; e.id = strtoll(row[0], nullptr, 10); - e.task_id = atoi(row[1]); + e.task_id = static_cast(atoi(row[1])); e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10); e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.is_locked = atoi(row[5]); + e.is_locked = static_cast(atoi(row[5])); return e; } @@ -275,11 +275,11 @@ public: CompletedSharedTasks e{}; e.id = strtoll(row[0], nullptr, 10); - e.task_id = atoi(row[1]); + e.task_id = static_cast(atoi(row[1])); e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10); e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.is_locked = atoi(row[5]); + e.is_locked = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -305,11 +305,11 @@ public: CompletedSharedTasks e{}; e.id = strtoll(row[0], nullptr, 10); - e.task_id = atoi(row[1]); + e.task_id = static_cast(atoi(row[1])); e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10); e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.is_locked = atoi(row[5]); + e.is_locked = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_completed_tasks_repository.h b/common/repositories/base/base_completed_tasks_repository.h index 805e1a45e..e195da188 100644 --- a/common/repositories/base/base_completed_tasks_repository.h +++ b/common/repositories/base/base_completed_tasks_repository.h @@ -19,10 +19,10 @@ class BaseCompletedTasksRepository { public: struct CompletedTasks { - int charid; - int completedtime; - int taskid; - int activityid; + uint32_t charid; + uint32_t completedtime; + uint32_t taskid; + int32_t activityid; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { CompletedTasks e{}; - e.charid = atoi(row[0]); - e.completedtime = atoi(row[1]); - e.taskid = atoi(row[2]); - e.activityid = atoi(row[3]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.completedtime = static_cast(strtoul(row[1], nullptr, 10)); + e.taskid = static_cast(strtoul(row[2], nullptr, 10)); + e.activityid = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CompletedTasks e{}; - e.charid = atoi(row[0]); - e.completedtime = atoi(row[1]); - e.taskid = atoi(row[2]); - e.activityid = atoi(row[3]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.completedtime = static_cast(strtoul(row[1], nullptr, 10)); + e.taskid = static_cast(strtoul(row[2], nullptr, 10)); + e.activityid = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CompletedTasks e{}; - e.charid = atoi(row[0]); - e.completedtime = atoi(row[1]); - e.taskid = atoi(row[2]); - e.activityid = atoi(row[3]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.completedtime = static_cast(strtoul(row[1], nullptr, 10)); + e.taskid = static_cast(strtoul(row[2], nullptr, 10)); + e.activityid = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_content_flags_repository.h b/common/repositories/base/base_content_flags_repository.h index a567a3833..f8e2bc4dc 100644 --- a/common/repositories/base/base_content_flags_repository.h +++ b/common/repositories/base/base_content_flags_repository.h @@ -19,9 +19,9 @@ class BaseContentFlagsRepository { public: struct ContentFlags { - int id; + int32_t id; std::string flag_name; - int enabled; + int8_t enabled; std::string notes; }; @@ -126,9 +126,9 @@ public: if (results.RowCount() == 1) { ContentFlags e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.flag_name = row[1] ? row[1] : ""; - e.enabled = atoi(row[2]); + e.enabled = static_cast(atoi(row[2])); e.notes = row[3] ? row[3] : ""; return e; @@ -257,9 +257,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ContentFlags e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.flag_name = row[1] ? row[1] : ""; - e.enabled = atoi(row[2]); + e.enabled = static_cast(atoi(row[2])); e.notes = row[3] ? row[3] : ""; all_entries.push_back(e); @@ -285,9 +285,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ContentFlags e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.flag_name = row[1] ? row[1] : ""; - e.enabled = atoi(row[2]); + e.enabled = static_cast(atoi(row[2])); e.notes = row[3] ? row[3] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_damageshieldtypes_repository.h b/common/repositories/base/base_damageshieldtypes_repository.h index 4de879b69..cc1ec4b8f 100644 --- a/common/repositories/base/base_damageshieldtypes_repository.h +++ b/common/repositories/base/base_damageshieldtypes_repository.h @@ -19,8 +19,8 @@ class BaseDamageshieldtypesRepository { public: struct Damageshieldtypes { - int spellid; - int type; + uint32_t spellid; + uint8_t type; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { Damageshieldtypes e{}; - e.spellid = atoi(row[0]); - e.type = atoi(row[1]); + e.spellid = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Damageshieldtypes e{}; - e.spellid = atoi(row[0]); - e.type = atoi(row[1]); + e.spellid = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Damageshieldtypes e{}; - e.spellid = atoi(row[0]); - e.type = atoi(row[1]); + e.spellid = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_data_buckets_repository.h b/common/repositories/base/base_data_buckets_repository.h index c2cb95512..3c7ad5a0a 100644 --- a/common/repositories/base/base_data_buckets_repository.h +++ b/common/repositories/base/base_data_buckets_repository.h @@ -19,10 +19,10 @@ class BaseDataBucketsRepository { public: struct DataBuckets { - int64 id; + uint64_t id; std::string key; std::string value; - int expires; + uint32_t expires; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { DataBuckets e{}; - e.id = strtoll(row[0], nullptr, 10); + e.id = strtoull(row[0], nullptr, 10); e.key = row[1] ? row[1] : ""; e.value = row[2] ? row[2] : ""; - e.expires = atoi(row[3]); + e.expires = static_cast(strtoul(row[3], nullptr, 10)); return e; } @@ -257,10 +257,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DataBuckets e{}; - e.id = strtoll(row[0], nullptr, 10); + e.id = strtoull(row[0], nullptr, 10); e.key = row[1] ? row[1] : ""; e.value = row[2] ? row[2] : ""; - e.expires = atoi(row[3]); + e.expires = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } @@ -285,10 +285,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DataBuckets e{}; - e.id = strtoll(row[0], nullptr, 10); + e.id = strtoull(row[0], nullptr, 10); e.key = row[1] ? row[1] : ""; e.value = row[2] ? row[2] : ""; - e.expires = atoi(row[3]); + e.expires = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_db_str_repository.h b/common/repositories/base/base_db_str_repository.h index 5e3b9a39d..d79d65410 100644 --- a/common/repositories/base/base_db_str_repository.h +++ b/common/repositories/base/base_db_str_repository.h @@ -19,8 +19,8 @@ class BaseDbStrRepository { public: struct DbStr { - int id; - int type; + int32_t id; + int32_t type; std::string value; }; @@ -122,8 +122,8 @@ public: if (results.RowCount() == 1) { DbStr e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.type = static_cast(atoi(row[1])); e.value = row[2] ? row[2] : ""; return e; @@ -250,8 +250,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DbStr e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.type = static_cast(atoi(row[1])); e.value = row[2] ? row[2] : ""; all_entries.push_back(e); @@ -277,8 +277,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DbStr e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.type = static_cast(atoi(row[1])); e.value = row[2] ? row[2] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_discord_webhooks_repository.h b/common/repositories/base/base_discord_webhooks_repository.h index f4b78d058..6967c1c28 100644 --- a/common/repositories/base/base_discord_webhooks_repository.h +++ b/common/repositories/base/base_discord_webhooks_repository.h @@ -19,7 +19,7 @@ class BaseDiscordWebhooksRepository { public: struct DiscordWebhooks { - int id; + int32_t id; std::string webhook_name; std::string webhook_url; time_t created_at; @@ -130,7 +130,7 @@ public: if (results.RowCount() == 1) { DiscordWebhooks e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.webhook_name = row[1] ? row[1] : ""; e.webhook_url = row[2] ? row[2] : ""; e.created_at = strtoll(row[3] ? row[3] : "-1", nullptr, 10); @@ -265,7 +265,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DiscordWebhooks e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.webhook_name = row[1] ? row[1] : ""; e.webhook_url = row[2] ? row[2] : ""; e.created_at = strtoll(row[3] ? row[3] : "-1", nullptr, 10); @@ -294,7 +294,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DiscordWebhooks e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.webhook_name = row[1] ? row[1] : ""; e.webhook_url = row[2] ? row[2] : ""; e.created_at = strtoll(row[3] ? row[3] : "-1", nullptr, 10); diff --git a/common/repositories/base/base_discovered_items_repository.h b/common/repositories/base/base_discovered_items_repository.h index 7aaaac4da..5cef65213 100644 --- a/common/repositories/base/base_discovered_items_repository.h +++ b/common/repositories/base/base_discovered_items_repository.h @@ -19,10 +19,10 @@ class BaseDiscoveredItemsRepository { public: struct DiscoveredItems { - int item_id; + uint32_t item_id; std::string char_name; - int discovered_date; - int account_status; + uint32_t discovered_date; + int32_t account_status; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { DiscoveredItems e{}; - e.item_id = atoi(row[0]); + e.item_id = static_cast(strtoul(row[0], nullptr, 10)); e.char_name = row[1] ? row[1] : ""; - e.discovered_date = atoi(row[2]); - e.account_status = atoi(row[3]); + e.discovered_date = static_cast(strtoul(row[2], nullptr, 10)); + e.account_status = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DiscoveredItems e{}; - e.item_id = atoi(row[0]); + e.item_id = static_cast(strtoul(row[0], nullptr, 10)); e.char_name = row[1] ? row[1] : ""; - e.discovered_date = atoi(row[2]); - e.account_status = atoi(row[3]); + e.discovered_date = static_cast(strtoul(row[2], nullptr, 10)); + e.account_status = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DiscoveredItems e{}; - e.item_id = atoi(row[0]); + e.item_id = static_cast(strtoul(row[0], nullptr, 10)); e.char_name = row[1] ? row[1] : ""; - e.discovered_date = atoi(row[2]); - e.account_status = atoi(row[3]); + e.discovered_date = static_cast(strtoul(row[2], nullptr, 10)); + e.account_status = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_doors_repository.h b/common/repositories/base/base_doors_repository.h index fc67d2dac..3711f192c 100644 --- a/common/repositories/base/base_doors_repository.h +++ b/common/repositories/base/base_doors_repository.h @@ -19,40 +19,40 @@ class BaseDoorsRepository { public: struct Doors { - int id; - int doorid; + int32_t id; + int16_t doorid; std::string zone; - int version; + int16_t version; std::string name; float pos_y; float pos_x; float pos_z; float heading; - int opentype; - int guild; - int lockpick; - int keyitem; - int nokeyring; - int triggerdoor; - int triggertype; - int disable_timer; - int doorisopen; - int door_param; + int16_t opentype; + int16_t guild; + int16_t lockpick; + int32_t keyitem; + uint8_t nokeyring; + int16_t triggerdoor; + int16_t triggertype; + int8_t disable_timer; + int16_t doorisopen; + int32_t door_param; std::string dest_zone; - int dest_instance; + uint32_t dest_instance; float dest_x; float dest_y; float dest_z; float dest_heading; - int invert_state; - int incline; - int size; + int32_t invert_state; + int32_t incline; + uint16_t size; float buffer; - int client_version_mask; - int is_ldon_door; - int dz_switch_id; - int min_expansion; - int max_expansion; + uint32_t client_version_mask; + int16_t is_ldon_door; + int32_t dz_switch_id; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -254,40 +254,40 @@ public: if (results.RowCount() == 1) { Doors e{}; - e.id = atoi(row[0]); - e.doorid = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.doorid = static_cast(atoi(row[1])); e.zone = row[2] ? row[2] : ""; - e.version = atoi(row[3]); + e.version = static_cast(atoi(row[3])); e.name = row[4] ? row[4] : ""; - e.pos_y = static_cast(atof(row[5])); - e.pos_x = static_cast(atof(row[6])); - e.pos_z = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); - e.opentype = atoi(row[9]); - e.guild = atoi(row[10]); - e.lockpick = atoi(row[11]); - e.keyitem = atoi(row[12]); - e.nokeyring = atoi(row[13]); - e.triggerdoor = atoi(row[14]); - e.triggertype = atoi(row[15]); - e.disable_timer = atoi(row[16]); - e.doorisopen = atoi(row[17]); - e.door_param = atoi(row[18]); + e.pos_y = strtof(row[5], nullptr); + e.pos_x = strtof(row[6], nullptr); + e.pos_z = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); + e.opentype = static_cast(atoi(row[9])); + e.guild = static_cast(atoi(row[10])); + e.lockpick = static_cast(atoi(row[11])); + e.keyitem = static_cast(atoi(row[12])); + e.nokeyring = static_cast(strtoul(row[13], nullptr, 10)); + e.triggerdoor = static_cast(atoi(row[14])); + e.triggertype = static_cast(atoi(row[15])); + e.disable_timer = static_cast(atoi(row[16])); + e.doorisopen = static_cast(atoi(row[17])); + e.door_param = static_cast(atoi(row[18])); e.dest_zone = row[19] ? row[19] : ""; - e.dest_instance = atoi(row[20]); - e.dest_x = static_cast(atof(row[21])); - e.dest_y = static_cast(atof(row[22])); - e.dest_z = static_cast(atof(row[23])); - e.dest_heading = static_cast(atof(row[24])); - e.invert_state = atoi(row[25]); - e.incline = atoi(row[26]); - e.size = atoi(row[27]); - e.buffer = static_cast(atof(row[28])); - e.client_version_mask = atoi(row[29]); - e.is_ldon_door = atoi(row[30]); - e.dz_switch_id = atoi(row[31]); - e.min_expansion = atoi(row[32]); - e.max_expansion = atoi(row[33]); + e.dest_instance = static_cast(strtoul(row[20], nullptr, 10)); + e.dest_x = strtof(row[21], nullptr); + e.dest_y = strtof(row[22], nullptr); + e.dest_z = strtof(row[23], nullptr); + e.dest_heading = strtof(row[24], nullptr); + e.invert_state = static_cast(atoi(row[25])); + e.incline = static_cast(atoi(row[26])); + e.size = static_cast(strtoul(row[27], nullptr, 10)); + e.buffer = strtof(row[28], nullptr); + e.client_version_mask = static_cast(strtoul(row[29], nullptr, 10)); + e.is_ldon_door = static_cast(atoi(row[30])); + e.dz_switch_id = static_cast(atoi(row[31])); + e.min_expansion = static_cast(atoi(row[32])); + e.max_expansion = static_cast(atoi(row[33])); e.content_flags = row[34] ? row[34] : ""; e.content_flags_disabled = row[35] ? row[35] : ""; @@ -513,40 +513,40 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Doors e{}; - e.id = atoi(row[0]); - e.doorid = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.doorid = static_cast(atoi(row[1])); e.zone = row[2] ? row[2] : ""; - e.version = atoi(row[3]); + e.version = static_cast(atoi(row[3])); e.name = row[4] ? row[4] : ""; - e.pos_y = static_cast(atof(row[5])); - e.pos_x = static_cast(atof(row[6])); - e.pos_z = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); - e.opentype = atoi(row[9]); - e.guild = atoi(row[10]); - e.lockpick = atoi(row[11]); - e.keyitem = atoi(row[12]); - e.nokeyring = atoi(row[13]); - e.triggerdoor = atoi(row[14]); - e.triggertype = atoi(row[15]); - e.disable_timer = atoi(row[16]); - e.doorisopen = atoi(row[17]); - e.door_param = atoi(row[18]); + e.pos_y = strtof(row[5], nullptr); + e.pos_x = strtof(row[6], nullptr); + e.pos_z = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); + e.opentype = static_cast(atoi(row[9])); + e.guild = static_cast(atoi(row[10])); + e.lockpick = static_cast(atoi(row[11])); + e.keyitem = static_cast(atoi(row[12])); + e.nokeyring = static_cast(strtoul(row[13], nullptr, 10)); + e.triggerdoor = static_cast(atoi(row[14])); + e.triggertype = static_cast(atoi(row[15])); + e.disable_timer = static_cast(atoi(row[16])); + e.doorisopen = static_cast(atoi(row[17])); + e.door_param = static_cast(atoi(row[18])); e.dest_zone = row[19] ? row[19] : ""; - e.dest_instance = atoi(row[20]); - e.dest_x = static_cast(atof(row[21])); - e.dest_y = static_cast(atof(row[22])); - e.dest_z = static_cast(atof(row[23])); - e.dest_heading = static_cast(atof(row[24])); - e.invert_state = atoi(row[25]); - e.incline = atoi(row[26]); - e.size = atoi(row[27]); - e.buffer = static_cast(atof(row[28])); - e.client_version_mask = atoi(row[29]); - e.is_ldon_door = atoi(row[30]); - e.dz_switch_id = atoi(row[31]); - e.min_expansion = atoi(row[32]); - e.max_expansion = atoi(row[33]); + e.dest_instance = static_cast(strtoul(row[20], nullptr, 10)); + e.dest_x = strtof(row[21], nullptr); + e.dest_y = strtof(row[22], nullptr); + e.dest_z = strtof(row[23], nullptr); + e.dest_heading = strtof(row[24], nullptr); + e.invert_state = static_cast(atoi(row[25])); + e.incline = static_cast(atoi(row[26])); + e.size = static_cast(strtoul(row[27], nullptr, 10)); + e.buffer = strtof(row[28], nullptr); + e.client_version_mask = static_cast(strtoul(row[29], nullptr, 10)); + e.is_ldon_door = static_cast(atoi(row[30])); + e.dz_switch_id = static_cast(atoi(row[31])); + e.min_expansion = static_cast(atoi(row[32])); + e.max_expansion = static_cast(atoi(row[33])); e.content_flags = row[34] ? row[34] : ""; e.content_flags_disabled = row[35] ? row[35] : ""; @@ -573,40 +573,40 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Doors e{}; - e.id = atoi(row[0]); - e.doorid = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.doorid = static_cast(atoi(row[1])); e.zone = row[2] ? row[2] : ""; - e.version = atoi(row[3]); + e.version = static_cast(atoi(row[3])); e.name = row[4] ? row[4] : ""; - e.pos_y = static_cast(atof(row[5])); - e.pos_x = static_cast(atof(row[6])); - e.pos_z = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); - e.opentype = atoi(row[9]); - e.guild = atoi(row[10]); - e.lockpick = atoi(row[11]); - e.keyitem = atoi(row[12]); - e.nokeyring = atoi(row[13]); - e.triggerdoor = atoi(row[14]); - e.triggertype = atoi(row[15]); - e.disable_timer = atoi(row[16]); - e.doorisopen = atoi(row[17]); - e.door_param = atoi(row[18]); + e.pos_y = strtof(row[5], nullptr); + e.pos_x = strtof(row[6], nullptr); + e.pos_z = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); + e.opentype = static_cast(atoi(row[9])); + e.guild = static_cast(atoi(row[10])); + e.lockpick = static_cast(atoi(row[11])); + e.keyitem = static_cast(atoi(row[12])); + e.nokeyring = static_cast(strtoul(row[13], nullptr, 10)); + e.triggerdoor = static_cast(atoi(row[14])); + e.triggertype = static_cast(atoi(row[15])); + e.disable_timer = static_cast(atoi(row[16])); + e.doorisopen = static_cast(atoi(row[17])); + e.door_param = static_cast(atoi(row[18])); e.dest_zone = row[19] ? row[19] : ""; - e.dest_instance = atoi(row[20]); - e.dest_x = static_cast(atof(row[21])); - e.dest_y = static_cast(atof(row[22])); - e.dest_z = static_cast(atof(row[23])); - e.dest_heading = static_cast(atof(row[24])); - e.invert_state = atoi(row[25]); - e.incline = atoi(row[26]); - e.size = atoi(row[27]); - e.buffer = static_cast(atof(row[28])); - e.client_version_mask = atoi(row[29]); - e.is_ldon_door = atoi(row[30]); - e.dz_switch_id = atoi(row[31]); - e.min_expansion = atoi(row[32]); - e.max_expansion = atoi(row[33]); + e.dest_instance = static_cast(strtoul(row[20], nullptr, 10)); + e.dest_x = strtof(row[21], nullptr); + e.dest_y = strtof(row[22], nullptr); + e.dest_z = strtof(row[23], nullptr); + e.dest_heading = strtof(row[24], nullptr); + e.invert_state = static_cast(atoi(row[25])); + e.incline = static_cast(atoi(row[26])); + e.size = static_cast(strtoul(row[27], nullptr, 10)); + e.buffer = strtof(row[28], nullptr); + e.client_version_mask = static_cast(strtoul(row[29], nullptr, 10)); + e.is_ldon_door = static_cast(atoi(row[30])); + e.dz_switch_id = static_cast(atoi(row[31])); + e.min_expansion = static_cast(atoi(row[32])); + e.max_expansion = static_cast(atoi(row[33])); e.content_flags = row[34] ? row[34] : ""; e.content_flags_disabled = row[35] ? row[35] : ""; diff --git a/common/repositories/base/base_dynamic_zone_members_repository.h b/common/repositories/base/base_dynamic_zone_members_repository.h index b0846fa83..7cd4fa68f 100644 --- a/common/repositories/base/base_dynamic_zone_members_repository.h +++ b/common/repositories/base/base_dynamic_zone_members_repository.h @@ -19,9 +19,9 @@ class BaseDynamicZoneMembersRepository { public: struct DynamicZoneMembers { - int id; - int dynamic_zone_id; - int character_id; + uint32_t id; + uint32_t dynamic_zone_id; + uint32_t character_id; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { DynamicZoneMembers e{}; - e.id = atoi(row[0]); - e.dynamic_zone_id = atoi(row[1]); - e.character_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); + e.character_id = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DynamicZoneMembers e{}; - e.id = atoi(row[0]); - e.dynamic_zone_id = atoi(row[1]); - e.character_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); + e.character_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DynamicZoneMembers e{}; - e.id = atoi(row[0]); - e.dynamic_zone_id = atoi(row[1]); - e.character_id = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); + e.character_id = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_dynamic_zone_templates_repository.h b/common/repositories/base/base_dynamic_zone_templates_repository.h index e6b5b5dce..40fa29397 100644 --- a/common/repositories/base/base_dynamic_zone_templates_repository.h +++ b/common/repositories/base/base_dynamic_zone_templates_repository.h @@ -19,24 +19,24 @@ class BaseDynamicZoneTemplatesRepository { public: struct DynamicZoneTemplates { - int id; - int zone_id; - int zone_version; + uint32_t id; + int32_t zone_id; + int32_t zone_version; std::string name; - int min_players; - int max_players; - int duration_seconds; - int dz_switch_id; - int compass_zone_id; + int32_t min_players; + int32_t max_players; + int32_t duration_seconds; + int32_t dz_switch_id; + int32_t compass_zone_id; float compass_x; float compass_y; float compass_z; - int return_zone_id; + int32_t return_zone_id; float return_x; float return_y; float return_z; float return_h; - int override_zone_in; + int8_t override_zone_in; float zone_in_x; float zone_in_y; float zone_in_z; @@ -198,28 +198,28 @@ public: if (results.RowCount() == 1) { DynamicZoneTemplates e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.zone_version = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.zone_id = static_cast(atoi(row[1])); + e.zone_version = static_cast(atoi(row[2])); e.name = row[3] ? row[3] : ""; - e.min_players = atoi(row[4]); - e.max_players = atoi(row[5]); - e.duration_seconds = atoi(row[6]); - e.dz_switch_id = atoi(row[7]); - e.compass_zone_id = atoi(row[8]); - e.compass_x = static_cast(atof(row[9])); - e.compass_y = static_cast(atof(row[10])); - e.compass_z = static_cast(atof(row[11])); - e.return_zone_id = atoi(row[12]); - e.return_x = static_cast(atof(row[13])); - e.return_y = static_cast(atof(row[14])); - e.return_z = static_cast(atof(row[15])); - e.return_h = static_cast(atof(row[16])); - e.override_zone_in = atoi(row[17]); - e.zone_in_x = static_cast(atof(row[18])); - e.zone_in_y = static_cast(atof(row[19])); - e.zone_in_z = static_cast(atof(row[20])); - e.zone_in_h = static_cast(atof(row[21])); + e.min_players = static_cast(atoi(row[4])); + e.max_players = static_cast(atoi(row[5])); + e.duration_seconds = static_cast(atoi(row[6])); + e.dz_switch_id = static_cast(atoi(row[7])); + e.compass_zone_id = static_cast(atoi(row[8])); + e.compass_x = strtof(row[9], nullptr); + e.compass_y = strtof(row[10], nullptr); + e.compass_z = strtof(row[11], nullptr); + e.return_zone_id = static_cast(atoi(row[12])); + e.return_x = strtof(row[13], nullptr); + e.return_y = strtof(row[14], nullptr); + e.return_z = strtof(row[15], nullptr); + e.return_h = strtof(row[16], nullptr); + e.override_zone_in = static_cast(atoi(row[17])); + e.zone_in_x = strtof(row[18], nullptr); + e.zone_in_y = strtof(row[19], nullptr); + e.zone_in_z = strtof(row[20], nullptr); + e.zone_in_h = strtof(row[21], nullptr); return e; } @@ -401,28 +401,28 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DynamicZoneTemplates e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.zone_version = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.zone_id = static_cast(atoi(row[1])); + e.zone_version = static_cast(atoi(row[2])); e.name = row[3] ? row[3] : ""; - e.min_players = atoi(row[4]); - e.max_players = atoi(row[5]); - e.duration_seconds = atoi(row[6]); - e.dz_switch_id = atoi(row[7]); - e.compass_zone_id = atoi(row[8]); - e.compass_x = static_cast(atof(row[9])); - e.compass_y = static_cast(atof(row[10])); - e.compass_z = static_cast(atof(row[11])); - e.return_zone_id = atoi(row[12]); - e.return_x = static_cast(atof(row[13])); - e.return_y = static_cast(atof(row[14])); - e.return_z = static_cast(atof(row[15])); - e.return_h = static_cast(atof(row[16])); - e.override_zone_in = atoi(row[17]); - e.zone_in_x = static_cast(atof(row[18])); - e.zone_in_y = static_cast(atof(row[19])); - e.zone_in_z = static_cast(atof(row[20])); - e.zone_in_h = static_cast(atof(row[21])); + e.min_players = static_cast(atoi(row[4])); + e.max_players = static_cast(atoi(row[5])); + e.duration_seconds = static_cast(atoi(row[6])); + e.dz_switch_id = static_cast(atoi(row[7])); + e.compass_zone_id = static_cast(atoi(row[8])); + e.compass_x = strtof(row[9], nullptr); + e.compass_y = strtof(row[10], nullptr); + e.compass_z = strtof(row[11], nullptr); + e.return_zone_id = static_cast(atoi(row[12])); + e.return_x = strtof(row[13], nullptr); + e.return_y = strtof(row[14], nullptr); + e.return_z = strtof(row[15], nullptr); + e.return_h = strtof(row[16], nullptr); + e.override_zone_in = static_cast(atoi(row[17])); + e.zone_in_x = strtof(row[18], nullptr); + e.zone_in_y = strtof(row[19], nullptr); + e.zone_in_z = strtof(row[20], nullptr); + e.zone_in_h = strtof(row[21], nullptr); all_entries.push_back(e); } @@ -447,28 +447,28 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DynamicZoneTemplates e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.zone_version = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.zone_id = static_cast(atoi(row[1])); + e.zone_version = static_cast(atoi(row[2])); e.name = row[3] ? row[3] : ""; - e.min_players = atoi(row[4]); - e.max_players = atoi(row[5]); - e.duration_seconds = atoi(row[6]); - e.dz_switch_id = atoi(row[7]); - e.compass_zone_id = atoi(row[8]); - e.compass_x = static_cast(atof(row[9])); - e.compass_y = static_cast(atof(row[10])); - e.compass_z = static_cast(atof(row[11])); - e.return_zone_id = atoi(row[12]); - e.return_x = static_cast(atof(row[13])); - e.return_y = static_cast(atof(row[14])); - e.return_z = static_cast(atof(row[15])); - e.return_h = static_cast(atof(row[16])); - e.override_zone_in = atoi(row[17]); - e.zone_in_x = static_cast(atof(row[18])); - e.zone_in_y = static_cast(atof(row[19])); - e.zone_in_z = static_cast(atof(row[20])); - e.zone_in_h = static_cast(atof(row[21])); + e.min_players = static_cast(atoi(row[4])); + e.max_players = static_cast(atoi(row[5])); + e.duration_seconds = static_cast(atoi(row[6])); + e.dz_switch_id = static_cast(atoi(row[7])); + e.compass_zone_id = static_cast(atoi(row[8])); + e.compass_x = strtof(row[9], nullptr); + e.compass_y = strtof(row[10], nullptr); + e.compass_z = strtof(row[11], nullptr); + e.return_zone_id = static_cast(atoi(row[12])); + e.return_x = strtof(row[13], nullptr); + e.return_y = strtof(row[14], nullptr); + e.return_z = strtof(row[15], nullptr); + e.return_h = strtof(row[16], nullptr); + e.override_zone_in = static_cast(atoi(row[17])); + e.zone_in_x = strtof(row[18], nullptr); + e.zone_in_y = strtof(row[19], nullptr); + e.zone_in_z = strtof(row[20], nullptr); + e.zone_in_h = strtof(row[21], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_dynamic_zones_repository.h b/common/repositories/base/base_dynamic_zones_repository.h index 723a84a8f..0def54ea1 100644 --- a/common/repositories/base/base_dynamic_zones_repository.h +++ b/common/repositories/base/base_dynamic_zones_repository.h @@ -19,20 +19,20 @@ class BaseDynamicZonesRepository { public: struct DynamicZones { - int id; - int instance_id; - int type; + uint32_t id; + int32_t instance_id; + uint8_t type; std::string uuid; std::string name; - int leader_id; - int min_players; - int max_players; - int dz_switch_id; - int compass_zone_id; + uint32_t leader_id; + uint32_t min_players; + uint32_t max_players; + int32_t dz_switch_id; + uint32_t compass_zone_id; float compass_x; float compass_y; float compass_z; - int safe_return_zone_id; + uint32_t safe_return_zone_id; float safe_return_x; float safe_return_y; float safe_return_z; @@ -41,7 +41,7 @@ public: float zone_in_y; float zone_in_z; float zone_in_heading; - int has_zone_in; + uint8_t has_zone_in; }; static std::string PrimaryKey() @@ -202,29 +202,29 @@ public: if (results.RowCount() == 1) { DynamicZones e{}; - e.id = atoi(row[0]); - e.instance_id = atoi(row[1]); - e.type = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.instance_id = static_cast(atoi(row[1])); + e.type = static_cast(strtoul(row[2], nullptr, 10)); e.uuid = row[3] ? row[3] : ""; e.name = row[4] ? row[4] : ""; - e.leader_id = atoi(row[5]); - e.min_players = atoi(row[6]); - e.max_players = atoi(row[7]); - e.dz_switch_id = atoi(row[8]); - e.compass_zone_id = atoi(row[9]); - e.compass_x = static_cast(atof(row[10])); - e.compass_y = static_cast(atof(row[11])); - e.compass_z = static_cast(atof(row[12])); - e.safe_return_zone_id = atoi(row[13]); - e.safe_return_x = static_cast(atof(row[14])); - e.safe_return_y = static_cast(atof(row[15])); - e.safe_return_z = static_cast(atof(row[16])); - e.safe_return_heading = static_cast(atof(row[17])); - e.zone_in_x = static_cast(atof(row[18])); - e.zone_in_y = static_cast(atof(row[19])); - e.zone_in_z = static_cast(atof(row[20])); - e.zone_in_heading = static_cast(atof(row[21])); - e.has_zone_in = atoi(row[22]); + e.leader_id = static_cast(strtoul(row[5], nullptr, 10)); + e.min_players = static_cast(strtoul(row[6], nullptr, 10)); + e.max_players = static_cast(strtoul(row[7], nullptr, 10)); + e.dz_switch_id = static_cast(atoi(row[8])); + e.compass_zone_id = static_cast(strtoul(row[9], nullptr, 10)); + e.compass_x = strtof(row[10], nullptr); + e.compass_y = strtof(row[11], nullptr); + e.compass_z = strtof(row[12], nullptr); + e.safe_return_zone_id = static_cast(strtoul(row[13], nullptr, 10)); + e.safe_return_x = strtof(row[14], nullptr); + e.safe_return_y = strtof(row[15], nullptr); + e.safe_return_z = strtof(row[16], nullptr); + e.safe_return_heading = strtof(row[17], nullptr); + e.zone_in_x = strtof(row[18], nullptr); + e.zone_in_y = strtof(row[19], nullptr); + e.zone_in_z = strtof(row[20], nullptr); + e.zone_in_heading = strtof(row[21], nullptr); + e.has_zone_in = static_cast(strtoul(row[22], nullptr, 10)); return e; } @@ -409,29 +409,29 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DynamicZones e{}; - e.id = atoi(row[0]); - e.instance_id = atoi(row[1]); - e.type = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.instance_id = static_cast(atoi(row[1])); + e.type = static_cast(strtoul(row[2], nullptr, 10)); e.uuid = row[3] ? row[3] : ""; e.name = row[4] ? row[4] : ""; - e.leader_id = atoi(row[5]); - e.min_players = atoi(row[6]); - e.max_players = atoi(row[7]); - e.dz_switch_id = atoi(row[8]); - e.compass_zone_id = atoi(row[9]); - e.compass_x = static_cast(atof(row[10])); - e.compass_y = static_cast(atof(row[11])); - e.compass_z = static_cast(atof(row[12])); - e.safe_return_zone_id = atoi(row[13]); - e.safe_return_x = static_cast(atof(row[14])); - e.safe_return_y = static_cast(atof(row[15])); - e.safe_return_z = static_cast(atof(row[16])); - e.safe_return_heading = static_cast(atof(row[17])); - e.zone_in_x = static_cast(atof(row[18])); - e.zone_in_y = static_cast(atof(row[19])); - e.zone_in_z = static_cast(atof(row[20])); - e.zone_in_heading = static_cast(atof(row[21])); - e.has_zone_in = atoi(row[22]); + e.leader_id = static_cast(strtoul(row[5], nullptr, 10)); + e.min_players = static_cast(strtoul(row[6], nullptr, 10)); + e.max_players = static_cast(strtoul(row[7], nullptr, 10)); + e.dz_switch_id = static_cast(atoi(row[8])); + e.compass_zone_id = static_cast(strtoul(row[9], nullptr, 10)); + e.compass_x = strtof(row[10], nullptr); + e.compass_y = strtof(row[11], nullptr); + e.compass_z = strtof(row[12], nullptr); + e.safe_return_zone_id = static_cast(strtoul(row[13], nullptr, 10)); + e.safe_return_x = strtof(row[14], nullptr); + e.safe_return_y = strtof(row[15], nullptr); + e.safe_return_z = strtof(row[16], nullptr); + e.safe_return_heading = strtof(row[17], nullptr); + e.zone_in_x = strtof(row[18], nullptr); + e.zone_in_y = strtof(row[19], nullptr); + e.zone_in_z = strtof(row[20], nullptr); + e.zone_in_heading = strtof(row[21], nullptr); + e.has_zone_in = static_cast(strtoul(row[22], nullptr, 10)); all_entries.push_back(e); } @@ -456,29 +456,29 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { DynamicZones e{}; - e.id = atoi(row[0]); - e.instance_id = atoi(row[1]); - e.type = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.instance_id = static_cast(atoi(row[1])); + e.type = static_cast(strtoul(row[2], nullptr, 10)); e.uuid = row[3] ? row[3] : ""; e.name = row[4] ? row[4] : ""; - e.leader_id = atoi(row[5]); - e.min_players = atoi(row[6]); - e.max_players = atoi(row[7]); - e.dz_switch_id = atoi(row[8]); - e.compass_zone_id = atoi(row[9]); - e.compass_x = static_cast(atof(row[10])); - e.compass_y = static_cast(atof(row[11])); - e.compass_z = static_cast(atof(row[12])); - e.safe_return_zone_id = atoi(row[13]); - e.safe_return_x = static_cast(atof(row[14])); - e.safe_return_y = static_cast(atof(row[15])); - e.safe_return_z = static_cast(atof(row[16])); - e.safe_return_heading = static_cast(atof(row[17])); - e.zone_in_x = static_cast(atof(row[18])); - e.zone_in_y = static_cast(atof(row[19])); - e.zone_in_z = static_cast(atof(row[20])); - e.zone_in_heading = static_cast(atof(row[21])); - e.has_zone_in = atoi(row[22]); + e.leader_id = static_cast(strtoul(row[5], nullptr, 10)); + e.min_players = static_cast(strtoul(row[6], nullptr, 10)); + e.max_players = static_cast(strtoul(row[7], nullptr, 10)); + e.dz_switch_id = static_cast(atoi(row[8])); + e.compass_zone_id = static_cast(strtoul(row[9], nullptr, 10)); + e.compass_x = strtof(row[10], nullptr); + e.compass_y = strtof(row[11], nullptr); + e.compass_z = strtof(row[12], nullptr); + e.safe_return_zone_id = static_cast(strtoul(row[13], nullptr, 10)); + e.safe_return_x = strtof(row[14], nullptr); + e.safe_return_y = strtof(row[15], nullptr); + e.safe_return_z = strtof(row[16], nullptr); + e.safe_return_heading = strtof(row[17], nullptr); + e.zone_in_x = strtof(row[18], nullptr); + e.zone_in_y = strtof(row[19], nullptr); + e.zone_in_z = strtof(row[20], nullptr); + e.zone_in_heading = strtof(row[21], nullptr); + e.has_zone_in = static_cast(strtoul(row[22], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_eventlog_repository.h b/common/repositories/base/base_eventlog_repository.h index 36d511100..c2b008106 100644 --- a/common/repositories/base/base_eventlog_repository.h +++ b/common/repositories/base/base_eventlog_repository.h @@ -19,16 +19,16 @@ class BaseEventlogRepository { public: struct Eventlog { - int id; + uint32_t id; std::string accountname; - int accountid; - int status; + uint32_t accountid; + int32_t status; std::string charname; std::string target; std::string time; std::string descriptiontype; std::string description; - int event_nid; + int32_t event_nid; }; static std::string PrimaryKey() @@ -150,16 +150,16 @@ public: if (results.RowCount() == 1) { Eventlog e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.accountname = row[1] ? row[1] : ""; - e.accountid = atoi(row[2]); - e.status = atoi(row[3]); + e.accountid = static_cast(strtoul(row[2], nullptr, 10)); + e.status = static_cast(atoi(row[3])); e.charname = row[4] ? row[4] : ""; e.target = row[5] ? row[5] : ""; e.time = row[6] ? row[6] : ""; e.descriptiontype = row[7] ? row[7] : ""; e.description = row[8] ? row[8] : ""; - e.event_nid = atoi(row[9]); + e.event_nid = static_cast(atoi(row[9])); return e; } @@ -305,16 +305,16 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Eventlog e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.accountname = row[1] ? row[1] : ""; - e.accountid = atoi(row[2]); - e.status = atoi(row[3]); + e.accountid = static_cast(strtoul(row[2], nullptr, 10)); + e.status = static_cast(atoi(row[3])); e.charname = row[4] ? row[4] : ""; e.target = row[5] ? row[5] : ""; e.time = row[6] ? row[6] : ""; e.descriptiontype = row[7] ? row[7] : ""; e.description = row[8] ? row[8] : ""; - e.event_nid = atoi(row[9]); + e.event_nid = static_cast(atoi(row[9])); all_entries.push_back(e); } @@ -339,16 +339,16 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Eventlog e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.accountname = row[1] ? row[1] : ""; - e.accountid = atoi(row[2]); - e.status = atoi(row[3]); + e.accountid = static_cast(strtoul(row[2], nullptr, 10)); + e.status = static_cast(atoi(row[3])); e.charname = row[4] ? row[4] : ""; e.target = row[5] ? row[5] : ""; e.time = row[6] ? row[6] : ""; e.descriptiontype = row[7] ? row[7] : ""; e.description = row[8] ? row[8] : ""; - e.event_nid = atoi(row[9]); + e.event_nid = static_cast(atoi(row[9])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_expedition_lockouts_repository.h b/common/repositories/base/base_expedition_lockouts_repository.h index 7c884ebba..e37dce650 100644 --- a/common/repositories/base/base_expedition_lockouts_repository.h +++ b/common/repositories/base/base_expedition_lockouts_repository.h @@ -19,11 +19,11 @@ class BaseExpeditionLockoutsRepository { public: struct ExpeditionLockouts { - int id; - int expedition_id; + uint32_t id; + uint32_t expedition_id; std::string event_name; time_t expire_time; - int duration; + uint32_t duration; std::string from_expedition_uuid; }; @@ -134,11 +134,11 @@ public: if (results.RowCount() == 1) { ExpeditionLockouts e{}; - e.id = atoi(row[0]); - e.expedition_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.expedition_id = static_cast(strtoul(row[1], nullptr, 10)); e.event_name = row[2] ? row[2] : ""; e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); - e.duration = atoi(row[4]); + e.duration = static_cast(strtoul(row[4], nullptr, 10)); e.from_expedition_uuid = row[5] ? row[5] : ""; return e; @@ -273,11 +273,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ExpeditionLockouts e{}; - e.id = atoi(row[0]); - e.expedition_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.expedition_id = static_cast(strtoul(row[1], nullptr, 10)); e.event_name = row[2] ? row[2] : ""; e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); - e.duration = atoi(row[4]); + e.duration = static_cast(strtoul(row[4], nullptr, 10)); e.from_expedition_uuid = row[5] ? row[5] : ""; all_entries.push_back(e); @@ -303,11 +303,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ExpeditionLockouts e{}; - e.id = atoi(row[0]); - e.expedition_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.expedition_id = static_cast(strtoul(row[1], nullptr, 10)); e.event_name = row[2] ? row[2] : ""; e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); - e.duration = atoi(row[4]); + e.duration = static_cast(strtoul(row[4], nullptr, 10)); e.from_expedition_uuid = row[5] ? row[5] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_expeditions_repository.h b/common/repositories/base/base_expeditions_repository.h index 487356784..deaa3a01f 100644 --- a/common/repositories/base/base_expeditions_repository.h +++ b/common/repositories/base/base_expeditions_repository.h @@ -19,10 +19,10 @@ class BaseExpeditionsRepository { public: struct Expeditions { - int id; - int dynamic_zone_id; - int add_replay_on_join; - int is_locked; + uint32_t id; + uint32_t dynamic_zone_id; + uint8_t add_replay_on_join; + uint8_t is_locked; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { Expeditions e{}; - e.id = atoi(row[0]); - e.dynamic_zone_id = atoi(row[1]); - e.add_replay_on_join = atoi(row[2]); - e.is_locked = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); + e.add_replay_on_join = static_cast(strtoul(row[2], nullptr, 10)); + e.is_locked = static_cast(strtoul(row[3], nullptr, 10)); return e; } @@ -257,10 +257,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Expeditions e{}; - e.id = atoi(row[0]); - e.dynamic_zone_id = atoi(row[1]); - e.add_replay_on_join = atoi(row[2]); - e.is_locked = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); + e.add_replay_on_join = static_cast(strtoul(row[2], nullptr, 10)); + e.is_locked = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } @@ -285,10 +285,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Expeditions e{}; - e.id = atoi(row[0]); - e.dynamic_zone_id = atoi(row[1]); - e.add_replay_on_join = atoi(row[2]); - e.is_locked = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); + e.add_replay_on_join = static_cast(strtoul(row[2], nullptr, 10)); + e.is_locked = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_faction_base_data_repository.h b/common/repositories/base/base_faction_base_data_repository.h index 87d65d2b4..3068d38bd 100644 --- a/common/repositories/base/base_faction_base_data_repository.h +++ b/common/repositories/base/base_faction_base_data_repository.h @@ -19,12 +19,12 @@ class BaseFactionBaseDataRepository { public: struct FactionBaseData { - int client_faction_id; - int min; - int max; - int unk_hero1; - int unk_hero2; - int unk_hero3; + int16_t client_faction_id; + int16_t min; + int16_t max; + int16_t unk_hero1; + int16_t unk_hero2; + int16_t unk_hero3; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { FactionBaseData e{}; - e.client_faction_id = atoi(row[0]); - e.min = atoi(row[1]); - e.max = atoi(row[2]); - e.unk_hero1 = atoi(row[3]); - e.unk_hero2 = atoi(row[4]); - e.unk_hero3 = atoi(row[5]); + e.client_faction_id = static_cast(atoi(row[0])); + e.min = static_cast(atoi(row[1])); + e.max = static_cast(atoi(row[2])); + e.unk_hero1 = static_cast(atoi(row[3])); + e.unk_hero2 = static_cast(atoi(row[4])); + e.unk_hero3 = static_cast(atoi(row[5])); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionBaseData e{}; - e.client_faction_id = atoi(row[0]); - e.min = atoi(row[1]); - e.max = atoi(row[2]); - e.unk_hero1 = atoi(row[3]); - e.unk_hero2 = atoi(row[4]); - e.unk_hero3 = atoi(row[5]); + e.client_faction_id = static_cast(atoi(row[0])); + e.min = static_cast(atoi(row[1])); + e.max = static_cast(atoi(row[2])); + e.unk_hero1 = static_cast(atoi(row[3])); + e.unk_hero2 = static_cast(atoi(row[4])); + e.unk_hero3 = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionBaseData e{}; - e.client_faction_id = atoi(row[0]); - e.min = atoi(row[1]); - e.max = atoi(row[2]); - e.unk_hero1 = atoi(row[3]); - e.unk_hero2 = atoi(row[4]); - e.unk_hero3 = atoi(row[5]); + e.client_faction_id = static_cast(atoi(row[0])); + e.min = static_cast(atoi(row[1])); + e.max = static_cast(atoi(row[2])); + e.unk_hero1 = static_cast(atoi(row[3])); + e.unk_hero2 = static_cast(atoi(row[4])); + e.unk_hero3 = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_faction_list_mod_repository.h b/common/repositories/base/base_faction_list_mod_repository.h index 7304897a0..26df4e6cb 100644 --- a/common/repositories/base/base_faction_list_mod_repository.h +++ b/common/repositories/base/base_faction_list_mod_repository.h @@ -19,9 +19,9 @@ class BaseFactionListModRepository { public: struct FactionListMod { - int id; - int faction_id; - int mod; + uint32_t id; + uint32_t faction_id; + int16_t mod; std::string mod_name; }; @@ -126,9 +126,9 @@ public: if (results.RowCount() == 1) { FactionListMod e{}; - e.id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.mod = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.faction_id = static_cast(strtoul(row[1], nullptr, 10)); + e.mod = static_cast(atoi(row[2])); e.mod_name = row[3] ? row[3] : ""; return e; @@ -257,9 +257,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionListMod e{}; - e.id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.mod = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.faction_id = static_cast(strtoul(row[1], nullptr, 10)); + e.mod = static_cast(atoi(row[2])); e.mod_name = row[3] ? row[3] : ""; all_entries.push_back(e); @@ -285,9 +285,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionListMod e{}; - e.id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.mod = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.faction_id = static_cast(strtoul(row[1], nullptr, 10)); + e.mod = static_cast(atoi(row[2])); e.mod_name = row[3] ? row[3] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_faction_list_repository.h b/common/repositories/base/base_faction_list_repository.h index c6f8cf569..6d2398187 100644 --- a/common/repositories/base/base_faction_list_repository.h +++ b/common/repositories/base/base_faction_list_repository.h @@ -19,9 +19,9 @@ class BaseFactionListRepository { public: struct FactionList { - int id; + int32_t id; std::string name; - int base; + int16_t base; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { FactionList e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.base = atoi(row[2]); + e.base = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionList e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.base = atoi(row[2]); + e.base = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionList e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.base = atoi(row[2]); + e.base = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_faction_values_repository.h b/common/repositories/base/base_faction_values_repository.h index 12739bb0e..5c2f134db 100644 --- a/common/repositories/base/base_faction_values_repository.h +++ b/common/repositories/base/base_faction_values_repository.h @@ -19,10 +19,10 @@ class BaseFactionValuesRepository { public: struct FactionValues { - int char_id; - int faction_id; - int current_value; - int temp; + int32_t char_id; + int32_t faction_id; + int16_t current_value; + int8_t temp; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { FactionValues e{}; - e.char_id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.current_value = atoi(row[2]); - e.temp = atoi(row[3]); + e.char_id = static_cast(atoi(row[0])); + e.faction_id = static_cast(atoi(row[1])); + e.current_value = static_cast(atoi(row[2])); + e.temp = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionValues e{}; - e.char_id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.current_value = atoi(row[2]); - e.temp = atoi(row[3]); + e.char_id = static_cast(atoi(row[0])); + e.faction_id = static_cast(atoi(row[1])); + e.current_value = static_cast(atoi(row[2])); + e.temp = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { FactionValues e{}; - e.char_id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.current_value = atoi(row[2]); - e.temp = atoi(row[3]); + e.char_id = static_cast(atoi(row[0])); + e.faction_id = static_cast(atoi(row[1])); + e.current_value = static_cast(atoi(row[2])); + e.temp = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_fishing_repository.h b/common/repositories/base/base_fishing_repository.h index 91a1be58d..c04886654 100644 --- a/common/repositories/base/base_fishing_repository.h +++ b/common/repositories/base/base_fishing_repository.h @@ -19,15 +19,15 @@ class BaseFishingRepository { public: struct Fishing { - int id; - int zoneid; - int Itemid; - int skill_level; - int chance; - int npc_id; - int npc_chance; - int min_expansion; - int max_expansion; + int32_t id; + int32_t zoneid; + int32_t Itemid; + int16_t skill_level; + int16_t chance; + int32_t npc_id; + int32_t npc_chance; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -154,15 +154,15 @@ public: if (results.RowCount() == 1) { Fishing e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.Itemid = atoi(row[2]); - e.skill_level = atoi(row[3]); - e.chance = atoi(row[4]); - e.npc_id = atoi(row[5]); - e.npc_chance = atoi(row[6]); - e.min_expansion = atoi(row[7]); - e.max_expansion = atoi(row[8]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.Itemid = static_cast(atoi(row[2])); + e.skill_level = static_cast(atoi(row[3])); + e.chance = static_cast(atoi(row[4])); + e.npc_id = static_cast(atoi(row[5])); + e.npc_chance = static_cast(atoi(row[6])); + e.min_expansion = static_cast(atoi(row[7])); + e.max_expansion = static_cast(atoi(row[8])); e.content_flags = row[9] ? row[9] : ""; e.content_flags_disabled = row[10] ? row[10] : ""; @@ -313,15 +313,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Fishing e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.Itemid = atoi(row[2]); - e.skill_level = atoi(row[3]); - e.chance = atoi(row[4]); - e.npc_id = atoi(row[5]); - e.npc_chance = atoi(row[6]); - e.min_expansion = atoi(row[7]); - e.max_expansion = atoi(row[8]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.Itemid = static_cast(atoi(row[2])); + e.skill_level = static_cast(atoi(row[3])); + e.chance = static_cast(atoi(row[4])); + e.npc_id = static_cast(atoi(row[5])); + e.npc_chance = static_cast(atoi(row[6])); + e.min_expansion = static_cast(atoi(row[7])); + e.max_expansion = static_cast(atoi(row[8])); e.content_flags = row[9] ? row[9] : ""; e.content_flags_disabled = row[10] ? row[10] : ""; @@ -348,15 +348,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Fishing e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.Itemid = atoi(row[2]); - e.skill_level = atoi(row[3]); - e.chance = atoi(row[4]); - e.npc_id = atoi(row[5]); - e.npc_chance = atoi(row[6]); - e.min_expansion = atoi(row[7]); - e.max_expansion = atoi(row[8]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.Itemid = static_cast(atoi(row[2])); + e.skill_level = static_cast(atoi(row[3])); + e.chance = static_cast(atoi(row[4])); + e.npc_id = static_cast(atoi(row[5])); + e.npc_chance = static_cast(atoi(row[6])); + e.min_expansion = static_cast(atoi(row[7])); + e.max_expansion = static_cast(atoi(row[8])); e.content_flags = row[9] ? row[9] : ""; e.content_flags_disabled = row[10] ? row[10] : ""; diff --git a/common/repositories/base/base_forage_repository.h b/common/repositories/base/base_forage_repository.h index af5131689..609af148e 100644 --- a/common/repositories/base/base_forage_repository.h +++ b/common/repositories/base/base_forage_repository.h @@ -19,13 +19,13 @@ class BaseForageRepository { public: struct Forage { - int id; - int zoneid; - int Itemid; - int level; - int chance; - int min_expansion; - int max_expansion; + int32_t id; + int32_t zoneid; + int32_t Itemid; + int16_t level; + int16_t chance; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -146,13 +146,13 @@ public: if (results.RowCount() == 1) { Forage e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.Itemid = atoi(row[2]); - e.level = atoi(row[3]); - e.chance = atoi(row[4]); - e.min_expansion = atoi(row[5]); - e.max_expansion = atoi(row[6]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.Itemid = static_cast(atoi(row[2])); + e.level = static_cast(atoi(row[3])); + e.chance = static_cast(atoi(row[4])); + e.min_expansion = static_cast(atoi(row[5])); + e.max_expansion = static_cast(atoi(row[6])); e.content_flags = row[7] ? row[7] : ""; e.content_flags_disabled = row[8] ? row[8] : ""; @@ -297,13 +297,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Forage e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.Itemid = atoi(row[2]); - e.level = atoi(row[3]); - e.chance = atoi(row[4]); - e.min_expansion = atoi(row[5]); - e.max_expansion = atoi(row[6]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.Itemid = static_cast(atoi(row[2])); + e.level = static_cast(atoi(row[3])); + e.chance = static_cast(atoi(row[4])); + e.min_expansion = static_cast(atoi(row[5])); + e.max_expansion = static_cast(atoi(row[6])); e.content_flags = row[7] ? row[7] : ""; e.content_flags_disabled = row[8] ? row[8] : ""; @@ -330,13 +330,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Forage e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.Itemid = atoi(row[2]); - e.level = atoi(row[3]); - e.chance = atoi(row[4]); - e.min_expansion = atoi(row[5]); - e.max_expansion = atoi(row[6]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.Itemid = static_cast(atoi(row[2])); + e.level = static_cast(atoi(row[3])); + e.chance = static_cast(atoi(row[4])); + e.min_expansion = static_cast(atoi(row[5])); + e.max_expansion = static_cast(atoi(row[6])); e.content_flags = row[7] ? row[7] : ""; e.content_flags_disabled = row[8] ? row[8] : ""; diff --git a/common/repositories/base/base_friends_repository.h b/common/repositories/base/base_friends_repository.h index b6c8a9e66..1f9acf7be 100644 --- a/common/repositories/base/base_friends_repository.h +++ b/common/repositories/base/base_friends_repository.h @@ -19,8 +19,8 @@ class BaseFriendsRepository { public: struct Friends { - int charid; - int type; + uint32_t charid; + uint8_t type; std::string name; }; @@ -122,8 +122,8 @@ public: if (results.RowCount() == 1) { Friends e{}; - e.charid = atoi(row[0]); - e.type = atoi(row[1]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); e.name = row[2] ? row[2] : ""; return e; @@ -250,8 +250,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Friends e{}; - e.charid = atoi(row[0]); - e.type = atoi(row[1]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); e.name = row[2] ? row[2] : ""; all_entries.push_back(e); @@ -277,8 +277,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Friends e{}; - e.charid = atoi(row[0]); - e.type = atoi(row[1]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); e.name = row[2] ? row[2] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_global_loot_repository.h b/common/repositories/base/base_global_loot_repository.h index e3326d672..c8755d267 100644 --- a/common/repositories/base/base_global_loot_repository.h +++ b/common/repositories/base/base_global_loot_repository.h @@ -19,21 +19,21 @@ class BaseGlobalLootRepository { public: struct GlobalLoot { - int id; + int32_t id; std::string description; - int loottable_id; - int enabled; - int min_level; - int max_level; - int rare; - int raid; + int32_t loottable_id; + int8_t enabled; + int32_t min_level; + int32_t max_level; + int8_t rare; + int8_t raid; std::string race; std::string class_; std::string bodytype; std::string zone; - int hot_zone; - int min_expansion; - int max_expansion; + int8_t hot_zone; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -178,21 +178,21 @@ public: if (results.RowCount() == 1) { GlobalLoot e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.description = row[1] ? row[1] : ""; - e.loottable_id = atoi(row[2]); - e.enabled = atoi(row[3]); - e.min_level = atoi(row[4]); - e.max_level = atoi(row[5]); - e.rare = atoi(row[6]); - e.raid = atoi(row[7]); + e.loottable_id = static_cast(atoi(row[2])); + e.enabled = static_cast(atoi(row[3])); + e.min_level = static_cast(atoi(row[4])); + e.max_level = static_cast(atoi(row[5])); + e.rare = static_cast(atoi(row[6])); + e.raid = static_cast(atoi(row[7])); e.race = row[8] ? row[8] : ""; e.class_ = row[9] ? row[9] : ""; e.bodytype = row[10] ? row[10] : ""; e.zone = row[11] ? row[11] : ""; - e.hot_zone = atoi(row[12]); - e.min_expansion = atoi(row[13]); - e.max_expansion = atoi(row[14]); + e.hot_zone = static_cast(atoi(row[12])); + e.min_expansion = static_cast(atoi(row[13])); + e.max_expansion = static_cast(atoi(row[14])); e.content_flags = row[15] ? row[15] : ""; e.content_flags_disabled = row[16] ? row[16] : ""; @@ -361,21 +361,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GlobalLoot e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.description = row[1] ? row[1] : ""; - e.loottable_id = atoi(row[2]); - e.enabled = atoi(row[3]); - e.min_level = atoi(row[4]); - e.max_level = atoi(row[5]); - e.rare = atoi(row[6]); - e.raid = atoi(row[7]); + e.loottable_id = static_cast(atoi(row[2])); + e.enabled = static_cast(atoi(row[3])); + e.min_level = static_cast(atoi(row[4])); + e.max_level = static_cast(atoi(row[5])); + e.rare = static_cast(atoi(row[6])); + e.raid = static_cast(atoi(row[7])); e.race = row[8] ? row[8] : ""; e.class_ = row[9] ? row[9] : ""; e.bodytype = row[10] ? row[10] : ""; e.zone = row[11] ? row[11] : ""; - e.hot_zone = atoi(row[12]); - e.min_expansion = atoi(row[13]); - e.max_expansion = atoi(row[14]); + e.hot_zone = static_cast(atoi(row[12])); + e.min_expansion = static_cast(atoi(row[13])); + e.max_expansion = static_cast(atoi(row[14])); e.content_flags = row[15] ? row[15] : ""; e.content_flags_disabled = row[16] ? row[16] : ""; @@ -402,21 +402,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GlobalLoot e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.description = row[1] ? row[1] : ""; - e.loottable_id = atoi(row[2]); - e.enabled = atoi(row[3]); - e.min_level = atoi(row[4]); - e.max_level = atoi(row[5]); - e.rare = atoi(row[6]); - e.raid = atoi(row[7]); + e.loottable_id = static_cast(atoi(row[2])); + e.enabled = static_cast(atoi(row[3])); + e.min_level = static_cast(atoi(row[4])); + e.max_level = static_cast(atoi(row[5])); + e.rare = static_cast(atoi(row[6])); + e.raid = static_cast(atoi(row[7])); e.race = row[8] ? row[8] : ""; e.class_ = row[9] ? row[9] : ""; e.bodytype = row[10] ? row[10] : ""; e.zone = row[11] ? row[11] : ""; - e.hot_zone = atoi(row[12]); - e.min_expansion = atoi(row[13]); - e.max_expansion = atoi(row[14]); + e.hot_zone = static_cast(atoi(row[12])); + e.min_expansion = static_cast(atoi(row[13])); + e.max_expansion = static_cast(atoi(row[14])); e.content_flags = row[15] ? row[15] : ""; e.content_flags_disabled = row[16] ? row[16] : ""; diff --git a/common/repositories/base/base_gm_ips_repository.h b/common/repositories/base/base_gm_ips_repository.h index c506ffe62..ae1f52ef9 100644 --- a/common/repositories/base/base_gm_ips_repository.h +++ b/common/repositories/base/base_gm_ips_repository.h @@ -20,7 +20,7 @@ class BaseGmIpsRepository { public: struct GmIps { std::string name; - int account_id; + int32_t account_id; std::string ip_address; }; @@ -123,7 +123,7 @@ public: GmIps e{}; e.name = row[0] ? row[0] : ""; - e.account_id = atoi(row[1]); + e.account_id = static_cast(atoi(row[1])); e.ip_address = row[2] ? row[2] : ""; return e; @@ -251,7 +251,7 @@ public: GmIps e{}; e.name = row[0] ? row[0] : ""; - e.account_id = atoi(row[1]); + e.account_id = static_cast(atoi(row[1])); e.ip_address = row[2] ? row[2] : ""; all_entries.push_back(e); @@ -278,7 +278,7 @@ public: GmIps e{}; e.name = row[0] ? row[0] : ""; - e.account_id = atoi(row[1]); + e.account_id = static_cast(atoi(row[1])); e.ip_address = row[2] ? row[2] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_goallists_repository.h b/common/repositories/base/base_goallists_repository.h index 1c02609f4..8c098d0d7 100644 --- a/common/repositories/base/base_goallists_repository.h +++ b/common/repositories/base/base_goallists_repository.h @@ -19,8 +19,8 @@ class BaseGoallistsRepository { public: struct Goallists { - int listid; - int entry; + uint32_t listid; + uint32_t entry; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { Goallists e{}; - e.listid = atoi(row[0]); - e.entry = atoi(row[1]); + e.listid = static_cast(strtoul(row[0], nullptr, 10)); + e.entry = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Goallists e{}; - e.listid = atoi(row[0]); - e.entry = atoi(row[1]); + e.listid = static_cast(strtoul(row[0], nullptr, 10)); + e.entry = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Goallists e{}; - e.listid = atoi(row[0]); - e.entry = atoi(row[1]); + e.listid = static_cast(strtoul(row[0], nullptr, 10)); + e.entry = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_graveyard_repository.h b/common/repositories/base/base_graveyard_repository.h index 3fbfd5c32..1cc7d5c1e 100644 --- a/common/repositories/base/base_graveyard_repository.h +++ b/common/repositories/base/base_graveyard_repository.h @@ -19,12 +19,12 @@ class BaseGraveyardRepository { public: struct Graveyard { - int id; - int zone_id; - float x; - float y; - float z; - float heading; + int32_t id; + int32_t zone_id; + float x; + float y; + float z; + float heading; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { Graveyard e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.x = static_cast(atof(row[2])); - e.y = static_cast(atof(row[3])); - e.z = static_cast(atof(row[4])); - e.heading = static_cast(atof(row[5])); + e.id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); + e.x = strtof(row[2], nullptr); + e.y = strtof(row[3], nullptr); + e.z = strtof(row[4], nullptr); + e.heading = strtof(row[5], nullptr); return e; } @@ -273,12 +273,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Graveyard e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.x = static_cast(atof(row[2])); - e.y = static_cast(atof(row[3])); - e.z = static_cast(atof(row[4])); - e.heading = static_cast(atof(row[5])); + e.id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); + e.x = strtof(row[2], nullptr); + e.y = strtof(row[3], nullptr); + e.z = strtof(row[4], nullptr); + e.heading = strtof(row[5], nullptr); all_entries.push_back(e); } @@ -303,12 +303,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Graveyard e{}; - e.id = atoi(row[0]); - e.zone_id = atoi(row[1]); - e.x = static_cast(atof(row[2])); - e.y = static_cast(atof(row[3])); - e.z = static_cast(atof(row[4])); - e.heading = static_cast(atof(row[5])); + e.id = static_cast(atoi(row[0])); + e.zone_id = static_cast(atoi(row[1])); + e.x = strtof(row[2], nullptr); + e.y = strtof(row[3], nullptr); + e.z = strtof(row[4], nullptr); + e.heading = strtof(row[5], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_grid_entries_repository.h b/common/repositories/base/base_grid_entries_repository.h index 93129e815..b4fafb192 100644 --- a/common/repositories/base/base_grid_entries_repository.h +++ b/common/repositories/base/base_grid_entries_repository.h @@ -19,15 +19,15 @@ class BaseGridEntriesRepository { public: struct GridEntries { - int gridid; - int zoneid; - int number; - float x; - float y; - float z; - float heading; - int pause; - int centerpoint; + int32_t gridid; + int32_t zoneid; + int32_t number; + float x; + float y; + float z; + float heading; + int32_t pause; + int8_t centerpoint; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { GridEntries e{}; - e.gridid = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.number = atoi(row[2]); - e.x = static_cast(atof(row[3])); - e.y = static_cast(atof(row[4])); - e.z = static_cast(atof(row[5])); - e.heading = static_cast(atof(row[6])); - e.pause = atoi(row[7]); - e.centerpoint = atoi(row[8]); + e.gridid = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.number = static_cast(atoi(row[2])); + e.x = strtof(row[3], nullptr); + e.y = strtof(row[4], nullptr); + e.z = strtof(row[5], nullptr); + e.heading = strtof(row[6], nullptr); + e.pause = static_cast(atoi(row[7])); + e.centerpoint = static_cast(atoi(row[8])); return e; } @@ -298,15 +298,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GridEntries e{}; - e.gridid = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.number = atoi(row[2]); - e.x = static_cast(atof(row[3])); - e.y = static_cast(atof(row[4])); - e.z = static_cast(atof(row[5])); - e.heading = static_cast(atof(row[6])); - e.pause = atoi(row[7]); - e.centerpoint = atoi(row[8]); + e.gridid = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.number = static_cast(atoi(row[2])); + e.x = strtof(row[3], nullptr); + e.y = strtof(row[4], nullptr); + e.z = strtof(row[5], nullptr); + e.heading = strtof(row[6], nullptr); + e.pause = static_cast(atoi(row[7])); + e.centerpoint = static_cast(atoi(row[8])); all_entries.push_back(e); } @@ -331,15 +331,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GridEntries e{}; - e.gridid = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.number = atoi(row[2]); - e.x = static_cast(atof(row[3])); - e.y = static_cast(atof(row[4])); - e.z = static_cast(atof(row[5])); - e.heading = static_cast(atof(row[6])); - e.pause = atoi(row[7]); - e.centerpoint = atoi(row[8]); + e.gridid = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.number = static_cast(atoi(row[2])); + e.x = strtof(row[3], nullptr); + e.y = strtof(row[4], nullptr); + e.z = strtof(row[5], nullptr); + e.heading = strtof(row[6], nullptr); + e.pause = static_cast(atoi(row[7])); + e.centerpoint = static_cast(atoi(row[8])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_grid_repository.h b/common/repositories/base/base_grid_repository.h index 7a5862899..e37e7971a 100644 --- a/common/repositories/base/base_grid_repository.h +++ b/common/repositories/base/base_grid_repository.h @@ -19,10 +19,10 @@ class BaseGridRepository { public: struct Grid { - int id; - int zoneid; - int type; - int type2; + int32_t id; + int32_t zoneid; + int32_t type; + int32_t type2; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { Grid e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.type = atoi(row[2]); - e.type2 = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.type = static_cast(atoi(row[2])); + e.type2 = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Grid e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.type = atoi(row[2]); - e.type2 = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.type = static_cast(atoi(row[2])); + e.type2 = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Grid e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.type = atoi(row[2]); - e.type2 = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(atoi(row[1])); + e.type = static_cast(atoi(row[2])); + e.type2 = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_ground_spawns_repository.h b/common/repositories/base/base_ground_spawns_repository.h index d965b5328..b9c534c13 100644 --- a/common/repositories/base/base_ground_spawns_repository.h +++ b/common/repositories/base/base_ground_spawns_repository.h @@ -19,9 +19,9 @@ class BaseGroundSpawnsRepository { public: struct GroundSpawns { - int id; - int zoneid; - int version; + uint32_t id; + uint32_t zoneid; + int16_t version; float max_x; float max_y; float max_z; @@ -29,12 +29,12 @@ public: float min_y; float heading; std::string name; - int item; - int max_allowed; + uint32_t item; + uint32_t max_allowed; std::string comment; - int respawn_timer; - int min_expansion; - int max_expansion; + uint32_t respawn_timer; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -182,22 +182,22 @@ public: if (results.RowCount() == 1) { GroundSpawns e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.version = atoi(row[2]); - e.max_x = static_cast(atof(row[3])); - e.max_y = static_cast(atof(row[4])); - e.max_z = static_cast(atof(row[5])); - e.min_x = static_cast(atof(row[6])); - e.min_y = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.zoneid = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(atoi(row[2])); + e.max_x = strtof(row[3], nullptr); + e.max_y = strtof(row[4], nullptr); + e.max_z = strtof(row[5], nullptr); + e.min_x = strtof(row[6], nullptr); + e.min_y = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); e.name = row[9] ? row[9] : ""; - e.item = atoi(row[10]); - e.max_allowed = atoi(row[11]); + e.item = static_cast(strtoul(row[10], nullptr, 10)); + e.max_allowed = static_cast(strtoul(row[11], nullptr, 10)); e.comment = row[12] ? row[12] : ""; - e.respawn_timer = atoi(row[13]); - e.min_expansion = atoi(row[14]); - e.max_expansion = atoi(row[15]); + e.respawn_timer = static_cast(strtoul(row[13], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[14])); + e.max_expansion = static_cast(atoi(row[15])); e.content_flags = row[16] ? row[16] : ""; e.content_flags_disabled = row[17] ? row[17] : ""; @@ -369,22 +369,22 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GroundSpawns e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.version = atoi(row[2]); - e.max_x = static_cast(atof(row[3])); - e.max_y = static_cast(atof(row[4])); - e.max_z = static_cast(atof(row[5])); - e.min_x = static_cast(atof(row[6])); - e.min_y = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.zoneid = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(atoi(row[2])); + e.max_x = strtof(row[3], nullptr); + e.max_y = strtof(row[4], nullptr); + e.max_z = strtof(row[5], nullptr); + e.min_x = strtof(row[6], nullptr); + e.min_y = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); e.name = row[9] ? row[9] : ""; - e.item = atoi(row[10]); - e.max_allowed = atoi(row[11]); + e.item = static_cast(strtoul(row[10], nullptr, 10)); + e.max_allowed = static_cast(strtoul(row[11], nullptr, 10)); e.comment = row[12] ? row[12] : ""; - e.respawn_timer = atoi(row[13]); - e.min_expansion = atoi(row[14]); - e.max_expansion = atoi(row[15]); + e.respawn_timer = static_cast(strtoul(row[13], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[14])); + e.max_expansion = static_cast(atoi(row[15])); e.content_flags = row[16] ? row[16] : ""; e.content_flags_disabled = row[17] ? row[17] : ""; @@ -411,22 +411,22 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GroundSpawns e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.version = atoi(row[2]); - e.max_x = static_cast(atof(row[3])); - e.max_y = static_cast(atof(row[4])); - e.max_z = static_cast(atof(row[5])); - e.min_x = static_cast(atof(row[6])); - e.min_y = static_cast(atof(row[7])); - e.heading = static_cast(atof(row[8])); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.zoneid = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(atoi(row[2])); + e.max_x = strtof(row[3], nullptr); + e.max_y = strtof(row[4], nullptr); + e.max_z = strtof(row[5], nullptr); + e.min_x = strtof(row[6], nullptr); + e.min_y = strtof(row[7], nullptr); + e.heading = strtof(row[8], nullptr); e.name = row[9] ? row[9] : ""; - e.item = atoi(row[10]); - e.max_allowed = atoi(row[11]); + e.item = static_cast(strtoul(row[10], nullptr, 10)); + e.max_allowed = static_cast(strtoul(row[11], nullptr, 10)); e.comment = row[12] ? row[12] : ""; - e.respawn_timer = atoi(row[13]); - e.min_expansion = atoi(row[14]); - e.max_expansion = atoi(row[15]); + e.respawn_timer = static_cast(strtoul(row[13], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[14])); + e.max_expansion = static_cast(atoi(row[15])); e.content_flags = row[16] ? row[16] : ""; e.content_flags_disabled = row[17] ? row[17] : ""; diff --git a/common/repositories/base/base_group_id_repository.h b/common/repositories/base/base_group_id_repository.h index 7c644461c..628e814d4 100644 --- a/common/repositories/base/base_group_id_repository.h +++ b/common/repositories/base/base_group_id_repository.h @@ -19,10 +19,10 @@ class BaseGroupIdRepository { public: struct GroupId { - int groupid; - int charid; + int32_t groupid; + int32_t charid; std::string name; - int ismerc; + int8_t ismerc; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { GroupId e{}; - e.groupid = atoi(row[0]); - e.charid = atoi(row[1]); + e.groupid = static_cast(atoi(row[0])); + e.charid = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; - e.ismerc = atoi(row[3]); + e.ismerc = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GroupId e{}; - e.groupid = atoi(row[0]); - e.charid = atoi(row[1]); + e.groupid = static_cast(atoi(row[0])); + e.charid = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; - e.ismerc = atoi(row[3]); + e.ismerc = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GroupId e{}; - e.groupid = atoi(row[0]); - e.charid = atoi(row[1]); + e.groupid = static_cast(atoi(row[0])); + e.charid = static_cast(atoi(row[1])); e.name = row[2] ? row[2] : ""; - e.ismerc = atoi(row[3]); + e.ismerc = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_group_leaders_repository.h b/common/repositories/base/base_group_leaders_repository.h index 04521c06a..5032bf65f 100644 --- a/common/repositories/base/base_group_leaders_repository.h +++ b/common/repositories/base/base_group_leaders_repository.h @@ -19,7 +19,7 @@ class BaseGroupLeadersRepository { public: struct GroupLeaders { - int gid; + int32_t gid; std::string leadername; std::string marknpc; std::string leadershipaa; @@ -27,7 +27,7 @@ public: std::string assist; std::string puller; std::string mentoree; - int mentor_percent; + int32_t mentor_percent; }; static std::string PrimaryKey() @@ -146,7 +146,7 @@ public: if (results.RowCount() == 1) { GroupLeaders e{}; - e.gid = atoi(row[0]); + e.gid = static_cast(atoi(row[0])); e.leadername = row[1] ? row[1] : ""; e.marknpc = row[2] ? row[2] : ""; e.leadershipaa = row[3] ? row[3] : ""; @@ -154,7 +154,7 @@ public: e.assist = row[5] ? row[5] : ""; e.puller = row[6] ? row[6] : ""; e.mentoree = row[7] ? row[7] : ""; - e.mentor_percent = atoi(row[8]); + e.mentor_percent = static_cast(atoi(row[8])); return e; } @@ -298,7 +298,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GroupLeaders e{}; - e.gid = atoi(row[0]); + e.gid = static_cast(atoi(row[0])); e.leadername = row[1] ? row[1] : ""; e.marknpc = row[2] ? row[2] : ""; e.leadershipaa = row[3] ? row[3] : ""; @@ -306,7 +306,7 @@ public: e.assist = row[5] ? row[5] : ""; e.puller = row[6] ? row[6] : ""; e.mentoree = row[7] ? row[7] : ""; - e.mentor_percent = atoi(row[8]); + e.mentor_percent = static_cast(atoi(row[8])); all_entries.push_back(e); } @@ -331,7 +331,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GroupLeaders e{}; - e.gid = atoi(row[0]); + e.gid = static_cast(atoi(row[0])); e.leadername = row[1] ? row[1] : ""; e.marknpc = row[2] ? row[2] : ""; e.leadershipaa = row[3] ? row[3] : ""; @@ -339,7 +339,7 @@ public: e.assist = row[5] ? row[5] : ""; e.puller = row[6] ? row[6] : ""; e.mentoree = row[7] ? row[7] : ""; - e.mentor_percent = atoi(row[8]); + e.mentor_percent = static_cast(atoi(row[8])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_guild_ranks_repository.h b/common/repositories/base/base_guild_ranks_repository.h index 9c61c8ca1..cbc4ddf64 100644 --- a/common/repositories/base/base_guild_ranks_repository.h +++ b/common/repositories/base/base_guild_ranks_repository.h @@ -19,17 +19,17 @@ class BaseGuildRanksRepository { public: struct GuildRanks { - int guild_id; - int rank; + uint32_t guild_id; + uint8_t rank; std::string title; - int can_hear; - int can_speak; - int can_invite; - int can_remove; - int can_promote; - int can_demote; - int can_motd; - int can_warpeace; + uint8_t can_hear; + uint8_t can_speak; + uint8_t can_invite; + uint8_t can_remove; + uint8_t can_promote; + uint8_t can_demote; + uint8_t can_motd; + uint8_t can_warpeace; }; static std::string PrimaryKey() @@ -154,17 +154,17 @@ public: if (results.RowCount() == 1) { GuildRanks e{}; - e.guild_id = atoi(row[0]); - e.rank = atoi(row[1]); + e.guild_id = static_cast(strtoul(row[0], nullptr, 10)); + e.rank = static_cast(strtoul(row[1], nullptr, 10)); e.title = row[2] ? row[2] : ""; - e.can_hear = atoi(row[3]); - e.can_speak = atoi(row[4]); - e.can_invite = atoi(row[5]); - e.can_remove = atoi(row[6]); - e.can_promote = atoi(row[7]); - e.can_demote = atoi(row[8]); - e.can_motd = atoi(row[9]); - e.can_warpeace = atoi(row[10]); + e.can_hear = static_cast(strtoul(row[3], nullptr, 10)); + e.can_speak = static_cast(strtoul(row[4], nullptr, 10)); + e.can_invite = static_cast(strtoul(row[5], nullptr, 10)); + e.can_remove = static_cast(strtoul(row[6], nullptr, 10)); + e.can_promote = static_cast(strtoul(row[7], nullptr, 10)); + e.can_demote = static_cast(strtoul(row[8], nullptr, 10)); + e.can_motd = static_cast(strtoul(row[9], nullptr, 10)); + e.can_warpeace = static_cast(strtoul(row[10], nullptr, 10)); return e; } @@ -314,17 +314,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GuildRanks e{}; - e.guild_id = atoi(row[0]); - e.rank = atoi(row[1]); + e.guild_id = static_cast(strtoul(row[0], nullptr, 10)); + e.rank = static_cast(strtoul(row[1], nullptr, 10)); e.title = row[2] ? row[2] : ""; - e.can_hear = atoi(row[3]); - e.can_speak = atoi(row[4]); - e.can_invite = atoi(row[5]); - e.can_remove = atoi(row[6]); - e.can_promote = atoi(row[7]); - e.can_demote = atoi(row[8]); - e.can_motd = atoi(row[9]); - e.can_warpeace = atoi(row[10]); + e.can_hear = static_cast(strtoul(row[3], nullptr, 10)); + e.can_speak = static_cast(strtoul(row[4], nullptr, 10)); + e.can_invite = static_cast(strtoul(row[5], nullptr, 10)); + e.can_remove = static_cast(strtoul(row[6], nullptr, 10)); + e.can_promote = static_cast(strtoul(row[7], nullptr, 10)); + e.can_demote = static_cast(strtoul(row[8], nullptr, 10)); + e.can_motd = static_cast(strtoul(row[9], nullptr, 10)); + e.can_warpeace = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } @@ -349,17 +349,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GuildRanks e{}; - e.guild_id = atoi(row[0]); - e.rank = atoi(row[1]); + e.guild_id = static_cast(strtoul(row[0], nullptr, 10)); + e.rank = static_cast(strtoul(row[1], nullptr, 10)); e.title = row[2] ? row[2] : ""; - e.can_hear = atoi(row[3]); - e.can_speak = atoi(row[4]); - e.can_invite = atoi(row[5]); - e.can_remove = atoi(row[6]); - e.can_promote = atoi(row[7]); - e.can_demote = atoi(row[8]); - e.can_motd = atoi(row[9]); - e.can_warpeace = atoi(row[10]); + e.can_hear = static_cast(strtoul(row[3], nullptr, 10)); + e.can_speak = static_cast(strtoul(row[4], nullptr, 10)); + e.can_invite = static_cast(strtoul(row[5], nullptr, 10)); + e.can_remove = static_cast(strtoul(row[6], nullptr, 10)); + e.can_promote = static_cast(strtoul(row[7], nullptr, 10)); + e.can_demote = static_cast(strtoul(row[8], nullptr, 10)); + e.can_motd = static_cast(strtoul(row[9], nullptr, 10)); + e.can_warpeace = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_guild_relations_repository.h b/common/repositories/base/base_guild_relations_repository.h index 10a7da86e..6208edadc 100644 --- a/common/repositories/base/base_guild_relations_repository.h +++ b/common/repositories/base/base_guild_relations_repository.h @@ -19,9 +19,9 @@ class BaseGuildRelationsRepository { public: struct GuildRelations { - int guild1; - int guild2; - int relation; + uint32_t guild1; + uint32_t guild2; + int8_t relation; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { GuildRelations e{}; - e.guild1 = atoi(row[0]); - e.guild2 = atoi(row[1]); - e.relation = atoi(row[2]); + e.guild1 = static_cast(strtoul(row[0], nullptr, 10)); + e.guild2 = static_cast(strtoul(row[1], nullptr, 10)); + e.relation = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GuildRelations e{}; - e.guild1 = atoi(row[0]); - e.guild2 = atoi(row[1]); - e.relation = atoi(row[2]); + e.guild1 = static_cast(strtoul(row[0], nullptr, 10)); + e.guild2 = static_cast(strtoul(row[1], nullptr, 10)); + e.relation = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { GuildRelations e{}; - e.guild1 = atoi(row[0]); - e.guild2 = atoi(row[1]); - e.relation = atoi(row[2]); + e.guild1 = static_cast(strtoul(row[0], nullptr, 10)); + e.guild2 = static_cast(strtoul(row[1], nullptr, 10)); + e.relation = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_guilds_repository.h b/common/repositories/base/base_guilds_repository.h index 53558afbc..a423eaaa7 100644 --- a/common/repositories/base/base_guilds_repository.h +++ b/common/repositories/base/base_guilds_repository.h @@ -19,12 +19,12 @@ class BaseGuildsRepository { public: struct Guilds { - int id; + int32_t id; std::string name; - int leader; - int minstatus; + int32_t leader; + int16_t minstatus; std::string motd; - int tribute; + uint32_t tribute; std::string motd_setter; std::string channel; std::string url; @@ -146,12 +146,12 @@ public: if (results.RowCount() == 1) { Guilds e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.leader = atoi(row[2]); - e.minstatus = atoi(row[3]); + e.leader = static_cast(atoi(row[2])); + e.minstatus = static_cast(atoi(row[3])); e.motd = row[4] ? row[4] : ""; - e.tribute = atoi(row[5]); + e.tribute = static_cast(strtoul(row[5], nullptr, 10)); e.motd_setter = row[6] ? row[6] : ""; e.channel = row[7] ? row[7] : ""; e.url = row[8] ? row[8] : ""; @@ -297,12 +297,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Guilds e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.leader = atoi(row[2]); - e.minstatus = atoi(row[3]); + e.leader = static_cast(atoi(row[2])); + e.minstatus = static_cast(atoi(row[3])); e.motd = row[4] ? row[4] : ""; - e.tribute = atoi(row[5]); + e.tribute = static_cast(strtoul(row[5], nullptr, 10)); e.motd_setter = row[6] ? row[6] : ""; e.channel = row[7] ? row[7] : ""; e.url = row[8] ? row[8] : ""; @@ -330,12 +330,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Guilds e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.leader = atoi(row[2]); - e.minstatus = atoi(row[3]); + e.leader = static_cast(atoi(row[2])); + e.minstatus = static_cast(atoi(row[3])); e.motd = row[4] ? row[4] : ""; - e.tribute = atoi(row[5]); + e.tribute = static_cast(strtoul(row[5], nullptr, 10)); e.motd_setter = row[6] ? row[6] : ""; e.channel = row[7] ? row[7] : ""; e.url = row[8] ? row[8] : ""; diff --git a/common/repositories/base/base_hackers_repository.h b/common/repositories/base/base_hackers_repository.h index f37ae9f64..329c370d8 100644 --- a/common/repositories/base/base_hackers_repository.h +++ b/common/repositories/base/base_hackers_repository.h @@ -19,7 +19,7 @@ class BaseHackersRepository { public: struct Hackers { - int id; + int32_t id; std::string account; std::string name; std::string hacked; @@ -134,7 +134,7 @@ public: if (results.RowCount() == 1) { Hackers e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.account = row[1] ? row[1] : ""; e.name = row[2] ? row[2] : ""; e.hacked = row[3] ? row[3] : ""; @@ -273,7 +273,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Hackers e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.account = row[1] ? row[1] : ""; e.name = row[2] ? row[2] : ""; e.hacked = row[3] ? row[3] : ""; @@ -303,7 +303,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Hackers e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.account = row[1] ? row[1] : ""; e.name = row[2] ? row[2] : ""; e.hacked = row[3] ? row[3] : ""; diff --git a/common/repositories/base/base_horses_repository.h b/common/repositories/base/base_horses_repository.h index c63398870..a881720de 100644 --- a/common/repositories/base/base_horses_repository.h +++ b/common/repositories/base/base_horses_repository.h @@ -19,11 +19,11 @@ class BaseHorsesRepository { public: struct Horses { - int id; + int32_t id; std::string filename; - int race; - int gender; - int texture; + int16_t race; + int8_t gender; + int8_t texture; float mountspeed; std::string notes; }; @@ -138,12 +138,12 @@ public: if (results.RowCount() == 1) { Horses e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.filename = row[1] ? row[1] : ""; - e.race = atoi(row[2]); - e.gender = atoi(row[3]); - e.texture = atoi(row[4]); - e.mountspeed = static_cast(atof(row[5])); + e.race = static_cast(atoi(row[2])); + e.gender = static_cast(atoi(row[3])); + e.texture = static_cast(atoi(row[4])); + e.mountspeed = strtof(row[5], nullptr); e.notes = row[6] ? row[6] : ""; return e; @@ -281,12 +281,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Horses e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.filename = row[1] ? row[1] : ""; - e.race = atoi(row[2]); - e.gender = atoi(row[3]); - e.texture = atoi(row[4]); - e.mountspeed = static_cast(atof(row[5])); + e.race = static_cast(atoi(row[2])); + e.gender = static_cast(atoi(row[3])); + e.texture = static_cast(atoi(row[4])); + e.mountspeed = strtof(row[5], nullptr); e.notes = row[6] ? row[6] : ""; all_entries.push_back(e); @@ -312,12 +312,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Horses e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.filename = row[1] ? row[1] : ""; - e.race = atoi(row[2]); - e.gender = atoi(row[3]); - e.texture = atoi(row[4]); - e.mountspeed = static_cast(atof(row[5])); + e.race = static_cast(atoi(row[2])); + e.gender = static_cast(atoi(row[3])); + e.texture = static_cast(atoi(row[4])); + e.mountspeed = strtof(row[5], nullptr); e.notes = row[6] ? row[6] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_instance_list_player_repository.h b/common/repositories/base/base_instance_list_player_repository.h index f031312c2..85e6fe012 100644 --- a/common/repositories/base/base_instance_list_player_repository.h +++ b/common/repositories/base/base_instance_list_player_repository.h @@ -19,8 +19,8 @@ class BaseInstanceListPlayerRepository { public: struct InstanceListPlayer { - int id; - int charid; + uint32_t id; + uint32_t charid; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { InstanceListPlayer e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { InstanceListPlayer e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { InstanceListPlayer e{}; - e.id = atoi(row[0]); - e.charid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_instance_list_repository.h b/common/repositories/base/base_instance_list_repository.h index 609b7e187..dd82569ec 100644 --- a/common/repositories/base/base_instance_list_repository.h +++ b/common/repositories/base/base_instance_list_repository.h @@ -19,13 +19,13 @@ class BaseInstanceListRepository { public: struct InstanceList { - int id; - int zone; - int version; - int is_global; - int start_time; - int duration; - int never_expires; + int32_t id; + uint32_t zone; + uint8_t version; + uint8_t is_global; + uint32_t start_time; + uint32_t duration; + uint8_t never_expires; }; static std::string PrimaryKey() @@ -138,13 +138,13 @@ public: if (results.RowCount() == 1) { InstanceList e{}; - e.id = atoi(row[0]); - e.zone = atoi(row[1]); - e.version = atoi(row[2]); - e.is_global = atoi(row[3]); - e.start_time = atoi(row[4]); - e.duration = atoi(row[5]); - e.never_expires = atoi(row[6]); + e.id = static_cast(atoi(row[0])); + e.zone = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(strtoul(row[2], nullptr, 10)); + e.is_global = static_cast(strtoul(row[3], nullptr, 10)); + e.start_time = static_cast(strtoul(row[4], nullptr, 10)); + e.duration = static_cast(strtoul(row[5], nullptr, 10)); + e.never_expires = static_cast(strtoul(row[6], nullptr, 10)); return e; } @@ -281,13 +281,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { InstanceList e{}; - e.id = atoi(row[0]); - e.zone = atoi(row[1]); - e.version = atoi(row[2]); - e.is_global = atoi(row[3]); - e.start_time = atoi(row[4]); - e.duration = atoi(row[5]); - e.never_expires = atoi(row[6]); + e.id = static_cast(atoi(row[0])); + e.zone = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(strtoul(row[2], nullptr, 10)); + e.is_global = static_cast(strtoul(row[3], nullptr, 10)); + e.start_time = static_cast(strtoul(row[4], nullptr, 10)); + e.duration = static_cast(strtoul(row[5], nullptr, 10)); + e.never_expires = static_cast(strtoul(row[6], nullptr, 10)); all_entries.push_back(e); } @@ -312,13 +312,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { InstanceList e{}; - e.id = atoi(row[0]); - e.zone = atoi(row[1]); - e.version = atoi(row[2]); - e.is_global = atoi(row[3]); - e.start_time = atoi(row[4]); - e.duration = atoi(row[5]); - e.never_expires = atoi(row[6]); + e.id = static_cast(atoi(row[0])); + e.zone = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(strtoul(row[2], nullptr, 10)); + e.is_global = static_cast(strtoul(row[3], nullptr, 10)); + e.start_time = static_cast(strtoul(row[4], nullptr, 10)); + e.duration = static_cast(strtoul(row[5], nullptr, 10)); + e.never_expires = static_cast(strtoul(row[6], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_inventory_repository.h b/common/repositories/base/base_inventory_repository.h index 7086e0d72..a3e0da3dd 100644 --- a/common/repositories/base/base_inventory_repository.h +++ b/common/repositories/base/base_inventory_repository.h @@ -19,22 +19,22 @@ class BaseInventoryRepository { public: struct Inventory { - int charid; - int slotid; - int itemid; - int charges; - int color; - int augslot1; - int augslot2; - int augslot3; - int augslot4; - int augslot5; - int augslot6; - int instnodrop; + uint32_t charid; + uint32_t slotid; + uint32_t itemid; + uint16_t charges; + uint32_t color; + uint32_t augslot1; + uint32_t augslot2; + uint32_t augslot3; + uint32_t augslot4; + uint32_t augslot5; + int32_t augslot6; + uint8_t instnodrop; std::string custom_data; - int ornamenticon; - int ornamentidfile; - int ornament_hero_model; + uint32_t ornamenticon; + uint32_t ornamentidfile; + int32_t ornament_hero_model; }; static std::string PrimaryKey() @@ -174,22 +174,22 @@ public: if (results.RowCount() == 1) { Inventory e{}; - e.charid = atoi(row[0]); - e.slotid = atoi(row[1]); - e.itemid = atoi(row[2]); - e.charges = atoi(row[3]); - e.color = atoi(row[4]); - e.augslot1 = atoi(row[5]); - e.augslot2 = atoi(row[6]); - e.augslot3 = atoi(row[7]); - e.augslot4 = atoi(row[8]); - e.augslot5 = atoi(row[9]); - e.augslot6 = atoi(row[10]); - e.instnodrop = atoi(row[11]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.slotid = static_cast(strtoul(row[1], nullptr, 10)); + e.itemid = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.color = static_cast(strtoul(row[4], nullptr, 10)); + e.augslot1 = static_cast(strtoul(row[5], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[10])); + e.instnodrop = static_cast(strtoul(row[11], nullptr, 10)); e.custom_data = row[12] ? row[12] : ""; - e.ornamenticon = atoi(row[13]); - e.ornamentidfile = atoi(row[14]); - e.ornament_hero_model = atoi(row[15]); + e.ornamenticon = static_cast(strtoul(row[13], nullptr, 10)); + e.ornamentidfile = static_cast(strtoul(row[14], nullptr, 10)); + e.ornament_hero_model = static_cast(atoi(row[15])); return e; } @@ -354,22 +354,22 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Inventory e{}; - e.charid = atoi(row[0]); - e.slotid = atoi(row[1]); - e.itemid = atoi(row[2]); - e.charges = atoi(row[3]); - e.color = atoi(row[4]); - e.augslot1 = atoi(row[5]); - e.augslot2 = atoi(row[6]); - e.augslot3 = atoi(row[7]); - e.augslot4 = atoi(row[8]); - e.augslot5 = atoi(row[9]); - e.augslot6 = atoi(row[10]); - e.instnodrop = atoi(row[11]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.slotid = static_cast(strtoul(row[1], nullptr, 10)); + e.itemid = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.color = static_cast(strtoul(row[4], nullptr, 10)); + e.augslot1 = static_cast(strtoul(row[5], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[10])); + e.instnodrop = static_cast(strtoul(row[11], nullptr, 10)); e.custom_data = row[12] ? row[12] : ""; - e.ornamenticon = atoi(row[13]); - e.ornamentidfile = atoi(row[14]); - e.ornament_hero_model = atoi(row[15]); + e.ornamenticon = static_cast(strtoul(row[13], nullptr, 10)); + e.ornamentidfile = static_cast(strtoul(row[14], nullptr, 10)); + e.ornament_hero_model = static_cast(atoi(row[15])); all_entries.push_back(e); } @@ -394,22 +394,22 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Inventory e{}; - e.charid = atoi(row[0]); - e.slotid = atoi(row[1]); - e.itemid = atoi(row[2]); - e.charges = atoi(row[3]); - e.color = atoi(row[4]); - e.augslot1 = atoi(row[5]); - e.augslot2 = atoi(row[6]); - e.augslot3 = atoi(row[7]); - e.augslot4 = atoi(row[8]); - e.augslot5 = atoi(row[9]); - e.augslot6 = atoi(row[10]); - e.instnodrop = atoi(row[11]); + e.charid = static_cast(strtoul(row[0], nullptr, 10)); + e.slotid = static_cast(strtoul(row[1], nullptr, 10)); + e.itemid = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.color = static_cast(strtoul(row[4], nullptr, 10)); + e.augslot1 = static_cast(strtoul(row[5], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[10])); + e.instnodrop = static_cast(strtoul(row[11], nullptr, 10)); e.custom_data = row[12] ? row[12] : ""; - e.ornamenticon = atoi(row[13]); - e.ornamentidfile = atoi(row[14]); - e.ornament_hero_model = atoi(row[15]); + e.ornamenticon = static_cast(strtoul(row[13], nullptr, 10)); + e.ornamentidfile = static_cast(strtoul(row[14], nullptr, 10)); + e.ornament_hero_model = static_cast(atoi(row[15])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_inventory_snapshots_repository.h b/common/repositories/base/base_inventory_snapshots_repository.h index 66d9c6932..2ae90332f 100644 --- a/common/repositories/base/base_inventory_snapshots_repository.h +++ b/common/repositories/base/base_inventory_snapshots_repository.h @@ -19,23 +19,23 @@ class BaseInventorySnapshotsRepository { public: struct InventorySnapshots { - int time_index; - int charid; - int slotid; - int itemid; - int charges; - int color; - int augslot1; - int augslot2; - int augslot3; - int augslot4; - int augslot5; - int augslot6; - int instnodrop; + uint32_t time_index; + uint32_t charid; + uint32_t slotid; + uint32_t itemid; + uint16_t charges; + uint32_t color; + uint32_t augslot1; + uint32_t augslot2; + uint32_t augslot3; + uint32_t augslot4; + uint32_t augslot5; + int32_t augslot6; + uint8_t instnodrop; std::string custom_data; - int ornamenticon; - int ornamentidfile; - int ornament_hero_model; + uint32_t ornamenticon; + uint32_t ornamentidfile; + int32_t ornament_hero_model; }; static std::string PrimaryKey() @@ -178,23 +178,23 @@ public: if (results.RowCount() == 1) { InventorySnapshots e{}; - e.time_index = atoi(row[0]); - e.charid = atoi(row[1]); - e.slotid = atoi(row[2]); - e.itemid = atoi(row[3]); - e.charges = atoi(row[4]); - e.color = atoi(row[5]); - e.augslot1 = atoi(row[6]); - e.augslot2 = atoi(row[7]); - e.augslot3 = atoi(row[8]); - e.augslot4 = atoi(row[9]); - e.augslot5 = atoi(row[10]); - e.augslot6 = atoi(row[11]); - e.instnodrop = atoi(row[12]); + e.time_index = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); + e.slotid = static_cast(strtoul(row[2], nullptr, 10)); + e.itemid = static_cast(strtoul(row[3], nullptr, 10)); + e.charges = static_cast(strtoul(row[4], nullptr, 10)); + e.color = static_cast(strtoul(row[5], nullptr, 10)); + e.augslot1 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[10], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[11])); + e.instnodrop = static_cast(strtoul(row[12], nullptr, 10)); e.custom_data = row[13] ? row[13] : ""; - e.ornamenticon = atoi(row[14]); - e.ornamentidfile = atoi(row[15]); - e.ornament_hero_model = atoi(row[16]); + e.ornamenticon = static_cast(strtoul(row[14], nullptr, 10)); + e.ornamentidfile = static_cast(strtoul(row[15], nullptr, 10)); + e.ornament_hero_model = static_cast(atoi(row[16])); return e; } @@ -362,23 +362,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { InventorySnapshots e{}; - e.time_index = atoi(row[0]); - e.charid = atoi(row[1]); - e.slotid = atoi(row[2]); - e.itemid = atoi(row[3]); - e.charges = atoi(row[4]); - e.color = atoi(row[5]); - e.augslot1 = atoi(row[6]); - e.augslot2 = atoi(row[7]); - e.augslot3 = atoi(row[8]); - e.augslot4 = atoi(row[9]); - e.augslot5 = atoi(row[10]); - e.augslot6 = atoi(row[11]); - e.instnodrop = atoi(row[12]); + e.time_index = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); + e.slotid = static_cast(strtoul(row[2], nullptr, 10)); + e.itemid = static_cast(strtoul(row[3], nullptr, 10)); + e.charges = static_cast(strtoul(row[4], nullptr, 10)); + e.color = static_cast(strtoul(row[5], nullptr, 10)); + e.augslot1 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[10], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[11])); + e.instnodrop = static_cast(strtoul(row[12], nullptr, 10)); e.custom_data = row[13] ? row[13] : ""; - e.ornamenticon = atoi(row[14]); - e.ornamentidfile = atoi(row[15]); - e.ornament_hero_model = atoi(row[16]); + e.ornamenticon = static_cast(strtoul(row[14], nullptr, 10)); + e.ornamentidfile = static_cast(strtoul(row[15], nullptr, 10)); + e.ornament_hero_model = static_cast(atoi(row[16])); all_entries.push_back(e); } @@ -403,23 +403,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { InventorySnapshots e{}; - e.time_index = atoi(row[0]); - e.charid = atoi(row[1]); - e.slotid = atoi(row[2]); - e.itemid = atoi(row[3]); - e.charges = atoi(row[4]); - e.color = atoi(row[5]); - e.augslot1 = atoi(row[6]); - e.augslot2 = atoi(row[7]); - e.augslot3 = atoi(row[8]); - e.augslot4 = atoi(row[9]); - e.augslot5 = atoi(row[10]); - e.augslot6 = atoi(row[11]); - e.instnodrop = atoi(row[12]); + e.time_index = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); + e.slotid = static_cast(strtoul(row[2], nullptr, 10)); + e.itemid = static_cast(strtoul(row[3], nullptr, 10)); + e.charges = static_cast(strtoul(row[4], nullptr, 10)); + e.color = static_cast(strtoul(row[5], nullptr, 10)); + e.augslot1 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[10], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[11])); + e.instnodrop = static_cast(strtoul(row[12], nullptr, 10)); e.custom_data = row[13] ? row[13] : ""; - e.ornamenticon = atoi(row[14]); - e.ornamentidfile = atoi(row[15]); - e.ornament_hero_model = atoi(row[16]); + e.ornamenticon = static_cast(strtoul(row[14], nullptr, 10)); + e.ornamentidfile = static_cast(strtoul(row[15], nullptr, 10)); + e.ornament_hero_model = static_cast(atoi(row[16])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_ip_exemptions_repository.h b/common/repositories/base/base_ip_exemptions_repository.h index e7f4f1dc7..f76e8c7a4 100644 --- a/common/repositories/base/base_ip_exemptions_repository.h +++ b/common/repositories/base/base_ip_exemptions_repository.h @@ -19,9 +19,9 @@ class BaseIpExemptionsRepository { public: struct IpExemptions { - int exemption_id; + int32_t exemption_id; std::string exemption_ip; - int exemption_amount; + int32_t exemption_amount; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { IpExemptions e{}; - e.exemption_id = atoi(row[0]); + e.exemption_id = static_cast(atoi(row[0])); e.exemption_ip = row[1] ? row[1] : ""; - e.exemption_amount = atoi(row[2]); + e.exemption_amount = static_cast(atoi(row[2])); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { IpExemptions e{}; - e.exemption_id = atoi(row[0]); + e.exemption_id = static_cast(atoi(row[0])); e.exemption_ip = row[1] ? row[1] : ""; - e.exemption_amount = atoi(row[2]); + e.exemption_amount = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { IpExemptions e{}; - e.exemption_id = atoi(row[0]); + e.exemption_id = static_cast(atoi(row[0])); e.exemption_ip = row[1] ? row[1] : ""; - e.exemption_amount = atoi(row[2]); + e.exemption_amount = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_item_tick_repository.h b/common/repositories/base/base_item_tick_repository.h index 8e7ba69a8..08b9ded48 100644 --- a/common/repositories/base/base_item_tick_repository.h +++ b/common/repositories/base/base_item_tick_repository.h @@ -19,12 +19,12 @@ class BaseItemTickRepository { public: struct ItemTick { - int it_itemid; - int it_chance; - int it_level; - int it_id; + int32_t it_itemid; + int32_t it_chance; + int32_t it_level; + int32_t it_id; std::string it_qglobal; - int it_bagslot; + int8_t it_bagslot; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { ItemTick e{}; - e.it_itemid = atoi(row[0]); - e.it_chance = atoi(row[1]); - e.it_level = atoi(row[2]); - e.it_id = atoi(row[3]); + e.it_itemid = static_cast(atoi(row[0])); + e.it_chance = static_cast(atoi(row[1])); + e.it_level = static_cast(atoi(row[2])); + e.it_id = static_cast(atoi(row[3])); e.it_qglobal = row[4] ? row[4] : ""; - e.it_bagslot = atoi(row[5]); + e.it_bagslot = static_cast(atoi(row[5])); return e; } @@ -273,12 +273,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ItemTick e{}; - e.it_itemid = atoi(row[0]); - e.it_chance = atoi(row[1]); - e.it_level = atoi(row[2]); - e.it_id = atoi(row[3]); + e.it_itemid = static_cast(atoi(row[0])); + e.it_chance = static_cast(atoi(row[1])); + e.it_level = static_cast(atoi(row[2])); + e.it_id = static_cast(atoi(row[3])); e.it_qglobal = row[4] ? row[4] : ""; - e.it_bagslot = atoi(row[5]); + e.it_bagslot = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -303,12 +303,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ItemTick e{}; - e.it_itemid = atoi(row[0]); - e.it_chance = atoi(row[1]); - e.it_level = atoi(row[2]); - e.it_id = atoi(row[3]); + e.it_itemid = static_cast(atoi(row[0])); + e.it_chance = static_cast(atoi(row[1])); + e.it_level = static_cast(atoi(row[2])); + e.it_id = static_cast(atoi(row[3])); e.it_qglobal = row[4] ? row[4] : ""; - e.it_bagslot = atoi(row[5]); + e.it_bagslot = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_items_repository.h b/common/repositories/base/base_items_repository.h index 4cd9acb7c..ef908262e 100644 --- a/common/repositories/base/base_items_repository.h +++ b/common/repositories/base/base_items_repository.h @@ -19,291 +19,291 @@ class BaseItemsRepository { public: struct Items { - int id; - int minstatus; + int32_t id; + int16_t minstatus; std::string Name; - int aagi; - int ac; - int accuracy; - int acha; - int adex; - int aint; - int artifactflag; - int asta; - int astr; - int attack; - int augrestrict; - int augslot1type; - int augslot1visible; - int augslot2type; - int augslot2visible; - int augslot3type; - int augslot3visible; - int augslot4type; - int augslot4visible; - int augslot5type; - int augslot5visible; - int augslot6type; - int augslot6visible; - int augtype; - int avoidance; - int awis; - int bagsize; - int bagslots; - int bagtype; - int bagwr; - int banedmgamt; - int banedmgraceamt; - int banedmgbody; - int banedmgrace; - int bardtype; - int bardvalue; - int book; - int casttime; - int casttime_; + int32_t aagi; + int32_t ac; + int32_t accuracy; + int32_t acha; + int32_t adex; + int32_t aint; + uint8_t artifactflag; + int32_t asta; + int32_t astr; + int32_t attack; + int32_t augrestrict; + int8_t augslot1type; + int8_t augslot1visible; + int8_t augslot2type; + int8_t augslot2visible; + int8_t augslot3type; + int8_t augslot3visible; + int8_t augslot4type; + int8_t augslot4visible; + int8_t augslot5type; + int8_t augslot5visible; + int8_t augslot6type; + int8_t augslot6visible; + int32_t augtype; + int32_t avoidance; + int32_t awis; + int32_t bagsize; + int32_t bagslots; + int32_t bagtype; + int32_t bagwr; + int32_t banedmgamt; + int32_t banedmgraceamt; + int32_t banedmgbody; + int32_t banedmgrace; + int32_t bardtype; + int32_t bardvalue; + int32_t book; + int32_t casttime; + int32_t casttime_; std::string charmfile; std::string charmfileid; - int classes; - int color; + int32_t classes; + uint32_t color; std::string combateffects; - int extradmgskill; - int extradmgamt; - int price; - int cr; - int damage; - int damageshield; - int deity; - int delay; - int augdistiller; - int dotshielding; - int dr; - int clicktype; - int clicklevel2; - int elemdmgtype; - int elemdmgamt; - int endur; - int factionamt1; - int factionamt2; - int factionamt3; - int factionamt4; - int factionmod1; - int factionmod2; - int factionmod3; - int factionmod4; + int32_t extradmgskill; + int32_t extradmgamt; + int32_t price; + int32_t cr; + int32_t damage; + int32_t damageshield; + int32_t deity; + int32_t delay; + int32_t augdistiller; + int32_t dotshielding; + int32_t dr; + int32_t clicktype; + int32_t clicklevel2; + int32_t elemdmgtype; + int32_t elemdmgamt; + int32_t endur; + int32_t factionamt1; + int32_t factionamt2; + int32_t factionamt3; + int32_t factionamt4; + int32_t factionmod1; + int32_t factionmod2; + int32_t factionmod3; + int32_t factionmod4; std::string filename; - int focuseffect; - int fr; - int fvnodrop; - int haste; - int clicklevel; - int hp; - int regen; - int icon; + int32_t focuseffect; + int32_t fr; + int32_t fvnodrop; + int32_t haste; + int32_t clicklevel; + int32_t hp; + int32_t regen; + int32_t icon; std::string idfile; - int itemclass; - int itemtype; - int ldonprice; - int ldontheme; - int ldonsold; - int light; + int32_t itemclass; + int32_t itemtype; + int32_t ldonprice; + int32_t ldontheme; + int32_t ldonsold; + int32_t light; std::string lore; - int loregroup; - int magic; - int mana; - int manaregen; - int enduranceregen; - int material; - int herosforgemodel; - int maxcharges; - int mr; - int nodrop; - int norent; - int pendingloreflag; - int pr; - int procrate; - int races; - int range; - int reclevel; - int recskill; - int reqlevel; + int32_t loregroup; + int32_t magic; + int32_t mana; + int32_t manaregen; + int32_t enduranceregen; + int32_t material; + int32_t herosforgemodel; + int32_t maxcharges; + int32_t mr; + int32_t nodrop; + int32_t norent; + uint8_t pendingloreflag; + int32_t pr; + int32_t procrate; + int32_t races; + int32_t range; + int32_t reclevel; + int32_t recskill; + int32_t reqlevel; float sellrate; - int shielding; - int size; - int skillmodtype; - int skillmodvalue; - int slots; - int clickeffect; - int spellshield; - int strikethrough; - int stunresist; - int summonedflag; - int tradeskills; - int favor; - int weight; - int UNK012; - int UNK013; - int benefitflag; - int UNK054; - int UNK059; - int booktype; - int recastdelay; - int recasttype; - int guildfavor; - int UNK123; - int UNK124; - int attuneable; - int nopet; + int32_t shielding; + int32_t size; + int32_t skillmodtype; + int32_t skillmodvalue; + int32_t slots; + int32_t clickeffect; + int32_t spellshield; + int32_t strikethrough; + int32_t stunresist; + uint8_t summonedflag; + int32_t tradeskills; + int32_t favor; + int32_t weight; + int32_t UNK012; + int32_t UNK013; + int32_t benefitflag; + int32_t UNK054; + int32_t UNK059; + int32_t booktype; + int32_t recastdelay; + int32_t recasttype; + int32_t guildfavor; + int32_t UNK123; + int32_t UNK124; + int32_t attuneable; + int32_t nopet; time_t updated; std::string comment; - int UNK127; - int pointtype; - int potionbelt; - int potionbeltslots; - int stacksize; - int notransfer; - int stackable; + int32_t UNK127; + int32_t pointtype; + int32_t potionbelt; + int32_t potionbeltslots; + int32_t stacksize; + int32_t notransfer; + int32_t stackable; std::string UNK134; - int UNK137; - int proceffect; - int proctype; - int proclevel2; - int proclevel; - int UNK142; - int worneffect; - int worntype; - int wornlevel2; - int wornlevel; - int UNK147; - int focustype; - int focuslevel2; - int focuslevel; - int UNK152; - int scrolleffect; - int scrolltype; - int scrolllevel2; - int scrolllevel; - int UNK157; + int32_t UNK137; + int32_t proceffect; + int32_t proctype; + int32_t proclevel2; + int32_t proclevel; + int32_t UNK142; + int32_t worneffect; + int32_t worntype; + int32_t wornlevel2; + int32_t wornlevel; + int32_t UNK147; + int32_t focustype; + int32_t focuslevel2; + int32_t focuslevel; + int32_t UNK152; + int32_t scrolleffect; + int32_t scrolltype; + int32_t scrolllevel2; + int32_t scrolllevel; + int32_t UNK157; time_t serialized; time_t verified; std::string serialization; std::string source; - int UNK033; + int32_t UNK033; std::string lorefile; - int UNK014; - int svcorruption; - int skillmodmax; - int UNK060; - int augslot1unk2; - int augslot2unk2; - int augslot3unk2; - int augslot4unk2; - int augslot5unk2; - int augslot6unk2; - int UNK120; - int UNK121; - int questitemflag; + int32_t UNK014; + int32_t svcorruption; + int32_t skillmodmax; + int32_t UNK060; + int32_t augslot1unk2; + int32_t augslot2unk2; + int32_t augslot3unk2; + int32_t augslot4unk2; + int32_t augslot5unk2; + int32_t augslot6unk2; + int32_t UNK120; + int32_t UNK121; + int32_t questitemflag; std::string UNK132; - int clickunk5; + int32_t clickunk5; std::string clickunk6; - int clickunk7; - int procunk1; - int procunk2; - int procunk3; - int procunk4; + int32_t clickunk7; + int32_t procunk1; + int32_t procunk2; + int32_t procunk3; + int32_t procunk4; std::string procunk6; - int procunk7; - int wornunk1; - int wornunk2; - int wornunk3; - int wornunk4; - int wornunk5; + int32_t procunk7; + int32_t wornunk1; + int32_t wornunk2; + int32_t wornunk3; + int32_t wornunk4; + int32_t wornunk5; std::string wornunk6; - int wornunk7; - int focusunk1; - int focusunk2; - int focusunk3; - int focusunk4; - int focusunk5; + int32_t wornunk7; + int32_t focusunk1; + int32_t focusunk2; + int32_t focusunk3; + int32_t focusunk4; + int32_t focusunk5; std::string focusunk6; - int focusunk7; - int scrollunk1; - int scrollunk2; - int scrollunk3; - int scrollunk4; - int scrollunk5; + int32_t focusunk7; + int32_t scrollunk1; + int32_t scrollunk2; + int32_t scrollunk3; + int32_t scrollunk4; + int32_t scrollunk5; std::string scrollunk6; - int scrollunk7; - int UNK193; - int purity; - int evoitem; - int evoid; - int evolvinglevel; - int evomax; + int32_t scrollunk7; + int32_t UNK193; + int32_t purity; + int32_t evoitem; + int32_t evoid; + int32_t evolvinglevel; + int32_t evomax; std::string clickname; std::string procname; std::string wornname; std::string focusname; std::string scrollname; - int dsmitigation; - int heroic_str; - int heroic_int; - int heroic_wis; - int heroic_agi; - int heroic_dex; - int heroic_sta; - int heroic_cha; - int heroic_pr; - int heroic_dr; - int heroic_fr; - int heroic_cr; - int heroic_mr; - int heroic_svcorrup; - int healamt; - int spelldmg; - int clairvoyance; - int backstabdmg; + int16_t dsmitigation; + int16_t heroic_str; + int16_t heroic_int; + int16_t heroic_wis; + int16_t heroic_agi; + int16_t heroic_dex; + int16_t heroic_sta; + int16_t heroic_cha; + int16_t heroic_pr; + int16_t heroic_dr; + int16_t heroic_fr; + int16_t heroic_cr; + int16_t heroic_mr; + int16_t heroic_svcorrup; + int16_t healamt; + int16_t spelldmg; + int16_t clairvoyance; + int16_t backstabdmg; std::string created; - int elitematerial; - int ldonsellbackrate; - int scriptfileid; - int expendablearrow; - int powersourcecapacity; - int bardeffect; - int bardeffecttype; - int bardlevel2; - int bardlevel; - int bardunk1; - int bardunk2; - int bardunk3; - int bardunk4; - int bardunk5; + int16_t elitematerial; + int16_t ldonsellbackrate; + int16_t scriptfileid; + int16_t expendablearrow; + int16_t powersourcecapacity; + int16_t bardeffect; + int16_t bardeffecttype; + int16_t bardlevel2; + int16_t bardlevel; + int16_t bardunk1; + int16_t bardunk2; + int16_t bardunk3; + int16_t bardunk4; + int16_t bardunk5; std::string bardname; - int bardunk7; - int UNK214; - int subtype; - int UNK220; - int UNK221; - int heirloom; - int UNK223; - int UNK224; - int UNK225; - int UNK226; - int UNK227; - int UNK228; - int UNK229; - int UNK230; - int UNK231; - int UNK232; - int UNK233; - int UNK234; - int placeable; - int UNK236; - int UNK237; - int UNK238; - int UNK239; - int UNK240; - int UNK241; - int epicitem; + int16_t bardunk7; + int16_t UNK214; + int32_t subtype; + int32_t UNK220; + int32_t UNK221; + int32_t heirloom; + int32_t UNK223; + int32_t UNK224; + int32_t UNK225; + int32_t UNK226; + int32_t UNK227; + int32_t UNK228; + int32_t UNK229; + int32_t UNK230; + int32_t UNK231; + int32_t UNK232; + int32_t UNK233; + int32_t UNK234; + int32_t placeable; + int32_t UNK236; + int32_t UNK237; + int32_t UNK238; + int32_t UNK239; + int32_t UNK240; + int32_t UNK241; + int32_t epicitem; }; static std::string PrimaryKey() @@ -1250,291 +1250,291 @@ public: if (results.RowCount() == 1) { Items e{}; - e.id = atoi(row[0]); - e.minstatus = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.minstatus = static_cast(atoi(row[1])); e.Name = row[2] ? row[2] : ""; - e.aagi = atoi(row[3]); - e.ac = atoi(row[4]); - e.accuracy = atoi(row[5]); - e.acha = atoi(row[6]); - e.adex = atoi(row[7]); - e.aint = atoi(row[8]); - e.artifactflag = atoi(row[9]); - e.asta = atoi(row[10]); - e.astr = atoi(row[11]); - e.attack = atoi(row[12]); - e.augrestrict = atoi(row[13]); - e.augslot1type = atoi(row[14]); - e.augslot1visible = atoi(row[15]); - e.augslot2type = atoi(row[16]); - e.augslot2visible = atoi(row[17]); - e.augslot3type = atoi(row[18]); - e.augslot3visible = atoi(row[19]); - e.augslot4type = atoi(row[20]); - e.augslot4visible = atoi(row[21]); - e.augslot5type = atoi(row[22]); - e.augslot5visible = atoi(row[23]); - e.augslot6type = atoi(row[24]); - e.augslot6visible = atoi(row[25]); - e.augtype = atoi(row[26]); - e.avoidance = atoi(row[27]); - e.awis = atoi(row[28]); - e.bagsize = atoi(row[29]); - e.bagslots = atoi(row[30]); - e.bagtype = atoi(row[31]); - e.bagwr = atoi(row[32]); - e.banedmgamt = atoi(row[33]); - e.banedmgraceamt = atoi(row[34]); - e.banedmgbody = atoi(row[35]); - e.banedmgrace = atoi(row[36]); - e.bardtype = atoi(row[37]); - e.bardvalue = atoi(row[38]); - e.book = atoi(row[39]); - e.casttime = atoi(row[40]); - e.casttime_ = atoi(row[41]); + e.aagi = static_cast(atoi(row[3])); + e.ac = static_cast(atoi(row[4])); + e.accuracy = static_cast(atoi(row[5])); + e.acha = static_cast(atoi(row[6])); + e.adex = static_cast(atoi(row[7])); + e.aint = static_cast(atoi(row[8])); + e.artifactflag = static_cast(strtoul(row[9], nullptr, 10)); + e.asta = static_cast(atoi(row[10])); + e.astr = static_cast(atoi(row[11])); + e.attack = static_cast(atoi(row[12])); + e.augrestrict = static_cast(atoi(row[13])); + e.augslot1type = static_cast(atoi(row[14])); + e.augslot1visible = static_cast(atoi(row[15])); + e.augslot2type = static_cast(atoi(row[16])); + e.augslot2visible = static_cast(atoi(row[17])); + e.augslot3type = static_cast(atoi(row[18])); + e.augslot3visible = static_cast(atoi(row[19])); + e.augslot4type = static_cast(atoi(row[20])); + e.augslot4visible = static_cast(atoi(row[21])); + e.augslot5type = static_cast(atoi(row[22])); + e.augslot5visible = static_cast(atoi(row[23])); + e.augslot6type = static_cast(atoi(row[24])); + e.augslot6visible = static_cast(atoi(row[25])); + e.augtype = static_cast(atoi(row[26])); + e.avoidance = static_cast(atoi(row[27])); + e.awis = static_cast(atoi(row[28])); + e.bagsize = static_cast(atoi(row[29])); + e.bagslots = static_cast(atoi(row[30])); + e.bagtype = static_cast(atoi(row[31])); + e.bagwr = static_cast(atoi(row[32])); + e.banedmgamt = static_cast(atoi(row[33])); + e.banedmgraceamt = static_cast(atoi(row[34])); + e.banedmgbody = static_cast(atoi(row[35])); + e.banedmgrace = static_cast(atoi(row[36])); + e.bardtype = static_cast(atoi(row[37])); + e.bardvalue = static_cast(atoi(row[38])); + e.book = static_cast(atoi(row[39])); + e.casttime = static_cast(atoi(row[40])); + e.casttime_ = static_cast(atoi(row[41])); e.charmfile = row[42] ? row[42] : ""; e.charmfileid = row[43] ? row[43] : ""; - e.classes = atoi(row[44]); - e.color = atoi(row[45]); + e.classes = static_cast(atoi(row[44])); + e.color = static_cast(strtoul(row[45], nullptr, 10)); e.combateffects = row[46] ? row[46] : ""; - e.extradmgskill = atoi(row[47]); - e.extradmgamt = atoi(row[48]); - e.price = atoi(row[49]); - e.cr = atoi(row[50]); - e.damage = atoi(row[51]); - e.damageshield = atoi(row[52]); - e.deity = atoi(row[53]); - e.delay = atoi(row[54]); - e.augdistiller = atoi(row[55]); - e.dotshielding = atoi(row[56]); - e.dr = atoi(row[57]); - e.clicktype = atoi(row[58]); - e.clicklevel2 = atoi(row[59]); - e.elemdmgtype = atoi(row[60]); - e.elemdmgamt = atoi(row[61]); - e.endur = atoi(row[62]); - e.factionamt1 = atoi(row[63]); - e.factionamt2 = atoi(row[64]); - e.factionamt3 = atoi(row[65]); - e.factionamt4 = atoi(row[66]); - e.factionmod1 = atoi(row[67]); - e.factionmod2 = atoi(row[68]); - e.factionmod3 = atoi(row[69]); - e.factionmod4 = atoi(row[70]); + e.extradmgskill = static_cast(atoi(row[47])); + e.extradmgamt = static_cast(atoi(row[48])); + e.price = static_cast(atoi(row[49])); + e.cr = static_cast(atoi(row[50])); + e.damage = static_cast(atoi(row[51])); + e.damageshield = static_cast(atoi(row[52])); + e.deity = static_cast(atoi(row[53])); + e.delay = static_cast(atoi(row[54])); + e.augdistiller = static_cast(atoi(row[55])); + e.dotshielding = static_cast(atoi(row[56])); + e.dr = static_cast(atoi(row[57])); + e.clicktype = static_cast(atoi(row[58])); + e.clicklevel2 = static_cast(atoi(row[59])); + e.elemdmgtype = static_cast(atoi(row[60])); + e.elemdmgamt = static_cast(atoi(row[61])); + e.endur = static_cast(atoi(row[62])); + e.factionamt1 = static_cast(atoi(row[63])); + e.factionamt2 = static_cast(atoi(row[64])); + e.factionamt3 = static_cast(atoi(row[65])); + e.factionamt4 = static_cast(atoi(row[66])); + e.factionmod1 = static_cast(atoi(row[67])); + e.factionmod2 = static_cast(atoi(row[68])); + e.factionmod3 = static_cast(atoi(row[69])); + e.factionmod4 = static_cast(atoi(row[70])); e.filename = row[71] ? row[71] : ""; - e.focuseffect = atoi(row[72]); - e.fr = atoi(row[73]); - e.fvnodrop = atoi(row[74]); - e.haste = atoi(row[75]); - e.clicklevel = atoi(row[76]); - e.hp = atoi(row[77]); - e.regen = atoi(row[78]); - e.icon = atoi(row[79]); + e.focuseffect = static_cast(atoi(row[72])); + e.fr = static_cast(atoi(row[73])); + e.fvnodrop = static_cast(atoi(row[74])); + e.haste = static_cast(atoi(row[75])); + e.clicklevel = static_cast(atoi(row[76])); + e.hp = static_cast(atoi(row[77])); + e.regen = static_cast(atoi(row[78])); + e.icon = static_cast(atoi(row[79])); e.idfile = row[80] ? row[80] : ""; - e.itemclass = atoi(row[81]); - e.itemtype = atoi(row[82]); - e.ldonprice = atoi(row[83]); - e.ldontheme = atoi(row[84]); - e.ldonsold = atoi(row[85]); - e.light = atoi(row[86]); + e.itemclass = static_cast(atoi(row[81])); + e.itemtype = static_cast(atoi(row[82])); + e.ldonprice = static_cast(atoi(row[83])); + e.ldontheme = static_cast(atoi(row[84])); + e.ldonsold = static_cast(atoi(row[85])); + e.light = static_cast(atoi(row[86])); e.lore = row[87] ? row[87] : ""; - e.loregroup = atoi(row[88]); - e.magic = atoi(row[89]); - e.mana = atoi(row[90]); - e.manaregen = atoi(row[91]); - e.enduranceregen = atoi(row[92]); - e.material = atoi(row[93]); - e.herosforgemodel = atoi(row[94]); - e.maxcharges = atoi(row[95]); - e.mr = atoi(row[96]); - e.nodrop = atoi(row[97]); - e.norent = atoi(row[98]); - e.pendingloreflag = atoi(row[99]); - e.pr = atoi(row[100]); - e.procrate = atoi(row[101]); - e.races = atoi(row[102]); - e.range = atoi(row[103]); - e.reclevel = atoi(row[104]); - e.recskill = atoi(row[105]); - e.reqlevel = atoi(row[106]); - e.sellrate = static_cast(atof(row[107])); - e.shielding = atoi(row[108]); - e.size = atoi(row[109]); - e.skillmodtype = atoi(row[110]); - e.skillmodvalue = atoi(row[111]); - e.slots = atoi(row[112]); - e.clickeffect = atoi(row[113]); - e.spellshield = atoi(row[114]); - e.strikethrough = atoi(row[115]); - e.stunresist = atoi(row[116]); - e.summonedflag = atoi(row[117]); - e.tradeskills = atoi(row[118]); - e.favor = atoi(row[119]); - e.weight = atoi(row[120]); - e.UNK012 = atoi(row[121]); - e.UNK013 = atoi(row[122]); - e.benefitflag = atoi(row[123]); - e.UNK054 = atoi(row[124]); - e.UNK059 = atoi(row[125]); - e.booktype = atoi(row[126]); - e.recastdelay = atoi(row[127]); - e.recasttype = atoi(row[128]); - e.guildfavor = atoi(row[129]); - e.UNK123 = atoi(row[130]); - e.UNK124 = atoi(row[131]); - e.attuneable = atoi(row[132]); - e.nopet = atoi(row[133]); + e.loregroup = static_cast(atoi(row[88])); + e.magic = static_cast(atoi(row[89])); + e.mana = static_cast(atoi(row[90])); + e.manaregen = static_cast(atoi(row[91])); + e.enduranceregen = static_cast(atoi(row[92])); + e.material = static_cast(atoi(row[93])); + e.herosforgemodel = static_cast(atoi(row[94])); + e.maxcharges = static_cast(atoi(row[95])); + e.mr = static_cast(atoi(row[96])); + e.nodrop = static_cast(atoi(row[97])); + e.norent = static_cast(atoi(row[98])); + e.pendingloreflag = static_cast(strtoul(row[99], nullptr, 10)); + e.pr = static_cast(atoi(row[100])); + e.procrate = static_cast(atoi(row[101])); + e.races = static_cast(atoi(row[102])); + e.range = static_cast(atoi(row[103])); + e.reclevel = static_cast(atoi(row[104])); + e.recskill = static_cast(atoi(row[105])); + e.reqlevel = static_cast(atoi(row[106])); + e.sellrate = strtof(row[107], nullptr); + e.shielding = static_cast(atoi(row[108])); + e.size = static_cast(atoi(row[109])); + e.skillmodtype = static_cast(atoi(row[110])); + e.skillmodvalue = static_cast(atoi(row[111])); + e.slots = static_cast(atoi(row[112])); + e.clickeffect = static_cast(atoi(row[113])); + e.spellshield = static_cast(atoi(row[114])); + e.strikethrough = static_cast(atoi(row[115])); + e.stunresist = static_cast(atoi(row[116])); + e.summonedflag = static_cast(strtoul(row[117], nullptr, 10)); + e.tradeskills = static_cast(atoi(row[118])); + e.favor = static_cast(atoi(row[119])); + e.weight = static_cast(atoi(row[120])); + e.UNK012 = static_cast(atoi(row[121])); + e.UNK013 = static_cast(atoi(row[122])); + e.benefitflag = static_cast(atoi(row[123])); + e.UNK054 = static_cast(atoi(row[124])); + e.UNK059 = static_cast(atoi(row[125])); + e.booktype = static_cast(atoi(row[126])); + e.recastdelay = static_cast(atoi(row[127])); + e.recasttype = static_cast(atoi(row[128])); + e.guildfavor = static_cast(atoi(row[129])); + e.UNK123 = static_cast(atoi(row[130])); + e.UNK124 = static_cast(atoi(row[131])); + e.attuneable = static_cast(atoi(row[132])); + e.nopet = static_cast(atoi(row[133])); e.updated = strtoll(row[134] ? row[134] : "-1", nullptr, 10); e.comment = row[135] ? row[135] : ""; - e.UNK127 = atoi(row[136]); - e.pointtype = atoi(row[137]); - e.potionbelt = atoi(row[138]); - e.potionbeltslots = atoi(row[139]); - e.stacksize = atoi(row[140]); - e.notransfer = atoi(row[141]); - e.stackable = atoi(row[142]); + e.UNK127 = static_cast(atoi(row[136])); + e.pointtype = static_cast(atoi(row[137])); + e.potionbelt = static_cast(atoi(row[138])); + e.potionbeltslots = static_cast(atoi(row[139])); + e.stacksize = static_cast(atoi(row[140])); + e.notransfer = static_cast(atoi(row[141])); + e.stackable = static_cast(atoi(row[142])); e.UNK134 = row[143] ? row[143] : ""; - e.UNK137 = atoi(row[144]); - e.proceffect = atoi(row[145]); - e.proctype = atoi(row[146]); - e.proclevel2 = atoi(row[147]); - e.proclevel = atoi(row[148]); - e.UNK142 = atoi(row[149]); - e.worneffect = atoi(row[150]); - e.worntype = atoi(row[151]); - e.wornlevel2 = atoi(row[152]); - e.wornlevel = atoi(row[153]); - e.UNK147 = atoi(row[154]); - e.focustype = atoi(row[155]); - e.focuslevel2 = atoi(row[156]); - e.focuslevel = atoi(row[157]); - e.UNK152 = atoi(row[158]); - e.scrolleffect = atoi(row[159]); - e.scrolltype = atoi(row[160]); - e.scrolllevel2 = atoi(row[161]); - e.scrolllevel = atoi(row[162]); - e.UNK157 = atoi(row[163]); + e.UNK137 = static_cast(atoi(row[144])); + e.proceffect = static_cast(atoi(row[145])); + e.proctype = static_cast(atoi(row[146])); + e.proclevel2 = static_cast(atoi(row[147])); + e.proclevel = static_cast(atoi(row[148])); + e.UNK142 = static_cast(atoi(row[149])); + e.worneffect = static_cast(atoi(row[150])); + e.worntype = static_cast(atoi(row[151])); + e.wornlevel2 = static_cast(atoi(row[152])); + e.wornlevel = static_cast(atoi(row[153])); + e.UNK147 = static_cast(atoi(row[154])); + e.focustype = static_cast(atoi(row[155])); + e.focuslevel2 = static_cast(atoi(row[156])); + e.focuslevel = static_cast(atoi(row[157])); + e.UNK152 = static_cast(atoi(row[158])); + e.scrolleffect = static_cast(atoi(row[159])); + e.scrolltype = static_cast(atoi(row[160])); + e.scrolllevel2 = static_cast(atoi(row[161])); + e.scrolllevel = static_cast(atoi(row[162])); + e.UNK157 = static_cast(atoi(row[163])); e.serialized = strtoll(row[164] ? row[164] : "-1", nullptr, 10); e.verified = strtoll(row[165] ? row[165] : "-1", nullptr, 10); e.serialization = row[166] ? row[166] : ""; e.source = row[167] ? row[167] : ""; - e.UNK033 = atoi(row[168]); + e.UNK033 = static_cast(atoi(row[168])); e.lorefile = row[169] ? row[169] : ""; - e.UNK014 = atoi(row[170]); - e.svcorruption = atoi(row[171]); - e.skillmodmax = atoi(row[172]); - e.UNK060 = atoi(row[173]); - e.augslot1unk2 = atoi(row[174]); - e.augslot2unk2 = atoi(row[175]); - e.augslot3unk2 = atoi(row[176]); - e.augslot4unk2 = atoi(row[177]); - e.augslot5unk2 = atoi(row[178]); - e.augslot6unk2 = atoi(row[179]); - e.UNK120 = atoi(row[180]); - e.UNK121 = atoi(row[181]); - e.questitemflag = atoi(row[182]); + e.UNK014 = static_cast(atoi(row[170])); + e.svcorruption = static_cast(atoi(row[171])); + e.skillmodmax = static_cast(atoi(row[172])); + e.UNK060 = static_cast(atoi(row[173])); + e.augslot1unk2 = static_cast(atoi(row[174])); + e.augslot2unk2 = static_cast(atoi(row[175])); + e.augslot3unk2 = static_cast(atoi(row[176])); + e.augslot4unk2 = static_cast(atoi(row[177])); + e.augslot5unk2 = static_cast(atoi(row[178])); + e.augslot6unk2 = static_cast(atoi(row[179])); + e.UNK120 = static_cast(atoi(row[180])); + e.UNK121 = static_cast(atoi(row[181])); + e.questitemflag = static_cast(atoi(row[182])); e.UNK132 = row[183] ? row[183] : ""; - e.clickunk5 = atoi(row[184]); + e.clickunk5 = static_cast(atoi(row[184])); e.clickunk6 = row[185] ? row[185] : ""; - e.clickunk7 = atoi(row[186]); - e.procunk1 = atoi(row[187]); - e.procunk2 = atoi(row[188]); - e.procunk3 = atoi(row[189]); - e.procunk4 = atoi(row[190]); + e.clickunk7 = static_cast(atoi(row[186])); + e.procunk1 = static_cast(atoi(row[187])); + e.procunk2 = static_cast(atoi(row[188])); + e.procunk3 = static_cast(atoi(row[189])); + e.procunk4 = static_cast(atoi(row[190])); e.procunk6 = row[191] ? row[191] : ""; - e.procunk7 = atoi(row[192]); - e.wornunk1 = atoi(row[193]); - e.wornunk2 = atoi(row[194]); - e.wornunk3 = atoi(row[195]); - e.wornunk4 = atoi(row[196]); - e.wornunk5 = atoi(row[197]); + e.procunk7 = static_cast(atoi(row[192])); + e.wornunk1 = static_cast(atoi(row[193])); + e.wornunk2 = static_cast(atoi(row[194])); + e.wornunk3 = static_cast(atoi(row[195])); + e.wornunk4 = static_cast(atoi(row[196])); + e.wornunk5 = static_cast(atoi(row[197])); e.wornunk6 = row[198] ? row[198] : ""; - e.wornunk7 = atoi(row[199]); - e.focusunk1 = atoi(row[200]); - e.focusunk2 = atoi(row[201]); - e.focusunk3 = atoi(row[202]); - e.focusunk4 = atoi(row[203]); - e.focusunk5 = atoi(row[204]); + e.wornunk7 = static_cast(atoi(row[199])); + e.focusunk1 = static_cast(atoi(row[200])); + e.focusunk2 = static_cast(atoi(row[201])); + e.focusunk3 = static_cast(atoi(row[202])); + e.focusunk4 = static_cast(atoi(row[203])); + e.focusunk5 = static_cast(atoi(row[204])); e.focusunk6 = row[205] ? row[205] : ""; - e.focusunk7 = atoi(row[206]); - e.scrollunk1 = atoi(row[207]); - e.scrollunk2 = atoi(row[208]); - e.scrollunk3 = atoi(row[209]); - e.scrollunk4 = atoi(row[210]); - e.scrollunk5 = atoi(row[211]); + e.focusunk7 = static_cast(atoi(row[206])); + e.scrollunk1 = static_cast(atoi(row[207])); + e.scrollunk2 = static_cast(atoi(row[208])); + e.scrollunk3 = static_cast(atoi(row[209])); + e.scrollunk4 = static_cast(atoi(row[210])); + e.scrollunk5 = static_cast(atoi(row[211])); e.scrollunk6 = row[212] ? row[212] : ""; - e.scrollunk7 = atoi(row[213]); - e.UNK193 = atoi(row[214]); - e.purity = atoi(row[215]); - e.evoitem = atoi(row[216]); - e.evoid = atoi(row[217]); - e.evolvinglevel = atoi(row[218]); - e.evomax = atoi(row[219]); + e.scrollunk7 = static_cast(atoi(row[213])); + e.UNK193 = static_cast(atoi(row[214])); + e.purity = static_cast(atoi(row[215])); + e.evoitem = static_cast(atoi(row[216])); + e.evoid = static_cast(atoi(row[217])); + e.evolvinglevel = static_cast(atoi(row[218])); + e.evomax = static_cast(atoi(row[219])); e.clickname = row[220] ? row[220] : ""; e.procname = row[221] ? row[221] : ""; e.wornname = row[222] ? row[222] : ""; e.focusname = row[223] ? row[223] : ""; e.scrollname = row[224] ? row[224] : ""; - e.dsmitigation = atoi(row[225]); - e.heroic_str = atoi(row[226]); - e.heroic_int = atoi(row[227]); - e.heroic_wis = atoi(row[228]); - e.heroic_agi = atoi(row[229]); - e.heroic_dex = atoi(row[230]); - e.heroic_sta = atoi(row[231]); - e.heroic_cha = atoi(row[232]); - e.heroic_pr = atoi(row[233]); - e.heroic_dr = atoi(row[234]); - e.heroic_fr = atoi(row[235]); - e.heroic_cr = atoi(row[236]); - e.heroic_mr = atoi(row[237]); - e.heroic_svcorrup = atoi(row[238]); - e.healamt = atoi(row[239]); - e.spelldmg = atoi(row[240]); - e.clairvoyance = atoi(row[241]); - e.backstabdmg = atoi(row[242]); + e.dsmitigation = static_cast(atoi(row[225])); + e.heroic_str = static_cast(atoi(row[226])); + e.heroic_int = static_cast(atoi(row[227])); + e.heroic_wis = static_cast(atoi(row[228])); + e.heroic_agi = static_cast(atoi(row[229])); + e.heroic_dex = static_cast(atoi(row[230])); + e.heroic_sta = static_cast(atoi(row[231])); + e.heroic_cha = static_cast(atoi(row[232])); + e.heroic_pr = static_cast(atoi(row[233])); + e.heroic_dr = static_cast(atoi(row[234])); + e.heroic_fr = static_cast(atoi(row[235])); + e.heroic_cr = static_cast(atoi(row[236])); + e.heroic_mr = static_cast(atoi(row[237])); + e.heroic_svcorrup = static_cast(atoi(row[238])); + e.healamt = static_cast(atoi(row[239])); + e.spelldmg = static_cast(atoi(row[240])); + e.clairvoyance = static_cast(atoi(row[241])); + e.backstabdmg = static_cast(atoi(row[242])); e.created = row[243] ? row[243] : ""; - e.elitematerial = atoi(row[244]); - e.ldonsellbackrate = atoi(row[245]); - e.scriptfileid = atoi(row[246]); - e.expendablearrow = atoi(row[247]); - e.powersourcecapacity = atoi(row[248]); - e.bardeffect = atoi(row[249]); - e.bardeffecttype = atoi(row[250]); - e.bardlevel2 = atoi(row[251]); - e.bardlevel = atoi(row[252]); - e.bardunk1 = atoi(row[253]); - e.bardunk2 = atoi(row[254]); - e.bardunk3 = atoi(row[255]); - e.bardunk4 = atoi(row[256]); - e.bardunk5 = atoi(row[257]); + e.elitematerial = static_cast(atoi(row[244])); + e.ldonsellbackrate = static_cast(atoi(row[245])); + e.scriptfileid = static_cast(atoi(row[246])); + e.expendablearrow = static_cast(atoi(row[247])); + e.powersourcecapacity = static_cast(atoi(row[248])); + e.bardeffect = static_cast(atoi(row[249])); + e.bardeffecttype = static_cast(atoi(row[250])); + e.bardlevel2 = static_cast(atoi(row[251])); + e.bardlevel = static_cast(atoi(row[252])); + e.bardunk1 = static_cast(atoi(row[253])); + e.bardunk2 = static_cast(atoi(row[254])); + e.bardunk3 = static_cast(atoi(row[255])); + e.bardunk4 = static_cast(atoi(row[256])); + e.bardunk5 = static_cast(atoi(row[257])); e.bardname = row[258] ? row[258] : ""; - e.bardunk7 = atoi(row[259]); - e.UNK214 = atoi(row[260]); - e.subtype = atoi(row[261]); - e.UNK220 = atoi(row[262]); - e.UNK221 = atoi(row[263]); - e.heirloom = atoi(row[264]); - e.UNK223 = atoi(row[265]); - e.UNK224 = atoi(row[266]); - e.UNK225 = atoi(row[267]); - e.UNK226 = atoi(row[268]); - e.UNK227 = atoi(row[269]); - e.UNK228 = atoi(row[270]); - e.UNK229 = atoi(row[271]); - e.UNK230 = atoi(row[272]); - e.UNK231 = atoi(row[273]); - e.UNK232 = atoi(row[274]); - e.UNK233 = atoi(row[275]); - e.UNK234 = atoi(row[276]); - e.placeable = atoi(row[277]); - e.UNK236 = atoi(row[278]); - e.UNK237 = atoi(row[279]); - e.UNK238 = atoi(row[280]); - e.UNK239 = atoi(row[281]); - e.UNK240 = atoi(row[282]); - e.UNK241 = atoi(row[283]); - e.epicitem = atoi(row[284]); + e.bardunk7 = static_cast(atoi(row[259])); + e.UNK214 = static_cast(atoi(row[260])); + e.subtype = static_cast(atoi(row[261])); + e.UNK220 = static_cast(atoi(row[262])); + e.UNK221 = static_cast(atoi(row[263])); + e.heirloom = static_cast(atoi(row[264])); + e.UNK223 = static_cast(atoi(row[265])); + e.UNK224 = static_cast(atoi(row[266])); + e.UNK225 = static_cast(atoi(row[267])); + e.UNK226 = static_cast(atoi(row[268])); + e.UNK227 = static_cast(atoi(row[269])); + e.UNK228 = static_cast(atoi(row[270])); + e.UNK229 = static_cast(atoi(row[271])); + e.UNK230 = static_cast(atoi(row[272])); + e.UNK231 = static_cast(atoi(row[273])); + e.UNK232 = static_cast(atoi(row[274])); + e.UNK233 = static_cast(atoi(row[275])); + e.UNK234 = static_cast(atoi(row[276])); + e.placeable = static_cast(atoi(row[277])); + e.UNK236 = static_cast(atoi(row[278])); + e.UNK237 = static_cast(atoi(row[279])); + e.UNK238 = static_cast(atoi(row[280])); + e.UNK239 = static_cast(atoi(row[281])); + e.UNK240 = static_cast(atoi(row[282])); + e.UNK241 = static_cast(atoi(row[283])); + e.epicitem = static_cast(atoi(row[284])); return e; } @@ -2506,291 +2506,291 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Items e{}; - e.id = atoi(row[0]); - e.minstatus = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.minstatus = static_cast(atoi(row[1])); e.Name = row[2] ? row[2] : ""; - e.aagi = atoi(row[3]); - e.ac = atoi(row[4]); - e.accuracy = atoi(row[5]); - e.acha = atoi(row[6]); - e.adex = atoi(row[7]); - e.aint = atoi(row[8]); - e.artifactflag = atoi(row[9]); - e.asta = atoi(row[10]); - e.astr = atoi(row[11]); - e.attack = atoi(row[12]); - e.augrestrict = atoi(row[13]); - e.augslot1type = atoi(row[14]); - e.augslot1visible = atoi(row[15]); - e.augslot2type = atoi(row[16]); - e.augslot2visible = atoi(row[17]); - e.augslot3type = atoi(row[18]); - e.augslot3visible = atoi(row[19]); - e.augslot4type = atoi(row[20]); - e.augslot4visible = atoi(row[21]); - e.augslot5type = atoi(row[22]); - e.augslot5visible = atoi(row[23]); - e.augslot6type = atoi(row[24]); - e.augslot6visible = atoi(row[25]); - e.augtype = atoi(row[26]); - e.avoidance = atoi(row[27]); - e.awis = atoi(row[28]); - e.bagsize = atoi(row[29]); - e.bagslots = atoi(row[30]); - e.bagtype = atoi(row[31]); - e.bagwr = atoi(row[32]); - e.banedmgamt = atoi(row[33]); - e.banedmgraceamt = atoi(row[34]); - e.banedmgbody = atoi(row[35]); - e.banedmgrace = atoi(row[36]); - e.bardtype = atoi(row[37]); - e.bardvalue = atoi(row[38]); - e.book = atoi(row[39]); - e.casttime = atoi(row[40]); - e.casttime_ = atoi(row[41]); + e.aagi = static_cast(atoi(row[3])); + e.ac = static_cast(atoi(row[4])); + e.accuracy = static_cast(atoi(row[5])); + e.acha = static_cast(atoi(row[6])); + e.adex = static_cast(atoi(row[7])); + e.aint = static_cast(atoi(row[8])); + e.artifactflag = static_cast(strtoul(row[9], nullptr, 10)); + e.asta = static_cast(atoi(row[10])); + e.astr = static_cast(atoi(row[11])); + e.attack = static_cast(atoi(row[12])); + e.augrestrict = static_cast(atoi(row[13])); + e.augslot1type = static_cast(atoi(row[14])); + e.augslot1visible = static_cast(atoi(row[15])); + e.augslot2type = static_cast(atoi(row[16])); + e.augslot2visible = static_cast(atoi(row[17])); + e.augslot3type = static_cast(atoi(row[18])); + e.augslot3visible = static_cast(atoi(row[19])); + e.augslot4type = static_cast(atoi(row[20])); + e.augslot4visible = static_cast(atoi(row[21])); + e.augslot5type = static_cast(atoi(row[22])); + e.augslot5visible = static_cast(atoi(row[23])); + e.augslot6type = static_cast(atoi(row[24])); + e.augslot6visible = static_cast(atoi(row[25])); + e.augtype = static_cast(atoi(row[26])); + e.avoidance = static_cast(atoi(row[27])); + e.awis = static_cast(atoi(row[28])); + e.bagsize = static_cast(atoi(row[29])); + e.bagslots = static_cast(atoi(row[30])); + e.bagtype = static_cast(atoi(row[31])); + e.bagwr = static_cast(atoi(row[32])); + e.banedmgamt = static_cast(atoi(row[33])); + e.banedmgraceamt = static_cast(atoi(row[34])); + e.banedmgbody = static_cast(atoi(row[35])); + e.banedmgrace = static_cast(atoi(row[36])); + e.bardtype = static_cast(atoi(row[37])); + e.bardvalue = static_cast(atoi(row[38])); + e.book = static_cast(atoi(row[39])); + e.casttime = static_cast(atoi(row[40])); + e.casttime_ = static_cast(atoi(row[41])); e.charmfile = row[42] ? row[42] : ""; e.charmfileid = row[43] ? row[43] : ""; - e.classes = atoi(row[44]); - e.color = atoi(row[45]); + e.classes = static_cast(atoi(row[44])); + e.color = static_cast(strtoul(row[45], nullptr, 10)); e.combateffects = row[46] ? row[46] : ""; - e.extradmgskill = atoi(row[47]); - e.extradmgamt = atoi(row[48]); - e.price = atoi(row[49]); - e.cr = atoi(row[50]); - e.damage = atoi(row[51]); - e.damageshield = atoi(row[52]); - e.deity = atoi(row[53]); - e.delay = atoi(row[54]); - e.augdistiller = atoi(row[55]); - e.dotshielding = atoi(row[56]); - e.dr = atoi(row[57]); - e.clicktype = atoi(row[58]); - e.clicklevel2 = atoi(row[59]); - e.elemdmgtype = atoi(row[60]); - e.elemdmgamt = atoi(row[61]); - e.endur = atoi(row[62]); - e.factionamt1 = atoi(row[63]); - e.factionamt2 = atoi(row[64]); - e.factionamt3 = atoi(row[65]); - e.factionamt4 = atoi(row[66]); - e.factionmod1 = atoi(row[67]); - e.factionmod2 = atoi(row[68]); - e.factionmod3 = atoi(row[69]); - e.factionmod4 = atoi(row[70]); + e.extradmgskill = static_cast(atoi(row[47])); + e.extradmgamt = static_cast(atoi(row[48])); + e.price = static_cast(atoi(row[49])); + e.cr = static_cast(atoi(row[50])); + e.damage = static_cast(atoi(row[51])); + e.damageshield = static_cast(atoi(row[52])); + e.deity = static_cast(atoi(row[53])); + e.delay = static_cast(atoi(row[54])); + e.augdistiller = static_cast(atoi(row[55])); + e.dotshielding = static_cast(atoi(row[56])); + e.dr = static_cast(atoi(row[57])); + e.clicktype = static_cast(atoi(row[58])); + e.clicklevel2 = static_cast(atoi(row[59])); + e.elemdmgtype = static_cast(atoi(row[60])); + e.elemdmgamt = static_cast(atoi(row[61])); + e.endur = static_cast(atoi(row[62])); + e.factionamt1 = static_cast(atoi(row[63])); + e.factionamt2 = static_cast(atoi(row[64])); + e.factionamt3 = static_cast(atoi(row[65])); + e.factionamt4 = static_cast(atoi(row[66])); + e.factionmod1 = static_cast(atoi(row[67])); + e.factionmod2 = static_cast(atoi(row[68])); + e.factionmod3 = static_cast(atoi(row[69])); + e.factionmod4 = static_cast(atoi(row[70])); e.filename = row[71] ? row[71] : ""; - e.focuseffect = atoi(row[72]); - e.fr = atoi(row[73]); - e.fvnodrop = atoi(row[74]); - e.haste = atoi(row[75]); - e.clicklevel = atoi(row[76]); - e.hp = atoi(row[77]); - e.regen = atoi(row[78]); - e.icon = atoi(row[79]); + e.focuseffect = static_cast(atoi(row[72])); + e.fr = static_cast(atoi(row[73])); + e.fvnodrop = static_cast(atoi(row[74])); + e.haste = static_cast(atoi(row[75])); + e.clicklevel = static_cast(atoi(row[76])); + e.hp = static_cast(atoi(row[77])); + e.regen = static_cast(atoi(row[78])); + e.icon = static_cast(atoi(row[79])); e.idfile = row[80] ? row[80] : ""; - e.itemclass = atoi(row[81]); - e.itemtype = atoi(row[82]); - e.ldonprice = atoi(row[83]); - e.ldontheme = atoi(row[84]); - e.ldonsold = atoi(row[85]); - e.light = atoi(row[86]); + e.itemclass = static_cast(atoi(row[81])); + e.itemtype = static_cast(atoi(row[82])); + e.ldonprice = static_cast(atoi(row[83])); + e.ldontheme = static_cast(atoi(row[84])); + e.ldonsold = static_cast(atoi(row[85])); + e.light = static_cast(atoi(row[86])); e.lore = row[87] ? row[87] : ""; - e.loregroup = atoi(row[88]); - e.magic = atoi(row[89]); - e.mana = atoi(row[90]); - e.manaregen = atoi(row[91]); - e.enduranceregen = atoi(row[92]); - e.material = atoi(row[93]); - e.herosforgemodel = atoi(row[94]); - e.maxcharges = atoi(row[95]); - e.mr = atoi(row[96]); - e.nodrop = atoi(row[97]); - e.norent = atoi(row[98]); - e.pendingloreflag = atoi(row[99]); - e.pr = atoi(row[100]); - e.procrate = atoi(row[101]); - e.races = atoi(row[102]); - e.range = atoi(row[103]); - e.reclevel = atoi(row[104]); - e.recskill = atoi(row[105]); - e.reqlevel = atoi(row[106]); - e.sellrate = static_cast(atof(row[107])); - e.shielding = atoi(row[108]); - e.size = atoi(row[109]); - e.skillmodtype = atoi(row[110]); - e.skillmodvalue = atoi(row[111]); - e.slots = atoi(row[112]); - e.clickeffect = atoi(row[113]); - e.spellshield = atoi(row[114]); - e.strikethrough = atoi(row[115]); - e.stunresist = atoi(row[116]); - e.summonedflag = atoi(row[117]); - e.tradeskills = atoi(row[118]); - e.favor = atoi(row[119]); - e.weight = atoi(row[120]); - e.UNK012 = atoi(row[121]); - e.UNK013 = atoi(row[122]); - e.benefitflag = atoi(row[123]); - e.UNK054 = atoi(row[124]); - e.UNK059 = atoi(row[125]); - e.booktype = atoi(row[126]); - e.recastdelay = atoi(row[127]); - e.recasttype = atoi(row[128]); - e.guildfavor = atoi(row[129]); - e.UNK123 = atoi(row[130]); - e.UNK124 = atoi(row[131]); - e.attuneable = atoi(row[132]); - e.nopet = atoi(row[133]); + e.loregroup = static_cast(atoi(row[88])); + e.magic = static_cast(atoi(row[89])); + e.mana = static_cast(atoi(row[90])); + e.manaregen = static_cast(atoi(row[91])); + e.enduranceregen = static_cast(atoi(row[92])); + e.material = static_cast(atoi(row[93])); + e.herosforgemodel = static_cast(atoi(row[94])); + e.maxcharges = static_cast(atoi(row[95])); + e.mr = static_cast(atoi(row[96])); + e.nodrop = static_cast(atoi(row[97])); + e.norent = static_cast(atoi(row[98])); + e.pendingloreflag = static_cast(strtoul(row[99], nullptr, 10)); + e.pr = static_cast(atoi(row[100])); + e.procrate = static_cast(atoi(row[101])); + e.races = static_cast(atoi(row[102])); + e.range = static_cast(atoi(row[103])); + e.reclevel = static_cast(atoi(row[104])); + e.recskill = static_cast(atoi(row[105])); + e.reqlevel = static_cast(atoi(row[106])); + e.sellrate = strtof(row[107], nullptr); + e.shielding = static_cast(atoi(row[108])); + e.size = static_cast(atoi(row[109])); + e.skillmodtype = static_cast(atoi(row[110])); + e.skillmodvalue = static_cast(atoi(row[111])); + e.slots = static_cast(atoi(row[112])); + e.clickeffect = static_cast(atoi(row[113])); + e.spellshield = static_cast(atoi(row[114])); + e.strikethrough = static_cast(atoi(row[115])); + e.stunresist = static_cast(atoi(row[116])); + e.summonedflag = static_cast(strtoul(row[117], nullptr, 10)); + e.tradeskills = static_cast(atoi(row[118])); + e.favor = static_cast(atoi(row[119])); + e.weight = static_cast(atoi(row[120])); + e.UNK012 = static_cast(atoi(row[121])); + e.UNK013 = static_cast(atoi(row[122])); + e.benefitflag = static_cast(atoi(row[123])); + e.UNK054 = static_cast(atoi(row[124])); + e.UNK059 = static_cast(atoi(row[125])); + e.booktype = static_cast(atoi(row[126])); + e.recastdelay = static_cast(atoi(row[127])); + e.recasttype = static_cast(atoi(row[128])); + e.guildfavor = static_cast(atoi(row[129])); + e.UNK123 = static_cast(atoi(row[130])); + e.UNK124 = static_cast(atoi(row[131])); + e.attuneable = static_cast(atoi(row[132])); + e.nopet = static_cast(atoi(row[133])); e.updated = strtoll(row[134] ? row[134] : "-1", nullptr, 10); e.comment = row[135] ? row[135] : ""; - e.UNK127 = atoi(row[136]); - e.pointtype = atoi(row[137]); - e.potionbelt = atoi(row[138]); - e.potionbeltslots = atoi(row[139]); - e.stacksize = atoi(row[140]); - e.notransfer = atoi(row[141]); - e.stackable = atoi(row[142]); + e.UNK127 = static_cast(atoi(row[136])); + e.pointtype = static_cast(atoi(row[137])); + e.potionbelt = static_cast(atoi(row[138])); + e.potionbeltslots = static_cast(atoi(row[139])); + e.stacksize = static_cast(atoi(row[140])); + e.notransfer = static_cast(atoi(row[141])); + e.stackable = static_cast(atoi(row[142])); e.UNK134 = row[143] ? row[143] : ""; - e.UNK137 = atoi(row[144]); - e.proceffect = atoi(row[145]); - e.proctype = atoi(row[146]); - e.proclevel2 = atoi(row[147]); - e.proclevel = atoi(row[148]); - e.UNK142 = atoi(row[149]); - e.worneffect = atoi(row[150]); - e.worntype = atoi(row[151]); - e.wornlevel2 = atoi(row[152]); - e.wornlevel = atoi(row[153]); - e.UNK147 = atoi(row[154]); - e.focustype = atoi(row[155]); - e.focuslevel2 = atoi(row[156]); - e.focuslevel = atoi(row[157]); - e.UNK152 = atoi(row[158]); - e.scrolleffect = atoi(row[159]); - e.scrolltype = atoi(row[160]); - e.scrolllevel2 = atoi(row[161]); - e.scrolllevel = atoi(row[162]); - e.UNK157 = atoi(row[163]); + e.UNK137 = static_cast(atoi(row[144])); + e.proceffect = static_cast(atoi(row[145])); + e.proctype = static_cast(atoi(row[146])); + e.proclevel2 = static_cast(atoi(row[147])); + e.proclevel = static_cast(atoi(row[148])); + e.UNK142 = static_cast(atoi(row[149])); + e.worneffect = static_cast(atoi(row[150])); + e.worntype = static_cast(atoi(row[151])); + e.wornlevel2 = static_cast(atoi(row[152])); + e.wornlevel = static_cast(atoi(row[153])); + e.UNK147 = static_cast(atoi(row[154])); + e.focustype = static_cast(atoi(row[155])); + e.focuslevel2 = static_cast(atoi(row[156])); + e.focuslevel = static_cast(atoi(row[157])); + e.UNK152 = static_cast(atoi(row[158])); + e.scrolleffect = static_cast(atoi(row[159])); + e.scrolltype = static_cast(atoi(row[160])); + e.scrolllevel2 = static_cast(atoi(row[161])); + e.scrolllevel = static_cast(atoi(row[162])); + e.UNK157 = static_cast(atoi(row[163])); e.serialized = strtoll(row[164] ? row[164] : "-1", nullptr, 10); e.verified = strtoll(row[165] ? row[165] : "-1", nullptr, 10); e.serialization = row[166] ? row[166] : ""; e.source = row[167] ? row[167] : ""; - e.UNK033 = atoi(row[168]); + e.UNK033 = static_cast(atoi(row[168])); e.lorefile = row[169] ? row[169] : ""; - e.UNK014 = atoi(row[170]); - e.svcorruption = atoi(row[171]); - e.skillmodmax = atoi(row[172]); - e.UNK060 = atoi(row[173]); - e.augslot1unk2 = atoi(row[174]); - e.augslot2unk2 = atoi(row[175]); - e.augslot3unk2 = atoi(row[176]); - e.augslot4unk2 = atoi(row[177]); - e.augslot5unk2 = atoi(row[178]); - e.augslot6unk2 = atoi(row[179]); - e.UNK120 = atoi(row[180]); - e.UNK121 = atoi(row[181]); - e.questitemflag = atoi(row[182]); + e.UNK014 = static_cast(atoi(row[170])); + e.svcorruption = static_cast(atoi(row[171])); + e.skillmodmax = static_cast(atoi(row[172])); + e.UNK060 = static_cast(atoi(row[173])); + e.augslot1unk2 = static_cast(atoi(row[174])); + e.augslot2unk2 = static_cast(atoi(row[175])); + e.augslot3unk2 = static_cast(atoi(row[176])); + e.augslot4unk2 = static_cast(atoi(row[177])); + e.augslot5unk2 = static_cast(atoi(row[178])); + e.augslot6unk2 = static_cast(atoi(row[179])); + e.UNK120 = static_cast(atoi(row[180])); + e.UNK121 = static_cast(atoi(row[181])); + e.questitemflag = static_cast(atoi(row[182])); e.UNK132 = row[183] ? row[183] : ""; - e.clickunk5 = atoi(row[184]); + e.clickunk5 = static_cast(atoi(row[184])); e.clickunk6 = row[185] ? row[185] : ""; - e.clickunk7 = atoi(row[186]); - e.procunk1 = atoi(row[187]); - e.procunk2 = atoi(row[188]); - e.procunk3 = atoi(row[189]); - e.procunk4 = atoi(row[190]); + e.clickunk7 = static_cast(atoi(row[186])); + e.procunk1 = static_cast(atoi(row[187])); + e.procunk2 = static_cast(atoi(row[188])); + e.procunk3 = static_cast(atoi(row[189])); + e.procunk4 = static_cast(atoi(row[190])); e.procunk6 = row[191] ? row[191] : ""; - e.procunk7 = atoi(row[192]); - e.wornunk1 = atoi(row[193]); - e.wornunk2 = atoi(row[194]); - e.wornunk3 = atoi(row[195]); - e.wornunk4 = atoi(row[196]); - e.wornunk5 = atoi(row[197]); + e.procunk7 = static_cast(atoi(row[192])); + e.wornunk1 = static_cast(atoi(row[193])); + e.wornunk2 = static_cast(atoi(row[194])); + e.wornunk3 = static_cast(atoi(row[195])); + e.wornunk4 = static_cast(atoi(row[196])); + e.wornunk5 = static_cast(atoi(row[197])); e.wornunk6 = row[198] ? row[198] : ""; - e.wornunk7 = atoi(row[199]); - e.focusunk1 = atoi(row[200]); - e.focusunk2 = atoi(row[201]); - e.focusunk3 = atoi(row[202]); - e.focusunk4 = atoi(row[203]); - e.focusunk5 = atoi(row[204]); + e.wornunk7 = static_cast(atoi(row[199])); + e.focusunk1 = static_cast(atoi(row[200])); + e.focusunk2 = static_cast(atoi(row[201])); + e.focusunk3 = static_cast(atoi(row[202])); + e.focusunk4 = static_cast(atoi(row[203])); + e.focusunk5 = static_cast(atoi(row[204])); e.focusunk6 = row[205] ? row[205] : ""; - e.focusunk7 = atoi(row[206]); - e.scrollunk1 = atoi(row[207]); - e.scrollunk2 = atoi(row[208]); - e.scrollunk3 = atoi(row[209]); - e.scrollunk4 = atoi(row[210]); - e.scrollunk5 = atoi(row[211]); + e.focusunk7 = static_cast(atoi(row[206])); + e.scrollunk1 = static_cast(atoi(row[207])); + e.scrollunk2 = static_cast(atoi(row[208])); + e.scrollunk3 = static_cast(atoi(row[209])); + e.scrollunk4 = static_cast(atoi(row[210])); + e.scrollunk5 = static_cast(atoi(row[211])); e.scrollunk6 = row[212] ? row[212] : ""; - e.scrollunk7 = atoi(row[213]); - e.UNK193 = atoi(row[214]); - e.purity = atoi(row[215]); - e.evoitem = atoi(row[216]); - e.evoid = atoi(row[217]); - e.evolvinglevel = atoi(row[218]); - e.evomax = atoi(row[219]); + e.scrollunk7 = static_cast(atoi(row[213])); + e.UNK193 = static_cast(atoi(row[214])); + e.purity = static_cast(atoi(row[215])); + e.evoitem = static_cast(atoi(row[216])); + e.evoid = static_cast(atoi(row[217])); + e.evolvinglevel = static_cast(atoi(row[218])); + e.evomax = static_cast(atoi(row[219])); e.clickname = row[220] ? row[220] : ""; e.procname = row[221] ? row[221] : ""; e.wornname = row[222] ? row[222] : ""; e.focusname = row[223] ? row[223] : ""; e.scrollname = row[224] ? row[224] : ""; - e.dsmitigation = atoi(row[225]); - e.heroic_str = atoi(row[226]); - e.heroic_int = atoi(row[227]); - e.heroic_wis = atoi(row[228]); - e.heroic_agi = atoi(row[229]); - e.heroic_dex = atoi(row[230]); - e.heroic_sta = atoi(row[231]); - e.heroic_cha = atoi(row[232]); - e.heroic_pr = atoi(row[233]); - e.heroic_dr = atoi(row[234]); - e.heroic_fr = atoi(row[235]); - e.heroic_cr = atoi(row[236]); - e.heroic_mr = atoi(row[237]); - e.heroic_svcorrup = atoi(row[238]); - e.healamt = atoi(row[239]); - e.spelldmg = atoi(row[240]); - e.clairvoyance = atoi(row[241]); - e.backstabdmg = atoi(row[242]); + e.dsmitigation = static_cast(atoi(row[225])); + e.heroic_str = static_cast(atoi(row[226])); + e.heroic_int = static_cast(atoi(row[227])); + e.heroic_wis = static_cast(atoi(row[228])); + e.heroic_agi = static_cast(atoi(row[229])); + e.heroic_dex = static_cast(atoi(row[230])); + e.heroic_sta = static_cast(atoi(row[231])); + e.heroic_cha = static_cast(atoi(row[232])); + e.heroic_pr = static_cast(atoi(row[233])); + e.heroic_dr = static_cast(atoi(row[234])); + e.heroic_fr = static_cast(atoi(row[235])); + e.heroic_cr = static_cast(atoi(row[236])); + e.heroic_mr = static_cast(atoi(row[237])); + e.heroic_svcorrup = static_cast(atoi(row[238])); + e.healamt = static_cast(atoi(row[239])); + e.spelldmg = static_cast(atoi(row[240])); + e.clairvoyance = static_cast(atoi(row[241])); + e.backstabdmg = static_cast(atoi(row[242])); e.created = row[243] ? row[243] : ""; - e.elitematerial = atoi(row[244]); - e.ldonsellbackrate = atoi(row[245]); - e.scriptfileid = atoi(row[246]); - e.expendablearrow = atoi(row[247]); - e.powersourcecapacity = atoi(row[248]); - e.bardeffect = atoi(row[249]); - e.bardeffecttype = atoi(row[250]); - e.bardlevel2 = atoi(row[251]); - e.bardlevel = atoi(row[252]); - e.bardunk1 = atoi(row[253]); - e.bardunk2 = atoi(row[254]); - e.bardunk3 = atoi(row[255]); - e.bardunk4 = atoi(row[256]); - e.bardunk5 = atoi(row[257]); + e.elitematerial = static_cast(atoi(row[244])); + e.ldonsellbackrate = static_cast(atoi(row[245])); + e.scriptfileid = static_cast(atoi(row[246])); + e.expendablearrow = static_cast(atoi(row[247])); + e.powersourcecapacity = static_cast(atoi(row[248])); + e.bardeffect = static_cast(atoi(row[249])); + e.bardeffecttype = static_cast(atoi(row[250])); + e.bardlevel2 = static_cast(atoi(row[251])); + e.bardlevel = static_cast(atoi(row[252])); + e.bardunk1 = static_cast(atoi(row[253])); + e.bardunk2 = static_cast(atoi(row[254])); + e.bardunk3 = static_cast(atoi(row[255])); + e.bardunk4 = static_cast(atoi(row[256])); + e.bardunk5 = static_cast(atoi(row[257])); e.bardname = row[258] ? row[258] : ""; - e.bardunk7 = atoi(row[259]); - e.UNK214 = atoi(row[260]); - e.subtype = atoi(row[261]); - e.UNK220 = atoi(row[262]); - e.UNK221 = atoi(row[263]); - e.heirloom = atoi(row[264]); - e.UNK223 = atoi(row[265]); - e.UNK224 = atoi(row[266]); - e.UNK225 = atoi(row[267]); - e.UNK226 = atoi(row[268]); - e.UNK227 = atoi(row[269]); - e.UNK228 = atoi(row[270]); - e.UNK229 = atoi(row[271]); - e.UNK230 = atoi(row[272]); - e.UNK231 = atoi(row[273]); - e.UNK232 = atoi(row[274]); - e.UNK233 = atoi(row[275]); - e.UNK234 = atoi(row[276]); - e.placeable = atoi(row[277]); - e.UNK236 = atoi(row[278]); - e.UNK237 = atoi(row[279]); - e.UNK238 = atoi(row[280]); - e.UNK239 = atoi(row[281]); - e.UNK240 = atoi(row[282]); - e.UNK241 = atoi(row[283]); - e.epicitem = atoi(row[284]); + e.bardunk7 = static_cast(atoi(row[259])); + e.UNK214 = static_cast(atoi(row[260])); + e.subtype = static_cast(atoi(row[261])); + e.UNK220 = static_cast(atoi(row[262])); + e.UNK221 = static_cast(atoi(row[263])); + e.heirloom = static_cast(atoi(row[264])); + e.UNK223 = static_cast(atoi(row[265])); + e.UNK224 = static_cast(atoi(row[266])); + e.UNK225 = static_cast(atoi(row[267])); + e.UNK226 = static_cast(atoi(row[268])); + e.UNK227 = static_cast(atoi(row[269])); + e.UNK228 = static_cast(atoi(row[270])); + e.UNK229 = static_cast(atoi(row[271])); + e.UNK230 = static_cast(atoi(row[272])); + e.UNK231 = static_cast(atoi(row[273])); + e.UNK232 = static_cast(atoi(row[274])); + e.UNK233 = static_cast(atoi(row[275])); + e.UNK234 = static_cast(atoi(row[276])); + e.placeable = static_cast(atoi(row[277])); + e.UNK236 = static_cast(atoi(row[278])); + e.UNK237 = static_cast(atoi(row[279])); + e.UNK238 = static_cast(atoi(row[280])); + e.UNK239 = static_cast(atoi(row[281])); + e.UNK240 = static_cast(atoi(row[282])); + e.UNK241 = static_cast(atoi(row[283])); + e.epicitem = static_cast(atoi(row[284])); all_entries.push_back(e); } @@ -2815,291 +2815,291 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Items e{}; - e.id = atoi(row[0]); - e.minstatus = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.minstatus = static_cast(atoi(row[1])); e.Name = row[2] ? row[2] : ""; - e.aagi = atoi(row[3]); - e.ac = atoi(row[4]); - e.accuracy = atoi(row[5]); - e.acha = atoi(row[6]); - e.adex = atoi(row[7]); - e.aint = atoi(row[8]); - e.artifactflag = atoi(row[9]); - e.asta = atoi(row[10]); - e.astr = atoi(row[11]); - e.attack = atoi(row[12]); - e.augrestrict = atoi(row[13]); - e.augslot1type = atoi(row[14]); - e.augslot1visible = atoi(row[15]); - e.augslot2type = atoi(row[16]); - e.augslot2visible = atoi(row[17]); - e.augslot3type = atoi(row[18]); - e.augslot3visible = atoi(row[19]); - e.augslot4type = atoi(row[20]); - e.augslot4visible = atoi(row[21]); - e.augslot5type = atoi(row[22]); - e.augslot5visible = atoi(row[23]); - e.augslot6type = atoi(row[24]); - e.augslot6visible = atoi(row[25]); - e.augtype = atoi(row[26]); - e.avoidance = atoi(row[27]); - e.awis = atoi(row[28]); - e.bagsize = atoi(row[29]); - e.bagslots = atoi(row[30]); - e.bagtype = atoi(row[31]); - e.bagwr = atoi(row[32]); - e.banedmgamt = atoi(row[33]); - e.banedmgraceamt = atoi(row[34]); - e.banedmgbody = atoi(row[35]); - e.banedmgrace = atoi(row[36]); - e.bardtype = atoi(row[37]); - e.bardvalue = atoi(row[38]); - e.book = atoi(row[39]); - e.casttime = atoi(row[40]); - e.casttime_ = atoi(row[41]); + e.aagi = static_cast(atoi(row[3])); + e.ac = static_cast(atoi(row[4])); + e.accuracy = static_cast(atoi(row[5])); + e.acha = static_cast(atoi(row[6])); + e.adex = static_cast(atoi(row[7])); + e.aint = static_cast(atoi(row[8])); + e.artifactflag = static_cast(strtoul(row[9], nullptr, 10)); + e.asta = static_cast(atoi(row[10])); + e.astr = static_cast(atoi(row[11])); + e.attack = static_cast(atoi(row[12])); + e.augrestrict = static_cast(atoi(row[13])); + e.augslot1type = static_cast(atoi(row[14])); + e.augslot1visible = static_cast(atoi(row[15])); + e.augslot2type = static_cast(atoi(row[16])); + e.augslot2visible = static_cast(atoi(row[17])); + e.augslot3type = static_cast(atoi(row[18])); + e.augslot3visible = static_cast(atoi(row[19])); + e.augslot4type = static_cast(atoi(row[20])); + e.augslot4visible = static_cast(atoi(row[21])); + e.augslot5type = static_cast(atoi(row[22])); + e.augslot5visible = static_cast(atoi(row[23])); + e.augslot6type = static_cast(atoi(row[24])); + e.augslot6visible = static_cast(atoi(row[25])); + e.augtype = static_cast(atoi(row[26])); + e.avoidance = static_cast(atoi(row[27])); + e.awis = static_cast(atoi(row[28])); + e.bagsize = static_cast(atoi(row[29])); + e.bagslots = static_cast(atoi(row[30])); + e.bagtype = static_cast(atoi(row[31])); + e.bagwr = static_cast(atoi(row[32])); + e.banedmgamt = static_cast(atoi(row[33])); + e.banedmgraceamt = static_cast(atoi(row[34])); + e.banedmgbody = static_cast(atoi(row[35])); + e.banedmgrace = static_cast(atoi(row[36])); + e.bardtype = static_cast(atoi(row[37])); + e.bardvalue = static_cast(atoi(row[38])); + e.book = static_cast(atoi(row[39])); + e.casttime = static_cast(atoi(row[40])); + e.casttime_ = static_cast(atoi(row[41])); e.charmfile = row[42] ? row[42] : ""; e.charmfileid = row[43] ? row[43] : ""; - e.classes = atoi(row[44]); - e.color = atoi(row[45]); + e.classes = static_cast(atoi(row[44])); + e.color = static_cast(strtoul(row[45], nullptr, 10)); e.combateffects = row[46] ? row[46] : ""; - e.extradmgskill = atoi(row[47]); - e.extradmgamt = atoi(row[48]); - e.price = atoi(row[49]); - e.cr = atoi(row[50]); - e.damage = atoi(row[51]); - e.damageshield = atoi(row[52]); - e.deity = atoi(row[53]); - e.delay = atoi(row[54]); - e.augdistiller = atoi(row[55]); - e.dotshielding = atoi(row[56]); - e.dr = atoi(row[57]); - e.clicktype = atoi(row[58]); - e.clicklevel2 = atoi(row[59]); - e.elemdmgtype = atoi(row[60]); - e.elemdmgamt = atoi(row[61]); - e.endur = atoi(row[62]); - e.factionamt1 = atoi(row[63]); - e.factionamt2 = atoi(row[64]); - e.factionamt3 = atoi(row[65]); - e.factionamt4 = atoi(row[66]); - e.factionmod1 = atoi(row[67]); - e.factionmod2 = atoi(row[68]); - e.factionmod3 = atoi(row[69]); - e.factionmod4 = atoi(row[70]); + e.extradmgskill = static_cast(atoi(row[47])); + e.extradmgamt = static_cast(atoi(row[48])); + e.price = static_cast(atoi(row[49])); + e.cr = static_cast(atoi(row[50])); + e.damage = static_cast(atoi(row[51])); + e.damageshield = static_cast(atoi(row[52])); + e.deity = static_cast(atoi(row[53])); + e.delay = static_cast(atoi(row[54])); + e.augdistiller = static_cast(atoi(row[55])); + e.dotshielding = static_cast(atoi(row[56])); + e.dr = static_cast(atoi(row[57])); + e.clicktype = static_cast(atoi(row[58])); + e.clicklevel2 = static_cast(atoi(row[59])); + e.elemdmgtype = static_cast(atoi(row[60])); + e.elemdmgamt = static_cast(atoi(row[61])); + e.endur = static_cast(atoi(row[62])); + e.factionamt1 = static_cast(atoi(row[63])); + e.factionamt2 = static_cast(atoi(row[64])); + e.factionamt3 = static_cast(atoi(row[65])); + e.factionamt4 = static_cast(atoi(row[66])); + e.factionmod1 = static_cast(atoi(row[67])); + e.factionmod2 = static_cast(atoi(row[68])); + e.factionmod3 = static_cast(atoi(row[69])); + e.factionmod4 = static_cast(atoi(row[70])); e.filename = row[71] ? row[71] : ""; - e.focuseffect = atoi(row[72]); - e.fr = atoi(row[73]); - e.fvnodrop = atoi(row[74]); - e.haste = atoi(row[75]); - e.clicklevel = atoi(row[76]); - e.hp = atoi(row[77]); - e.regen = atoi(row[78]); - e.icon = atoi(row[79]); + e.focuseffect = static_cast(atoi(row[72])); + e.fr = static_cast(atoi(row[73])); + e.fvnodrop = static_cast(atoi(row[74])); + e.haste = static_cast(atoi(row[75])); + e.clicklevel = static_cast(atoi(row[76])); + e.hp = static_cast(atoi(row[77])); + e.regen = static_cast(atoi(row[78])); + e.icon = static_cast(atoi(row[79])); e.idfile = row[80] ? row[80] : ""; - e.itemclass = atoi(row[81]); - e.itemtype = atoi(row[82]); - e.ldonprice = atoi(row[83]); - e.ldontheme = atoi(row[84]); - e.ldonsold = atoi(row[85]); - e.light = atoi(row[86]); + e.itemclass = static_cast(atoi(row[81])); + e.itemtype = static_cast(atoi(row[82])); + e.ldonprice = static_cast(atoi(row[83])); + e.ldontheme = static_cast(atoi(row[84])); + e.ldonsold = static_cast(atoi(row[85])); + e.light = static_cast(atoi(row[86])); e.lore = row[87] ? row[87] : ""; - e.loregroup = atoi(row[88]); - e.magic = atoi(row[89]); - e.mana = atoi(row[90]); - e.manaregen = atoi(row[91]); - e.enduranceregen = atoi(row[92]); - e.material = atoi(row[93]); - e.herosforgemodel = atoi(row[94]); - e.maxcharges = atoi(row[95]); - e.mr = atoi(row[96]); - e.nodrop = atoi(row[97]); - e.norent = atoi(row[98]); - e.pendingloreflag = atoi(row[99]); - e.pr = atoi(row[100]); - e.procrate = atoi(row[101]); - e.races = atoi(row[102]); - e.range = atoi(row[103]); - e.reclevel = atoi(row[104]); - e.recskill = atoi(row[105]); - e.reqlevel = atoi(row[106]); - e.sellrate = static_cast(atof(row[107])); - e.shielding = atoi(row[108]); - e.size = atoi(row[109]); - e.skillmodtype = atoi(row[110]); - e.skillmodvalue = atoi(row[111]); - e.slots = atoi(row[112]); - e.clickeffect = atoi(row[113]); - e.spellshield = atoi(row[114]); - e.strikethrough = atoi(row[115]); - e.stunresist = atoi(row[116]); - e.summonedflag = atoi(row[117]); - e.tradeskills = atoi(row[118]); - e.favor = atoi(row[119]); - e.weight = atoi(row[120]); - e.UNK012 = atoi(row[121]); - e.UNK013 = atoi(row[122]); - e.benefitflag = atoi(row[123]); - e.UNK054 = atoi(row[124]); - e.UNK059 = atoi(row[125]); - e.booktype = atoi(row[126]); - e.recastdelay = atoi(row[127]); - e.recasttype = atoi(row[128]); - e.guildfavor = atoi(row[129]); - e.UNK123 = atoi(row[130]); - e.UNK124 = atoi(row[131]); - e.attuneable = atoi(row[132]); - e.nopet = atoi(row[133]); + e.loregroup = static_cast(atoi(row[88])); + e.magic = static_cast(atoi(row[89])); + e.mana = static_cast(atoi(row[90])); + e.manaregen = static_cast(atoi(row[91])); + e.enduranceregen = static_cast(atoi(row[92])); + e.material = static_cast(atoi(row[93])); + e.herosforgemodel = static_cast(atoi(row[94])); + e.maxcharges = static_cast(atoi(row[95])); + e.mr = static_cast(atoi(row[96])); + e.nodrop = static_cast(atoi(row[97])); + e.norent = static_cast(atoi(row[98])); + e.pendingloreflag = static_cast(strtoul(row[99], nullptr, 10)); + e.pr = static_cast(atoi(row[100])); + e.procrate = static_cast(atoi(row[101])); + e.races = static_cast(atoi(row[102])); + e.range = static_cast(atoi(row[103])); + e.reclevel = static_cast(atoi(row[104])); + e.recskill = static_cast(atoi(row[105])); + e.reqlevel = static_cast(atoi(row[106])); + e.sellrate = strtof(row[107], nullptr); + e.shielding = static_cast(atoi(row[108])); + e.size = static_cast(atoi(row[109])); + e.skillmodtype = static_cast(atoi(row[110])); + e.skillmodvalue = static_cast(atoi(row[111])); + e.slots = static_cast(atoi(row[112])); + e.clickeffect = static_cast(atoi(row[113])); + e.spellshield = static_cast(atoi(row[114])); + e.strikethrough = static_cast(atoi(row[115])); + e.stunresist = static_cast(atoi(row[116])); + e.summonedflag = static_cast(strtoul(row[117], nullptr, 10)); + e.tradeskills = static_cast(atoi(row[118])); + e.favor = static_cast(atoi(row[119])); + e.weight = static_cast(atoi(row[120])); + e.UNK012 = static_cast(atoi(row[121])); + e.UNK013 = static_cast(atoi(row[122])); + e.benefitflag = static_cast(atoi(row[123])); + e.UNK054 = static_cast(atoi(row[124])); + e.UNK059 = static_cast(atoi(row[125])); + e.booktype = static_cast(atoi(row[126])); + e.recastdelay = static_cast(atoi(row[127])); + e.recasttype = static_cast(atoi(row[128])); + e.guildfavor = static_cast(atoi(row[129])); + e.UNK123 = static_cast(atoi(row[130])); + e.UNK124 = static_cast(atoi(row[131])); + e.attuneable = static_cast(atoi(row[132])); + e.nopet = static_cast(atoi(row[133])); e.updated = strtoll(row[134] ? row[134] : "-1", nullptr, 10); e.comment = row[135] ? row[135] : ""; - e.UNK127 = atoi(row[136]); - e.pointtype = atoi(row[137]); - e.potionbelt = atoi(row[138]); - e.potionbeltslots = atoi(row[139]); - e.stacksize = atoi(row[140]); - e.notransfer = atoi(row[141]); - e.stackable = atoi(row[142]); + e.UNK127 = static_cast(atoi(row[136])); + e.pointtype = static_cast(atoi(row[137])); + e.potionbelt = static_cast(atoi(row[138])); + e.potionbeltslots = static_cast(atoi(row[139])); + e.stacksize = static_cast(atoi(row[140])); + e.notransfer = static_cast(atoi(row[141])); + e.stackable = static_cast(atoi(row[142])); e.UNK134 = row[143] ? row[143] : ""; - e.UNK137 = atoi(row[144]); - e.proceffect = atoi(row[145]); - e.proctype = atoi(row[146]); - e.proclevel2 = atoi(row[147]); - e.proclevel = atoi(row[148]); - e.UNK142 = atoi(row[149]); - e.worneffect = atoi(row[150]); - e.worntype = atoi(row[151]); - e.wornlevel2 = atoi(row[152]); - e.wornlevel = atoi(row[153]); - e.UNK147 = atoi(row[154]); - e.focustype = atoi(row[155]); - e.focuslevel2 = atoi(row[156]); - e.focuslevel = atoi(row[157]); - e.UNK152 = atoi(row[158]); - e.scrolleffect = atoi(row[159]); - e.scrolltype = atoi(row[160]); - e.scrolllevel2 = atoi(row[161]); - e.scrolllevel = atoi(row[162]); - e.UNK157 = atoi(row[163]); + e.UNK137 = static_cast(atoi(row[144])); + e.proceffect = static_cast(atoi(row[145])); + e.proctype = static_cast(atoi(row[146])); + e.proclevel2 = static_cast(atoi(row[147])); + e.proclevel = static_cast(atoi(row[148])); + e.UNK142 = static_cast(atoi(row[149])); + e.worneffect = static_cast(atoi(row[150])); + e.worntype = static_cast(atoi(row[151])); + e.wornlevel2 = static_cast(atoi(row[152])); + e.wornlevel = static_cast(atoi(row[153])); + e.UNK147 = static_cast(atoi(row[154])); + e.focustype = static_cast(atoi(row[155])); + e.focuslevel2 = static_cast(atoi(row[156])); + e.focuslevel = static_cast(atoi(row[157])); + e.UNK152 = static_cast(atoi(row[158])); + e.scrolleffect = static_cast(atoi(row[159])); + e.scrolltype = static_cast(atoi(row[160])); + e.scrolllevel2 = static_cast(atoi(row[161])); + e.scrolllevel = static_cast(atoi(row[162])); + e.UNK157 = static_cast(atoi(row[163])); e.serialized = strtoll(row[164] ? row[164] : "-1", nullptr, 10); e.verified = strtoll(row[165] ? row[165] : "-1", nullptr, 10); e.serialization = row[166] ? row[166] : ""; e.source = row[167] ? row[167] : ""; - e.UNK033 = atoi(row[168]); + e.UNK033 = static_cast(atoi(row[168])); e.lorefile = row[169] ? row[169] : ""; - e.UNK014 = atoi(row[170]); - e.svcorruption = atoi(row[171]); - e.skillmodmax = atoi(row[172]); - e.UNK060 = atoi(row[173]); - e.augslot1unk2 = atoi(row[174]); - e.augslot2unk2 = atoi(row[175]); - e.augslot3unk2 = atoi(row[176]); - e.augslot4unk2 = atoi(row[177]); - e.augslot5unk2 = atoi(row[178]); - e.augslot6unk2 = atoi(row[179]); - e.UNK120 = atoi(row[180]); - e.UNK121 = atoi(row[181]); - e.questitemflag = atoi(row[182]); + e.UNK014 = static_cast(atoi(row[170])); + e.svcorruption = static_cast(atoi(row[171])); + e.skillmodmax = static_cast(atoi(row[172])); + e.UNK060 = static_cast(atoi(row[173])); + e.augslot1unk2 = static_cast(atoi(row[174])); + e.augslot2unk2 = static_cast(atoi(row[175])); + e.augslot3unk2 = static_cast(atoi(row[176])); + e.augslot4unk2 = static_cast(atoi(row[177])); + e.augslot5unk2 = static_cast(atoi(row[178])); + e.augslot6unk2 = static_cast(atoi(row[179])); + e.UNK120 = static_cast(atoi(row[180])); + e.UNK121 = static_cast(atoi(row[181])); + e.questitemflag = static_cast(atoi(row[182])); e.UNK132 = row[183] ? row[183] : ""; - e.clickunk5 = atoi(row[184]); + e.clickunk5 = static_cast(atoi(row[184])); e.clickunk6 = row[185] ? row[185] : ""; - e.clickunk7 = atoi(row[186]); - e.procunk1 = atoi(row[187]); - e.procunk2 = atoi(row[188]); - e.procunk3 = atoi(row[189]); - e.procunk4 = atoi(row[190]); + e.clickunk7 = static_cast(atoi(row[186])); + e.procunk1 = static_cast(atoi(row[187])); + e.procunk2 = static_cast(atoi(row[188])); + e.procunk3 = static_cast(atoi(row[189])); + e.procunk4 = static_cast(atoi(row[190])); e.procunk6 = row[191] ? row[191] : ""; - e.procunk7 = atoi(row[192]); - e.wornunk1 = atoi(row[193]); - e.wornunk2 = atoi(row[194]); - e.wornunk3 = atoi(row[195]); - e.wornunk4 = atoi(row[196]); - e.wornunk5 = atoi(row[197]); + e.procunk7 = static_cast(atoi(row[192])); + e.wornunk1 = static_cast(atoi(row[193])); + e.wornunk2 = static_cast(atoi(row[194])); + e.wornunk3 = static_cast(atoi(row[195])); + e.wornunk4 = static_cast(atoi(row[196])); + e.wornunk5 = static_cast(atoi(row[197])); e.wornunk6 = row[198] ? row[198] : ""; - e.wornunk7 = atoi(row[199]); - e.focusunk1 = atoi(row[200]); - e.focusunk2 = atoi(row[201]); - e.focusunk3 = atoi(row[202]); - e.focusunk4 = atoi(row[203]); - e.focusunk5 = atoi(row[204]); + e.wornunk7 = static_cast(atoi(row[199])); + e.focusunk1 = static_cast(atoi(row[200])); + e.focusunk2 = static_cast(atoi(row[201])); + e.focusunk3 = static_cast(atoi(row[202])); + e.focusunk4 = static_cast(atoi(row[203])); + e.focusunk5 = static_cast(atoi(row[204])); e.focusunk6 = row[205] ? row[205] : ""; - e.focusunk7 = atoi(row[206]); - e.scrollunk1 = atoi(row[207]); - e.scrollunk2 = atoi(row[208]); - e.scrollunk3 = atoi(row[209]); - e.scrollunk4 = atoi(row[210]); - e.scrollunk5 = atoi(row[211]); + e.focusunk7 = static_cast(atoi(row[206])); + e.scrollunk1 = static_cast(atoi(row[207])); + e.scrollunk2 = static_cast(atoi(row[208])); + e.scrollunk3 = static_cast(atoi(row[209])); + e.scrollunk4 = static_cast(atoi(row[210])); + e.scrollunk5 = static_cast(atoi(row[211])); e.scrollunk6 = row[212] ? row[212] : ""; - e.scrollunk7 = atoi(row[213]); - e.UNK193 = atoi(row[214]); - e.purity = atoi(row[215]); - e.evoitem = atoi(row[216]); - e.evoid = atoi(row[217]); - e.evolvinglevel = atoi(row[218]); - e.evomax = atoi(row[219]); + e.scrollunk7 = static_cast(atoi(row[213])); + e.UNK193 = static_cast(atoi(row[214])); + e.purity = static_cast(atoi(row[215])); + e.evoitem = static_cast(atoi(row[216])); + e.evoid = static_cast(atoi(row[217])); + e.evolvinglevel = static_cast(atoi(row[218])); + e.evomax = static_cast(atoi(row[219])); e.clickname = row[220] ? row[220] : ""; e.procname = row[221] ? row[221] : ""; e.wornname = row[222] ? row[222] : ""; e.focusname = row[223] ? row[223] : ""; e.scrollname = row[224] ? row[224] : ""; - e.dsmitigation = atoi(row[225]); - e.heroic_str = atoi(row[226]); - e.heroic_int = atoi(row[227]); - e.heroic_wis = atoi(row[228]); - e.heroic_agi = atoi(row[229]); - e.heroic_dex = atoi(row[230]); - e.heroic_sta = atoi(row[231]); - e.heroic_cha = atoi(row[232]); - e.heroic_pr = atoi(row[233]); - e.heroic_dr = atoi(row[234]); - e.heroic_fr = atoi(row[235]); - e.heroic_cr = atoi(row[236]); - e.heroic_mr = atoi(row[237]); - e.heroic_svcorrup = atoi(row[238]); - e.healamt = atoi(row[239]); - e.spelldmg = atoi(row[240]); - e.clairvoyance = atoi(row[241]); - e.backstabdmg = atoi(row[242]); + e.dsmitigation = static_cast(atoi(row[225])); + e.heroic_str = static_cast(atoi(row[226])); + e.heroic_int = static_cast(atoi(row[227])); + e.heroic_wis = static_cast(atoi(row[228])); + e.heroic_agi = static_cast(atoi(row[229])); + e.heroic_dex = static_cast(atoi(row[230])); + e.heroic_sta = static_cast(atoi(row[231])); + e.heroic_cha = static_cast(atoi(row[232])); + e.heroic_pr = static_cast(atoi(row[233])); + e.heroic_dr = static_cast(atoi(row[234])); + e.heroic_fr = static_cast(atoi(row[235])); + e.heroic_cr = static_cast(atoi(row[236])); + e.heroic_mr = static_cast(atoi(row[237])); + e.heroic_svcorrup = static_cast(atoi(row[238])); + e.healamt = static_cast(atoi(row[239])); + e.spelldmg = static_cast(atoi(row[240])); + e.clairvoyance = static_cast(atoi(row[241])); + e.backstabdmg = static_cast(atoi(row[242])); e.created = row[243] ? row[243] : ""; - e.elitematerial = atoi(row[244]); - e.ldonsellbackrate = atoi(row[245]); - e.scriptfileid = atoi(row[246]); - e.expendablearrow = atoi(row[247]); - e.powersourcecapacity = atoi(row[248]); - e.bardeffect = atoi(row[249]); - e.bardeffecttype = atoi(row[250]); - e.bardlevel2 = atoi(row[251]); - e.bardlevel = atoi(row[252]); - e.bardunk1 = atoi(row[253]); - e.bardunk2 = atoi(row[254]); - e.bardunk3 = atoi(row[255]); - e.bardunk4 = atoi(row[256]); - e.bardunk5 = atoi(row[257]); + e.elitematerial = static_cast(atoi(row[244])); + e.ldonsellbackrate = static_cast(atoi(row[245])); + e.scriptfileid = static_cast(atoi(row[246])); + e.expendablearrow = static_cast(atoi(row[247])); + e.powersourcecapacity = static_cast(atoi(row[248])); + e.bardeffect = static_cast(atoi(row[249])); + e.bardeffecttype = static_cast(atoi(row[250])); + e.bardlevel2 = static_cast(atoi(row[251])); + e.bardlevel = static_cast(atoi(row[252])); + e.bardunk1 = static_cast(atoi(row[253])); + e.bardunk2 = static_cast(atoi(row[254])); + e.bardunk3 = static_cast(atoi(row[255])); + e.bardunk4 = static_cast(atoi(row[256])); + e.bardunk5 = static_cast(atoi(row[257])); e.bardname = row[258] ? row[258] : ""; - e.bardunk7 = atoi(row[259]); - e.UNK214 = atoi(row[260]); - e.subtype = atoi(row[261]); - e.UNK220 = atoi(row[262]); - e.UNK221 = atoi(row[263]); - e.heirloom = atoi(row[264]); - e.UNK223 = atoi(row[265]); - e.UNK224 = atoi(row[266]); - e.UNK225 = atoi(row[267]); - e.UNK226 = atoi(row[268]); - e.UNK227 = atoi(row[269]); - e.UNK228 = atoi(row[270]); - e.UNK229 = atoi(row[271]); - e.UNK230 = atoi(row[272]); - e.UNK231 = atoi(row[273]); - e.UNK232 = atoi(row[274]); - e.UNK233 = atoi(row[275]); - e.UNK234 = atoi(row[276]); - e.placeable = atoi(row[277]); - e.UNK236 = atoi(row[278]); - e.UNK237 = atoi(row[279]); - e.UNK238 = atoi(row[280]); - e.UNK239 = atoi(row[281]); - e.UNK240 = atoi(row[282]); - e.UNK241 = atoi(row[283]); - e.epicitem = atoi(row[284]); + e.bardunk7 = static_cast(atoi(row[259])); + e.UNK214 = static_cast(atoi(row[260])); + e.subtype = static_cast(atoi(row[261])); + e.UNK220 = static_cast(atoi(row[262])); + e.UNK221 = static_cast(atoi(row[263])); + e.heirloom = static_cast(atoi(row[264])); + e.UNK223 = static_cast(atoi(row[265])); + e.UNK224 = static_cast(atoi(row[266])); + e.UNK225 = static_cast(atoi(row[267])); + e.UNK226 = static_cast(atoi(row[268])); + e.UNK227 = static_cast(atoi(row[269])); + e.UNK228 = static_cast(atoi(row[270])); + e.UNK229 = static_cast(atoi(row[271])); + e.UNK230 = static_cast(atoi(row[272])); + e.UNK231 = static_cast(atoi(row[273])); + e.UNK232 = static_cast(atoi(row[274])); + e.UNK233 = static_cast(atoi(row[275])); + e.UNK234 = static_cast(atoi(row[276])); + e.placeable = static_cast(atoi(row[277])); + e.UNK236 = static_cast(atoi(row[278])); + e.UNK237 = static_cast(atoi(row[279])); + e.UNK238 = static_cast(atoi(row[280])); + e.UNK239 = static_cast(atoi(row[281])); + e.UNK240 = static_cast(atoi(row[282])); + e.UNK241 = static_cast(atoi(row[283])); + e.epicitem = static_cast(atoi(row[284])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_ldon_trap_entries_repository.h b/common/repositories/base/base_ldon_trap_entries_repository.h index 9388018e4..d47f815be 100644 --- a/common/repositories/base/base_ldon_trap_entries_repository.h +++ b/common/repositories/base/base_ldon_trap_entries_repository.h @@ -19,8 +19,8 @@ class BaseLdonTrapEntriesRepository { public: struct LdonTrapEntries { - int id; - int trap_id; + uint32_t id; + uint32_t trap_id; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { LdonTrapEntries e{}; - e.id = atoi(row[0]); - e.trap_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.trap_id = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LdonTrapEntries e{}; - e.id = atoi(row[0]); - e.trap_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.trap_id = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LdonTrapEntries e{}; - e.id = atoi(row[0]); - e.trap_id = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.trap_id = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_ldon_trap_templates_repository.h b/common/repositories/base/base_ldon_trap_templates_repository.h index f9f22c2ac..5a4281db6 100644 --- a/common/repositories/base/base_ldon_trap_templates_repository.h +++ b/common/repositories/base/base_ldon_trap_templates_repository.h @@ -19,11 +19,11 @@ class BaseLdonTrapTemplatesRepository { public: struct LdonTrapTemplates { - int id; - int type; - int spell_id; - int skill; - int locked; + uint32_t id; + uint8_t type; + uint16_t spell_id; + uint16_t skill; + uint8_t locked; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { LdonTrapTemplates e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); - e.spell_id = atoi(row[2]); - e.skill = atoi(row[3]); - e.locked = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); + e.skill = static_cast(strtoul(row[3], nullptr, 10)); + e.locked = static_cast(strtoul(row[4], nullptr, 10)); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LdonTrapTemplates e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); - e.spell_id = atoi(row[2]); - e.skill = atoi(row[3]); - e.locked = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); + e.skill = static_cast(strtoul(row[3], nullptr, 10)); + e.locked = static_cast(strtoul(row[4], nullptr, 10)); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LdonTrapTemplates e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); - e.spell_id = atoi(row[2]); - e.skill = atoi(row[3]); - e.locked = atoi(row[4]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(strtoul(row[1], nullptr, 10)); + e.spell_id = static_cast(strtoul(row[2], nullptr, 10)); + e.skill = static_cast(strtoul(row[3], nullptr, 10)); + e.locked = static_cast(strtoul(row[4], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_level_exp_mods_repository.h b/common/repositories/base/base_level_exp_mods_repository.h index 541b4d16e..13dcb2cfd 100644 --- a/common/repositories/base/base_level_exp_mods_repository.h +++ b/common/repositories/base/base_level_exp_mods_repository.h @@ -19,9 +19,9 @@ class BaseLevelExpModsRepository { public: struct LevelExpMods { - int level; - float exp_mod; - float aa_exp_mod; + int32_t level; + float exp_mod; + float aa_exp_mod; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { LevelExpMods e{}; - e.level = atoi(row[0]); - e.exp_mod = static_cast(atof(row[1])); - e.aa_exp_mod = static_cast(atof(row[2])); + e.level = static_cast(atoi(row[0])); + e.exp_mod = strtof(row[1], nullptr); + e.aa_exp_mod = strtof(row[2], nullptr); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LevelExpMods e{}; - e.level = atoi(row[0]); - e.exp_mod = static_cast(atof(row[1])); - e.aa_exp_mod = static_cast(atof(row[2])); + e.level = static_cast(atoi(row[0])); + e.exp_mod = strtof(row[1], nullptr); + e.aa_exp_mod = strtof(row[2], nullptr); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LevelExpMods e{}; - e.level = atoi(row[0]); - e.exp_mod = static_cast(atof(row[1])); - e.aa_exp_mod = static_cast(atof(row[2])); + e.level = static_cast(atoi(row[0])); + e.exp_mod = strtof(row[1], nullptr); + e.aa_exp_mod = strtof(row[2], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_lfguild_repository.h b/common/repositories/base/base_lfguild_repository.h index 7382fab9a..3fef33af2 100644 --- a/common/repositories/base/base_lfguild_repository.h +++ b/common/repositories/base/base_lfguild_repository.h @@ -19,15 +19,15 @@ class BaseLfguildRepository { public: struct Lfguild { - int type; + uint8_t type; std::string name; std::string comment; - int fromlevel; - int tolevel; - int classes; - int aacount; - int timezone; - int timeposted; + uint8_t fromlevel; + uint8_t tolevel; + uint32_t classes; + uint32_t aacount; + uint32_t timezone; + uint32_t timeposted; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { Lfguild e{}; - e.type = atoi(row[0]); + e.type = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; e.comment = row[2] ? row[2] : ""; - e.fromlevel = atoi(row[3]); - e.tolevel = atoi(row[4]); - e.classes = atoi(row[5]); - e.aacount = atoi(row[6]); - e.timezone = atoi(row[7]); - e.timeposted = atoi(row[8]); + e.fromlevel = static_cast(strtoul(row[3], nullptr, 10)); + e.tolevel = static_cast(strtoul(row[4], nullptr, 10)); + e.classes = static_cast(strtoul(row[5], nullptr, 10)); + e.aacount = static_cast(strtoul(row[6], nullptr, 10)); + e.timezone = static_cast(strtoul(row[7], nullptr, 10)); + e.timeposted = static_cast(strtoul(row[8], nullptr, 10)); return e; } @@ -298,15 +298,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Lfguild e{}; - e.type = atoi(row[0]); + e.type = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; e.comment = row[2] ? row[2] : ""; - e.fromlevel = atoi(row[3]); - e.tolevel = atoi(row[4]); - e.classes = atoi(row[5]); - e.aacount = atoi(row[6]); - e.timezone = atoi(row[7]); - e.timeposted = atoi(row[8]); + e.fromlevel = static_cast(strtoul(row[3], nullptr, 10)); + e.tolevel = static_cast(strtoul(row[4], nullptr, 10)); + e.classes = static_cast(strtoul(row[5], nullptr, 10)); + e.aacount = static_cast(strtoul(row[6], nullptr, 10)); + e.timezone = static_cast(strtoul(row[7], nullptr, 10)); + e.timeposted = static_cast(strtoul(row[8], nullptr, 10)); all_entries.push_back(e); } @@ -331,15 +331,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Lfguild e{}; - e.type = atoi(row[0]); + e.type = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; e.comment = row[2] ? row[2] : ""; - e.fromlevel = atoi(row[3]); - e.tolevel = atoi(row[4]); - e.classes = atoi(row[5]); - e.aacount = atoi(row[6]); - e.timezone = atoi(row[7]); - e.timeposted = atoi(row[8]); + e.fromlevel = static_cast(strtoul(row[3], nullptr, 10)); + e.tolevel = static_cast(strtoul(row[4], nullptr, 10)); + e.classes = static_cast(strtoul(row[5], nullptr, 10)); + e.aacount = static_cast(strtoul(row[6], nullptr, 10)); + e.timezone = static_cast(strtoul(row[7], nullptr, 10)); + e.timeposted = static_cast(strtoul(row[8], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_login_accounts_repository.h b/common/repositories/base/base_login_accounts_repository.h index e353a5a66..4ac86f8d1 100644 --- a/common/repositories/base/base_login_accounts_repository.h +++ b/common/repositories/base/base_login_accounts_repository.h @@ -19,7 +19,7 @@ class BaseLoginAccountsRepository { public: struct LoginAccounts { - int id; + uint32_t id; std::string account_name; std::string account_password; std::string account_email; @@ -146,7 +146,7 @@ public: if (results.RowCount() == 1) { LoginAccounts e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.account_name = row[1] ? row[1] : ""; e.account_password = row[2] ? row[2] : ""; e.account_email = row[3] ? row[3] : ""; @@ -298,7 +298,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginAccounts e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.account_name = row[1] ? row[1] : ""; e.account_password = row[2] ? row[2] : ""; e.account_email = row[3] ? row[3] : ""; @@ -331,7 +331,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginAccounts e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.account_name = row[1] ? row[1] : ""; e.account_password = row[2] ? row[2] : ""; e.account_email = row[3] ? row[3] : ""; diff --git a/common/repositories/base/base_login_api_tokens_repository.h b/common/repositories/base/base_login_api_tokens_repository.h index a56f17fc8..3f5a107d3 100644 --- a/common/repositories/base/base_login_api_tokens_repository.h +++ b/common/repositories/base/base_login_api_tokens_repository.h @@ -19,10 +19,10 @@ class BaseLoginApiTokensRepository { public: struct LoginApiTokens { - int id; + int32_t id; std::string token; - int can_write; - int can_read; + int32_t can_write; + int32_t can_read; time_t created_at; time_t updated_at; }; @@ -134,10 +134,10 @@ public: if (results.RowCount() == 1) { LoginApiTokens e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.token = row[1] ? row[1] : ""; - e.can_write = atoi(row[2]); - e.can_read = atoi(row[3]); + e.can_write = static_cast(atoi(row[2])); + e.can_read = static_cast(atoi(row[3])); e.created_at = strtoll(row[4] ? row[4] : "-1", nullptr, 10); e.updated_at = strtoll(row[5] ? row[5] : "-1", nullptr, 10); @@ -273,10 +273,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginApiTokens e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.token = row[1] ? row[1] : ""; - e.can_write = atoi(row[2]); - e.can_read = atoi(row[3]); + e.can_write = static_cast(atoi(row[2])); + e.can_read = static_cast(atoi(row[3])); e.created_at = strtoll(row[4] ? row[4] : "-1", nullptr, 10); e.updated_at = strtoll(row[5] ? row[5] : "-1", nullptr, 10); @@ -303,10 +303,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginApiTokens e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.token = row[1] ? row[1] : ""; - e.can_write = atoi(row[2]); - e.can_read = atoi(row[3]); + e.can_write = static_cast(atoi(row[2])); + e.can_read = static_cast(atoi(row[3])); e.created_at = strtoll(row[4] ? row[4] : "-1", nullptr, 10); e.updated_at = strtoll(row[5] ? row[5] : "-1", nullptr, 10); diff --git a/common/repositories/base/base_login_server_admins_repository.h b/common/repositories/base/base_login_server_admins_repository.h index 45fce3397..297dbd312 100644 --- a/common/repositories/base/base_login_server_admins_repository.h +++ b/common/repositories/base/base_login_server_admins_repository.h @@ -19,7 +19,7 @@ class BaseLoginServerAdminsRepository { public: struct LoginServerAdmins { - int id; + uint32_t id; std::string account_name; std::string account_password; std::string first_name; @@ -142,7 +142,7 @@ public: if (results.RowCount() == 1) { LoginServerAdmins e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.account_name = row[1] ? row[1] : ""; e.account_password = row[2] ? row[2] : ""; e.first_name = row[3] ? row[3] : ""; @@ -289,7 +289,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginServerAdmins e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.account_name = row[1] ? row[1] : ""; e.account_password = row[2] ? row[2] : ""; e.first_name = row[3] ? row[3] : ""; @@ -321,7 +321,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginServerAdmins e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.account_name = row[1] ? row[1] : ""; e.account_password = row[2] ? row[2] : ""; e.first_name = row[3] ? row[3] : ""; diff --git a/common/repositories/base/base_login_server_list_types_repository.h b/common/repositories/base/base_login_server_list_types_repository.h index b03d85588..9973d28aa 100644 --- a/common/repositories/base/base_login_server_list_types_repository.h +++ b/common/repositories/base/base_login_server_list_types_repository.h @@ -19,7 +19,7 @@ class BaseLoginServerListTypesRepository { public: struct LoginServerListTypes { - int id; + uint32_t id; std::string description; }; @@ -118,7 +118,7 @@ public: if (results.RowCount() == 1) { LoginServerListTypes e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.description = row[1] ? row[1] : ""; return e; @@ -242,7 +242,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginServerListTypes e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.description = row[1] ? row[1] : ""; all_entries.push_back(e); @@ -268,7 +268,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginServerListTypes e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.description = row[1] ? row[1] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_login_world_servers_repository.h b/common/repositories/base/base_login_world_servers_repository.h index 3ffb9fa6d..850f233a8 100644 --- a/common/repositories/base/base_login_world_servers_repository.h +++ b/common/repositories/base/base_login_world_servers_repository.h @@ -19,15 +19,15 @@ class BaseLoginWorldServersRepository { public: struct LoginWorldServers { - int id; + uint32_t id; std::string long_name; std::string short_name; std::string tag_description; - int login_server_list_type_id; + int32_t login_server_list_type_id; time_t last_login_date; std::string last_ip_address; - int login_server_admin_id; - int is_server_trusted; + int32_t login_server_admin_id; + int32_t is_server_trusted; std::string note; }; @@ -150,15 +150,15 @@ public: if (results.RowCount() == 1) { LoginWorldServers e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.long_name = row[1] ? row[1] : ""; e.short_name = row[2] ? row[2] : ""; e.tag_description = row[3] ? row[3] : ""; - e.login_server_list_type_id = atoi(row[4]); + e.login_server_list_type_id = static_cast(atoi(row[4])); e.last_login_date = strtoll(row[5] ? row[5] : "-1", nullptr, 10); e.last_ip_address = row[6] ? row[6] : ""; - e.login_server_admin_id = atoi(row[7]); - e.is_server_trusted = atoi(row[8]); + e.login_server_admin_id = static_cast(atoi(row[7])); + e.is_server_trusted = static_cast(atoi(row[8])); e.note = row[9] ? row[9] : ""; return e; @@ -305,15 +305,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginWorldServers e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.long_name = row[1] ? row[1] : ""; e.short_name = row[2] ? row[2] : ""; e.tag_description = row[3] ? row[3] : ""; - e.login_server_list_type_id = atoi(row[4]); + e.login_server_list_type_id = static_cast(atoi(row[4])); e.last_login_date = strtoll(row[5] ? row[5] : "-1", nullptr, 10); e.last_ip_address = row[6] ? row[6] : ""; - e.login_server_admin_id = atoi(row[7]); - e.is_server_trusted = atoi(row[8]); + e.login_server_admin_id = static_cast(atoi(row[7])); + e.is_server_trusted = static_cast(atoi(row[8])); e.note = row[9] ? row[9] : ""; all_entries.push_back(e); @@ -339,15 +339,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoginWorldServers e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.long_name = row[1] ? row[1] : ""; e.short_name = row[2] ? row[2] : ""; e.tag_description = row[3] ? row[3] : ""; - e.login_server_list_type_id = atoi(row[4]); + e.login_server_list_type_id = static_cast(atoi(row[4])); e.last_login_date = strtoll(row[5] ? row[5] : "-1", nullptr, 10); e.last_ip_address = row[6] ? row[6] : ""; - e.login_server_admin_id = atoi(row[7]); - e.is_server_trusted = atoi(row[8]); + e.login_server_admin_id = static_cast(atoi(row[7])); + e.is_server_trusted = static_cast(atoi(row[8])); e.note = row[9] ? row[9] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_logsys_categories_repository.h b/common/repositories/base/base_logsys_categories_repository.h index e03374b48..867ca894c 100644 --- a/common/repositories/base/base_logsys_categories_repository.h +++ b/common/repositories/base/base_logsys_categories_repository.h @@ -19,13 +19,13 @@ class BaseLogsysCategoriesRepository { public: struct LogsysCategories { - int log_category_id; + int32_t log_category_id; std::string log_category_description; - int log_to_console; - int log_to_file; - int log_to_gmsay; - int log_to_discord; - int discord_webhook_id; + int16_t log_to_console; + int16_t log_to_file; + int16_t log_to_gmsay; + int16_t log_to_discord; + int32_t discord_webhook_id; }; static std::string PrimaryKey() @@ -138,13 +138,13 @@ public: if (results.RowCount() == 1) { LogsysCategories e{}; - e.log_category_id = atoi(row[0]); + e.log_category_id = static_cast(atoi(row[0])); e.log_category_description = row[1] ? row[1] : ""; - e.log_to_console = atoi(row[2]); - e.log_to_file = atoi(row[3]); - e.log_to_gmsay = atoi(row[4]); - e.log_to_discord = atoi(row[5]); - e.discord_webhook_id = atoi(row[6]); + e.log_to_console = static_cast(atoi(row[2])); + e.log_to_file = static_cast(atoi(row[3])); + e.log_to_gmsay = static_cast(atoi(row[4])); + e.log_to_discord = static_cast(atoi(row[5])); + e.discord_webhook_id = static_cast(atoi(row[6])); return e; } @@ -282,13 +282,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LogsysCategories e{}; - e.log_category_id = atoi(row[0]); + e.log_category_id = static_cast(atoi(row[0])); e.log_category_description = row[1] ? row[1] : ""; - e.log_to_console = atoi(row[2]); - e.log_to_file = atoi(row[3]); - e.log_to_gmsay = atoi(row[4]); - e.log_to_discord = atoi(row[5]); - e.discord_webhook_id = atoi(row[6]); + e.log_to_console = static_cast(atoi(row[2])); + e.log_to_file = static_cast(atoi(row[3])); + e.log_to_gmsay = static_cast(atoi(row[4])); + e.log_to_discord = static_cast(atoi(row[5])); + e.discord_webhook_id = static_cast(atoi(row[6])); all_entries.push_back(e); } @@ -313,13 +313,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LogsysCategories e{}; - e.log_category_id = atoi(row[0]); + e.log_category_id = static_cast(atoi(row[0])); e.log_category_description = row[1] ? row[1] : ""; - e.log_to_console = atoi(row[2]); - e.log_to_file = atoi(row[3]); - e.log_to_gmsay = atoi(row[4]); - e.log_to_discord = atoi(row[5]); - e.discord_webhook_id = atoi(row[6]); + e.log_to_console = static_cast(atoi(row[2])); + e.log_to_file = static_cast(atoi(row[3])); + e.log_to_gmsay = static_cast(atoi(row[4])); + e.log_to_discord = static_cast(atoi(row[5])); + e.discord_webhook_id = static_cast(atoi(row[6])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_lootdrop_entries_repository.h b/common/repositories/base/base_lootdrop_entries_repository.h index 5988381d5..48a0cf337 100644 --- a/common/repositories/base/base_lootdrop_entries_repository.h +++ b/common/repositories/base/base_lootdrop_entries_repository.h @@ -19,17 +19,17 @@ class BaseLootdropEntriesRepository { public: struct LootdropEntries { - int lootdrop_id; - int item_id; - int item_charges; - int equip_item; - float chance; - float disabled_chance; - int trivial_min_level; - int trivial_max_level; - int multiplier; - int npc_min_level; - int npc_max_level; + uint32_t lootdrop_id; + int32_t item_id; + uint16_t item_charges; + uint8_t equip_item; + float chance; + float disabled_chance; + uint16_t trivial_min_level; + uint16_t trivial_max_level; + uint8_t multiplier; + uint16_t npc_min_level; + uint16_t npc_max_level; }; static std::string PrimaryKey() @@ -154,17 +154,17 @@ public: if (results.RowCount() == 1) { LootdropEntries e{}; - e.lootdrop_id = atoi(row[0]); - e.item_id = atoi(row[1]); - e.item_charges = atoi(row[2]); - e.equip_item = atoi(row[3]); - e.chance = static_cast(atof(row[4])); - e.disabled_chance = static_cast(atof(row[5])); - e.trivial_min_level = atoi(row[6]); - e.trivial_max_level = atoi(row[7]); - e.multiplier = atoi(row[8]); - e.npc_min_level = atoi(row[9]); - e.npc_max_level = atoi(row[10]); + e.lootdrop_id = static_cast(strtoul(row[0], nullptr, 10)); + e.item_id = static_cast(atoi(row[1])); + e.item_charges = static_cast(strtoul(row[2], nullptr, 10)); + e.equip_item = static_cast(strtoul(row[3], nullptr, 10)); + e.chance = strtof(row[4], nullptr); + e.disabled_chance = strtof(row[5], nullptr); + e.trivial_min_level = static_cast(strtoul(row[6], nullptr, 10)); + e.trivial_max_level = static_cast(strtoul(row[7], nullptr, 10)); + e.multiplier = static_cast(strtoul(row[8], nullptr, 10)); + e.npc_min_level = static_cast(strtoul(row[9], nullptr, 10)); + e.npc_max_level = static_cast(strtoul(row[10], nullptr, 10)); return e; } @@ -314,17 +314,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LootdropEntries e{}; - e.lootdrop_id = atoi(row[0]); - e.item_id = atoi(row[1]); - e.item_charges = atoi(row[2]); - e.equip_item = atoi(row[3]); - e.chance = static_cast(atof(row[4])); - e.disabled_chance = static_cast(atof(row[5])); - e.trivial_min_level = atoi(row[6]); - e.trivial_max_level = atoi(row[7]); - e.multiplier = atoi(row[8]); - e.npc_min_level = atoi(row[9]); - e.npc_max_level = atoi(row[10]); + e.lootdrop_id = static_cast(strtoul(row[0], nullptr, 10)); + e.item_id = static_cast(atoi(row[1])); + e.item_charges = static_cast(strtoul(row[2], nullptr, 10)); + e.equip_item = static_cast(strtoul(row[3], nullptr, 10)); + e.chance = strtof(row[4], nullptr); + e.disabled_chance = strtof(row[5], nullptr); + e.trivial_min_level = static_cast(strtoul(row[6], nullptr, 10)); + e.trivial_max_level = static_cast(strtoul(row[7], nullptr, 10)); + e.multiplier = static_cast(strtoul(row[8], nullptr, 10)); + e.npc_min_level = static_cast(strtoul(row[9], nullptr, 10)); + e.npc_max_level = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } @@ -349,17 +349,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LootdropEntries e{}; - e.lootdrop_id = atoi(row[0]); - e.item_id = atoi(row[1]); - e.item_charges = atoi(row[2]); - e.equip_item = atoi(row[3]); - e.chance = static_cast(atof(row[4])); - e.disabled_chance = static_cast(atof(row[5])); - e.trivial_min_level = atoi(row[6]); - e.trivial_max_level = atoi(row[7]); - e.multiplier = atoi(row[8]); - e.npc_min_level = atoi(row[9]); - e.npc_max_level = atoi(row[10]); + e.lootdrop_id = static_cast(strtoul(row[0], nullptr, 10)); + e.item_id = static_cast(atoi(row[1])); + e.item_charges = static_cast(strtoul(row[2], nullptr, 10)); + e.equip_item = static_cast(strtoul(row[3], nullptr, 10)); + e.chance = strtof(row[4], nullptr); + e.disabled_chance = strtof(row[5], nullptr); + e.trivial_min_level = static_cast(strtoul(row[6], nullptr, 10)); + e.trivial_max_level = static_cast(strtoul(row[7], nullptr, 10)); + e.multiplier = static_cast(strtoul(row[8], nullptr, 10)); + e.npc_min_level = static_cast(strtoul(row[9], nullptr, 10)); + e.npc_max_level = static_cast(strtoul(row[10], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_lootdrop_repository.h b/common/repositories/base/base_lootdrop_repository.h index 53fb883d6..6361dd6bf 100644 --- a/common/repositories/base/base_lootdrop_repository.h +++ b/common/repositories/base/base_lootdrop_repository.h @@ -19,10 +19,10 @@ class BaseLootdropRepository { public: struct Lootdrop { - int id; + uint32_t id; std::string name; - int min_expansion; - int max_expansion; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -134,10 +134,10 @@ public: if (results.RowCount() == 1) { Lootdrop e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.min_expansion = atoi(row[2]); - e.max_expansion = atoi(row[3]); + e.min_expansion = static_cast(atoi(row[2])); + e.max_expansion = static_cast(atoi(row[3])); e.content_flags = row[4] ? row[4] : ""; e.content_flags_disabled = row[5] ? row[5] : ""; @@ -273,10 +273,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Lootdrop e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.min_expansion = atoi(row[2]); - e.max_expansion = atoi(row[3]); + e.min_expansion = static_cast(atoi(row[2])); + e.max_expansion = static_cast(atoi(row[3])); e.content_flags = row[4] ? row[4] : ""; e.content_flags_disabled = row[5] ? row[5] : ""; @@ -303,10 +303,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Lootdrop e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.min_expansion = atoi(row[2]); - e.max_expansion = atoi(row[3]); + e.min_expansion = static_cast(atoi(row[2])); + e.max_expansion = static_cast(atoi(row[3])); e.content_flags = row[4] ? row[4] : ""; e.content_flags_disabled = row[5] ? row[5] : ""; diff --git a/common/repositories/base/base_loottable_entries_repository.h b/common/repositories/base/base_loottable_entries_repository.h index 13ffc23e4..f36d8026a 100644 --- a/common/repositories/base/base_loottable_entries_repository.h +++ b/common/repositories/base/base_loottable_entries_repository.h @@ -19,12 +19,12 @@ class BaseLoottableEntriesRepository { public: struct LoottableEntries { - int loottable_id; - int lootdrop_id; - int multiplier; - int droplimit; - int mindrop; - float probability; + uint32_t loottable_id; + uint32_t lootdrop_id; + uint8_t multiplier; + uint8_t droplimit; + uint8_t mindrop; + float probability; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { LoottableEntries e{}; - e.loottable_id = atoi(row[0]); - e.lootdrop_id = atoi(row[1]); - e.multiplier = atoi(row[2]); - e.droplimit = atoi(row[3]); - e.mindrop = atoi(row[4]); - e.probability = static_cast(atof(row[5])); + e.loottable_id = static_cast(strtoul(row[0], nullptr, 10)); + e.lootdrop_id = static_cast(strtoul(row[1], nullptr, 10)); + e.multiplier = static_cast(strtoul(row[2], nullptr, 10)); + e.droplimit = static_cast(strtoul(row[3], nullptr, 10)); + e.mindrop = static_cast(strtoul(row[4], nullptr, 10)); + e.probability = strtof(row[5], nullptr); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoottableEntries e{}; - e.loottable_id = atoi(row[0]); - e.lootdrop_id = atoi(row[1]); - e.multiplier = atoi(row[2]); - e.droplimit = atoi(row[3]); - e.mindrop = atoi(row[4]); - e.probability = static_cast(atof(row[5])); + e.loottable_id = static_cast(strtoul(row[0], nullptr, 10)); + e.lootdrop_id = static_cast(strtoul(row[1], nullptr, 10)); + e.multiplier = static_cast(strtoul(row[2], nullptr, 10)); + e.droplimit = static_cast(strtoul(row[3], nullptr, 10)); + e.mindrop = static_cast(strtoul(row[4], nullptr, 10)); + e.probability = strtof(row[5], nullptr); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { LoottableEntries e{}; - e.loottable_id = atoi(row[0]); - e.lootdrop_id = atoi(row[1]); - e.multiplier = atoi(row[2]); - e.droplimit = atoi(row[3]); - e.mindrop = atoi(row[4]); - e.probability = static_cast(atof(row[5])); + e.loottable_id = static_cast(strtoul(row[0], nullptr, 10)); + e.lootdrop_id = static_cast(strtoul(row[1], nullptr, 10)); + e.multiplier = static_cast(strtoul(row[2], nullptr, 10)); + e.droplimit = static_cast(strtoul(row[3], nullptr, 10)); + e.mindrop = static_cast(strtoul(row[4], nullptr, 10)); + e.probability = strtof(row[5], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_loottable_repository.h b/common/repositories/base/base_loottable_repository.h index 636e64f84..44d5156f0 100644 --- a/common/repositories/base/base_loottable_repository.h +++ b/common/repositories/base/base_loottable_repository.h @@ -19,14 +19,14 @@ class BaseLoottableRepository { public: struct Loottable { - int id; + uint32_t id; std::string name; - int mincash; - int maxcash; - int avgcoin; - int done; - int min_expansion; - int max_expansion; + uint32_t mincash; + uint32_t maxcash; + uint32_t avgcoin; + int8_t done; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -150,14 +150,14 @@ public: if (results.RowCount() == 1) { Loottable e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.mincash = atoi(row[2]); - e.maxcash = atoi(row[3]); - e.avgcoin = atoi(row[4]); - e.done = atoi(row[5]); - e.min_expansion = atoi(row[6]); - e.max_expansion = atoi(row[7]); + e.mincash = static_cast(strtoul(row[2], nullptr, 10)); + e.maxcash = static_cast(strtoul(row[3], nullptr, 10)); + e.avgcoin = static_cast(strtoul(row[4], nullptr, 10)); + e.done = static_cast(atoi(row[5])); + e.min_expansion = static_cast(atoi(row[6])); + e.max_expansion = static_cast(atoi(row[7])); e.content_flags = row[8] ? row[8] : ""; e.content_flags_disabled = row[9] ? row[9] : ""; @@ -305,14 +305,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Loottable e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.mincash = atoi(row[2]); - e.maxcash = atoi(row[3]); - e.avgcoin = atoi(row[4]); - e.done = atoi(row[5]); - e.min_expansion = atoi(row[6]); - e.max_expansion = atoi(row[7]); + e.mincash = static_cast(strtoul(row[2], nullptr, 10)); + e.maxcash = static_cast(strtoul(row[3], nullptr, 10)); + e.avgcoin = static_cast(strtoul(row[4], nullptr, 10)); + e.done = static_cast(atoi(row[5])); + e.min_expansion = static_cast(atoi(row[6])); + e.max_expansion = static_cast(atoi(row[7])); e.content_flags = row[8] ? row[8] : ""; e.content_flags_disabled = row[9] ? row[9] : ""; @@ -339,14 +339,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Loottable e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.mincash = atoi(row[2]); - e.maxcash = atoi(row[3]); - e.avgcoin = atoi(row[4]); - e.done = atoi(row[5]); - e.min_expansion = atoi(row[6]); - e.max_expansion = atoi(row[7]); + e.mincash = static_cast(strtoul(row[2], nullptr, 10)); + e.maxcash = static_cast(strtoul(row[3], nullptr, 10)); + e.avgcoin = static_cast(strtoul(row[4], nullptr, 10)); + e.done = static_cast(atoi(row[5])); + e.min_expansion = static_cast(atoi(row[6])); + e.max_expansion = static_cast(atoi(row[7])); e.content_flags = row[8] ? row[8] : ""; e.content_flags_disabled = row[9] ? row[9] : ""; diff --git a/common/repositories/base/base_mail_repository.h b/common/repositories/base/base_mail_repository.h index 2594cb1a7..11fcbce8d 100644 --- a/common/repositories/base/base_mail_repository.h +++ b/common/repositories/base/base_mail_repository.h @@ -19,14 +19,14 @@ class BaseMailRepository { public: struct Mail { - int msgid; - int charid; - int timestamp; + uint32_t msgid; + uint32_t charid; + int32_t timestamp; std::string from; std::string subject; std::string body; std::string to; - int status; + int8_t status; }; static std::string PrimaryKey() @@ -142,14 +142,14 @@ public: if (results.RowCount() == 1) { Mail e{}; - e.msgid = atoi(row[0]); - e.charid = atoi(row[1]); - e.timestamp = atoi(row[2]); + e.msgid = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); + e.timestamp = static_cast(atoi(row[2])); e.from = row[3] ? row[3] : ""; e.subject = row[4] ? row[4] : ""; e.body = row[5] ? row[5] : ""; e.to = row[6] ? row[6] : ""; - e.status = atoi(row[7]); + e.status = static_cast(atoi(row[7])); return e; } @@ -289,14 +289,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Mail e{}; - e.msgid = atoi(row[0]); - e.charid = atoi(row[1]); - e.timestamp = atoi(row[2]); + e.msgid = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); + e.timestamp = static_cast(atoi(row[2])); e.from = row[3] ? row[3] : ""; e.subject = row[4] ? row[4] : ""; e.body = row[5] ? row[5] : ""; e.to = row[6] ? row[6] : ""; - e.status = atoi(row[7]); + e.status = static_cast(atoi(row[7])); all_entries.push_back(e); } @@ -321,14 +321,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Mail e{}; - e.msgid = atoi(row[0]); - e.charid = atoi(row[1]); - e.timestamp = atoi(row[2]); + e.msgid = static_cast(strtoul(row[0], nullptr, 10)); + e.charid = static_cast(strtoul(row[1], nullptr, 10)); + e.timestamp = static_cast(atoi(row[2])); e.from = row[3] ? row[3] : ""; e.subject = row[4] ? row[4] : ""; e.body = row[5] ? row[5] : ""; e.to = row[6] ? row[6] : ""; - e.status = atoi(row[7]); + e.status = static_cast(atoi(row[7])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_merchantlist_repository.h b/common/repositories/base/base_merchantlist_repository.h index b2ec44c32..014a48919 100644 --- a/common/repositories/base/base_merchantlist_repository.h +++ b/common/repositories/base/base_merchantlist_repository.h @@ -19,19 +19,19 @@ class BaseMerchantlistRepository { public: struct Merchantlist { - int merchantid; - int slot; - int item; - int faction_required; - int level_required; - int alt_currency_cost; - int classes_required; - int probability; + int32_t merchantid; + int32_t slot; + int32_t item; + int16_t faction_required; + uint8_t level_required; + uint16_t alt_currency_cost; + int32_t classes_required; + int32_t probability; std::string bucket_name; std::string bucket_value; - int bucket_comparison; - int min_expansion; - int max_expansion; + uint8_t bucket_comparison; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -170,19 +170,19 @@ public: if (results.RowCount() == 1) { Merchantlist e{}; - e.merchantid = atoi(row[0]); - e.slot = atoi(row[1]); - e.item = atoi(row[2]); - e.faction_required = atoi(row[3]); - e.level_required = atoi(row[4]); - e.alt_currency_cost = atoi(row[5]); - e.classes_required = atoi(row[6]); - e.probability = atoi(row[7]); + e.merchantid = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.item = static_cast(atoi(row[2])); + e.faction_required = static_cast(atoi(row[3])); + e.level_required = static_cast(strtoul(row[4], nullptr, 10)); + e.alt_currency_cost = static_cast(strtoul(row[5], nullptr, 10)); + e.classes_required = static_cast(atoi(row[6])); + e.probability = static_cast(atoi(row[7])); e.bucket_name = row[8] ? row[8] : ""; e.bucket_value = row[9] ? row[9] : ""; - e.bucket_comparison = atoi(row[10]); - e.min_expansion = atoi(row[11]); - e.max_expansion = atoi(row[12]); + e.bucket_comparison = static_cast(strtoul(row[10], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[11])); + e.max_expansion = static_cast(atoi(row[12])); e.content_flags = row[13] ? row[13] : ""; e.content_flags_disabled = row[14] ? row[14] : ""; @@ -346,19 +346,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Merchantlist e{}; - e.merchantid = atoi(row[0]); - e.slot = atoi(row[1]); - e.item = atoi(row[2]); - e.faction_required = atoi(row[3]); - e.level_required = atoi(row[4]); - e.alt_currency_cost = atoi(row[5]); - e.classes_required = atoi(row[6]); - e.probability = atoi(row[7]); + e.merchantid = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.item = static_cast(atoi(row[2])); + e.faction_required = static_cast(atoi(row[3])); + e.level_required = static_cast(strtoul(row[4], nullptr, 10)); + e.alt_currency_cost = static_cast(strtoul(row[5], nullptr, 10)); + e.classes_required = static_cast(atoi(row[6])); + e.probability = static_cast(atoi(row[7])); e.bucket_name = row[8] ? row[8] : ""; e.bucket_value = row[9] ? row[9] : ""; - e.bucket_comparison = atoi(row[10]); - e.min_expansion = atoi(row[11]); - e.max_expansion = atoi(row[12]); + e.bucket_comparison = static_cast(strtoul(row[10], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[11])); + e.max_expansion = static_cast(atoi(row[12])); e.content_flags = row[13] ? row[13] : ""; e.content_flags_disabled = row[14] ? row[14] : ""; @@ -385,19 +385,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Merchantlist e{}; - e.merchantid = atoi(row[0]); - e.slot = atoi(row[1]); - e.item = atoi(row[2]); - e.faction_required = atoi(row[3]); - e.level_required = atoi(row[4]); - e.alt_currency_cost = atoi(row[5]); - e.classes_required = atoi(row[6]); - e.probability = atoi(row[7]); + e.merchantid = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.item = static_cast(atoi(row[2])); + e.faction_required = static_cast(atoi(row[3])); + e.level_required = static_cast(strtoul(row[4], nullptr, 10)); + e.alt_currency_cost = static_cast(strtoul(row[5], nullptr, 10)); + e.classes_required = static_cast(atoi(row[6])); + e.probability = static_cast(atoi(row[7])); e.bucket_name = row[8] ? row[8] : ""; e.bucket_value = row[9] ? row[9] : ""; - e.bucket_comparison = atoi(row[10]); - e.min_expansion = atoi(row[11]); - e.max_expansion = atoi(row[12]); + e.bucket_comparison = static_cast(strtoul(row[10], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[11])); + e.max_expansion = static_cast(atoi(row[12])); e.content_flags = row[13] ? row[13] : ""; e.content_flags_disabled = row[14] ? row[14] : ""; diff --git a/common/repositories/base/base_merchantlist_temp_repository.h b/common/repositories/base/base_merchantlist_temp_repository.h index c6e076ecc..99f25da49 100644 --- a/common/repositories/base/base_merchantlist_temp_repository.h +++ b/common/repositories/base/base_merchantlist_temp_repository.h @@ -19,12 +19,12 @@ class BaseMerchantlistTempRepository { public: struct MerchantlistTemp { - int npcid; - int slot; - int zone_id; - int instance_id; - int itemid; - int charges; + uint32_t npcid; + uint8_t slot; + int32_t zone_id; + int32_t instance_id; + uint32_t itemid; + uint32_t charges; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { MerchantlistTemp e{}; - e.npcid = atoi(row[0]); - e.slot = atoi(row[1]); - e.zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.itemid = atoi(row[4]); - e.charges = atoi(row[5]); + e.npcid = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.zone_id = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); + e.itemid = static_cast(strtoul(row[4], nullptr, 10)); + e.charges = static_cast(strtoul(row[5], nullptr, 10)); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { MerchantlistTemp e{}; - e.npcid = atoi(row[0]); - e.slot = atoi(row[1]); - e.zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.itemid = atoi(row[4]); - e.charges = atoi(row[5]); + e.npcid = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.zone_id = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); + e.itemid = static_cast(strtoul(row[4], nullptr, 10)); + e.charges = static_cast(strtoul(row[5], nullptr, 10)); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { MerchantlistTemp e{}; - e.npcid = atoi(row[0]); - e.slot = atoi(row[1]); - e.zone_id = atoi(row[2]); - e.instance_id = atoi(row[3]); - e.itemid = atoi(row[4]); - e.charges = atoi(row[5]); + e.npcid = static_cast(strtoul(row[0], nullptr, 10)); + e.slot = static_cast(strtoul(row[1], nullptr, 10)); + e.zone_id = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); + e.itemid = static_cast(strtoul(row[4], nullptr, 10)); + e.charges = static_cast(strtoul(row[5], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_name_filter_repository.h b/common/repositories/base/base_name_filter_repository.h index ae4c2327f..24125c098 100644 --- a/common/repositories/base/base_name_filter_repository.h +++ b/common/repositories/base/base_name_filter_repository.h @@ -19,7 +19,7 @@ class BaseNameFilterRepository { public: struct NameFilter { - int id; + int32_t id; std::string name; }; @@ -118,7 +118,7 @@ public: if (results.RowCount() == 1) { NameFilter e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; return e; @@ -241,7 +241,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NameFilter e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; all_entries.push_back(e); @@ -267,7 +267,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NameFilter e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_npc_emotes_repository.h b/common/repositories/base/base_npc_emotes_repository.h index 221f9d97b..6e2e5b37d 100644 --- a/common/repositories/base/base_npc_emotes_repository.h +++ b/common/repositories/base/base_npc_emotes_repository.h @@ -19,10 +19,10 @@ class BaseNpcEmotesRepository { public: struct NpcEmotes { - int id; - int emoteid; - int event_; - int type; + int32_t id; + uint32_t emoteid; + int8_t event_; + int8_t type; std::string text; }; @@ -130,10 +130,10 @@ public: if (results.RowCount() == 1) { NpcEmotes e{}; - e.id = atoi(row[0]); - e.emoteid = atoi(row[1]); - e.event_ = atoi(row[2]); - e.type = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.emoteid = static_cast(strtoul(row[1], nullptr, 10)); + e.event_ = static_cast(atoi(row[2])); + e.type = static_cast(atoi(row[3])); e.text = row[4] ? row[4] : ""; return e; @@ -265,10 +265,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcEmotes e{}; - e.id = atoi(row[0]); - e.emoteid = atoi(row[1]); - e.event_ = atoi(row[2]); - e.type = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.emoteid = static_cast(strtoul(row[1], nullptr, 10)); + e.event_ = static_cast(atoi(row[2])); + e.type = static_cast(atoi(row[3])); e.text = row[4] ? row[4] : ""; all_entries.push_back(e); @@ -294,10 +294,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcEmotes e{}; - e.id = atoi(row[0]); - e.emoteid = atoi(row[1]); - e.event_ = atoi(row[2]); - e.type = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.emoteid = static_cast(strtoul(row[1], nullptr, 10)); + e.event_ = static_cast(atoi(row[2])); + e.type = static_cast(atoi(row[3])); e.text = row[4] ? row[4] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_npc_faction_entries_repository.h b/common/repositories/base/base_npc_faction_entries_repository.h index a3082bbc5..44a24a00e 100644 --- a/common/repositories/base/base_npc_faction_entries_repository.h +++ b/common/repositories/base/base_npc_faction_entries_repository.h @@ -19,11 +19,11 @@ class BaseNpcFactionEntriesRepository { public: struct NpcFactionEntries { - int npc_faction_id; - int faction_id; - int value; - int npc_value; - int temp; + uint32_t npc_faction_id; + uint32_t faction_id; + int32_t value; + int8_t npc_value; + int8_t temp; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { NpcFactionEntries e{}; - e.npc_faction_id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.value = atoi(row[2]); - e.npc_value = atoi(row[3]); - e.temp = atoi(row[4]); + e.npc_faction_id = static_cast(strtoul(row[0], nullptr, 10)); + e.faction_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(atoi(row[2])); + e.npc_value = static_cast(atoi(row[3])); + e.temp = static_cast(atoi(row[4])); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcFactionEntries e{}; - e.npc_faction_id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.value = atoi(row[2]); - e.npc_value = atoi(row[3]); - e.temp = atoi(row[4]); + e.npc_faction_id = static_cast(strtoul(row[0], nullptr, 10)); + e.faction_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(atoi(row[2])); + e.npc_value = static_cast(atoi(row[3])); + e.temp = static_cast(atoi(row[4])); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcFactionEntries e{}; - e.npc_faction_id = atoi(row[0]); - e.faction_id = atoi(row[1]); - e.value = atoi(row[2]); - e.npc_value = atoi(row[3]); - e.temp = atoi(row[4]); + e.npc_faction_id = static_cast(strtoul(row[0], nullptr, 10)); + e.faction_id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(atoi(row[2])); + e.npc_value = static_cast(atoi(row[3])); + e.temp = static_cast(atoi(row[4])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_faction_repository.h b/common/repositories/base/base_npc_faction_repository.h index 10036103e..8c2f87f04 100644 --- a/common/repositories/base/base_npc_faction_repository.h +++ b/common/repositories/base/base_npc_faction_repository.h @@ -19,10 +19,10 @@ class BaseNpcFactionRepository { public: struct NpcFaction { - int id; + int32_t id; std::string name; - int primaryfaction; - int ignore_primary_assist; + int32_t primaryfaction; + int8_t ignore_primary_assist; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { NpcFaction e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.primaryfaction = atoi(row[2]); - e.ignore_primary_assist = atoi(row[3]); + e.primaryfaction = static_cast(atoi(row[2])); + e.ignore_primary_assist = static_cast(atoi(row[3])); return e; } @@ -257,10 +257,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcFaction e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.primaryfaction = atoi(row[2]); - e.ignore_primary_assist = atoi(row[3]); + e.primaryfaction = static_cast(atoi(row[2])); + e.ignore_primary_assist = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -285,10 +285,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcFaction e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.primaryfaction = atoi(row[2]); - e.ignore_primary_assist = atoi(row[3]); + e.primaryfaction = static_cast(atoi(row[2])); + e.ignore_primary_assist = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_scale_global_base_repository.h b/common/repositories/base/base_npc_scale_global_base_repository.h index 4cbc7c76b..c8f6642c8 100644 --- a/common/repositories/base/base_npc_scale_global_base_repository.h +++ b/common/repositories/base/base_npc_scale_global_base_repository.h @@ -19,33 +19,33 @@ class BaseNpcScaleGlobalBaseRepository { public: struct NpcScaleGlobalBase { - int type; - int level; - int ac; - int hp; - int accuracy; - int slow_mitigation; - int attack; - int strength; - int stamina; - int dexterity; - int agility; - int intelligence; - int wisdom; - int charisma; - int magic_resist; - int cold_resist; - int fire_resist; - int poison_resist; - int disease_resist; - int corruption_resist; - int physical_resist; - int min_dmg; - int max_dmg; - int hp_regen_rate; - int attack_delay; - int spell_scale; - int heal_scale; + int32_t type; + int32_t level; + int32_t ac; + int32_t hp; + int32_t accuracy; + int32_t slow_mitigation; + int32_t attack; + int32_t strength; + int32_t stamina; + int32_t dexterity; + int32_t agility; + int32_t intelligence; + int32_t wisdom; + int32_t charisma; + int32_t magic_resist; + int32_t cold_resist; + int32_t fire_resist; + int32_t poison_resist; + int32_t disease_resist; + int32_t corruption_resist; + int32_t physical_resist; + int32_t min_dmg; + int32_t max_dmg; + int32_t hp_regen_rate; + int32_t attack_delay; + int32_t spell_scale; + int32_t heal_scale; std::string special_abilities; }; @@ -222,33 +222,33 @@ public: if (results.RowCount() == 1) { NpcScaleGlobalBase e{}; - e.type = atoi(row[0]); - e.level = atoi(row[1]); - e.ac = atoi(row[2]); - e.hp = atoi(row[3]); - e.accuracy = atoi(row[4]); - e.slow_mitigation = atoi(row[5]); - e.attack = atoi(row[6]); - e.strength = atoi(row[7]); - e.stamina = atoi(row[8]); - e.dexterity = atoi(row[9]); - e.agility = atoi(row[10]); - e.intelligence = atoi(row[11]); - e.wisdom = atoi(row[12]); - e.charisma = atoi(row[13]); - e.magic_resist = atoi(row[14]); - e.cold_resist = atoi(row[15]); - e.fire_resist = atoi(row[16]); - e.poison_resist = atoi(row[17]); - e.disease_resist = atoi(row[18]); - e.corruption_resist = atoi(row[19]); - e.physical_resist = atoi(row[20]); - e.min_dmg = atoi(row[21]); - e.max_dmg = atoi(row[22]); - e.hp_regen_rate = atoi(row[23]); - e.attack_delay = atoi(row[24]); - e.spell_scale = atoi(row[25]); - e.heal_scale = atoi(row[26]); + e.type = static_cast(atoi(row[0])); + e.level = static_cast(atoi(row[1])); + e.ac = static_cast(atoi(row[2])); + e.hp = static_cast(atoi(row[3])); + e.accuracy = static_cast(atoi(row[4])); + e.slow_mitigation = static_cast(atoi(row[5])); + e.attack = static_cast(atoi(row[6])); + e.strength = static_cast(atoi(row[7])); + e.stamina = static_cast(atoi(row[8])); + e.dexterity = static_cast(atoi(row[9])); + e.agility = static_cast(atoi(row[10])); + e.intelligence = static_cast(atoi(row[11])); + e.wisdom = static_cast(atoi(row[12])); + e.charisma = static_cast(atoi(row[13])); + e.magic_resist = static_cast(atoi(row[14])); + e.cold_resist = static_cast(atoi(row[15])); + e.fire_resist = static_cast(atoi(row[16])); + e.poison_resist = static_cast(atoi(row[17])); + e.disease_resist = static_cast(atoi(row[18])); + e.corruption_resist = static_cast(atoi(row[19])); + e.physical_resist = static_cast(atoi(row[20])); + e.min_dmg = static_cast(atoi(row[21])); + e.max_dmg = static_cast(atoi(row[22])); + e.hp_regen_rate = static_cast(atoi(row[23])); + e.attack_delay = static_cast(atoi(row[24])); + e.spell_scale = static_cast(atoi(row[25])); + e.heal_scale = static_cast(atoi(row[26])); e.special_abilities = row[27] ? row[27] : ""; return e; @@ -450,33 +450,33 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcScaleGlobalBase e{}; - e.type = atoi(row[0]); - e.level = atoi(row[1]); - e.ac = atoi(row[2]); - e.hp = atoi(row[3]); - e.accuracy = atoi(row[4]); - e.slow_mitigation = atoi(row[5]); - e.attack = atoi(row[6]); - e.strength = atoi(row[7]); - e.stamina = atoi(row[8]); - e.dexterity = atoi(row[9]); - e.agility = atoi(row[10]); - e.intelligence = atoi(row[11]); - e.wisdom = atoi(row[12]); - e.charisma = atoi(row[13]); - e.magic_resist = atoi(row[14]); - e.cold_resist = atoi(row[15]); - e.fire_resist = atoi(row[16]); - e.poison_resist = atoi(row[17]); - e.disease_resist = atoi(row[18]); - e.corruption_resist = atoi(row[19]); - e.physical_resist = atoi(row[20]); - e.min_dmg = atoi(row[21]); - e.max_dmg = atoi(row[22]); - e.hp_regen_rate = atoi(row[23]); - e.attack_delay = atoi(row[24]); - e.spell_scale = atoi(row[25]); - e.heal_scale = atoi(row[26]); + e.type = static_cast(atoi(row[0])); + e.level = static_cast(atoi(row[1])); + e.ac = static_cast(atoi(row[2])); + e.hp = static_cast(atoi(row[3])); + e.accuracy = static_cast(atoi(row[4])); + e.slow_mitigation = static_cast(atoi(row[5])); + e.attack = static_cast(atoi(row[6])); + e.strength = static_cast(atoi(row[7])); + e.stamina = static_cast(atoi(row[8])); + e.dexterity = static_cast(atoi(row[9])); + e.agility = static_cast(atoi(row[10])); + e.intelligence = static_cast(atoi(row[11])); + e.wisdom = static_cast(atoi(row[12])); + e.charisma = static_cast(atoi(row[13])); + e.magic_resist = static_cast(atoi(row[14])); + e.cold_resist = static_cast(atoi(row[15])); + e.fire_resist = static_cast(atoi(row[16])); + e.poison_resist = static_cast(atoi(row[17])); + e.disease_resist = static_cast(atoi(row[18])); + e.corruption_resist = static_cast(atoi(row[19])); + e.physical_resist = static_cast(atoi(row[20])); + e.min_dmg = static_cast(atoi(row[21])); + e.max_dmg = static_cast(atoi(row[22])); + e.hp_regen_rate = static_cast(atoi(row[23])); + e.attack_delay = static_cast(atoi(row[24])); + e.spell_scale = static_cast(atoi(row[25])); + e.heal_scale = static_cast(atoi(row[26])); e.special_abilities = row[27] ? row[27] : ""; all_entries.push_back(e); @@ -502,33 +502,33 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcScaleGlobalBase e{}; - e.type = atoi(row[0]); - e.level = atoi(row[1]); - e.ac = atoi(row[2]); - e.hp = atoi(row[3]); - e.accuracy = atoi(row[4]); - e.slow_mitigation = atoi(row[5]); - e.attack = atoi(row[6]); - e.strength = atoi(row[7]); - e.stamina = atoi(row[8]); - e.dexterity = atoi(row[9]); - e.agility = atoi(row[10]); - e.intelligence = atoi(row[11]); - e.wisdom = atoi(row[12]); - e.charisma = atoi(row[13]); - e.magic_resist = atoi(row[14]); - e.cold_resist = atoi(row[15]); - e.fire_resist = atoi(row[16]); - e.poison_resist = atoi(row[17]); - e.disease_resist = atoi(row[18]); - e.corruption_resist = atoi(row[19]); - e.physical_resist = atoi(row[20]); - e.min_dmg = atoi(row[21]); - e.max_dmg = atoi(row[22]); - e.hp_regen_rate = atoi(row[23]); - e.attack_delay = atoi(row[24]); - e.spell_scale = atoi(row[25]); - e.heal_scale = atoi(row[26]); + e.type = static_cast(atoi(row[0])); + e.level = static_cast(atoi(row[1])); + e.ac = static_cast(atoi(row[2])); + e.hp = static_cast(atoi(row[3])); + e.accuracy = static_cast(atoi(row[4])); + e.slow_mitigation = static_cast(atoi(row[5])); + e.attack = static_cast(atoi(row[6])); + e.strength = static_cast(atoi(row[7])); + e.stamina = static_cast(atoi(row[8])); + e.dexterity = static_cast(atoi(row[9])); + e.agility = static_cast(atoi(row[10])); + e.intelligence = static_cast(atoi(row[11])); + e.wisdom = static_cast(atoi(row[12])); + e.charisma = static_cast(atoi(row[13])); + e.magic_resist = static_cast(atoi(row[14])); + e.cold_resist = static_cast(atoi(row[15])); + e.fire_resist = static_cast(atoi(row[16])); + e.poison_resist = static_cast(atoi(row[17])); + e.disease_resist = static_cast(atoi(row[18])); + e.corruption_resist = static_cast(atoi(row[19])); + e.physical_resist = static_cast(atoi(row[20])); + e.min_dmg = static_cast(atoi(row[21])); + e.max_dmg = static_cast(atoi(row[22])); + e.hp_regen_rate = static_cast(atoi(row[23])); + e.attack_delay = static_cast(atoi(row[24])); + e.spell_scale = static_cast(atoi(row[25])); + e.heal_scale = static_cast(atoi(row[26])); e.special_abilities = row[27] ? row[27] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_npc_spells_effects_entries_repository.h b/common/repositories/base/base_npc_spells_effects_entries_repository.h index 13909f0eb..257b5ffc7 100644 --- a/common/repositories/base/base_npc_spells_effects_entries_repository.h +++ b/common/repositories/base/base_npc_spells_effects_entries_repository.h @@ -19,14 +19,14 @@ class BaseNpcSpellsEffectsEntriesRepository { public: struct NpcSpellsEffectsEntries { - int id; - int npc_spells_effects_id; - int spell_effect_id; - int minlevel; - int maxlevel; - int se_base; - int se_limit; - int se_max; + uint32_t id; + int32_t npc_spells_effects_id; + int16_t spell_effect_id; + uint8_t minlevel; + uint8_t maxlevel; + int32_t se_base; + int32_t se_limit; + int32_t se_max; }; static std::string PrimaryKey() @@ -142,14 +142,14 @@ public: if (results.RowCount() == 1) { NpcSpellsEffectsEntries e{}; - e.id = atoi(row[0]); - e.npc_spells_effects_id = atoi(row[1]); - e.spell_effect_id = atoi(row[2]); - e.minlevel = atoi(row[3]); - e.maxlevel = atoi(row[4]); - e.se_base = atoi(row[5]); - e.se_limit = atoi(row[6]); - e.se_max = atoi(row[7]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.npc_spells_effects_id = static_cast(atoi(row[1])); + e.spell_effect_id = static_cast(atoi(row[2])); + e.minlevel = static_cast(strtoul(row[3], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[4], nullptr, 10)); + e.se_base = static_cast(atoi(row[5])); + e.se_limit = static_cast(atoi(row[6])); + e.se_max = static_cast(atoi(row[7])); return e; } @@ -289,14 +289,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpellsEffectsEntries e{}; - e.id = atoi(row[0]); - e.npc_spells_effects_id = atoi(row[1]); - e.spell_effect_id = atoi(row[2]); - e.minlevel = atoi(row[3]); - e.maxlevel = atoi(row[4]); - e.se_base = atoi(row[5]); - e.se_limit = atoi(row[6]); - e.se_max = atoi(row[7]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.npc_spells_effects_id = static_cast(atoi(row[1])); + e.spell_effect_id = static_cast(atoi(row[2])); + e.minlevel = static_cast(strtoul(row[3], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[4], nullptr, 10)); + e.se_base = static_cast(atoi(row[5])); + e.se_limit = static_cast(atoi(row[6])); + e.se_max = static_cast(atoi(row[7])); all_entries.push_back(e); } @@ -321,14 +321,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpellsEffectsEntries e{}; - e.id = atoi(row[0]); - e.npc_spells_effects_id = atoi(row[1]); - e.spell_effect_id = atoi(row[2]); - e.minlevel = atoi(row[3]); - e.maxlevel = atoi(row[4]); - e.se_base = atoi(row[5]); - e.se_limit = atoi(row[6]); - e.se_max = atoi(row[7]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.npc_spells_effects_id = static_cast(atoi(row[1])); + e.spell_effect_id = static_cast(atoi(row[2])); + e.minlevel = static_cast(strtoul(row[3], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[4], nullptr, 10)); + e.se_base = static_cast(atoi(row[5])); + e.se_limit = static_cast(atoi(row[6])); + e.se_max = static_cast(atoi(row[7])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_spells_effects_repository.h b/common/repositories/base/base_npc_spells_effects_repository.h index 319835d5c..333dc615c 100644 --- a/common/repositories/base/base_npc_spells_effects_repository.h +++ b/common/repositories/base/base_npc_spells_effects_repository.h @@ -19,9 +19,9 @@ class BaseNpcSpellsEffectsRepository { public: struct NpcSpellsEffects { - int id; + uint32_t id; std::string name; - int parent_list; + uint32_t parent_list; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { NpcSpellsEffects e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.parent_list = atoi(row[2]); + e.parent_list = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpellsEffects e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.parent_list = atoi(row[2]); + e.parent_list = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpellsEffects e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.parent_list = atoi(row[2]); + e.parent_list = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_spells_entries_repository.h b/common/repositories/base/base_npc_spells_entries_repository.h index 01fea395c..1b946a24a 100644 --- a/common/repositories/base/base_npc_spells_entries_repository.h +++ b/common/repositories/base/base_npc_spells_entries_repository.h @@ -19,18 +19,18 @@ class BaseNpcSpellsEntriesRepository { public: struct NpcSpellsEntries { - int id; - int npc_spells_id; - int spellid; - int type; - int minlevel; - int maxlevel; - int manacost; - int recast_delay; - int priority; - int resist_adjust; - int min_hp; - int max_hp; + uint32_t id; + int32_t npc_spells_id; + uint16_t spellid; + uint32_t type; + uint8_t minlevel; + uint8_t maxlevel; + int16_t manacost; + int32_t recast_delay; + int16_t priority; + int32_t resist_adjust; + int16_t min_hp; + int16_t max_hp; }; static std::string PrimaryKey() @@ -158,18 +158,18 @@ public: if (results.RowCount() == 1) { NpcSpellsEntries e{}; - e.id = atoi(row[0]); - e.npc_spells_id = atoi(row[1]); - e.spellid = atoi(row[2]); - e.type = atoi(row[3]); - e.minlevel = atoi(row[4]); - e.maxlevel = atoi(row[5]); - e.manacost = atoi(row[6]); - e.recast_delay = atoi(row[7]); - e.priority = atoi(row[8]); - e.resist_adjust = atoi(row[9]); - e.min_hp = atoi(row[10]); - e.max_hp = atoi(row[11]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.npc_spells_id = static_cast(atoi(row[1])); + e.spellid = static_cast(strtoul(row[2], nullptr, 10)); + e.type = static_cast(strtoul(row[3], nullptr, 10)); + e.minlevel = static_cast(strtoul(row[4], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[5], nullptr, 10)); + e.manacost = static_cast(atoi(row[6])); + e.recast_delay = static_cast(atoi(row[7])); + e.priority = static_cast(atoi(row[8])); + e.resist_adjust = static_cast(atoi(row[9])); + e.min_hp = static_cast(atoi(row[10])); + e.max_hp = static_cast(atoi(row[11])); return e; } @@ -321,18 +321,18 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpellsEntries e{}; - e.id = atoi(row[0]); - e.npc_spells_id = atoi(row[1]); - e.spellid = atoi(row[2]); - e.type = atoi(row[3]); - e.minlevel = atoi(row[4]); - e.maxlevel = atoi(row[5]); - e.manacost = atoi(row[6]); - e.recast_delay = atoi(row[7]); - e.priority = atoi(row[8]); - e.resist_adjust = atoi(row[9]); - e.min_hp = atoi(row[10]); - e.max_hp = atoi(row[11]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.npc_spells_id = static_cast(atoi(row[1])); + e.spellid = static_cast(strtoul(row[2], nullptr, 10)); + e.type = static_cast(strtoul(row[3], nullptr, 10)); + e.minlevel = static_cast(strtoul(row[4], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[5], nullptr, 10)); + e.manacost = static_cast(atoi(row[6])); + e.recast_delay = static_cast(atoi(row[7])); + e.priority = static_cast(atoi(row[8])); + e.resist_adjust = static_cast(atoi(row[9])); + e.min_hp = static_cast(atoi(row[10])); + e.max_hp = static_cast(atoi(row[11])); all_entries.push_back(e); } @@ -357,18 +357,18 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpellsEntries e{}; - e.id = atoi(row[0]); - e.npc_spells_id = atoi(row[1]); - e.spellid = atoi(row[2]); - e.type = atoi(row[3]); - e.minlevel = atoi(row[4]); - e.maxlevel = atoi(row[5]); - e.manacost = atoi(row[6]); - e.recast_delay = atoi(row[7]); - e.priority = atoi(row[8]); - e.resist_adjust = atoi(row[9]); - e.min_hp = atoi(row[10]); - e.max_hp = atoi(row[11]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.npc_spells_id = static_cast(atoi(row[1])); + e.spellid = static_cast(strtoul(row[2], nullptr, 10)); + e.type = static_cast(strtoul(row[3], nullptr, 10)); + e.minlevel = static_cast(strtoul(row[4], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[5], nullptr, 10)); + e.manacost = static_cast(atoi(row[6])); + e.recast_delay = static_cast(atoi(row[7])); + e.priority = static_cast(atoi(row[8])); + e.resist_adjust = static_cast(atoi(row[9])); + e.min_hp = static_cast(atoi(row[10])); + e.max_hp = static_cast(atoi(row[11])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_spells_repository.h b/common/repositories/base/base_npc_spells_repository.h index 1b72d4bda..576333a1d 100644 --- a/common/repositories/base/base_npc_spells_repository.h +++ b/common/repositories/base/base_npc_spells_repository.h @@ -19,27 +19,27 @@ class BaseNpcSpellsRepository { public: struct NpcSpells { - int id; + uint32_t id; std::string name; - int parent_list; - int attack_proc; - int proc_chance; - int range_proc; - int rproc_chance; - int defensive_proc; - int dproc_chance; - int fail_recast; - int engaged_no_sp_recast_min; - int engaged_no_sp_recast_max; - int engaged_b_self_chance; - int engaged_b_other_chance; - int engaged_d_chance; - int pursue_no_sp_recast_min; - int pursue_no_sp_recast_max; - int pursue_d_chance; - int idle_no_sp_recast_min; - int idle_no_sp_recast_max; - int idle_b_chance; + uint32_t parent_list; + int16_t attack_proc; + int8_t proc_chance; + int16_t range_proc; + int16_t rproc_chance; + int16_t defensive_proc; + int16_t dproc_chance; + uint32_t fail_recast; + uint32_t engaged_no_sp_recast_min; + uint32_t engaged_no_sp_recast_max; + uint8_t engaged_b_self_chance; + uint8_t engaged_b_other_chance; + uint8_t engaged_d_chance; + uint32_t pursue_no_sp_recast_min; + uint32_t pursue_no_sp_recast_max; + uint8_t pursue_d_chance; + uint32_t idle_no_sp_recast_min; + uint32_t idle_no_sp_recast_max; + uint8_t idle_b_chance; }; static std::string PrimaryKey() @@ -194,27 +194,27 @@ public: if (results.RowCount() == 1) { NpcSpells e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.parent_list = atoi(row[2]); - e.attack_proc = atoi(row[3]); - e.proc_chance = atoi(row[4]); - e.range_proc = atoi(row[5]); - e.rproc_chance = atoi(row[6]); - e.defensive_proc = atoi(row[7]); - e.dproc_chance = atoi(row[8]); - e.fail_recast = atoi(row[9]); - e.engaged_no_sp_recast_min = atoi(row[10]); - e.engaged_no_sp_recast_max = atoi(row[11]); - e.engaged_b_self_chance = atoi(row[12]); - e.engaged_b_other_chance = atoi(row[13]); - e.engaged_d_chance = atoi(row[14]); - e.pursue_no_sp_recast_min = atoi(row[15]); - e.pursue_no_sp_recast_max = atoi(row[16]); - e.pursue_d_chance = atoi(row[17]); - e.idle_no_sp_recast_min = atoi(row[18]); - e.idle_no_sp_recast_max = atoi(row[19]); - e.idle_b_chance = atoi(row[20]); + e.parent_list = static_cast(strtoul(row[2], nullptr, 10)); + e.attack_proc = static_cast(atoi(row[3])); + e.proc_chance = static_cast(atoi(row[4])); + e.range_proc = static_cast(atoi(row[5])); + e.rproc_chance = static_cast(atoi(row[6])); + e.defensive_proc = static_cast(atoi(row[7])); + e.dproc_chance = static_cast(atoi(row[8])); + e.fail_recast = static_cast(strtoul(row[9], nullptr, 10)); + e.engaged_no_sp_recast_min = static_cast(strtoul(row[10], nullptr, 10)); + e.engaged_no_sp_recast_max = static_cast(strtoul(row[11], nullptr, 10)); + e.engaged_b_self_chance = static_cast(strtoul(row[12], nullptr, 10)); + e.engaged_b_other_chance = static_cast(strtoul(row[13], nullptr, 10)); + e.engaged_d_chance = static_cast(strtoul(row[14], nullptr, 10)); + e.pursue_no_sp_recast_min = static_cast(strtoul(row[15], nullptr, 10)); + e.pursue_no_sp_recast_max = static_cast(strtoul(row[16], nullptr, 10)); + e.pursue_d_chance = static_cast(strtoul(row[17], nullptr, 10)); + e.idle_no_sp_recast_min = static_cast(strtoul(row[18], nullptr, 10)); + e.idle_no_sp_recast_max = static_cast(strtoul(row[19], nullptr, 10)); + e.idle_b_chance = static_cast(strtoul(row[20], nullptr, 10)); return e; } @@ -393,27 +393,27 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpells e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.parent_list = atoi(row[2]); - e.attack_proc = atoi(row[3]); - e.proc_chance = atoi(row[4]); - e.range_proc = atoi(row[5]); - e.rproc_chance = atoi(row[6]); - e.defensive_proc = atoi(row[7]); - e.dproc_chance = atoi(row[8]); - e.fail_recast = atoi(row[9]); - e.engaged_no_sp_recast_min = atoi(row[10]); - e.engaged_no_sp_recast_max = atoi(row[11]); - e.engaged_b_self_chance = atoi(row[12]); - e.engaged_b_other_chance = atoi(row[13]); - e.engaged_d_chance = atoi(row[14]); - e.pursue_no_sp_recast_min = atoi(row[15]); - e.pursue_no_sp_recast_max = atoi(row[16]); - e.pursue_d_chance = atoi(row[17]); - e.idle_no_sp_recast_min = atoi(row[18]); - e.idle_no_sp_recast_max = atoi(row[19]); - e.idle_b_chance = atoi(row[20]); + e.parent_list = static_cast(strtoul(row[2], nullptr, 10)); + e.attack_proc = static_cast(atoi(row[3])); + e.proc_chance = static_cast(atoi(row[4])); + e.range_proc = static_cast(atoi(row[5])); + e.rproc_chance = static_cast(atoi(row[6])); + e.defensive_proc = static_cast(atoi(row[7])); + e.dproc_chance = static_cast(atoi(row[8])); + e.fail_recast = static_cast(strtoul(row[9], nullptr, 10)); + e.engaged_no_sp_recast_min = static_cast(strtoul(row[10], nullptr, 10)); + e.engaged_no_sp_recast_max = static_cast(strtoul(row[11], nullptr, 10)); + e.engaged_b_self_chance = static_cast(strtoul(row[12], nullptr, 10)); + e.engaged_b_other_chance = static_cast(strtoul(row[13], nullptr, 10)); + e.engaged_d_chance = static_cast(strtoul(row[14], nullptr, 10)); + e.pursue_no_sp_recast_min = static_cast(strtoul(row[15], nullptr, 10)); + e.pursue_no_sp_recast_max = static_cast(strtoul(row[16], nullptr, 10)); + e.pursue_d_chance = static_cast(strtoul(row[17], nullptr, 10)); + e.idle_no_sp_recast_min = static_cast(strtoul(row[18], nullptr, 10)); + e.idle_no_sp_recast_max = static_cast(strtoul(row[19], nullptr, 10)); + e.idle_b_chance = static_cast(strtoul(row[20], nullptr, 10)); all_entries.push_back(e); } @@ -438,27 +438,27 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcSpells e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.parent_list = atoi(row[2]); - e.attack_proc = atoi(row[3]); - e.proc_chance = atoi(row[4]); - e.range_proc = atoi(row[5]); - e.rproc_chance = atoi(row[6]); - e.defensive_proc = atoi(row[7]); - e.dproc_chance = atoi(row[8]); - e.fail_recast = atoi(row[9]); - e.engaged_no_sp_recast_min = atoi(row[10]); - e.engaged_no_sp_recast_max = atoi(row[11]); - e.engaged_b_self_chance = atoi(row[12]); - e.engaged_b_other_chance = atoi(row[13]); - e.engaged_d_chance = atoi(row[14]); - e.pursue_no_sp_recast_min = atoi(row[15]); - e.pursue_no_sp_recast_max = atoi(row[16]); - e.pursue_d_chance = atoi(row[17]); - e.idle_no_sp_recast_min = atoi(row[18]); - e.idle_no_sp_recast_max = atoi(row[19]); - e.idle_b_chance = atoi(row[20]); + e.parent_list = static_cast(strtoul(row[2], nullptr, 10)); + e.attack_proc = static_cast(atoi(row[3])); + e.proc_chance = static_cast(atoi(row[4])); + e.range_proc = static_cast(atoi(row[5])); + e.rproc_chance = static_cast(atoi(row[6])); + e.defensive_proc = static_cast(atoi(row[7])); + e.dproc_chance = static_cast(atoi(row[8])); + e.fail_recast = static_cast(strtoul(row[9], nullptr, 10)); + e.engaged_no_sp_recast_min = static_cast(strtoul(row[10], nullptr, 10)); + e.engaged_no_sp_recast_max = static_cast(strtoul(row[11], nullptr, 10)); + e.engaged_b_self_chance = static_cast(strtoul(row[12], nullptr, 10)); + e.engaged_b_other_chance = static_cast(strtoul(row[13], nullptr, 10)); + e.engaged_d_chance = static_cast(strtoul(row[14], nullptr, 10)); + e.pursue_no_sp_recast_min = static_cast(strtoul(row[15], nullptr, 10)); + e.pursue_no_sp_recast_max = static_cast(strtoul(row[16], nullptr, 10)); + e.pursue_d_chance = static_cast(strtoul(row[17], nullptr, 10)); + e.idle_no_sp_recast_min = static_cast(strtoul(row[18], nullptr, 10)); + e.idle_no_sp_recast_max = static_cast(strtoul(row[19], nullptr, 10)); + e.idle_b_chance = static_cast(strtoul(row[20], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_types_repository.h b/common/repositories/base/base_npc_types_repository.h index 2f4bc3534..30e259d2a 100644 --- a/common/repositories/base/base_npc_types_repository.h +++ b/common/repositories/base/base_npc_types_repository.h @@ -19,131 +19,131 @@ class BaseNpcTypesRepository { public: struct NpcTypes { - int id; + int32_t id; std::string name; std::string lastname; - int level; - int race; - int class_; - int bodytype; - int64 hp; - int64 mana; - int gender; - int texture; - int helmtexture; - int herosforgemodel; + uint8_t level; + uint16_t race; + uint8_t class_; + int32_t bodytype; + int64_t hp; + int64_t mana; + uint8_t gender; + uint8_t texture; + uint8_t helmtexture; + int32_t herosforgemodel; float size; - int64 hp_regen_rate; - int64 hp_regen_per_second; - int64 mana_regen_rate; - int loottable_id; - int merchant_id; - int alt_currency_id; - int npc_spells_id; - int npc_spells_effects_id; - int npc_faction_id; - int adventure_template_id; - int trap_template; - int mindmg; - int maxdmg; - int attack_count; + int64_t hp_regen_rate; + int64_t hp_regen_per_second; + int64_t mana_regen_rate; + uint32_t loottable_id; + uint32_t merchant_id; + uint32_t alt_currency_id; + uint32_t npc_spells_id; + uint32_t npc_spells_effects_id; + int32_t npc_faction_id; + uint32_t adventure_template_id; + uint32_t trap_template; + uint32_t mindmg; + uint32_t maxdmg; + int16_t attack_count; std::string npcspecialattks; std::string special_abilities; - int aggroradius; - int assistradius; - int face; - int luclin_hairstyle; - int luclin_haircolor; - int luclin_eyecolor; - int luclin_eyecolor2; - int luclin_beardcolor; - int luclin_beard; - int drakkin_heritage; - int drakkin_tattoo; - int drakkin_details; - int armortint_id; - int armortint_red; - int armortint_green; - int armortint_blue; - int d_melee_texture1; - int d_melee_texture2; + uint32_t aggroradius; + uint32_t assistradius; + uint32_t face; + uint32_t luclin_hairstyle; + uint32_t luclin_haircolor; + uint32_t luclin_eyecolor; + uint32_t luclin_eyecolor2; + uint32_t luclin_beardcolor; + uint32_t luclin_beard; + int32_t drakkin_heritage; + int32_t drakkin_tattoo; + int32_t drakkin_details; + uint32_t armortint_id; + uint8_t armortint_red; + uint8_t armortint_green; + uint8_t armortint_blue; + int32_t d_melee_texture1; + int32_t d_melee_texture2; std::string ammo_idfile; - int prim_melee_type; - int sec_melee_type; - int ranged_type; + uint8_t prim_melee_type; + uint8_t sec_melee_type; + uint8_t ranged_type; float runspeed; - int MR; - int CR; - int DR; - int FR; - int PR; - int Corrup; - int PhR; - int see_invis; - int see_invis_undead; - int qglobal; - int AC; - int npc_aggro; - int spawn_limit; + int16_t MR; + int16_t CR; + int16_t DR; + int16_t FR; + int16_t PR; + int16_t Corrup; + uint16_t PhR; + int16_t see_invis; + int16_t see_invis_undead; + uint32_t qglobal; + int16_t AC; + int8_t npc_aggro; + int8_t spawn_limit; float attack_speed; - int attack_delay; - int findable; - int STR; - int STA; - int DEX; - int AGI; - int _INT; - int WIS; - int CHA; - int see_hide; - int see_improved_hide; - int trackable; - int isbot; - int exclude; - int ATK; - int Accuracy; - int Avoidance; - int slow_mitigation; - int version; - int maxlevel; - int scalerate; - int private_corpse; - int unique_spawn_by_name; - int underwater; - int isquest; - int emoteid; + uint8_t attack_delay; + int8_t findable; + uint32_t STR; + uint32_t STA; + uint32_t DEX; + uint32_t AGI; + uint32_t _INT; + uint32_t WIS; + uint32_t CHA; + int8_t see_hide; + int8_t see_improved_hide; + int8_t trackable; + int8_t isbot; + int8_t exclude; + int32_t ATK; + int32_t Accuracy; + uint32_t Avoidance; + int16_t slow_mitigation; + uint16_t version; + int8_t maxlevel; + int32_t scalerate; + uint8_t private_corpse; + uint8_t unique_spawn_by_name; + uint8_t underwater; + int8_t isquest; + uint32_t emoteid; float spellscale; float healscale; - int no_target_hotkey; - int raid_target; - int armtexture; - int bracertexture; - int handtexture; - int legtexture; - int feettexture; - int light; - int walkspeed; - int peqid; - int unique_; - int fixed; - int ignore_despawn; - int show_name; - int untargetable; - int charm_ac; - int charm_min_dmg; - int charm_max_dmg; - int charm_attack_delay; - int charm_accuracy_rating; - int charm_avoidance_rating; - int charm_atk; - int skip_global_loot; - int rare_spawn; - int stuck_behavior; - int model; - int flymode; - int always_aggro; - int exp_mod; - int heroic_strikethrough; + uint8_t no_target_hotkey; + uint8_t raid_target; + int8_t armtexture; + int8_t bracertexture; + int8_t handtexture; + int8_t legtexture; + int8_t feettexture; + int8_t light; + int8_t walkspeed; + int32_t peqid; + int8_t unique_; + int8_t fixed; + int8_t ignore_despawn; + int8_t show_name; + int8_t untargetable; + int16_t charm_ac; + int32_t charm_min_dmg; + int32_t charm_max_dmg; + int8_t charm_attack_delay; + int32_t charm_accuracy_rating; + int32_t charm_avoidance_rating; + int32_t charm_atk; + int8_t skip_global_loot; + int8_t rare_spawn; + int8_t stuck_behavior; + int16_t model; + int8_t flymode; + int8_t always_aggro; + int32_t exp_mod; + int32_t heroic_strikethrough; }; static std::string PrimaryKey() @@ -610,131 +610,131 @@ public: if (results.RowCount() == 1) { NpcTypes e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.lastname = row[2] ? row[2] : ""; - e.level = atoi(row[3]); - e.race = atoi(row[4]); - e.class_ = atoi(row[5]); - e.bodytype = atoi(row[6]); + e.level = static_cast(strtoul(row[3], nullptr, 10)); + e.race = static_cast(strtoul(row[4], nullptr, 10)); + e.class_ = static_cast(strtoul(row[5], nullptr, 10)); + e.bodytype = static_cast(atoi(row[6])); e.hp = strtoll(row[7], nullptr, 10); e.mana = strtoll(row[8], nullptr, 10); - e.gender = atoi(row[9]); - e.texture = atoi(row[10]); - e.helmtexture = atoi(row[11]); - e.herosforgemodel = atoi(row[12]); - e.size = static_cast(atof(row[13])); + e.gender = static_cast(strtoul(row[9], nullptr, 10)); + e.texture = static_cast(strtoul(row[10], nullptr, 10)); + e.helmtexture = static_cast(strtoul(row[11], nullptr, 10)); + e.herosforgemodel = static_cast(atoi(row[12])); + e.size = strtof(row[13], nullptr); e.hp_regen_rate = strtoll(row[14], nullptr, 10); e.hp_regen_per_second = strtoll(row[15], nullptr, 10); e.mana_regen_rate = strtoll(row[16], nullptr, 10); - e.loottable_id = atoi(row[17]); - e.merchant_id = atoi(row[18]); - e.alt_currency_id = atoi(row[19]); - e.npc_spells_id = atoi(row[20]); - e.npc_spells_effects_id = atoi(row[21]); - e.npc_faction_id = atoi(row[22]); - e.adventure_template_id = atoi(row[23]); - e.trap_template = atoi(row[24]); - e.mindmg = atoi(row[25]); - e.maxdmg = atoi(row[26]); - e.attack_count = atoi(row[27]); + e.loottable_id = static_cast(strtoul(row[17], nullptr, 10)); + e.merchant_id = static_cast(strtoul(row[18], nullptr, 10)); + e.alt_currency_id = static_cast(strtoul(row[19], nullptr, 10)); + e.npc_spells_id = static_cast(strtoul(row[20], nullptr, 10)); + e.npc_spells_effects_id = static_cast(strtoul(row[21], nullptr, 10)); + e.npc_faction_id = static_cast(atoi(row[22])); + e.adventure_template_id = static_cast(strtoul(row[23], nullptr, 10)); + e.trap_template = static_cast(strtoul(row[24], nullptr, 10)); + e.mindmg = static_cast(strtoul(row[25], nullptr, 10)); + e.maxdmg = static_cast(strtoul(row[26], nullptr, 10)); + e.attack_count = static_cast(atoi(row[27])); e.npcspecialattks = row[28] ? row[28] : ""; e.special_abilities = row[29] ? row[29] : ""; - e.aggroradius = atoi(row[30]); - e.assistradius = atoi(row[31]); - e.face = atoi(row[32]); - e.luclin_hairstyle = atoi(row[33]); - e.luclin_haircolor = atoi(row[34]); - e.luclin_eyecolor = atoi(row[35]); - e.luclin_eyecolor2 = atoi(row[36]); - e.luclin_beardcolor = atoi(row[37]); - e.luclin_beard = atoi(row[38]); - e.drakkin_heritage = atoi(row[39]); - e.drakkin_tattoo = atoi(row[40]); - e.drakkin_details = atoi(row[41]); - e.armortint_id = atoi(row[42]); - e.armortint_red = atoi(row[43]); - e.armortint_green = atoi(row[44]); - e.armortint_blue = atoi(row[45]); - e.d_melee_texture1 = atoi(row[46]); - e.d_melee_texture2 = atoi(row[47]); + e.aggroradius = static_cast(strtoul(row[30], nullptr, 10)); + e.assistradius = static_cast(strtoul(row[31], nullptr, 10)); + e.face = static_cast(strtoul(row[32], nullptr, 10)); + e.luclin_hairstyle = static_cast(strtoul(row[33], nullptr, 10)); + e.luclin_haircolor = static_cast(strtoul(row[34], nullptr, 10)); + e.luclin_eyecolor = static_cast(strtoul(row[35], nullptr, 10)); + e.luclin_eyecolor2 = static_cast(strtoul(row[36], nullptr, 10)); + e.luclin_beardcolor = static_cast(strtoul(row[37], nullptr, 10)); + e.luclin_beard = static_cast(strtoul(row[38], nullptr, 10)); + e.drakkin_heritage = static_cast(atoi(row[39])); + e.drakkin_tattoo = static_cast(atoi(row[40])); + e.drakkin_details = static_cast(atoi(row[41])); + e.armortint_id = static_cast(strtoul(row[42], nullptr, 10)); + e.armortint_red = static_cast(strtoul(row[43], nullptr, 10)); + e.armortint_green = static_cast(strtoul(row[44], nullptr, 10)); + e.armortint_blue = static_cast(strtoul(row[45], nullptr, 10)); + e.d_melee_texture1 = static_cast(atoi(row[46])); + e.d_melee_texture2 = static_cast(atoi(row[47])); e.ammo_idfile = row[48] ? row[48] : ""; - e.prim_melee_type = atoi(row[49]); - e.sec_melee_type = atoi(row[50]); - e.ranged_type = atoi(row[51]); - e.runspeed = static_cast(atof(row[52])); - e.MR = atoi(row[53]); - e.CR = atoi(row[54]); - e.DR = atoi(row[55]); - e.FR = atoi(row[56]); - e.PR = atoi(row[57]); - e.Corrup = atoi(row[58]); - e.PhR = atoi(row[59]); - e.see_invis = atoi(row[60]); - e.see_invis_undead = atoi(row[61]); - e.qglobal = atoi(row[62]); - e.AC = atoi(row[63]); - e.npc_aggro = atoi(row[64]); - e.spawn_limit = atoi(row[65]); - e.attack_speed = static_cast(atof(row[66])); - e.attack_delay = atoi(row[67]); - e.findable = atoi(row[68]); - e.STR = atoi(row[69]); - e.STA = atoi(row[70]); - e.DEX = atoi(row[71]); - e.AGI = atoi(row[72]); - e._INT = atoi(row[73]); - e.WIS = atoi(row[74]); - e.CHA = atoi(row[75]); - e.see_hide = atoi(row[76]); - e.see_improved_hide = atoi(row[77]); - e.trackable = atoi(row[78]); - e.isbot = atoi(row[79]); - e.exclude = atoi(row[80]); - e.ATK = atoi(row[81]); - e.Accuracy = atoi(row[82]); - e.Avoidance = atoi(row[83]); - e.slow_mitigation = atoi(row[84]); - e.version = atoi(row[85]); - e.maxlevel = atoi(row[86]); - e.scalerate = atoi(row[87]); - e.private_corpse = atoi(row[88]); - e.unique_spawn_by_name = atoi(row[89]); - e.underwater = atoi(row[90]); - e.isquest = atoi(row[91]); - e.emoteid = atoi(row[92]); - e.spellscale = static_cast(atof(row[93])); - e.healscale = static_cast(atof(row[94])); - e.no_target_hotkey = atoi(row[95]); - e.raid_target = atoi(row[96]); - e.armtexture = atoi(row[97]); - e.bracertexture = atoi(row[98]); - e.handtexture = atoi(row[99]); - e.legtexture = atoi(row[100]); - e.feettexture = atoi(row[101]); - e.light = atoi(row[102]); - e.walkspeed = atoi(row[103]); - e.peqid = atoi(row[104]); - e.unique_ = atoi(row[105]); - e.fixed = atoi(row[106]); - e.ignore_despawn = atoi(row[107]); - e.show_name = atoi(row[108]); - e.untargetable = atoi(row[109]); - e.charm_ac = atoi(row[110]); - e.charm_min_dmg = atoi(row[111]); - e.charm_max_dmg = atoi(row[112]); - e.charm_attack_delay = atoi(row[113]); - e.charm_accuracy_rating = atoi(row[114]); - e.charm_avoidance_rating = atoi(row[115]); - e.charm_atk = atoi(row[116]); - e.skip_global_loot = atoi(row[117]); - e.rare_spawn = atoi(row[118]); - e.stuck_behavior = atoi(row[119]); - e.model = atoi(row[120]); - e.flymode = atoi(row[121]); - e.always_aggro = atoi(row[122]); - e.exp_mod = atoi(row[123]); - e.heroic_strikethrough = atoi(row[124]); + e.prim_melee_type = static_cast(strtoul(row[49], nullptr, 10)); + e.sec_melee_type = static_cast(strtoul(row[50], nullptr, 10)); + e.ranged_type = static_cast(strtoul(row[51], nullptr, 10)); + e.runspeed = strtof(row[52], nullptr); + e.MR = static_cast(atoi(row[53])); + e.CR = static_cast(atoi(row[54])); + e.DR = static_cast(atoi(row[55])); + e.FR = static_cast(atoi(row[56])); + e.PR = static_cast(atoi(row[57])); + e.Corrup = static_cast(atoi(row[58])); + e.PhR = static_cast(strtoul(row[59], nullptr, 10)); + e.see_invis = static_cast(atoi(row[60])); + e.see_invis_undead = static_cast(atoi(row[61])); + e.qglobal = static_cast(strtoul(row[62], nullptr, 10)); + e.AC = static_cast(atoi(row[63])); + e.npc_aggro = static_cast(atoi(row[64])); + e.spawn_limit = static_cast(atoi(row[65])); + e.attack_speed = strtof(row[66], nullptr); + e.attack_delay = static_cast(strtoul(row[67], nullptr, 10)); + e.findable = static_cast(atoi(row[68])); + e.STR = static_cast(strtoul(row[69], nullptr, 10)); + e.STA = static_cast(strtoul(row[70], nullptr, 10)); + e.DEX = static_cast(strtoul(row[71], nullptr, 10)); + e.AGI = static_cast(strtoul(row[72], nullptr, 10)); + e._INT = static_cast(strtoul(row[73], nullptr, 10)); + e.WIS = static_cast(strtoul(row[74], nullptr, 10)); + e.CHA = static_cast(strtoul(row[75], nullptr, 10)); + e.see_hide = static_cast(atoi(row[76])); + e.see_improved_hide = static_cast(atoi(row[77])); + e.trackable = static_cast(atoi(row[78])); + e.isbot = static_cast(atoi(row[79])); + e.exclude = static_cast(atoi(row[80])); + e.ATK = static_cast(atoi(row[81])); + e.Accuracy = static_cast(atoi(row[82])); + e.Avoidance = static_cast(strtoul(row[83], nullptr, 10)); + e.slow_mitigation = static_cast(atoi(row[84])); + e.version = static_cast(strtoul(row[85], nullptr, 10)); + e.maxlevel = static_cast(atoi(row[86])); + e.scalerate = static_cast(atoi(row[87])); + e.private_corpse = static_cast(strtoul(row[88], nullptr, 10)); + e.unique_spawn_by_name = static_cast(strtoul(row[89], nullptr, 10)); + e.underwater = static_cast(strtoul(row[90], nullptr, 10)); + e.isquest = static_cast(atoi(row[91])); + e.emoteid = static_cast(strtoul(row[92], nullptr, 10)); + e.spellscale = strtof(row[93], nullptr); + e.healscale = strtof(row[94], nullptr); + e.no_target_hotkey = static_cast(strtoul(row[95], nullptr, 10)); + e.raid_target = static_cast(strtoul(row[96], nullptr, 10)); + e.armtexture = static_cast(atoi(row[97])); + e.bracertexture = static_cast(atoi(row[98])); + e.handtexture = static_cast(atoi(row[99])); + e.legtexture = static_cast(atoi(row[100])); + e.feettexture = static_cast(atoi(row[101])); + e.light = static_cast(atoi(row[102])); + e.walkspeed = static_cast(atoi(row[103])); + e.peqid = static_cast(atoi(row[104])); + e.unique_ = static_cast(atoi(row[105])); + e.fixed = static_cast(atoi(row[106])); + e.ignore_despawn = static_cast(atoi(row[107])); + e.show_name = static_cast(atoi(row[108])); + e.untargetable = static_cast(atoi(row[109])); + e.charm_ac = static_cast(atoi(row[110])); + e.charm_min_dmg = static_cast(atoi(row[111])); + e.charm_max_dmg = static_cast(atoi(row[112])); + e.charm_attack_delay = static_cast(atoi(row[113])); + e.charm_accuracy_rating = static_cast(atoi(row[114])); + e.charm_avoidance_rating = static_cast(atoi(row[115])); + e.charm_atk = static_cast(atoi(row[116])); + e.skip_global_loot = static_cast(atoi(row[117])); + e.rare_spawn = static_cast(atoi(row[118])); + e.stuck_behavior = static_cast(atoi(row[119])); + e.model = static_cast(atoi(row[120])); + e.flymode = static_cast(atoi(row[121])); + e.always_aggro = static_cast(atoi(row[122])); + e.exp_mod = static_cast(atoi(row[123])); + e.heroic_strikethrough = static_cast(atoi(row[124])); return e; } @@ -1037,6 +1037,7 @@ public: v.push_back(std::to_string(e.flymode)); v.push_back(std::to_string(e.always_aggro)); v.push_back(std::to_string(e.exp_mod)); + v.push_back(std::to_string(e.heroic_strikethrough)); auto results = db.QueryDatabase( fmt::format( @@ -1224,131 +1225,131 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcTypes e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.lastname = row[2] ? row[2] : ""; - e.level = atoi(row[3]); - e.race = atoi(row[4]); - e.class_ = atoi(row[5]); - e.bodytype = atoi(row[6]); + e.level = static_cast(strtoul(row[3], nullptr, 10)); + e.race = static_cast(strtoul(row[4], nullptr, 10)); + e.class_ = static_cast(strtoul(row[5], nullptr, 10)); + e.bodytype = static_cast(atoi(row[6])); e.hp = strtoll(row[7], nullptr, 10); e.mana = strtoll(row[8], nullptr, 10); - e.gender = atoi(row[9]); - e.texture = atoi(row[10]); - e.helmtexture = atoi(row[11]); - e.herosforgemodel = atoi(row[12]); - e.size = static_cast(atof(row[13])); + e.gender = static_cast(strtoul(row[9], nullptr, 10)); + e.texture = static_cast(strtoul(row[10], nullptr, 10)); + e.helmtexture = static_cast(strtoul(row[11], nullptr, 10)); + e.herosforgemodel = static_cast(atoi(row[12])); + e.size = strtof(row[13], nullptr); e.hp_regen_rate = strtoll(row[14], nullptr, 10); e.hp_regen_per_second = strtoll(row[15], nullptr, 10); e.mana_regen_rate = strtoll(row[16], nullptr, 10); - e.loottable_id = atoi(row[17]); - e.merchant_id = atoi(row[18]); - e.alt_currency_id = atoi(row[19]); - e.npc_spells_id = atoi(row[20]); - e.npc_spells_effects_id = atoi(row[21]); - e.npc_faction_id = atoi(row[22]); - e.adventure_template_id = atoi(row[23]); - e.trap_template = atoi(row[24]); - e.mindmg = atoi(row[25]); - e.maxdmg = atoi(row[26]); - e.attack_count = atoi(row[27]); + e.loottable_id = static_cast(strtoul(row[17], nullptr, 10)); + e.merchant_id = static_cast(strtoul(row[18], nullptr, 10)); + e.alt_currency_id = static_cast(strtoul(row[19], nullptr, 10)); + e.npc_spells_id = static_cast(strtoul(row[20], nullptr, 10)); + e.npc_spells_effects_id = static_cast(strtoul(row[21], nullptr, 10)); + e.npc_faction_id = static_cast(atoi(row[22])); + e.adventure_template_id = static_cast(strtoul(row[23], nullptr, 10)); + e.trap_template = static_cast(strtoul(row[24], nullptr, 10)); + e.mindmg = static_cast(strtoul(row[25], nullptr, 10)); + e.maxdmg = static_cast(strtoul(row[26], nullptr, 10)); + e.attack_count = static_cast(atoi(row[27])); e.npcspecialattks = row[28] ? row[28] : ""; e.special_abilities = row[29] ? row[29] : ""; - e.aggroradius = atoi(row[30]); - e.assistradius = atoi(row[31]); - e.face = atoi(row[32]); - e.luclin_hairstyle = atoi(row[33]); - e.luclin_haircolor = atoi(row[34]); - e.luclin_eyecolor = atoi(row[35]); - e.luclin_eyecolor2 = atoi(row[36]); - e.luclin_beardcolor = atoi(row[37]); - e.luclin_beard = atoi(row[38]); - e.drakkin_heritage = atoi(row[39]); - e.drakkin_tattoo = atoi(row[40]); - e.drakkin_details = atoi(row[41]); - e.armortint_id = atoi(row[42]); - e.armortint_red = atoi(row[43]); - e.armortint_green = atoi(row[44]); - e.armortint_blue = atoi(row[45]); - e.d_melee_texture1 = atoi(row[46]); - e.d_melee_texture2 = atoi(row[47]); + e.aggroradius = static_cast(strtoul(row[30], nullptr, 10)); + e.assistradius = static_cast(strtoul(row[31], nullptr, 10)); + e.face = static_cast(strtoul(row[32], nullptr, 10)); + e.luclin_hairstyle = static_cast(strtoul(row[33], nullptr, 10)); + e.luclin_haircolor = static_cast(strtoul(row[34], nullptr, 10)); + e.luclin_eyecolor = static_cast(strtoul(row[35], nullptr, 10)); + e.luclin_eyecolor2 = static_cast(strtoul(row[36], nullptr, 10)); + e.luclin_beardcolor = static_cast(strtoul(row[37], nullptr, 10)); + e.luclin_beard = static_cast(strtoul(row[38], nullptr, 10)); + e.drakkin_heritage = static_cast(atoi(row[39])); + e.drakkin_tattoo = static_cast(atoi(row[40])); + e.drakkin_details = static_cast(atoi(row[41])); + e.armortint_id = static_cast(strtoul(row[42], nullptr, 10)); + e.armortint_red = static_cast(strtoul(row[43], nullptr, 10)); + e.armortint_green = static_cast(strtoul(row[44], nullptr, 10)); + e.armortint_blue = static_cast(strtoul(row[45], nullptr, 10)); + e.d_melee_texture1 = static_cast(atoi(row[46])); + e.d_melee_texture2 = static_cast(atoi(row[47])); e.ammo_idfile = row[48] ? row[48] : ""; - e.prim_melee_type = atoi(row[49]); - e.sec_melee_type = atoi(row[50]); - e.ranged_type = atoi(row[51]); - e.runspeed = static_cast(atof(row[52])); - e.MR = atoi(row[53]); - e.CR = atoi(row[54]); - e.DR = atoi(row[55]); - e.FR = atoi(row[56]); - e.PR = atoi(row[57]); - e.Corrup = atoi(row[58]); - e.PhR = atoi(row[59]); - e.see_invis = atoi(row[60]); - e.see_invis_undead = atoi(row[61]); - e.qglobal = atoi(row[62]); - e.AC = atoi(row[63]); - e.npc_aggro = atoi(row[64]); - e.spawn_limit = atoi(row[65]); - e.attack_speed = static_cast(atof(row[66])); - e.attack_delay = atoi(row[67]); - e.findable = atoi(row[68]); - e.STR = atoi(row[69]); - e.STA = atoi(row[70]); - e.DEX = atoi(row[71]); - e.AGI = atoi(row[72]); - e._INT = atoi(row[73]); - e.WIS = atoi(row[74]); - e.CHA = atoi(row[75]); - e.see_hide = atoi(row[76]); - e.see_improved_hide = atoi(row[77]); - e.trackable = atoi(row[78]); - e.isbot = atoi(row[79]); - e.exclude = atoi(row[80]); - e.ATK = atoi(row[81]); - e.Accuracy = atoi(row[82]); - e.Avoidance = atoi(row[83]); - e.slow_mitigation = atoi(row[84]); - e.version = atoi(row[85]); - e.maxlevel = atoi(row[86]); - e.scalerate = atoi(row[87]); - e.private_corpse = atoi(row[88]); - e.unique_spawn_by_name = atoi(row[89]); - e.underwater = atoi(row[90]); - e.isquest = atoi(row[91]); - e.emoteid = atoi(row[92]); - e.spellscale = static_cast(atof(row[93])); - e.healscale = static_cast(atof(row[94])); - e.no_target_hotkey = atoi(row[95]); - e.raid_target = atoi(row[96]); - e.armtexture = atoi(row[97]); - e.bracertexture = atoi(row[98]); - e.handtexture = atoi(row[99]); - e.legtexture = atoi(row[100]); - e.feettexture = atoi(row[101]); - e.light = atoi(row[102]); - e.walkspeed = atoi(row[103]); - e.peqid = atoi(row[104]); - e.unique_ = atoi(row[105]); - e.fixed = atoi(row[106]); - e.ignore_despawn = atoi(row[107]); - e.show_name = atoi(row[108]); - e.untargetable = atoi(row[109]); - e.charm_ac = atoi(row[110]); - e.charm_min_dmg = atoi(row[111]); - e.charm_max_dmg = atoi(row[112]); - e.charm_attack_delay = atoi(row[113]); - e.charm_accuracy_rating = atoi(row[114]); - e.charm_avoidance_rating = atoi(row[115]); - e.charm_atk = atoi(row[116]); - e.skip_global_loot = atoi(row[117]); - e.rare_spawn = atoi(row[118]); - e.stuck_behavior = atoi(row[119]); - e.model = atoi(row[120]); - e.flymode = atoi(row[121]); - e.always_aggro = atoi(row[122]); - e.exp_mod = atoi(row[123]); - e.heroic_strikethrough = atoi(row[124]); + e.prim_melee_type = static_cast(strtoul(row[49], nullptr, 10)); + e.sec_melee_type = static_cast(strtoul(row[50], nullptr, 10)); + e.ranged_type = static_cast(strtoul(row[51], nullptr, 10)); + e.runspeed = strtof(row[52], nullptr); + e.MR = static_cast(atoi(row[53])); + e.CR = static_cast(atoi(row[54])); + e.DR = static_cast(atoi(row[55])); + e.FR = static_cast(atoi(row[56])); + e.PR = static_cast(atoi(row[57])); + e.Corrup = static_cast(atoi(row[58])); + e.PhR = static_cast(strtoul(row[59], nullptr, 10)); + e.see_invis = static_cast(atoi(row[60])); + e.see_invis_undead = static_cast(atoi(row[61])); + e.qglobal = static_cast(strtoul(row[62], nullptr, 10)); + e.AC = static_cast(atoi(row[63])); + e.npc_aggro = static_cast(atoi(row[64])); + e.spawn_limit = static_cast(atoi(row[65])); + e.attack_speed = strtof(row[66], nullptr); + e.attack_delay = static_cast(strtoul(row[67], nullptr, 10)); + e.findable = static_cast(atoi(row[68])); + e.STR = static_cast(strtoul(row[69], nullptr, 10)); + e.STA = static_cast(strtoul(row[70], nullptr, 10)); + e.DEX = static_cast(strtoul(row[71], nullptr, 10)); + e.AGI = static_cast(strtoul(row[72], nullptr, 10)); + e._INT = static_cast(strtoul(row[73], nullptr, 10)); + e.WIS = static_cast(strtoul(row[74], nullptr, 10)); + e.CHA = static_cast(strtoul(row[75], nullptr, 10)); + e.see_hide = static_cast(atoi(row[76])); + e.see_improved_hide = static_cast(atoi(row[77])); + e.trackable = static_cast(atoi(row[78])); + e.isbot = static_cast(atoi(row[79])); + e.exclude = static_cast(atoi(row[80])); + e.ATK = static_cast(atoi(row[81])); + e.Accuracy = static_cast(atoi(row[82])); + e.Avoidance = static_cast(strtoul(row[83], nullptr, 10)); + e.slow_mitigation = static_cast(atoi(row[84])); + e.version = static_cast(strtoul(row[85], nullptr, 10)); + e.maxlevel = static_cast(atoi(row[86])); + e.scalerate = static_cast(atoi(row[87])); + e.private_corpse = static_cast(strtoul(row[88], nullptr, 10)); + e.unique_spawn_by_name = static_cast(strtoul(row[89], nullptr, 10)); + e.underwater = static_cast(strtoul(row[90], nullptr, 10)); + e.isquest = static_cast(atoi(row[91])); + e.emoteid = static_cast(strtoul(row[92], nullptr, 10)); + e.spellscale = strtof(row[93], nullptr); + e.healscale = strtof(row[94], nullptr); + e.no_target_hotkey = static_cast(strtoul(row[95], nullptr, 10)); + e.raid_target = static_cast(strtoul(row[96], nullptr, 10)); + e.armtexture = static_cast(atoi(row[97])); + e.bracertexture = static_cast(atoi(row[98])); + e.handtexture = static_cast(atoi(row[99])); + e.legtexture = static_cast(atoi(row[100])); + e.feettexture = static_cast(atoi(row[101])); + e.light = static_cast(atoi(row[102])); + e.walkspeed = static_cast(atoi(row[103])); + e.peqid = static_cast(atoi(row[104])); + e.unique_ = static_cast(atoi(row[105])); + e.fixed = static_cast(atoi(row[106])); + e.ignore_despawn = static_cast(atoi(row[107])); + e.show_name = static_cast(atoi(row[108])); + e.untargetable = static_cast(atoi(row[109])); + e.charm_ac = static_cast(atoi(row[110])); + e.charm_min_dmg = static_cast(atoi(row[111])); + e.charm_max_dmg = static_cast(atoi(row[112])); + e.charm_attack_delay = static_cast(atoi(row[113])); + e.charm_accuracy_rating = static_cast(atoi(row[114])); + e.charm_avoidance_rating = static_cast(atoi(row[115])); + e.charm_atk = static_cast(atoi(row[116])); + e.skip_global_loot = static_cast(atoi(row[117])); + e.rare_spawn = static_cast(atoi(row[118])); + e.stuck_behavior = static_cast(atoi(row[119])); + e.model = static_cast(atoi(row[120])); + e.flymode = static_cast(atoi(row[121])); + e.always_aggro = static_cast(atoi(row[122])); + e.exp_mod = static_cast(atoi(row[123])); + e.heroic_strikethrough = static_cast(atoi(row[124])); all_entries.push_back(e); } @@ -1373,131 +1374,131 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcTypes e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.lastname = row[2] ? row[2] : ""; - e.level = atoi(row[3]); - e.race = atoi(row[4]); - e.class_ = atoi(row[5]); - e.bodytype = atoi(row[6]); + e.level = static_cast(strtoul(row[3], nullptr, 10)); + e.race = static_cast(strtoul(row[4], nullptr, 10)); + e.class_ = static_cast(strtoul(row[5], nullptr, 10)); + e.bodytype = static_cast(atoi(row[6])); e.hp = strtoll(row[7], nullptr, 10); e.mana = strtoll(row[8], nullptr, 10); - e.gender = atoi(row[9]); - e.texture = atoi(row[10]); - e.helmtexture = atoi(row[11]); - e.herosforgemodel = atoi(row[12]); - e.size = static_cast(atof(row[13])); + e.gender = static_cast(strtoul(row[9], nullptr, 10)); + e.texture = static_cast(strtoul(row[10], nullptr, 10)); + e.helmtexture = static_cast(strtoul(row[11], nullptr, 10)); + e.herosforgemodel = static_cast(atoi(row[12])); + e.size = strtof(row[13], nullptr); e.hp_regen_rate = strtoll(row[14], nullptr, 10); e.hp_regen_per_second = strtoll(row[15], nullptr, 10); e.mana_regen_rate = strtoll(row[16], nullptr, 10); - e.loottable_id = atoi(row[17]); - e.merchant_id = atoi(row[18]); - e.alt_currency_id = atoi(row[19]); - e.npc_spells_id = atoi(row[20]); - e.npc_spells_effects_id = atoi(row[21]); - e.npc_faction_id = atoi(row[22]); - e.adventure_template_id = atoi(row[23]); - e.trap_template = atoi(row[24]); - e.mindmg = atoi(row[25]); - e.maxdmg = atoi(row[26]); - e.attack_count = atoi(row[27]); + e.loottable_id = static_cast(strtoul(row[17], nullptr, 10)); + e.merchant_id = static_cast(strtoul(row[18], nullptr, 10)); + e.alt_currency_id = static_cast(strtoul(row[19], nullptr, 10)); + e.npc_spells_id = static_cast(strtoul(row[20], nullptr, 10)); + e.npc_spells_effects_id = static_cast(strtoul(row[21], nullptr, 10)); + e.npc_faction_id = static_cast(atoi(row[22])); + e.adventure_template_id = static_cast(strtoul(row[23], nullptr, 10)); + e.trap_template = static_cast(strtoul(row[24], nullptr, 10)); + e.mindmg = static_cast(strtoul(row[25], nullptr, 10)); + e.maxdmg = static_cast(strtoul(row[26], nullptr, 10)); + e.attack_count = static_cast(atoi(row[27])); e.npcspecialattks = row[28] ? row[28] : ""; e.special_abilities = row[29] ? row[29] : ""; - e.aggroradius = atoi(row[30]); - e.assistradius = atoi(row[31]); - e.face = atoi(row[32]); - e.luclin_hairstyle = atoi(row[33]); - e.luclin_haircolor = atoi(row[34]); - e.luclin_eyecolor = atoi(row[35]); - e.luclin_eyecolor2 = atoi(row[36]); - e.luclin_beardcolor = atoi(row[37]); - e.luclin_beard = atoi(row[38]); - e.drakkin_heritage = atoi(row[39]); - e.drakkin_tattoo = atoi(row[40]); - e.drakkin_details = atoi(row[41]); - e.armortint_id = atoi(row[42]); - e.armortint_red = atoi(row[43]); - e.armortint_green = atoi(row[44]); - e.armortint_blue = atoi(row[45]); - e.d_melee_texture1 = atoi(row[46]); - e.d_melee_texture2 = atoi(row[47]); + e.aggroradius = static_cast(strtoul(row[30], nullptr, 10)); + e.assistradius = static_cast(strtoul(row[31], nullptr, 10)); + e.face = static_cast(strtoul(row[32], nullptr, 10)); + e.luclin_hairstyle = static_cast(strtoul(row[33], nullptr, 10)); + e.luclin_haircolor = static_cast(strtoul(row[34], nullptr, 10)); + e.luclin_eyecolor = static_cast(strtoul(row[35], nullptr, 10)); + e.luclin_eyecolor2 = static_cast(strtoul(row[36], nullptr, 10)); + e.luclin_beardcolor = static_cast(strtoul(row[37], nullptr, 10)); + e.luclin_beard = static_cast(strtoul(row[38], nullptr, 10)); + e.drakkin_heritage = static_cast(atoi(row[39])); + e.drakkin_tattoo = static_cast(atoi(row[40])); + e.drakkin_details = static_cast(atoi(row[41])); + e.armortint_id = static_cast(strtoul(row[42], nullptr, 10)); + e.armortint_red = static_cast(strtoul(row[43], nullptr, 10)); + e.armortint_green = static_cast(strtoul(row[44], nullptr, 10)); + e.armortint_blue = static_cast(strtoul(row[45], nullptr, 10)); + e.d_melee_texture1 = static_cast(atoi(row[46])); + e.d_melee_texture2 = static_cast(atoi(row[47])); e.ammo_idfile = row[48] ? row[48] : ""; - e.prim_melee_type = atoi(row[49]); - e.sec_melee_type = atoi(row[50]); - e.ranged_type = atoi(row[51]); - e.runspeed = static_cast(atof(row[52])); - e.MR = atoi(row[53]); - e.CR = atoi(row[54]); - e.DR = atoi(row[55]); - e.FR = atoi(row[56]); - e.PR = atoi(row[57]); - e.Corrup = atoi(row[58]); - e.PhR = atoi(row[59]); - e.see_invis = atoi(row[60]); - e.see_invis_undead = atoi(row[61]); - e.qglobal = atoi(row[62]); - e.AC = atoi(row[63]); - e.npc_aggro = atoi(row[64]); - e.spawn_limit = atoi(row[65]); - e.attack_speed = static_cast(atof(row[66])); - e.attack_delay = atoi(row[67]); - e.findable = atoi(row[68]); - e.STR = atoi(row[69]); - e.STA = atoi(row[70]); - e.DEX = atoi(row[71]); - e.AGI = atoi(row[72]); - e._INT = atoi(row[73]); - e.WIS = atoi(row[74]); - e.CHA = atoi(row[75]); - e.see_hide = atoi(row[76]); - e.see_improved_hide = atoi(row[77]); - e.trackable = atoi(row[78]); - e.isbot = atoi(row[79]); - e.exclude = atoi(row[80]); - e.ATK = atoi(row[81]); - e.Accuracy = atoi(row[82]); - e.Avoidance = atoi(row[83]); - e.slow_mitigation = atoi(row[84]); - e.version = atoi(row[85]); - e.maxlevel = atoi(row[86]); - e.scalerate = atoi(row[87]); - e.private_corpse = atoi(row[88]); - e.unique_spawn_by_name = atoi(row[89]); - e.underwater = atoi(row[90]); - e.isquest = atoi(row[91]); - e.emoteid = atoi(row[92]); - e.spellscale = static_cast(atof(row[93])); - e.healscale = static_cast(atof(row[94])); - e.no_target_hotkey = atoi(row[95]); - e.raid_target = atoi(row[96]); - e.armtexture = atoi(row[97]); - e.bracertexture = atoi(row[98]); - e.handtexture = atoi(row[99]); - e.legtexture = atoi(row[100]); - e.feettexture = atoi(row[101]); - e.light = atoi(row[102]); - e.walkspeed = atoi(row[103]); - e.peqid = atoi(row[104]); - e.unique_ = atoi(row[105]); - e.fixed = atoi(row[106]); - e.ignore_despawn = atoi(row[107]); - e.show_name = atoi(row[108]); - e.untargetable = atoi(row[109]); - e.charm_ac = atoi(row[110]); - e.charm_min_dmg = atoi(row[111]); - e.charm_max_dmg = atoi(row[112]); - e.charm_attack_delay = atoi(row[113]); - e.charm_accuracy_rating = atoi(row[114]); - e.charm_avoidance_rating = atoi(row[115]); - e.charm_atk = atoi(row[116]); - e.skip_global_loot = atoi(row[117]); - e.rare_spawn = atoi(row[118]); - e.stuck_behavior = atoi(row[119]); - e.model = atoi(row[120]); - e.flymode = atoi(row[121]); - e.always_aggro = atoi(row[122]); - e.exp_mod = atoi(row[123]); - e.heroic_strikethrough = atoi(row[124]); + e.prim_melee_type = static_cast(strtoul(row[49], nullptr, 10)); + e.sec_melee_type = static_cast(strtoul(row[50], nullptr, 10)); + e.ranged_type = static_cast(strtoul(row[51], nullptr, 10)); + e.runspeed = strtof(row[52], nullptr); + e.MR = static_cast(atoi(row[53])); + e.CR = static_cast(atoi(row[54])); + e.DR = static_cast(atoi(row[55])); + e.FR = static_cast(atoi(row[56])); + e.PR = static_cast(atoi(row[57])); + e.Corrup = static_cast(atoi(row[58])); + e.PhR = static_cast(strtoul(row[59], nullptr, 10)); + e.see_invis = static_cast(atoi(row[60])); + e.see_invis_undead = static_cast(atoi(row[61])); + e.qglobal = static_cast(strtoul(row[62], nullptr, 10)); + e.AC = static_cast(atoi(row[63])); + e.npc_aggro = static_cast(atoi(row[64])); + e.spawn_limit = static_cast(atoi(row[65])); + e.attack_speed = strtof(row[66], nullptr); + e.attack_delay = static_cast(strtoul(row[67], nullptr, 10)); + e.findable = static_cast(atoi(row[68])); + e.STR = static_cast(strtoul(row[69], nullptr, 10)); + e.STA = static_cast(strtoul(row[70], nullptr, 10)); + e.DEX = static_cast(strtoul(row[71], nullptr, 10)); + e.AGI = static_cast(strtoul(row[72], nullptr, 10)); + e._INT = static_cast(strtoul(row[73], nullptr, 10)); + e.WIS = static_cast(strtoul(row[74], nullptr, 10)); + e.CHA = static_cast(strtoul(row[75], nullptr, 10)); + e.see_hide = static_cast(atoi(row[76])); + e.see_improved_hide = static_cast(atoi(row[77])); + e.trackable = static_cast(atoi(row[78])); + e.isbot = static_cast(atoi(row[79])); + e.exclude = static_cast(atoi(row[80])); + e.ATK = static_cast(atoi(row[81])); + e.Accuracy = static_cast(atoi(row[82])); + e.Avoidance = static_cast(strtoul(row[83], nullptr, 10)); + e.slow_mitigation = static_cast(atoi(row[84])); + e.version = static_cast(strtoul(row[85], nullptr, 10)); + e.maxlevel = static_cast(atoi(row[86])); + e.scalerate = static_cast(atoi(row[87])); + e.private_corpse = static_cast(strtoul(row[88], nullptr, 10)); + e.unique_spawn_by_name = static_cast(strtoul(row[89], nullptr, 10)); + e.underwater = static_cast(strtoul(row[90], nullptr, 10)); + e.isquest = static_cast(atoi(row[91])); + e.emoteid = static_cast(strtoul(row[92], nullptr, 10)); + e.spellscale = strtof(row[93], nullptr); + e.healscale = strtof(row[94], nullptr); + e.no_target_hotkey = static_cast(strtoul(row[95], nullptr, 10)); + e.raid_target = static_cast(strtoul(row[96], nullptr, 10)); + e.armtexture = static_cast(atoi(row[97])); + e.bracertexture = static_cast(atoi(row[98])); + e.handtexture = static_cast(atoi(row[99])); + e.legtexture = static_cast(atoi(row[100])); + e.feettexture = static_cast(atoi(row[101])); + e.light = static_cast(atoi(row[102])); + e.walkspeed = static_cast(atoi(row[103])); + e.peqid = static_cast(atoi(row[104])); + e.unique_ = static_cast(atoi(row[105])); + e.fixed = static_cast(atoi(row[106])); + e.ignore_despawn = static_cast(atoi(row[107])); + e.show_name = static_cast(atoi(row[108])); + e.untargetable = static_cast(atoi(row[109])); + e.charm_ac = static_cast(atoi(row[110])); + e.charm_min_dmg = static_cast(atoi(row[111])); + e.charm_max_dmg = static_cast(atoi(row[112])); + e.charm_attack_delay = static_cast(atoi(row[113])); + e.charm_accuracy_rating = static_cast(atoi(row[114])); + e.charm_avoidance_rating = static_cast(atoi(row[115])); + e.charm_atk = static_cast(atoi(row[116])); + e.skip_global_loot = static_cast(atoi(row[117])); + e.rare_spawn = static_cast(atoi(row[118])); + e.stuck_behavior = static_cast(atoi(row[119])); + e.model = static_cast(atoi(row[120])); + e.flymode = static_cast(atoi(row[121])); + e.always_aggro = static_cast(atoi(row[122])); + e.exp_mod = static_cast(atoi(row[123])); + e.heroic_strikethrough = static_cast(atoi(row[124])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_npc_types_tint_repository.h b/common/repositories/base/base_npc_types_tint_repository.h index 0275d2b37..3a4361fa1 100644 --- a/common/repositories/base/base_npc_types_tint_repository.h +++ b/common/repositories/base/base_npc_types_tint_repository.h @@ -19,35 +19,35 @@ class BaseNpcTypesTintRepository { public: struct NpcTypesTint { - int id; + uint32_t id; std::string tint_set_name; - int red1h; - int grn1h; - int blu1h; - int red2c; - int grn2c; - int blu2c; - int red3a; - int grn3a; - int blu3a; - int red4b; - int grn4b; - int blu4b; - int red5g; - int grn5g; - int blu5g; - int red6l; - int grn6l; - int blu6l; - int red7f; - int grn7f; - int blu7f; - int red8x; - int grn8x; - int blu8x; - int red9x; - int grn9x; - int blu9x; + uint8_t red1h; + uint8_t grn1h; + uint8_t blu1h; + uint8_t red2c; + uint8_t grn2c; + uint8_t blu2c; + uint8_t red3a; + uint8_t grn3a; + uint8_t blu3a; + uint8_t red4b; + uint8_t grn4b; + uint8_t blu4b; + uint8_t red5g; + uint8_t grn5g; + uint8_t blu5g; + uint8_t red6l; + uint8_t grn6l; + uint8_t blu6l; + uint8_t red7f; + uint8_t grn7f; + uint8_t blu7f; + uint8_t red8x; + uint8_t grn8x; + uint8_t blu8x; + uint8_t red9x; + uint8_t grn9x; + uint8_t blu9x; }; static std::string PrimaryKey() @@ -226,35 +226,35 @@ public: if (results.RowCount() == 1) { NpcTypesTint e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.tint_set_name = row[1] ? row[1] : ""; - e.red1h = atoi(row[2]); - e.grn1h = atoi(row[3]); - e.blu1h = atoi(row[4]); - e.red2c = atoi(row[5]); - e.grn2c = atoi(row[6]); - e.blu2c = atoi(row[7]); - e.red3a = atoi(row[8]); - e.grn3a = atoi(row[9]); - e.blu3a = atoi(row[10]); - e.red4b = atoi(row[11]); - e.grn4b = atoi(row[12]); - e.blu4b = atoi(row[13]); - e.red5g = atoi(row[14]); - e.grn5g = atoi(row[15]); - e.blu5g = atoi(row[16]); - e.red6l = atoi(row[17]); - e.grn6l = atoi(row[18]); - e.blu6l = atoi(row[19]); - e.red7f = atoi(row[20]); - e.grn7f = atoi(row[21]); - e.blu7f = atoi(row[22]); - e.red8x = atoi(row[23]); - e.grn8x = atoi(row[24]); - e.blu8x = atoi(row[25]); - e.red9x = atoi(row[26]); - e.grn9x = atoi(row[27]); - e.blu9x = atoi(row[28]); + e.red1h = static_cast(strtoul(row[2], nullptr, 10)); + e.grn1h = static_cast(strtoul(row[3], nullptr, 10)); + e.blu1h = static_cast(strtoul(row[4], nullptr, 10)); + e.red2c = static_cast(strtoul(row[5], nullptr, 10)); + e.grn2c = static_cast(strtoul(row[6], nullptr, 10)); + e.blu2c = static_cast(strtoul(row[7], nullptr, 10)); + e.red3a = static_cast(strtoul(row[8], nullptr, 10)); + e.grn3a = static_cast(strtoul(row[9], nullptr, 10)); + e.blu3a = static_cast(strtoul(row[10], nullptr, 10)); + e.red4b = static_cast(strtoul(row[11], nullptr, 10)); + e.grn4b = static_cast(strtoul(row[12], nullptr, 10)); + e.blu4b = static_cast(strtoul(row[13], nullptr, 10)); + e.red5g = static_cast(strtoul(row[14], nullptr, 10)); + e.grn5g = static_cast(strtoul(row[15], nullptr, 10)); + e.blu5g = static_cast(strtoul(row[16], nullptr, 10)); + e.red6l = static_cast(strtoul(row[17], nullptr, 10)); + e.grn6l = static_cast(strtoul(row[18], nullptr, 10)); + e.blu6l = static_cast(strtoul(row[19], nullptr, 10)); + e.red7f = static_cast(strtoul(row[20], nullptr, 10)); + e.grn7f = static_cast(strtoul(row[21], nullptr, 10)); + e.blu7f = static_cast(strtoul(row[22], nullptr, 10)); + e.red8x = static_cast(strtoul(row[23], nullptr, 10)); + e.grn8x = static_cast(strtoul(row[24], nullptr, 10)); + e.blu8x = static_cast(strtoul(row[25], nullptr, 10)); + e.red9x = static_cast(strtoul(row[26], nullptr, 10)); + e.grn9x = static_cast(strtoul(row[27], nullptr, 10)); + e.blu9x = static_cast(strtoul(row[28], nullptr, 10)); return e; } @@ -458,35 +458,35 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcTypesTint e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.tint_set_name = row[1] ? row[1] : ""; - e.red1h = atoi(row[2]); - e.grn1h = atoi(row[3]); - e.blu1h = atoi(row[4]); - e.red2c = atoi(row[5]); - e.grn2c = atoi(row[6]); - e.blu2c = atoi(row[7]); - e.red3a = atoi(row[8]); - e.grn3a = atoi(row[9]); - e.blu3a = atoi(row[10]); - e.red4b = atoi(row[11]); - e.grn4b = atoi(row[12]); - e.blu4b = atoi(row[13]); - e.red5g = atoi(row[14]); - e.grn5g = atoi(row[15]); - e.blu5g = atoi(row[16]); - e.red6l = atoi(row[17]); - e.grn6l = atoi(row[18]); - e.blu6l = atoi(row[19]); - e.red7f = atoi(row[20]); - e.grn7f = atoi(row[21]); - e.blu7f = atoi(row[22]); - e.red8x = atoi(row[23]); - e.grn8x = atoi(row[24]); - e.blu8x = atoi(row[25]); - e.red9x = atoi(row[26]); - e.grn9x = atoi(row[27]); - e.blu9x = atoi(row[28]); + e.red1h = static_cast(strtoul(row[2], nullptr, 10)); + e.grn1h = static_cast(strtoul(row[3], nullptr, 10)); + e.blu1h = static_cast(strtoul(row[4], nullptr, 10)); + e.red2c = static_cast(strtoul(row[5], nullptr, 10)); + e.grn2c = static_cast(strtoul(row[6], nullptr, 10)); + e.blu2c = static_cast(strtoul(row[7], nullptr, 10)); + e.red3a = static_cast(strtoul(row[8], nullptr, 10)); + e.grn3a = static_cast(strtoul(row[9], nullptr, 10)); + e.blu3a = static_cast(strtoul(row[10], nullptr, 10)); + e.red4b = static_cast(strtoul(row[11], nullptr, 10)); + e.grn4b = static_cast(strtoul(row[12], nullptr, 10)); + e.blu4b = static_cast(strtoul(row[13], nullptr, 10)); + e.red5g = static_cast(strtoul(row[14], nullptr, 10)); + e.grn5g = static_cast(strtoul(row[15], nullptr, 10)); + e.blu5g = static_cast(strtoul(row[16], nullptr, 10)); + e.red6l = static_cast(strtoul(row[17], nullptr, 10)); + e.grn6l = static_cast(strtoul(row[18], nullptr, 10)); + e.blu6l = static_cast(strtoul(row[19], nullptr, 10)); + e.red7f = static_cast(strtoul(row[20], nullptr, 10)); + e.grn7f = static_cast(strtoul(row[21], nullptr, 10)); + e.blu7f = static_cast(strtoul(row[22], nullptr, 10)); + e.red8x = static_cast(strtoul(row[23], nullptr, 10)); + e.grn8x = static_cast(strtoul(row[24], nullptr, 10)); + e.blu8x = static_cast(strtoul(row[25], nullptr, 10)); + e.red9x = static_cast(strtoul(row[26], nullptr, 10)); + e.grn9x = static_cast(strtoul(row[27], nullptr, 10)); + e.blu9x = static_cast(strtoul(row[28], nullptr, 10)); all_entries.push_back(e); } @@ -511,35 +511,35 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { NpcTypesTint e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.tint_set_name = row[1] ? row[1] : ""; - e.red1h = atoi(row[2]); - e.grn1h = atoi(row[3]); - e.blu1h = atoi(row[4]); - e.red2c = atoi(row[5]); - e.grn2c = atoi(row[6]); - e.blu2c = atoi(row[7]); - e.red3a = atoi(row[8]); - e.grn3a = atoi(row[9]); - e.blu3a = atoi(row[10]); - e.red4b = atoi(row[11]); - e.grn4b = atoi(row[12]); - e.blu4b = atoi(row[13]); - e.red5g = atoi(row[14]); - e.grn5g = atoi(row[15]); - e.blu5g = atoi(row[16]); - e.red6l = atoi(row[17]); - e.grn6l = atoi(row[18]); - e.blu6l = atoi(row[19]); - e.red7f = atoi(row[20]); - e.grn7f = atoi(row[21]); - e.blu7f = atoi(row[22]); - e.red8x = atoi(row[23]); - e.grn8x = atoi(row[24]); - e.blu8x = atoi(row[25]); - e.red9x = atoi(row[26]); - e.grn9x = atoi(row[27]); - e.blu9x = atoi(row[28]); + e.red1h = static_cast(strtoul(row[2], nullptr, 10)); + e.grn1h = static_cast(strtoul(row[3], nullptr, 10)); + e.blu1h = static_cast(strtoul(row[4], nullptr, 10)); + e.red2c = static_cast(strtoul(row[5], nullptr, 10)); + e.grn2c = static_cast(strtoul(row[6], nullptr, 10)); + e.blu2c = static_cast(strtoul(row[7], nullptr, 10)); + e.red3a = static_cast(strtoul(row[8], nullptr, 10)); + e.grn3a = static_cast(strtoul(row[9], nullptr, 10)); + e.blu3a = static_cast(strtoul(row[10], nullptr, 10)); + e.red4b = static_cast(strtoul(row[11], nullptr, 10)); + e.grn4b = static_cast(strtoul(row[12], nullptr, 10)); + e.blu4b = static_cast(strtoul(row[13], nullptr, 10)); + e.red5g = static_cast(strtoul(row[14], nullptr, 10)); + e.grn5g = static_cast(strtoul(row[15], nullptr, 10)); + e.blu5g = static_cast(strtoul(row[16], nullptr, 10)); + e.red6l = static_cast(strtoul(row[17], nullptr, 10)); + e.grn6l = static_cast(strtoul(row[18], nullptr, 10)); + e.blu6l = static_cast(strtoul(row[19], nullptr, 10)); + e.red7f = static_cast(strtoul(row[20], nullptr, 10)); + e.grn7f = static_cast(strtoul(row[21], nullptr, 10)); + e.blu7f = static_cast(strtoul(row[22], nullptr, 10)); + e.red8x = static_cast(strtoul(row[23], nullptr, 10)); + e.grn8x = static_cast(strtoul(row[24], nullptr, 10)); + e.blu8x = static_cast(strtoul(row[25], nullptr, 10)); + e.red9x = static_cast(strtoul(row[26], nullptr, 10)); + e.grn9x = static_cast(strtoul(row[27], nullptr, 10)); + e.blu9x = static_cast(strtoul(row[28], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_object_contents_repository.h b/common/repositories/base/base_object_contents_repository.h index efa50c4b8..f0cf358bb 100644 --- a/common/repositories/base/base_object_contents_repository.h +++ b/common/repositories/base/base_object_contents_repository.h @@ -19,18 +19,18 @@ class BaseObjectContentsRepository { public: struct ObjectContents { - int zoneid; - int parentid; - int bagidx; - int itemid; - int charges; - time_t droptime; - int augslot1; - int augslot2; - int augslot3; - int augslot4; - int augslot5; - int augslot6; + uint32_t zoneid; + uint32_t parentid; + uint32_t bagidx; + uint32_t itemid; + int16_t charges; + time_t droptime; + uint32_t augslot1; + uint32_t augslot2; + uint32_t augslot3; + uint32_t augslot4; + uint32_t augslot5; + int32_t augslot6; }; static std::string PrimaryKey() @@ -158,18 +158,18 @@ public: if (results.RowCount() == 1) { ObjectContents e{}; - e.zoneid = atoi(row[0]); - e.parentid = atoi(row[1]); - e.bagidx = atoi(row[2]); - e.itemid = atoi(row[3]); - e.charges = atoi(row[4]); + e.zoneid = static_cast(strtoul(row[0], nullptr, 10)); + e.parentid = static_cast(strtoul(row[1], nullptr, 10)); + e.bagidx = static_cast(strtoul(row[2], nullptr, 10)); + e.itemid = static_cast(strtoul(row[3], nullptr, 10)); + e.charges = static_cast(atoi(row[4])); e.droptime = strtoll(row[5] ? row[5] : "-1", nullptr, 10); - e.augslot1 = atoi(row[6]); - e.augslot2 = atoi(row[7]); - e.augslot3 = atoi(row[8]); - e.augslot4 = atoi(row[9]); - e.augslot5 = atoi(row[10]); - e.augslot6 = atoi(row[11]); + e.augslot1 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[10], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[11])); return e; } @@ -322,18 +322,18 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ObjectContents e{}; - e.zoneid = atoi(row[0]); - e.parentid = atoi(row[1]); - e.bagidx = atoi(row[2]); - e.itemid = atoi(row[3]); - e.charges = atoi(row[4]); + e.zoneid = static_cast(strtoul(row[0], nullptr, 10)); + e.parentid = static_cast(strtoul(row[1], nullptr, 10)); + e.bagidx = static_cast(strtoul(row[2], nullptr, 10)); + e.itemid = static_cast(strtoul(row[3], nullptr, 10)); + e.charges = static_cast(atoi(row[4])); e.droptime = strtoll(row[5] ? row[5] : "-1", nullptr, 10); - e.augslot1 = atoi(row[6]); - e.augslot2 = atoi(row[7]); - e.augslot3 = atoi(row[8]); - e.augslot4 = atoi(row[9]); - e.augslot5 = atoi(row[10]); - e.augslot6 = atoi(row[11]); + e.augslot1 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[10], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[11])); all_entries.push_back(e); } @@ -358,18 +358,18 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ObjectContents e{}; - e.zoneid = atoi(row[0]); - e.parentid = atoi(row[1]); - e.bagidx = atoi(row[2]); - e.itemid = atoi(row[3]); - e.charges = atoi(row[4]); + e.zoneid = static_cast(strtoul(row[0], nullptr, 10)); + e.parentid = static_cast(strtoul(row[1], nullptr, 10)); + e.bagidx = static_cast(strtoul(row[2], nullptr, 10)); + e.itemid = static_cast(strtoul(row[3], nullptr, 10)); + e.charges = static_cast(atoi(row[4])); e.droptime = strtoll(row[5] ? row[5] : "-1", nullptr, 10); - e.augslot1 = atoi(row[6]); - e.augslot2 = atoi(row[7]); - e.augslot3 = atoi(row[8]); - e.augslot4 = atoi(row[9]); - e.augslot5 = atoi(row[10]); - e.augslot6 = atoi(row[11]); + e.augslot1 = static_cast(strtoul(row[6], nullptr, 10)); + e.augslot2 = static_cast(strtoul(row[7], nullptr, 10)); + e.augslot3 = static_cast(strtoul(row[8], nullptr, 10)); + e.augslot4 = static_cast(strtoul(row[9], nullptr, 10)); + e.augslot5 = static_cast(strtoul(row[10], nullptr, 10)); + e.augslot6 = static_cast(atoi(row[11])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_object_repository.h b/common/repositories/base/base_object_repository.h index 5aa04182d..34e42debf 100644 --- a/common/repositories/base/base_object_repository.h +++ b/common/repositories/base/base_object_repository.h @@ -19,34 +19,34 @@ class BaseObjectRepository { public: struct Object { - int id; - int zoneid; - int version; + int32_t id; + uint32_t zoneid; + int16_t version; float xpos; float ypos; float zpos; float heading; - int itemid; - int charges; + int32_t itemid; + uint16_t charges; std::string objectname; - int type; - int icon; - int unknown08; - int unknown10; - int unknown20; - int unknown24; - int unknown60; - int unknown64; - int unknown68; - int unknown72; - int unknown76; - int unknown84; + int32_t type; + int32_t icon; + int32_t unknown08; + int32_t unknown10; + int32_t unknown20; + int32_t unknown24; + int32_t unknown60; + int32_t unknown64; + int32_t unknown68; + int32_t unknown72; + int32_t unknown76; + int32_t unknown84; float size; float tilt_x; float tilt_y; std::string display_name; - int min_expansion; - int max_expansion; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -230,34 +230,34 @@ public: if (results.RowCount() == 1) { Object e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.version = atoi(row[2]); - e.xpos = static_cast(atof(row[3])); - e.ypos = static_cast(atof(row[4])); - e.zpos = static_cast(atof(row[5])); - e.heading = static_cast(atof(row[6])); - e.itemid = atoi(row[7]); - e.charges = atoi(row[8]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(atoi(row[2])); + e.xpos = strtof(row[3], nullptr); + e.ypos = strtof(row[4], nullptr); + e.zpos = strtof(row[5], nullptr); + e.heading = strtof(row[6], nullptr); + e.itemid = static_cast(atoi(row[7])); + e.charges = static_cast(strtoul(row[8], nullptr, 10)); e.objectname = row[9] ? row[9] : ""; - e.type = atoi(row[10]); - e.icon = atoi(row[11]); - e.unknown08 = atoi(row[12]); - e.unknown10 = atoi(row[13]); - e.unknown20 = atoi(row[14]); - e.unknown24 = atoi(row[15]); - e.unknown60 = atoi(row[16]); - e.unknown64 = atoi(row[17]); - e.unknown68 = atoi(row[18]); - e.unknown72 = atoi(row[19]); - e.unknown76 = atoi(row[20]); - e.unknown84 = atoi(row[21]); - e.size = static_cast(atof(row[22])); - e.tilt_x = static_cast(atof(row[23])); - e.tilt_y = static_cast(atof(row[24])); + e.type = static_cast(atoi(row[10])); + e.icon = static_cast(atoi(row[11])); + e.unknown08 = static_cast(atoi(row[12])); + e.unknown10 = static_cast(atoi(row[13])); + e.unknown20 = static_cast(atoi(row[14])); + e.unknown24 = static_cast(atoi(row[15])); + e.unknown60 = static_cast(atoi(row[16])); + e.unknown64 = static_cast(atoi(row[17])); + e.unknown68 = static_cast(atoi(row[18])); + e.unknown72 = static_cast(atoi(row[19])); + e.unknown76 = static_cast(atoi(row[20])); + e.unknown84 = static_cast(atoi(row[21])); + e.size = strtof(row[22], nullptr); + e.tilt_x = strtof(row[23], nullptr); + e.tilt_y = strtof(row[24], nullptr); e.display_name = row[25] ? row[25] : ""; - e.min_expansion = atoi(row[26]); - e.max_expansion = atoi(row[27]); + e.min_expansion = static_cast(atoi(row[26])); + e.max_expansion = static_cast(atoi(row[27])); e.content_flags = row[28] ? row[28] : ""; e.content_flags_disabled = row[29] ? row[29] : ""; @@ -465,34 +465,34 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Object e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.version = atoi(row[2]); - e.xpos = static_cast(atof(row[3])); - e.ypos = static_cast(atof(row[4])); - e.zpos = static_cast(atof(row[5])); - e.heading = static_cast(atof(row[6])); - e.itemid = atoi(row[7]); - e.charges = atoi(row[8]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(atoi(row[2])); + e.xpos = strtof(row[3], nullptr); + e.ypos = strtof(row[4], nullptr); + e.zpos = strtof(row[5], nullptr); + e.heading = strtof(row[6], nullptr); + e.itemid = static_cast(atoi(row[7])); + e.charges = static_cast(strtoul(row[8], nullptr, 10)); e.objectname = row[9] ? row[9] : ""; - e.type = atoi(row[10]); - e.icon = atoi(row[11]); - e.unknown08 = atoi(row[12]); - e.unknown10 = atoi(row[13]); - e.unknown20 = atoi(row[14]); - e.unknown24 = atoi(row[15]); - e.unknown60 = atoi(row[16]); - e.unknown64 = atoi(row[17]); - e.unknown68 = atoi(row[18]); - e.unknown72 = atoi(row[19]); - e.unknown76 = atoi(row[20]); - e.unknown84 = atoi(row[21]); - e.size = static_cast(atof(row[22])); - e.tilt_x = static_cast(atof(row[23])); - e.tilt_y = static_cast(atof(row[24])); + e.type = static_cast(atoi(row[10])); + e.icon = static_cast(atoi(row[11])); + e.unknown08 = static_cast(atoi(row[12])); + e.unknown10 = static_cast(atoi(row[13])); + e.unknown20 = static_cast(atoi(row[14])); + e.unknown24 = static_cast(atoi(row[15])); + e.unknown60 = static_cast(atoi(row[16])); + e.unknown64 = static_cast(atoi(row[17])); + e.unknown68 = static_cast(atoi(row[18])); + e.unknown72 = static_cast(atoi(row[19])); + e.unknown76 = static_cast(atoi(row[20])); + e.unknown84 = static_cast(atoi(row[21])); + e.size = strtof(row[22], nullptr); + e.tilt_x = strtof(row[23], nullptr); + e.tilt_y = strtof(row[24], nullptr); e.display_name = row[25] ? row[25] : ""; - e.min_expansion = atoi(row[26]); - e.max_expansion = atoi(row[27]); + e.min_expansion = static_cast(atoi(row[26])); + e.max_expansion = static_cast(atoi(row[27])); e.content_flags = row[28] ? row[28] : ""; e.content_flags_disabled = row[29] ? row[29] : ""; @@ -519,34 +519,34 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Object e{}; - e.id = atoi(row[0]); - e.zoneid = atoi(row[1]); - e.version = atoi(row[2]); - e.xpos = static_cast(atof(row[3])); - e.ypos = static_cast(atof(row[4])); - e.zpos = static_cast(atof(row[5])); - e.heading = static_cast(atof(row[6])); - e.itemid = atoi(row[7]); - e.charges = atoi(row[8]); + e.id = static_cast(atoi(row[0])); + e.zoneid = static_cast(strtoul(row[1], nullptr, 10)); + e.version = static_cast(atoi(row[2])); + e.xpos = strtof(row[3], nullptr); + e.ypos = strtof(row[4], nullptr); + e.zpos = strtof(row[5], nullptr); + e.heading = strtof(row[6], nullptr); + e.itemid = static_cast(atoi(row[7])); + e.charges = static_cast(strtoul(row[8], nullptr, 10)); e.objectname = row[9] ? row[9] : ""; - e.type = atoi(row[10]); - e.icon = atoi(row[11]); - e.unknown08 = atoi(row[12]); - e.unknown10 = atoi(row[13]); - e.unknown20 = atoi(row[14]); - e.unknown24 = atoi(row[15]); - e.unknown60 = atoi(row[16]); - e.unknown64 = atoi(row[17]); - e.unknown68 = atoi(row[18]); - e.unknown72 = atoi(row[19]); - e.unknown76 = atoi(row[20]); - e.unknown84 = atoi(row[21]); - e.size = static_cast(atof(row[22])); - e.tilt_x = static_cast(atof(row[23])); - e.tilt_y = static_cast(atof(row[24])); + e.type = static_cast(atoi(row[10])); + e.icon = static_cast(atoi(row[11])); + e.unknown08 = static_cast(atoi(row[12])); + e.unknown10 = static_cast(atoi(row[13])); + e.unknown20 = static_cast(atoi(row[14])); + e.unknown24 = static_cast(atoi(row[15])); + e.unknown60 = static_cast(atoi(row[16])); + e.unknown64 = static_cast(atoi(row[17])); + e.unknown68 = static_cast(atoi(row[18])); + e.unknown72 = static_cast(atoi(row[19])); + e.unknown76 = static_cast(atoi(row[20])); + e.unknown84 = static_cast(atoi(row[21])); + e.size = strtof(row[22], nullptr); + e.tilt_x = strtof(row[23], nullptr); + e.tilt_y = strtof(row[24], nullptr); e.display_name = row[25] ? row[25] : ""; - e.min_expansion = atoi(row[26]); - e.max_expansion = atoi(row[27]); + e.min_expansion = static_cast(atoi(row[26])); + e.max_expansion = static_cast(atoi(row[27])); e.content_flags = row[28] ? row[28] : ""; e.content_flags_disabled = row[29] ? row[29] : ""; diff --git a/common/repositories/base/base_perl_event_export_settings_repository.h b/common/repositories/base/base_perl_event_export_settings_repository.h index 3151699c2..d4e2fcafc 100644 --- a/common/repositories/base/base_perl_event_export_settings_repository.h +++ b/common/repositories/base/base_perl_event_export_settings_repository.h @@ -19,13 +19,13 @@ class BasePerlEventExportSettingsRepository { public: struct PerlEventExportSettings { - int event_id; + int32_t event_id; std::string event_description; - int export_qglobals; - int export_mob; - int export_zone; - int export_item; - int export_event; + int16_t export_qglobals; + int16_t export_mob; + int16_t export_zone; + int16_t export_item; + int16_t export_event; }; static std::string PrimaryKey() @@ -138,13 +138,13 @@ public: if (results.RowCount() == 1) { PerlEventExportSettings e{}; - e.event_id = atoi(row[0]); + e.event_id = static_cast(atoi(row[0])); e.event_description = row[1] ? row[1] : ""; - e.export_qglobals = atoi(row[2]); - e.export_mob = atoi(row[3]); - e.export_zone = atoi(row[4]); - e.export_item = atoi(row[5]); - e.export_event = atoi(row[6]); + e.export_qglobals = static_cast(atoi(row[2])); + e.export_mob = static_cast(atoi(row[3])); + e.export_zone = static_cast(atoi(row[4])); + e.export_item = static_cast(atoi(row[5])); + e.export_event = static_cast(atoi(row[6])); return e; } @@ -282,13 +282,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PerlEventExportSettings e{}; - e.event_id = atoi(row[0]); + e.event_id = static_cast(atoi(row[0])); e.event_description = row[1] ? row[1] : ""; - e.export_qglobals = atoi(row[2]); - e.export_mob = atoi(row[3]); - e.export_zone = atoi(row[4]); - e.export_item = atoi(row[5]); - e.export_event = atoi(row[6]); + e.export_qglobals = static_cast(atoi(row[2])); + e.export_mob = static_cast(atoi(row[3])); + e.export_zone = static_cast(atoi(row[4])); + e.export_item = static_cast(atoi(row[5])); + e.export_event = static_cast(atoi(row[6])); all_entries.push_back(e); } @@ -313,13 +313,13 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PerlEventExportSettings e{}; - e.event_id = atoi(row[0]); + e.event_id = static_cast(atoi(row[0])); e.event_description = row[1] ? row[1] : ""; - e.export_qglobals = atoi(row[2]); - e.export_mob = atoi(row[3]); - e.export_zone = atoi(row[4]); - e.export_item = atoi(row[5]); - e.export_event = atoi(row[6]); + e.export_qglobals = static_cast(atoi(row[2])); + e.export_mob = static_cast(atoi(row[3])); + e.export_zone = static_cast(atoi(row[4])); + e.export_item = static_cast(atoi(row[5])); + e.export_event = static_cast(atoi(row[6])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_petitions_repository.h b/common/repositories/base/base_petitions_repository.h index 74fe0e041..94706c16c 100644 --- a/common/repositories/base/base_petitions_repository.h +++ b/common/repositories/base/base_petitions_repository.h @@ -19,22 +19,22 @@ class BasePetitionsRepository { public: struct Petitions { - int dib; - int petid; + uint32_t dib; + uint32_t petid; std::string charname; std::string accountname; std::string lastgm; std::string petitiontext; std::string gmtext; std::string zone; - int urgency; - int charclass; - int charrace; - int charlevel; - int checkouts; - int unavailables; - int ischeckedout; - int64 senttime; + int32_t urgency; + int32_t charclass; + int32_t charrace; + int32_t charlevel; + int32_t checkouts; + int32_t unavailables; + int8_t ischeckedout; + int64_t senttime; }; static std::string PrimaryKey() @@ -174,21 +174,21 @@ public: if (results.RowCount() == 1) { Petitions e{}; - e.dib = atoi(row[0]); - e.petid = atoi(row[1]); + e.dib = static_cast(strtoul(row[0], nullptr, 10)); + e.petid = static_cast(strtoul(row[1], nullptr, 10)); e.charname = row[2] ? row[2] : ""; e.accountname = row[3] ? row[3] : ""; e.lastgm = row[4] ? row[4] : ""; e.petitiontext = row[5] ? row[5] : ""; e.gmtext = row[6] ? row[6] : ""; e.zone = row[7] ? row[7] : ""; - e.urgency = atoi(row[8]); - e.charclass = atoi(row[9]); - e.charrace = atoi(row[10]); - e.charlevel = atoi(row[11]); - e.checkouts = atoi(row[12]); - e.unavailables = atoi(row[13]); - e.ischeckedout = atoi(row[14]); + e.urgency = static_cast(atoi(row[8])); + e.charclass = static_cast(atoi(row[9])); + e.charrace = static_cast(atoi(row[10])); + e.charlevel = static_cast(atoi(row[11])); + e.checkouts = static_cast(atoi(row[12])); + e.unavailables = static_cast(atoi(row[13])); + e.ischeckedout = static_cast(atoi(row[14])); e.senttime = strtoll(row[15], nullptr, 10); return e; @@ -353,21 +353,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Petitions e{}; - e.dib = atoi(row[0]); - e.petid = atoi(row[1]); + e.dib = static_cast(strtoul(row[0], nullptr, 10)); + e.petid = static_cast(strtoul(row[1], nullptr, 10)); e.charname = row[2] ? row[2] : ""; e.accountname = row[3] ? row[3] : ""; e.lastgm = row[4] ? row[4] : ""; e.petitiontext = row[5] ? row[5] : ""; e.gmtext = row[6] ? row[6] : ""; e.zone = row[7] ? row[7] : ""; - e.urgency = atoi(row[8]); - e.charclass = atoi(row[9]); - e.charrace = atoi(row[10]); - e.charlevel = atoi(row[11]); - e.checkouts = atoi(row[12]); - e.unavailables = atoi(row[13]); - e.ischeckedout = atoi(row[14]); + e.urgency = static_cast(atoi(row[8])); + e.charclass = static_cast(atoi(row[9])); + e.charrace = static_cast(atoi(row[10])); + e.charlevel = static_cast(atoi(row[11])); + e.checkouts = static_cast(atoi(row[12])); + e.unavailables = static_cast(atoi(row[13])); + e.ischeckedout = static_cast(atoi(row[14])); e.senttime = strtoll(row[15], nullptr, 10); all_entries.push_back(e); @@ -393,21 +393,21 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Petitions e{}; - e.dib = atoi(row[0]); - e.petid = atoi(row[1]); + e.dib = static_cast(strtoul(row[0], nullptr, 10)); + e.petid = static_cast(strtoul(row[1], nullptr, 10)); e.charname = row[2] ? row[2] : ""; e.accountname = row[3] ? row[3] : ""; e.lastgm = row[4] ? row[4] : ""; e.petitiontext = row[5] ? row[5] : ""; e.gmtext = row[6] ? row[6] : ""; e.zone = row[7] ? row[7] : ""; - e.urgency = atoi(row[8]); - e.charclass = atoi(row[9]); - e.charrace = atoi(row[10]); - e.charlevel = atoi(row[11]); - e.checkouts = atoi(row[12]); - e.unavailables = atoi(row[13]); - e.ischeckedout = atoi(row[14]); + e.urgency = static_cast(atoi(row[8])); + e.charclass = static_cast(atoi(row[9])); + e.charrace = static_cast(atoi(row[10])); + e.charlevel = static_cast(atoi(row[11])); + e.checkouts = static_cast(atoi(row[12])); + e.unavailables = static_cast(atoi(row[13])); + e.ischeckedout = static_cast(atoi(row[14])); e.senttime = strtoll(row[15], nullptr, 10); all_entries.push_back(e); diff --git a/common/repositories/base/base_pets_beastlord_data_repository.h b/common/repositories/base/base_pets_beastlord_data_repository.h index 34e2fc346..fd0519f6e 100644 --- a/common/repositories/base/base_pets_beastlord_data_repository.h +++ b/common/repositories/base/base_pets_beastlord_data_repository.h @@ -19,13 +19,13 @@ class BasePetsBeastlordDataRepository { public: struct PetsBeastlordData { - int player_race; - int pet_race; - int texture; - int helm_texture; - int gender; - float size_modifier; - int face; + uint32_t player_race; + uint32_t pet_race; + uint8_t texture; + uint8_t helm_texture; + uint8_t gender; + std::string size_modifier; + uint8_t face; }; static std::string PrimaryKey() @@ -138,13 +138,12 @@ public: if (results.RowCount() == 1) { PetsBeastlordData e{}; - e.player_race = atoi(row[0]); - e.pet_race = atoi(row[1]); - e.texture = atoi(row[2]); - e.helm_texture = atoi(row[3]); - e.gender = atoi(row[4]); - e.size_modifier = static_cast(atof(row[5])); - e.face = atoi(row[6]); + e.player_race = static_cast(strtoul(row[0], nullptr, 10)); + e.pet_race = static_cast(strtoul(row[1], nullptr, 10)); + e.texture = static_cast(strtoul(row[2], nullptr, 10)); + e.helm_texture = static_cast(strtoul(row[3], nullptr, 10)); + e.gender = static_cast(strtoul(row[4], nullptr, 10)); + e.face = static_cast(strtoul(row[6], nullptr, 10)); return e; } @@ -282,13 +281,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PetsBeastlordData e{}; - e.player_race = atoi(row[0]); - e.pet_race = atoi(row[1]); - e.texture = atoi(row[2]); - e.helm_texture = atoi(row[3]); - e.gender = atoi(row[4]); - e.size_modifier = static_cast(atof(row[5])); - e.face = atoi(row[6]); + e.player_race = static_cast(strtoul(row[0], nullptr, 10)); + e.pet_race = static_cast(strtoul(row[1], nullptr, 10)); + e.texture = static_cast(strtoul(row[2], nullptr, 10)); + e.helm_texture = static_cast(strtoul(row[3], nullptr, 10)); + e.gender = static_cast(strtoul(row[4], nullptr, 10)); + e.face = static_cast(strtoul(row[6], nullptr, 10)); all_entries.push_back(e); } @@ -313,13 +311,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PetsBeastlordData e{}; - e.player_race = atoi(row[0]); - e.pet_race = atoi(row[1]); - e.texture = atoi(row[2]); - e.helm_texture = atoi(row[3]); - e.gender = atoi(row[4]); - e.size_modifier = static_cast(atof(row[5])); - e.face = atoi(row[6]); + e.player_race = static_cast(strtoul(row[0], nullptr, 10)); + e.pet_race = static_cast(strtoul(row[1], nullptr, 10)); + e.texture = static_cast(strtoul(row[2], nullptr, 10)); + e.helm_texture = static_cast(strtoul(row[3], nullptr, 10)); + e.gender = static_cast(strtoul(row[4], nullptr, 10)); + e.face = static_cast(strtoul(row[6], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_pets_equipmentset_entries_repository.h b/common/repositories/base/base_pets_equipmentset_entries_repository.h index c2ea4dec5..c6ba9b48a 100644 --- a/common/repositories/base/base_pets_equipmentset_entries_repository.h +++ b/common/repositories/base/base_pets_equipmentset_entries_repository.h @@ -19,9 +19,9 @@ class BasePetsEquipmentsetEntriesRepository { public: struct PetsEquipmentsetEntries { - int set_id; - int slot; - int item_id; + int32_t set_id; + int32_t slot; + int32_t item_id; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { PetsEquipmentsetEntries e{}; - e.set_id = atoi(row[0]); - e.slot = atoi(row[1]); - e.item_id = atoi(row[2]); + e.set_id = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.item_id = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PetsEquipmentsetEntries e{}; - e.set_id = atoi(row[0]); - e.slot = atoi(row[1]); - e.item_id = atoi(row[2]); + e.set_id = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.item_id = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PetsEquipmentsetEntries e{}; - e.set_id = atoi(row[0]); - e.slot = atoi(row[1]); - e.item_id = atoi(row[2]); + e.set_id = static_cast(atoi(row[0])); + e.slot = static_cast(atoi(row[1])); + e.item_id = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_pets_equipmentset_repository.h b/common/repositories/base/base_pets_equipmentset_repository.h index d8acbc206..944df956f 100644 --- a/common/repositories/base/base_pets_equipmentset_repository.h +++ b/common/repositories/base/base_pets_equipmentset_repository.h @@ -19,9 +19,9 @@ class BasePetsEquipmentsetRepository { public: struct PetsEquipmentset { - int set_id; + int32_t set_id; std::string setname; - int nested_set; + int32_t nested_set; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { PetsEquipmentset e{}; - e.set_id = atoi(row[0]); + e.set_id = static_cast(atoi(row[0])); e.setname = row[1] ? row[1] : ""; - e.nested_set = atoi(row[2]); + e.nested_set = static_cast(atoi(row[2])); return e; } @@ -250,9 +250,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PetsEquipmentset e{}; - e.set_id = atoi(row[0]); + e.set_id = static_cast(atoi(row[0])); e.setname = row[1] ? row[1] : ""; - e.nested_set = atoi(row[2]); + e.nested_set = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -277,9 +277,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PetsEquipmentset e{}; - e.set_id = atoi(row[0]); + e.set_id = static_cast(atoi(row[0])); e.setname = row[1] ? row[1] : ""; - e.nested_set = atoi(row[2]); + e.nested_set = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_pets_repository.h b/common/repositories/base/base_pets_repository.h index 882a26e9d..dff44229f 100644 --- a/common/repositories/base/base_pets_repository.h +++ b/common/repositories/base/base_pets_repository.h @@ -19,15 +19,15 @@ class BasePetsRepository { public: struct Pets { - int id; + int32_t id; std::string type; - int petpower; - int npcID; - int temp; - int petcontrol; - int petnaming; - int monsterflag; - int equipmentset; + int32_t petpower; + int32_t npcID; + int8_t temp; + int8_t petcontrol; + int8_t petnaming; + int8_t monsterflag; + int32_t equipmentset; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { Pets e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.type = row[1] ? row[1] : ""; - e.petpower = atoi(row[2]); - e.npcID = atoi(row[3]); - e.temp = atoi(row[4]); - e.petcontrol = atoi(row[5]); - e.petnaming = atoi(row[6]); - e.monsterflag = atoi(row[7]); - e.equipmentset = atoi(row[8]); + e.petpower = static_cast(atoi(row[2])); + e.npcID = static_cast(atoi(row[3])); + e.temp = static_cast(atoi(row[4])); + e.petcontrol = static_cast(atoi(row[5])); + e.petnaming = static_cast(atoi(row[6])); + e.monsterflag = static_cast(atoi(row[7])); + e.equipmentset = static_cast(atoi(row[8])); return e; } @@ -297,15 +297,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Pets e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.type = row[1] ? row[1] : ""; - e.petpower = atoi(row[2]); - e.npcID = atoi(row[3]); - e.temp = atoi(row[4]); - e.petcontrol = atoi(row[5]); - e.petnaming = atoi(row[6]); - e.monsterflag = atoi(row[7]); - e.equipmentset = atoi(row[8]); + e.petpower = static_cast(atoi(row[2])); + e.npcID = static_cast(atoi(row[3])); + e.temp = static_cast(atoi(row[4])); + e.petcontrol = static_cast(atoi(row[5])); + e.petnaming = static_cast(atoi(row[6])); + e.monsterflag = static_cast(atoi(row[7])); + e.equipmentset = static_cast(atoi(row[8])); all_entries.push_back(e); } @@ -330,15 +330,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Pets e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.type = row[1] ? row[1] : ""; - e.petpower = atoi(row[2]); - e.npcID = atoi(row[3]); - e.temp = atoi(row[4]); - e.petcontrol = atoi(row[5]); - e.petnaming = atoi(row[6]); - e.monsterflag = atoi(row[7]); - e.equipmentset = atoi(row[8]); + e.petpower = static_cast(atoi(row[2])); + e.npcID = static_cast(atoi(row[3])); + e.temp = static_cast(atoi(row[4])); + e.petcontrol = static_cast(atoi(row[5])); + e.petnaming = static_cast(atoi(row[6])); + e.monsterflag = static_cast(atoi(row[7])); + e.equipmentset = static_cast(atoi(row[8])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_player_titlesets_repository.h b/common/repositories/base/base_player_titlesets_repository.h index 298a66b0e..2904ce0fb 100644 --- a/common/repositories/base/base_player_titlesets_repository.h +++ b/common/repositories/base/base_player_titlesets_repository.h @@ -19,9 +19,9 @@ class BasePlayerTitlesetsRepository { public: struct PlayerTitlesets { - int id; - int char_id; - int title_set; + uint32_t id; + uint32_t char_id; + uint32_t title_set; }; static std::string PrimaryKey() @@ -122,9 +122,9 @@ public: if (results.RowCount() == 1) { PlayerTitlesets e{}; - e.id = atoi(row[0]); - e.char_id = atoi(row[1]); - e.title_set = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.char_id = static_cast(strtoul(row[1], nullptr, 10)); + e.title_set = static_cast(strtoul(row[2], nullptr, 10)); return e; } @@ -249,9 +249,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PlayerTitlesets e{}; - e.id = atoi(row[0]); - e.char_id = atoi(row[1]); - e.title_set = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.char_id = static_cast(strtoul(row[1], nullptr, 10)); + e.title_set = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } @@ -276,9 +276,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { PlayerTitlesets e{}; - e.id = atoi(row[0]); - e.char_id = atoi(row[1]); - e.title_set = atoi(row[2]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.char_id = static_cast(strtoul(row[1], nullptr, 10)); + e.title_set = static_cast(strtoul(row[2], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_proximities_repository.h b/common/repositories/base/base_proximities_repository.h index 252696745..9498857df 100644 --- a/common/repositories/base/base_proximities_repository.h +++ b/common/repositories/base/base_proximities_repository.h @@ -19,14 +19,14 @@ class BaseProximitiesRepository { public: struct Proximities { - int zoneid; - int exploreid; - float minx; - float maxx; - float miny; - float maxy; - float minz; - float maxz; + uint32_t zoneid; + uint32_t exploreid; + float minx; + float maxx; + float miny; + float maxy; + float minz; + float maxz; }; static std::string PrimaryKey() @@ -142,14 +142,14 @@ public: if (results.RowCount() == 1) { Proximities e{}; - e.zoneid = atoi(row[0]); - e.exploreid = atoi(row[1]); - e.minx = static_cast(atof(row[2])); - e.maxx = static_cast(atof(row[3])); - e.miny = static_cast(atof(row[4])); - e.maxy = static_cast(atof(row[5])); - e.minz = static_cast(atof(row[6])); - e.maxz = static_cast(atof(row[7])); + e.zoneid = static_cast(strtoul(row[0], nullptr, 10)); + e.exploreid = static_cast(strtoul(row[1], nullptr, 10)); + e.minx = strtof(row[2], nullptr); + e.maxx = strtof(row[3], nullptr); + e.miny = strtof(row[4], nullptr); + e.maxy = strtof(row[5], nullptr); + e.minz = strtof(row[6], nullptr); + e.maxz = strtof(row[7], nullptr); return e; } @@ -290,14 +290,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Proximities e{}; - e.zoneid = atoi(row[0]); - e.exploreid = atoi(row[1]); - e.minx = static_cast(atof(row[2])); - e.maxx = static_cast(atof(row[3])); - e.miny = static_cast(atof(row[4])); - e.maxy = static_cast(atof(row[5])); - e.minz = static_cast(atof(row[6])); - e.maxz = static_cast(atof(row[7])); + e.zoneid = static_cast(strtoul(row[0], nullptr, 10)); + e.exploreid = static_cast(strtoul(row[1], nullptr, 10)); + e.minx = strtof(row[2], nullptr); + e.maxx = strtof(row[3], nullptr); + e.miny = strtof(row[4], nullptr); + e.maxy = strtof(row[5], nullptr); + e.minz = strtof(row[6], nullptr); + e.maxz = strtof(row[7], nullptr); all_entries.push_back(e); } @@ -322,14 +322,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Proximities e{}; - e.zoneid = atoi(row[0]); - e.exploreid = atoi(row[1]); - e.minx = static_cast(atof(row[2])); - e.maxx = static_cast(atof(row[3])); - e.miny = static_cast(atof(row[4])); - e.maxy = static_cast(atof(row[5])); - e.minz = static_cast(atof(row[6])); - e.maxz = static_cast(atof(row[7])); + e.zoneid = static_cast(strtoul(row[0], nullptr, 10)); + e.exploreid = static_cast(strtoul(row[1], nullptr, 10)); + e.minx = strtof(row[2], nullptr); + e.maxx = strtof(row[3], nullptr); + e.miny = strtof(row[4], nullptr); + e.maxy = strtof(row[5], nullptr); + e.minz = strtof(row[6], nullptr); + e.maxz = strtof(row[7], nullptr); all_entries.push_back(e); } diff --git a/common/repositories/base/base_quest_globals_repository.h b/common/repositories/base/base_quest_globals_repository.h index 64defd56d..c09e955a7 100644 --- a/common/repositories/base/base_quest_globals_repository.h +++ b/common/repositories/base/base_quest_globals_repository.h @@ -19,12 +19,12 @@ class BaseQuestGlobalsRepository { public: struct QuestGlobals { - int charid; - int npcid; - int zoneid; + int32_t charid; + int32_t npcid; + int32_t zoneid; std::string name; std::string value; - int expdate; + int32_t expdate; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { QuestGlobals e{}; - e.charid = atoi(row[0]); - e.npcid = atoi(row[1]); - e.zoneid = atoi(row[2]); + e.charid = static_cast(atoi(row[0])); + e.npcid = static_cast(atoi(row[1])); + e.zoneid = static_cast(atoi(row[2])); e.name = row[3] ? row[3] : ""; e.value = row[4] ? row[4] : ""; - e.expdate = atoi(row[5]); + e.expdate = static_cast(atoi(row[5])); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { QuestGlobals e{}; - e.charid = atoi(row[0]); - e.npcid = atoi(row[1]); - e.zoneid = atoi(row[2]); + e.charid = static_cast(atoi(row[0])); + e.npcid = static_cast(atoi(row[1])); + e.zoneid = static_cast(atoi(row[2])); e.name = row[3] ? row[3] : ""; e.value = row[4] ? row[4] : ""; - e.expdate = atoi(row[5]); + e.expdate = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { QuestGlobals e{}; - e.charid = atoi(row[0]); - e.npcid = atoi(row[1]); - e.zoneid = atoi(row[2]); + e.charid = static_cast(atoi(row[0])); + e.npcid = static_cast(atoi(row[1])); + e.zoneid = static_cast(atoi(row[2])); e.name = row[3] ? row[3] : ""; e.value = row[4] ? row[4] : ""; - e.expdate = atoi(row[5]); + e.expdate = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_raid_details_repository.h b/common/repositories/base/base_raid_details_repository.h index 78f734782..7ce468c60 100644 --- a/common/repositories/base/base_raid_details_repository.h +++ b/common/repositories/base/base_raid_details_repository.h @@ -19,9 +19,9 @@ class BaseRaidDetailsRepository { public: struct RaidDetails { - int raidid; - int loottype; - int locked; + int32_t raidid; + int32_t loottype; + int8_t locked; std::string motd; }; @@ -126,9 +126,9 @@ public: if (results.RowCount() == 1) { RaidDetails e{}; - e.raidid = atoi(row[0]); - e.loottype = atoi(row[1]); - e.locked = atoi(row[2]); + e.raidid = static_cast(atoi(row[0])); + e.loottype = static_cast(atoi(row[1])); + e.locked = static_cast(atoi(row[2])); e.motd = row[3] ? row[3] : ""; return e; @@ -258,9 +258,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RaidDetails e{}; - e.raidid = atoi(row[0]); - e.loottype = atoi(row[1]); - e.locked = atoi(row[2]); + e.raidid = static_cast(atoi(row[0])); + e.loottype = static_cast(atoi(row[1])); + e.locked = static_cast(atoi(row[2])); e.motd = row[3] ? row[3] : ""; all_entries.push_back(e); @@ -286,9 +286,9 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RaidDetails e{}; - e.raidid = atoi(row[0]); - e.loottype = atoi(row[1]); - e.locked = atoi(row[2]); + e.raidid = static_cast(atoi(row[0])); + e.loottype = static_cast(atoi(row[1])); + e.locked = static_cast(atoi(row[2])); e.motd = row[3] ? row[3] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_raid_members_repository.h b/common/repositories/base/base_raid_members_repository.h index f54d4fffc..07defda40 100644 --- a/common/repositories/base/base_raid_members_repository.h +++ b/common/repositories/base/base_raid_members_repository.h @@ -19,15 +19,15 @@ class BaseRaidMembersRepository { public: struct RaidMembers { - int raidid; - int charid; - int groupid; - int _class; - int level; + int32_t raidid; + int32_t charid; + uint32_t groupid; + int8_t _class; + int8_t level; std::string name; - int isgroupleader; - int israidleader; - int islooter; + int8_t isgroupleader; + int8_t israidleader; + int8_t islooter; }; static std::string PrimaryKey() @@ -146,15 +146,15 @@ public: if (results.RowCount() == 1) { RaidMembers e{}; - e.raidid = atoi(row[0]); - e.charid = atoi(row[1]); - e.groupid = atoi(row[2]); - e._class = atoi(row[3]); - e.level = atoi(row[4]); + e.raidid = static_cast(atoi(row[0])); + e.charid = static_cast(atoi(row[1])); + e.groupid = static_cast(strtoul(row[2], nullptr, 10)); + e._class = static_cast(atoi(row[3])); + e.level = static_cast(atoi(row[4])); e.name = row[5] ? row[5] : ""; - e.isgroupleader = atoi(row[6]); - e.israidleader = atoi(row[7]); - e.islooter = atoi(row[8]); + e.isgroupleader = static_cast(atoi(row[6])); + e.israidleader = static_cast(atoi(row[7])); + e.islooter = static_cast(atoi(row[8])); return e; } @@ -298,15 +298,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RaidMembers e{}; - e.raidid = atoi(row[0]); - e.charid = atoi(row[1]); - e.groupid = atoi(row[2]); - e._class = atoi(row[3]); - e.level = atoi(row[4]); + e.raidid = static_cast(atoi(row[0])); + e.charid = static_cast(atoi(row[1])); + e.groupid = static_cast(strtoul(row[2], nullptr, 10)); + e._class = static_cast(atoi(row[3])); + e.level = static_cast(atoi(row[4])); e.name = row[5] ? row[5] : ""; - e.isgroupleader = atoi(row[6]); - e.israidleader = atoi(row[7]); - e.islooter = atoi(row[8]); + e.isgroupleader = static_cast(atoi(row[6])); + e.israidleader = static_cast(atoi(row[7])); + e.islooter = static_cast(atoi(row[8])); all_entries.push_back(e); } @@ -331,15 +331,15 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RaidMembers e{}; - e.raidid = atoi(row[0]); - e.charid = atoi(row[1]); - e.groupid = atoi(row[2]); - e._class = atoi(row[3]); - e.level = atoi(row[4]); + e.raidid = static_cast(atoi(row[0])); + e.charid = static_cast(atoi(row[1])); + e.groupid = static_cast(strtoul(row[2], nullptr, 10)); + e._class = static_cast(atoi(row[3])); + e.level = static_cast(atoi(row[4])); e.name = row[5] ? row[5] : ""; - e.isgroupleader = atoi(row[6]); - e.israidleader = atoi(row[7]); - e.islooter = atoi(row[8]); + e.isgroupleader = static_cast(atoi(row[6])); + e.israidleader = static_cast(atoi(row[7])); + e.islooter = static_cast(atoi(row[8])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_reports_repository.h b/common/repositories/base/base_reports_repository.h index 84e5d4eee..3a45fe730 100644 --- a/common/repositories/base/base_reports_repository.h +++ b/common/repositories/base/base_reports_repository.h @@ -19,7 +19,7 @@ class BaseReportsRepository { public: struct Reports { - int id; + uint32_t id; std::string name; std::string reported; std::string reported_text; @@ -126,7 +126,7 @@ public: if (results.RowCount() == 1) { Reports e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; e.reported = row[2] ? row[2] : ""; e.reported_text = row[3] ? row[3] : ""; @@ -257,7 +257,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Reports e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; e.reported = row[2] ? row[2] : ""; e.reported_text = row[3] ? row[3] : ""; @@ -285,7 +285,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Reports e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; e.reported = row[2] ? row[2] : ""; e.reported_text = row[3] ? row[3] : ""; diff --git a/common/repositories/base/base_respawn_times_repository.h b/common/repositories/base/base_respawn_times_repository.h index 9429e3b82..446a78216 100644 --- a/common/repositories/base/base_respawn_times_repository.h +++ b/common/repositories/base/base_respawn_times_repository.h @@ -19,10 +19,10 @@ class BaseRespawnTimesRepository { public: struct RespawnTimes { - int id; - int start; - int duration; - int instance_id; + int32_t id; + int32_t start; + int32_t duration; + int16_t instance_id; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { RespawnTimes e{}; - e.id = atoi(row[0]); - e.start = atoi(row[1]); - e.duration = atoi(row[2]); - e.instance_id = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.start = static_cast(atoi(row[1])); + e.duration = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RespawnTimes e{}; - e.id = atoi(row[0]); - e.start = atoi(row[1]); - e.duration = atoi(row[2]); - e.instance_id = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.start = static_cast(atoi(row[1])); + e.duration = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RespawnTimes e{}; - e.id = atoi(row[0]); - e.start = atoi(row[1]); - e.duration = atoi(row[2]); - e.instance_id = atoi(row[3]); + e.id = static_cast(atoi(row[0])); + e.start = static_cast(atoi(row[1])); + e.duration = static_cast(atoi(row[2])); + e.instance_id = static_cast(atoi(row[3])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_rule_sets_repository.h b/common/repositories/base/base_rule_sets_repository.h index bb00caa22..461c6f1e6 100644 --- a/common/repositories/base/base_rule_sets_repository.h +++ b/common/repositories/base/base_rule_sets_repository.h @@ -19,7 +19,7 @@ class BaseRuleSetsRepository { public: struct RuleSets { - int ruleset_id; + uint8_t ruleset_id; std::string name; }; @@ -118,7 +118,7 @@ public: if (results.RowCount() == 1) { RuleSets e{}; - e.ruleset_id = atoi(row[0]); + e.ruleset_id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; return e; @@ -241,7 +241,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RuleSets e{}; - e.ruleset_id = atoi(row[0]); + e.ruleset_id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; all_entries.push_back(e); @@ -267,7 +267,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RuleSets e{}; - e.ruleset_id = atoi(row[0]); + e.ruleset_id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_rule_values_repository.h b/common/repositories/base/base_rule_values_repository.h index 9faccd833..b98e3f7dc 100644 --- a/common/repositories/base/base_rule_values_repository.h +++ b/common/repositories/base/base_rule_values_repository.h @@ -19,7 +19,7 @@ class BaseRuleValuesRepository { public: struct RuleValues { - int ruleset_id; + uint8_t ruleset_id; std::string rule_name; std::string rule_value; std::string notes; @@ -126,7 +126,7 @@ public: if (results.RowCount() == 1) { RuleValues e{}; - e.ruleset_id = atoi(row[0]); + e.ruleset_id = static_cast(strtoul(row[0], nullptr, 10)); e.rule_name = row[1] ? row[1] : ""; e.rule_value = row[2] ? row[2] : ""; e.notes = row[3] ? row[3] : ""; @@ -258,7 +258,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RuleValues e{}; - e.ruleset_id = atoi(row[0]); + e.ruleset_id = static_cast(strtoul(row[0], nullptr, 10)); e.rule_name = row[1] ? row[1] : ""; e.rule_value = row[2] ? row[2] : ""; e.notes = row[3] ? row[3] : ""; @@ -286,7 +286,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { RuleValues e{}; - e.ruleset_id = atoi(row[0]); + e.ruleset_id = static_cast(strtoul(row[0], nullptr, 10)); e.rule_name = row[1] ? row[1] : ""; e.rule_value = row[2] ? row[2] : ""; e.notes = row[3] ? row[3] : ""; diff --git a/common/repositories/base/base_saylink_repository.h b/common/repositories/base/base_saylink_repository.h index 903b906d5..5e35da29c 100644 --- a/common/repositories/base/base_saylink_repository.h +++ b/common/repositories/base/base_saylink_repository.h @@ -19,7 +19,7 @@ class BaseSaylinkRepository { public: struct Saylink { - int id; + int32_t id; std::string phrase; }; @@ -118,7 +118,7 @@ public: if (results.RowCount() == 1) { Saylink e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.phrase = row[1] ? row[1] : ""; return e; @@ -241,7 +241,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Saylink e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.phrase = row[1] ? row[1] : ""; all_entries.push_back(e); @@ -267,7 +267,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Saylink e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.phrase = row[1] ? row[1] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_server_scheduled_events_repository.h b/common/repositories/base/base_server_scheduled_events_repository.h index a510b51fc..a1e32b40e 100644 --- a/common/repositories/base/base_server_scheduled_events_repository.h +++ b/common/repositories/base/base_server_scheduled_events_repository.h @@ -19,20 +19,20 @@ class BaseServerScheduledEventsRepository { public: struct ServerScheduledEvents { - int id; + int32_t id; std::string description; std::string event_type; std::string event_data; - int minute_start; - int hour_start; - int day_start; - int month_start; - int year_start; - int minute_end; - int hour_end; - int day_end; - int month_end; - int year_end; + int32_t minute_start; + int32_t hour_start; + int32_t day_start; + int32_t month_start; + int32_t year_start; + int32_t minute_end; + int32_t hour_end; + int32_t day_end; + int32_t month_end; + int32_t year_end; std::string cron_expression; time_t created_at; time_t deleted_at; @@ -178,20 +178,20 @@ public: if (results.RowCount() == 1) { ServerScheduledEvents e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.description = row[1] ? row[1] : ""; e.event_type = row[2] ? row[2] : ""; e.event_data = row[3] ? row[3] : ""; - e.minute_start = atoi(row[4]); - e.hour_start = atoi(row[5]); - e.day_start = atoi(row[6]); - e.month_start = atoi(row[7]); - e.year_start = atoi(row[8]); - e.minute_end = atoi(row[9]); - e.hour_end = atoi(row[10]); - e.day_end = atoi(row[11]); - e.month_end = atoi(row[12]); - e.year_end = atoi(row[13]); + e.minute_start = static_cast(atoi(row[4])); + e.hour_start = static_cast(atoi(row[5])); + e.day_start = static_cast(atoi(row[6])); + e.month_start = static_cast(atoi(row[7])); + e.year_start = static_cast(atoi(row[8])); + e.minute_end = static_cast(atoi(row[9])); + e.hour_end = static_cast(atoi(row[10])); + e.day_end = static_cast(atoi(row[11])); + e.month_end = static_cast(atoi(row[12])); + e.year_end = static_cast(atoi(row[13])); e.cron_expression = row[14] ? row[14] : ""; e.created_at = strtoll(row[15] ? row[15] : "-1", nullptr, 10); e.deleted_at = strtoll(row[16] ? row[16] : "-1", nullptr, 10); @@ -361,20 +361,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ServerScheduledEvents e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.description = row[1] ? row[1] : ""; e.event_type = row[2] ? row[2] : ""; e.event_data = row[3] ? row[3] : ""; - e.minute_start = atoi(row[4]); - e.hour_start = atoi(row[5]); - e.day_start = atoi(row[6]); - e.month_start = atoi(row[7]); - e.year_start = atoi(row[8]); - e.minute_end = atoi(row[9]); - e.hour_end = atoi(row[10]); - e.day_end = atoi(row[11]); - e.month_end = atoi(row[12]); - e.year_end = atoi(row[13]); + e.minute_start = static_cast(atoi(row[4])); + e.hour_start = static_cast(atoi(row[5])); + e.day_start = static_cast(atoi(row[6])); + e.month_start = static_cast(atoi(row[7])); + e.year_start = static_cast(atoi(row[8])); + e.minute_end = static_cast(atoi(row[9])); + e.hour_end = static_cast(atoi(row[10])); + e.day_end = static_cast(atoi(row[11])); + e.month_end = static_cast(atoi(row[12])); + e.year_end = static_cast(atoi(row[13])); e.cron_expression = row[14] ? row[14] : ""; e.created_at = strtoll(row[15] ? row[15] : "-1", nullptr, 10); e.deleted_at = strtoll(row[16] ? row[16] : "-1", nullptr, 10); @@ -402,20 +402,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ServerScheduledEvents e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.description = row[1] ? row[1] : ""; e.event_type = row[2] ? row[2] : ""; e.event_data = row[3] ? row[3] : ""; - e.minute_start = atoi(row[4]); - e.hour_start = atoi(row[5]); - e.day_start = atoi(row[6]); - e.month_start = atoi(row[7]); - e.year_start = atoi(row[8]); - e.minute_end = atoi(row[9]); - e.hour_end = atoi(row[10]); - e.day_end = atoi(row[11]); - e.month_end = atoi(row[12]); - e.year_end = atoi(row[13]); + e.minute_start = static_cast(atoi(row[4])); + e.hour_start = static_cast(atoi(row[5])); + e.day_start = static_cast(atoi(row[6])); + e.month_start = static_cast(atoi(row[7])); + e.year_start = static_cast(atoi(row[8])); + e.minute_end = static_cast(atoi(row[9])); + e.hour_end = static_cast(atoi(row[10])); + e.day_end = static_cast(atoi(row[11])); + e.month_end = static_cast(atoi(row[12])); + e.year_end = static_cast(atoi(row[13])); e.cron_expression = row[14] ? row[14] : ""; e.created_at = strtoll(row[15] ? row[15] : "-1", nullptr, 10); e.deleted_at = strtoll(row[16] ? row[16] : "-1", nullptr, 10); diff --git a/common/repositories/base/base_shared_task_activity_state_repository.h b/common/repositories/base/base_shared_task_activity_state_repository.h index 09e94f49d..fb6b56531 100644 --- a/common/repositories/base/base_shared_task_activity_state_repository.h +++ b/common/repositories/base/base_shared_task_activity_state_repository.h @@ -19,11 +19,11 @@ class BaseSharedTaskActivityStateRepository { public: struct SharedTaskActivityState { - int64 shared_task_id; - int activity_id; - int done_count; - time_t updated_time; - time_t completed_time; + int64_t shared_task_id; + int32_t activity_id; + int32_t done_count; + time_t updated_time; + time_t completed_time; }; static std::string PrimaryKey() @@ -131,8 +131,8 @@ public: SharedTaskActivityState e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.activity_id = atoi(row[1]); - e.done_count = atoi(row[2]); + e.activity_id = static_cast(atoi(row[1])); + e.done_count = static_cast(atoi(row[2])); e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); @@ -267,8 +267,8 @@ public: SharedTaskActivityState e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.activity_id = atoi(row[1]); - e.done_count = atoi(row[2]); + e.activity_id = static_cast(atoi(row[1])); + e.done_count = static_cast(atoi(row[2])); e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); @@ -296,8 +296,8 @@ public: SharedTaskActivityState e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.activity_id = atoi(row[1]); - e.done_count = atoi(row[2]); + e.activity_id = static_cast(atoi(row[1])); + e.done_count = static_cast(atoi(row[2])); e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); diff --git a/common/repositories/base/base_shared_task_dynamic_zones_repository.h b/common/repositories/base/base_shared_task_dynamic_zones_repository.h index 919fbe15a..2bf92d75a 100644 --- a/common/repositories/base/base_shared_task_dynamic_zones_repository.h +++ b/common/repositories/base/base_shared_task_dynamic_zones_repository.h @@ -19,8 +19,8 @@ class BaseSharedTaskDynamicZonesRepository { public: struct SharedTaskDynamicZones { - int64 shared_task_id; - int dynamic_zone_id; + int64_t shared_task_id; + uint32_t dynamic_zone_id; }; static std::string PrimaryKey() @@ -119,7 +119,7 @@ public: SharedTaskDynamicZones e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.dynamic_zone_id = atoi(row[1]); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -243,7 +243,7 @@ public: SharedTaskDynamicZones e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.dynamic_zone_id = atoi(row[1]); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -269,7 +269,7 @@ public: SharedTaskDynamicZones e{}; e.shared_task_id = strtoll(row[0], nullptr, 10); - e.dynamic_zone_id = atoi(row[1]); + e.dynamic_zone_id = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_shared_task_members_repository.h b/common/repositories/base/base_shared_task_members_repository.h index 282f36bef..b26e42c66 100644 --- a/common/repositories/base/base_shared_task_members_repository.h +++ b/common/repositories/base/base_shared_task_members_repository.h @@ -19,9 +19,9 @@ class BaseSharedTaskMembersRepository { public: struct SharedTaskMembers { - int64 shared_task_id; - int64 character_id; - int is_leader; + int64_t shared_task_id; + int64_t character_id; + int8_t is_leader; }; static std::string PrimaryKey() @@ -124,7 +124,7 @@ public: e.shared_task_id = strtoll(row[0], nullptr, 10); e.character_id = strtoll(row[1], nullptr, 10); - e.is_leader = atoi(row[2]); + e.is_leader = static_cast(atoi(row[2])); return e; } @@ -252,7 +252,7 @@ public: e.shared_task_id = strtoll(row[0], nullptr, 10); e.character_id = strtoll(row[1], nullptr, 10); - e.is_leader = atoi(row[2]); + e.is_leader = static_cast(atoi(row[2])); all_entries.push_back(e); } @@ -279,7 +279,7 @@ public: e.shared_task_id = strtoll(row[0], nullptr, 10); e.character_id = strtoll(row[1], nullptr, 10); - e.is_leader = atoi(row[2]); + e.is_leader = static_cast(atoi(row[2])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_shared_tasks_repository.h b/common/repositories/base/base_shared_tasks_repository.h index e72f2d28f..82fee3608 100644 --- a/common/repositories/base/base_shared_tasks_repository.h +++ b/common/repositories/base/base_shared_tasks_repository.h @@ -19,12 +19,12 @@ class BaseSharedTasksRepository { public: struct SharedTasks { - int64 id; - int task_id; - time_t accepted_time; - time_t expire_time; - time_t completion_time; - int is_locked; + int64_t id; + int32_t task_id; + time_t accepted_time; + time_t expire_time; + time_t completion_time; + int8_t is_locked; }; static std::string PrimaryKey() @@ -135,11 +135,11 @@ public: SharedTasks e{}; e.id = strtoll(row[0], nullptr, 10); - e.task_id = atoi(row[1]); + e.task_id = static_cast(atoi(row[1])); e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10); e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.is_locked = atoi(row[5]); + e.is_locked = static_cast(atoi(row[5])); return e; } @@ -274,11 +274,11 @@ public: SharedTasks e{}; e.id = strtoll(row[0], nullptr, 10); - e.task_id = atoi(row[1]); + e.task_id = static_cast(atoi(row[1])); e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10); e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.is_locked = atoi(row[5]); + e.is_locked = static_cast(atoi(row[5])); all_entries.push_back(e); } @@ -304,11 +304,11 @@ public: SharedTasks e{}; e.id = strtoll(row[0], nullptr, 10); - e.task_id = atoi(row[1]); + e.task_id = static_cast(atoi(row[1])); e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10); e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10); e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10); - e.is_locked = atoi(row[5]); + e.is_locked = static_cast(atoi(row[5])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_skill_caps_repository.h b/common/repositories/base/base_skill_caps_repository.h index 04ed2e6ff..c1dc1c24f 100644 --- a/common/repositories/base/base_skill_caps_repository.h +++ b/common/repositories/base/base_skill_caps_repository.h @@ -19,11 +19,11 @@ class BaseSkillCapsRepository { public: struct SkillCaps { - int skillID; - int class_; - int level; - int cap; - int class_; + uint8_t skillID; + uint8_t class_; + uint8_t level; + uint32_t cap; + uint8_t class_; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { SkillCaps e{}; - e.skillID = atoi(row[0]); - e.class_ = atoi(row[1]); - e.level = atoi(row[2]); - e.cap = atoi(row[3]); - e.class_ = atoi(row[4]); + e.skillID = static_cast(strtoul(row[0], nullptr, 10)); + e.class_ = static_cast(strtoul(row[1], nullptr, 10)); + e.level = static_cast(strtoul(row[2], nullptr, 10)); + e.cap = static_cast(strtoul(row[3], nullptr, 10)); + e.class_ = static_cast(strtoul(row[4], nullptr, 10)); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SkillCaps e{}; - e.skillID = atoi(row[0]); - e.class_ = atoi(row[1]); - e.level = atoi(row[2]); - e.cap = atoi(row[3]); - e.class_ = atoi(row[4]); + e.skillID = static_cast(strtoul(row[0], nullptr, 10)); + e.class_ = static_cast(strtoul(row[1], nullptr, 10)); + e.level = static_cast(strtoul(row[2], nullptr, 10)); + e.cap = static_cast(strtoul(row[3], nullptr, 10)); + e.class_ = static_cast(strtoul(row[4], nullptr, 10)); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SkillCaps e{}; - e.skillID = atoi(row[0]); - e.class_ = atoi(row[1]); - e.level = atoi(row[2]); - e.cap = atoi(row[3]); - e.class_ = atoi(row[4]); + e.skillID = static_cast(strtoul(row[0], nullptr, 10)); + e.class_ = static_cast(strtoul(row[1], nullptr, 10)); + e.level = static_cast(strtoul(row[2], nullptr, 10)); + e.cap = static_cast(strtoul(row[3], nullptr, 10)); + e.class_ = static_cast(strtoul(row[4], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_spawn2_repository.h b/common/repositories/base/base_spawn2_repository.h index 8b7518653..bcfc8f0c9 100644 --- a/common/repositories/base/base_spawn2_repository.h +++ b/common/repositories/base/base_spawn2_repository.h @@ -19,24 +19,24 @@ class BaseSpawn2Repository { public: struct Spawn2 { - int id; - int spawngroupID; + int32_t id; + int32_t spawngroupID; std::string zone; - int version; + int16_t version; float x; float y; float z; float heading; - int respawntime; - int variance; - int pathgrid; - int path_when_zone_idle; - int _condition; - int cond_value; - int enabled; - int animation; - int min_expansion; - int max_expansion; + int32_t respawntime; + int32_t variance; + int32_t pathgrid; + int8_t path_when_zone_idle; + uint32_t _condition; + int32_t cond_value; + uint8_t enabled; + uint8_t animation; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -190,24 +190,24 @@ public: if (results.RowCount() == 1) { Spawn2 e{}; - e.id = atoi(row[0]); - e.spawngroupID = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.spawngroupID = static_cast(atoi(row[1])); e.zone = row[2] ? row[2] : ""; - e.version = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); - e.respawntime = atoi(row[8]); - e.variance = atoi(row[9]); - e.pathgrid = atoi(row[10]); - e.path_when_zone_idle = atoi(row[11]); - e._condition = atoi(row[12]); - e.cond_value = atoi(row[13]); - e.enabled = atoi(row[14]); - e.animation = atoi(row[15]); - e.min_expansion = atoi(row[16]); - e.max_expansion = atoi(row[17]); + e.version = static_cast(atoi(row[3])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); + e.respawntime = static_cast(atoi(row[8])); + e.variance = static_cast(atoi(row[9])); + e.pathgrid = static_cast(atoi(row[10])); + e.path_when_zone_idle = static_cast(atoi(row[11])); + e._condition = static_cast(strtoul(row[12], nullptr, 10)); + e.cond_value = static_cast(atoi(row[13])); + e.enabled = static_cast(strtoul(row[14], nullptr, 10)); + e.animation = static_cast(strtoul(row[15], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[16])); + e.max_expansion = static_cast(atoi(row[17])); e.content_flags = row[18] ? row[18] : ""; e.content_flags_disabled = row[19] ? row[19] : ""; @@ -385,24 +385,24 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Spawn2 e{}; - e.id = atoi(row[0]); - e.spawngroupID = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.spawngroupID = static_cast(atoi(row[1])); e.zone = row[2] ? row[2] : ""; - e.version = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); - e.respawntime = atoi(row[8]); - e.variance = atoi(row[9]); - e.pathgrid = atoi(row[10]); - e.path_when_zone_idle = atoi(row[11]); - e._condition = atoi(row[12]); - e.cond_value = atoi(row[13]); - e.enabled = atoi(row[14]); - e.animation = atoi(row[15]); - e.min_expansion = atoi(row[16]); - e.max_expansion = atoi(row[17]); + e.version = static_cast(atoi(row[3])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); + e.respawntime = static_cast(atoi(row[8])); + e.variance = static_cast(atoi(row[9])); + e.pathgrid = static_cast(atoi(row[10])); + e.path_when_zone_idle = static_cast(atoi(row[11])); + e._condition = static_cast(strtoul(row[12], nullptr, 10)); + e.cond_value = static_cast(atoi(row[13])); + e.enabled = static_cast(strtoul(row[14], nullptr, 10)); + e.animation = static_cast(strtoul(row[15], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[16])); + e.max_expansion = static_cast(atoi(row[17])); e.content_flags = row[18] ? row[18] : ""; e.content_flags_disabled = row[19] ? row[19] : ""; @@ -429,24 +429,24 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Spawn2 e{}; - e.id = atoi(row[0]); - e.spawngroupID = atoi(row[1]); + e.id = static_cast(atoi(row[0])); + e.spawngroupID = static_cast(atoi(row[1])); e.zone = row[2] ? row[2] : ""; - e.version = atoi(row[3]); - e.x = static_cast(atof(row[4])); - e.y = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); - e.respawntime = atoi(row[8]); - e.variance = atoi(row[9]); - e.pathgrid = atoi(row[10]); - e.path_when_zone_idle = atoi(row[11]); - e._condition = atoi(row[12]); - e.cond_value = atoi(row[13]); - e.enabled = atoi(row[14]); - e.animation = atoi(row[15]); - e.min_expansion = atoi(row[16]); - e.max_expansion = atoi(row[17]); + e.version = static_cast(atoi(row[3])); + e.x = strtof(row[4], nullptr); + e.y = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); + e.respawntime = static_cast(atoi(row[8])); + e.variance = static_cast(atoi(row[9])); + e.pathgrid = static_cast(atoi(row[10])); + e.path_when_zone_idle = static_cast(atoi(row[11])); + e._condition = static_cast(strtoul(row[12], nullptr, 10)); + e.cond_value = static_cast(atoi(row[13])); + e.enabled = static_cast(strtoul(row[14], nullptr, 10)); + e.animation = static_cast(strtoul(row[15], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[16])); + e.max_expansion = static_cast(atoi(row[17])); e.content_flags = row[18] ? row[18] : ""; e.content_flags_disabled = row[19] ? row[19] : ""; diff --git a/common/repositories/base/base_spawn_condition_values_repository.h b/common/repositories/base/base_spawn_condition_values_repository.h index ebba336fe..450572b0e 100644 --- a/common/repositories/base/base_spawn_condition_values_repository.h +++ b/common/repositories/base/base_spawn_condition_values_repository.h @@ -19,10 +19,10 @@ class BaseSpawnConditionValuesRepository { public: struct SpawnConditionValues { - int id; - int value; + uint32_t id; + uint8_t value; std::string zone; - int instance_id; + uint32_t instance_id; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { SpawnConditionValues e{}; - e.id = atoi(row[0]); - e.value = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.value = static_cast(strtoul(row[1], nullptr, 10)); e.zone = row[2] ? row[2] : ""; - e.instance_id = atoi(row[3]); + e.instance_id = static_cast(strtoul(row[3], nullptr, 10)); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpawnConditionValues e{}; - e.id = atoi(row[0]); - e.value = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.value = static_cast(strtoul(row[1], nullptr, 10)); e.zone = row[2] ? row[2] : ""; - e.instance_id = atoi(row[3]); + e.instance_id = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpawnConditionValues e{}; - e.id = atoi(row[0]); - e.value = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.value = static_cast(strtoul(row[1], nullptr, 10)); e.zone = row[2] ? row[2] : ""; - e.instance_id = atoi(row[3]); + e.instance_id = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_spawn_conditions_repository.h b/common/repositories/base/base_spawn_conditions_repository.h index 668dec292..54d7a0ae1 100644 --- a/common/repositories/base/base_spawn_conditions_repository.h +++ b/common/repositories/base/base_spawn_conditions_repository.h @@ -20,9 +20,9 @@ class BaseSpawnConditionsRepository { public: struct SpawnConditions { std::string zone; - int id; - int value; - int onchange; + uint32_t id; + int32_t value; + uint8_t onchange; std::string name; }; @@ -131,9 +131,9 @@ public: SpawnConditions e{}; e.zone = row[0] ? row[0] : ""; - e.id = atoi(row[1]); - e.value = atoi(row[2]); - e.onchange = atoi(row[3]); + e.id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(atoi(row[2])); + e.onchange = static_cast(strtoul(row[3], nullptr, 10)); e.name = row[4] ? row[4] : ""; return e; @@ -267,9 +267,9 @@ public: SpawnConditions e{}; e.zone = row[0] ? row[0] : ""; - e.id = atoi(row[1]); - e.value = atoi(row[2]); - e.onchange = atoi(row[3]); + e.id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(atoi(row[2])); + e.onchange = static_cast(strtoul(row[3], nullptr, 10)); e.name = row[4] ? row[4] : ""; all_entries.push_back(e); @@ -296,9 +296,9 @@ public: SpawnConditions e{}; e.zone = row[0] ? row[0] : ""; - e.id = atoi(row[1]); - e.value = atoi(row[2]); - e.onchange = atoi(row[3]); + e.id = static_cast(strtoul(row[1], nullptr, 10)); + e.value = static_cast(atoi(row[2])); + e.onchange = static_cast(strtoul(row[3], nullptr, 10)); e.name = row[4] ? row[4] : ""; all_entries.push_back(e); diff --git a/common/repositories/base/base_spawn_events_repository.h b/common/repositories/base/base_spawn_events_repository.h index 196f98d55..d894ba1f7 100644 --- a/common/repositories/base/base_spawn_events_repository.h +++ b/common/repositories/base/base_spawn_events_repository.h @@ -19,20 +19,20 @@ class BaseSpawnEventsRepository { public: struct SpawnEvents { - int id; + uint32_t id; std::string zone; - int cond_id; + uint32_t cond_id; std::string name; - int period; - int next_minute; - int next_hour; - int next_day; - int next_month; - int next_year; - int enabled; - int action; - int argument; - int strict; + uint32_t period; + uint8_t next_minute; + uint8_t next_hour; + uint8_t next_day; + uint8_t next_month; + uint32_t next_year; + int8_t enabled; + uint8_t action; + int32_t argument; + int8_t strict; }; static std::string PrimaryKey() @@ -166,20 +166,20 @@ public: if (results.RowCount() == 1) { SpawnEvents e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.cond_id = atoi(row[2]); + e.cond_id = static_cast(strtoul(row[2], nullptr, 10)); e.name = row[3] ? row[3] : ""; - e.period = atoi(row[4]); - e.next_minute = atoi(row[5]); - e.next_hour = atoi(row[6]); - e.next_day = atoi(row[7]); - e.next_month = atoi(row[8]); - e.next_year = atoi(row[9]); - e.enabled = atoi(row[10]); - e.action = atoi(row[11]); - e.argument = atoi(row[12]); - e.strict = atoi(row[13]); + e.period = static_cast(strtoul(row[4], nullptr, 10)); + e.next_minute = static_cast(strtoul(row[5], nullptr, 10)); + e.next_hour = static_cast(strtoul(row[6], nullptr, 10)); + e.next_day = static_cast(strtoul(row[7], nullptr, 10)); + e.next_month = static_cast(strtoul(row[8], nullptr, 10)); + e.next_year = static_cast(strtoul(row[9], nullptr, 10)); + e.enabled = static_cast(atoi(row[10])); + e.action = static_cast(strtoul(row[11], nullptr, 10)); + e.argument = static_cast(atoi(row[12])); + e.strict = static_cast(atoi(row[13])); return e; } @@ -337,20 +337,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpawnEvents e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.cond_id = atoi(row[2]); + e.cond_id = static_cast(strtoul(row[2], nullptr, 10)); e.name = row[3] ? row[3] : ""; - e.period = atoi(row[4]); - e.next_minute = atoi(row[5]); - e.next_hour = atoi(row[6]); - e.next_day = atoi(row[7]); - e.next_month = atoi(row[8]); - e.next_year = atoi(row[9]); - e.enabled = atoi(row[10]); - e.action = atoi(row[11]); - e.argument = atoi(row[12]); - e.strict = atoi(row[13]); + e.period = static_cast(strtoul(row[4], nullptr, 10)); + e.next_minute = static_cast(strtoul(row[5], nullptr, 10)); + e.next_hour = static_cast(strtoul(row[6], nullptr, 10)); + e.next_day = static_cast(strtoul(row[7], nullptr, 10)); + e.next_month = static_cast(strtoul(row[8], nullptr, 10)); + e.next_year = static_cast(strtoul(row[9], nullptr, 10)); + e.enabled = static_cast(atoi(row[10])); + e.action = static_cast(strtoul(row[11], nullptr, 10)); + e.argument = static_cast(atoi(row[12])); + e.strict = static_cast(atoi(row[13])); all_entries.push_back(e); } @@ -375,20 +375,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpawnEvents e{}; - e.id = atoi(row[0]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); e.zone = row[1] ? row[1] : ""; - e.cond_id = atoi(row[2]); + e.cond_id = static_cast(strtoul(row[2], nullptr, 10)); e.name = row[3] ? row[3] : ""; - e.period = atoi(row[4]); - e.next_minute = atoi(row[5]); - e.next_hour = atoi(row[6]); - e.next_day = atoi(row[7]); - e.next_month = atoi(row[8]); - e.next_year = atoi(row[9]); - e.enabled = atoi(row[10]); - e.action = atoi(row[11]); - e.argument = atoi(row[12]); - e.strict = atoi(row[13]); + e.period = static_cast(strtoul(row[4], nullptr, 10)); + e.next_minute = static_cast(strtoul(row[5], nullptr, 10)); + e.next_hour = static_cast(strtoul(row[6], nullptr, 10)); + e.next_day = static_cast(strtoul(row[7], nullptr, 10)); + e.next_month = static_cast(strtoul(row[8], nullptr, 10)); + e.next_year = static_cast(strtoul(row[9], nullptr, 10)); + e.enabled = static_cast(atoi(row[10])); + e.action = static_cast(strtoul(row[11], nullptr, 10)); + e.argument = static_cast(atoi(row[12])); + e.strict = static_cast(atoi(row[13])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_spawnentry_repository.h b/common/repositories/base/base_spawnentry_repository.h index 1fc95e4e7..1632a4c79 100644 --- a/common/repositories/base/base_spawnentry_repository.h +++ b/common/repositories/base/base_spawnentry_repository.h @@ -19,12 +19,12 @@ class BaseSpawnentryRepository { public: struct Spawnentry { - int spawngroupID; - int npcID; - int chance; - int condition_value_filter; - int min_expansion; - int max_expansion; + int32_t spawngroupID; + int32_t npcID; + int16_t chance; + int32_t condition_value_filter; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -142,12 +142,12 @@ public: if (results.RowCount() == 1) { Spawnentry e{}; - e.spawngroupID = atoi(row[0]); - e.npcID = atoi(row[1]); - e.chance = atoi(row[2]); - e.condition_value_filter = atoi(row[3]); - e.min_expansion = atoi(row[4]); - e.max_expansion = atoi(row[5]); + e.spawngroupID = static_cast(atoi(row[0])); + e.npcID = static_cast(atoi(row[1])); + e.chance = static_cast(atoi(row[2])); + e.condition_value_filter = static_cast(atoi(row[3])); + e.min_expansion = static_cast(atoi(row[4])); + e.max_expansion = static_cast(atoi(row[5])); e.content_flags = row[6] ? row[6] : ""; e.content_flags_disabled = row[7] ? row[7] : ""; @@ -290,12 +290,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Spawnentry e{}; - e.spawngroupID = atoi(row[0]); - e.npcID = atoi(row[1]); - e.chance = atoi(row[2]); - e.condition_value_filter = atoi(row[3]); - e.min_expansion = atoi(row[4]); - e.max_expansion = atoi(row[5]); + e.spawngroupID = static_cast(atoi(row[0])); + e.npcID = static_cast(atoi(row[1])); + e.chance = static_cast(atoi(row[2])); + e.condition_value_filter = static_cast(atoi(row[3])); + e.min_expansion = static_cast(atoi(row[4])); + e.max_expansion = static_cast(atoi(row[5])); e.content_flags = row[6] ? row[6] : ""; e.content_flags_disabled = row[7] ? row[7] : ""; @@ -322,12 +322,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Spawnentry e{}; - e.spawngroupID = atoi(row[0]); - e.npcID = atoi(row[1]); - e.chance = atoi(row[2]); - e.condition_value_filter = atoi(row[3]); - e.min_expansion = atoi(row[4]); - e.max_expansion = atoi(row[5]); + e.spawngroupID = static_cast(atoi(row[0])); + e.npcID = static_cast(atoi(row[1])); + e.chance = static_cast(atoi(row[2])); + e.condition_value_filter = static_cast(atoi(row[3])); + e.min_expansion = static_cast(atoi(row[4])); + e.max_expansion = static_cast(atoi(row[5])); e.content_flags = row[6] ? row[6] : ""; e.content_flags_disabled = row[7] ? row[7] : ""; diff --git a/common/repositories/base/base_spawngroup_repository.h b/common/repositories/base/base_spawngroup_repository.h index 3194108ea..16c1931b7 100644 --- a/common/repositories/base/base_spawngroup_repository.h +++ b/common/repositories/base/base_spawngroup_repository.h @@ -19,19 +19,19 @@ class BaseSpawngroupRepository { public: struct Spawngroup { - int id; + int32_t id; std::string name; - int spawn_limit; + int8_t spawn_limit; float dist; float max_x; float min_x; float max_y; float min_y; - int delay; - int mindelay; - int despawn; - int despawn_timer; - int wp_spawns; + int32_t delay; + int32_t mindelay; + int8_t despawn; + int32_t despawn_timer; + uint8_t wp_spawns; }; static std::string PrimaryKey() @@ -162,19 +162,19 @@ public: if (results.RowCount() == 1) { Spawngroup e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.spawn_limit = atoi(row[2]); - e.dist = static_cast(atof(row[3])); - e.max_x = static_cast(atof(row[4])); - e.min_x = static_cast(atof(row[5])); - e.max_y = static_cast(atof(row[6])); - e.min_y = static_cast(atof(row[7])); - e.delay = atoi(row[8]); - e.mindelay = atoi(row[9]); - e.despawn = atoi(row[10]); - e.despawn_timer = atoi(row[11]); - e.wp_spawns = atoi(row[12]); + e.spawn_limit = static_cast(atoi(row[2])); + e.dist = strtof(row[3], nullptr); + e.max_x = strtof(row[4], nullptr); + e.min_x = strtof(row[5], nullptr); + e.max_y = strtof(row[6], nullptr); + e.min_y = strtof(row[7], nullptr); + e.delay = static_cast(atoi(row[8])); + e.mindelay = static_cast(atoi(row[9])); + e.despawn = static_cast(atoi(row[10])); + e.despawn_timer = static_cast(atoi(row[11])); + e.wp_spawns = static_cast(strtoul(row[12], nullptr, 10)); return e; } @@ -329,19 +329,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Spawngroup e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.spawn_limit = atoi(row[2]); - e.dist = static_cast(atof(row[3])); - e.max_x = static_cast(atof(row[4])); - e.min_x = static_cast(atof(row[5])); - e.max_y = static_cast(atof(row[6])); - e.min_y = static_cast(atof(row[7])); - e.delay = atoi(row[8]); - e.mindelay = atoi(row[9]); - e.despawn = atoi(row[10]); - e.despawn_timer = atoi(row[11]); - e.wp_spawns = atoi(row[12]); + e.spawn_limit = static_cast(atoi(row[2])); + e.dist = strtof(row[3], nullptr); + e.max_x = strtof(row[4], nullptr); + e.min_x = strtof(row[5], nullptr); + e.max_y = strtof(row[6], nullptr); + e.min_y = strtof(row[7], nullptr); + e.delay = static_cast(atoi(row[8])); + e.mindelay = static_cast(atoi(row[9])); + e.despawn = static_cast(atoi(row[10])); + e.despawn_timer = static_cast(atoi(row[11])); + e.wp_spawns = static_cast(strtoul(row[12], nullptr, 10)); all_entries.push_back(e); } @@ -366,19 +366,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Spawngroup e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.spawn_limit = atoi(row[2]); - e.dist = static_cast(atof(row[3])); - e.max_x = static_cast(atof(row[4])); - e.min_x = static_cast(atof(row[5])); - e.max_y = static_cast(atof(row[6])); - e.min_y = static_cast(atof(row[7])); - e.delay = atoi(row[8]); - e.mindelay = atoi(row[9]); - e.despawn = atoi(row[10]); - e.despawn_timer = atoi(row[11]); - e.wp_spawns = atoi(row[12]); + e.spawn_limit = static_cast(atoi(row[2])); + e.dist = strtof(row[3], nullptr); + e.max_x = strtof(row[4], nullptr); + e.min_x = strtof(row[5], nullptr); + e.max_y = strtof(row[6], nullptr); + e.min_y = strtof(row[7], nullptr); + e.delay = static_cast(atoi(row[8])); + e.mindelay = static_cast(atoi(row[9])); + e.despawn = static_cast(atoi(row[10])); + e.despawn_timer = static_cast(atoi(row[11])); + e.wp_spawns = static_cast(strtoul(row[12], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_spell_buckets_repository.h b/common/repositories/base/base_spell_buckets_repository.h index 994156024..a9c78953a 100644 --- a/common/repositories/base/base_spell_buckets_repository.h +++ b/common/repositories/base/base_spell_buckets_repository.h @@ -19,7 +19,7 @@ class BaseSpellBucketsRepository { public: struct SpellBuckets { - int64 spellid; + uint64_t spellid; std::string key; std::string value; }; @@ -122,7 +122,7 @@ public: if (results.RowCount() == 1) { SpellBuckets e{}; - e.spellid = strtoll(row[0], nullptr, 10); + e.spellid = strtoull(row[0], nullptr, 10); e.key = row[1] ? row[1] : ""; e.value = row[2] ? row[2] : ""; @@ -250,7 +250,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellBuckets e{}; - e.spellid = strtoll(row[0], nullptr, 10); + e.spellid = strtoull(row[0], nullptr, 10); e.key = row[1] ? row[1] : ""; e.value = row[2] ? row[2] : ""; @@ -277,7 +277,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellBuckets e{}; - e.spellid = strtoll(row[0], nullptr, 10); + e.spellid = strtoull(row[0], nullptr, 10); e.key = row[1] ? row[1] : ""; e.value = row[2] ? row[2] : ""; diff --git a/common/repositories/base/base_spell_globals_repository.h b/common/repositories/base/base_spell_globals_repository.h index 5803d5bd3..a7a0541df 100644 --- a/common/repositories/base/base_spell_globals_repository.h +++ b/common/repositories/base/base_spell_globals_repository.h @@ -19,7 +19,7 @@ class BaseSpellGlobalsRepository { public: struct SpellGlobals { - int spellid; + int32_t spellid; std::string spell_name; std::string qglobal; std::string value; @@ -126,7 +126,7 @@ public: if (results.RowCount() == 1) { SpellGlobals e{}; - e.spellid = atoi(row[0]); + e.spellid = static_cast(atoi(row[0])); e.spell_name = row[1] ? row[1] : ""; e.qglobal = row[2] ? row[2] : ""; e.value = row[3] ? row[3] : ""; @@ -258,7 +258,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellGlobals e{}; - e.spellid = atoi(row[0]); + e.spellid = static_cast(atoi(row[0])); e.spell_name = row[1] ? row[1] : ""; e.qglobal = row[2] ? row[2] : ""; e.value = row[3] ? row[3] : ""; @@ -286,7 +286,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellGlobals e{}; - e.spellid = atoi(row[0]); + e.spellid = static_cast(atoi(row[0])); e.spell_name = row[1] ? row[1] : ""; e.qglobal = row[2] ? row[2] : ""; e.value = row[3] ? row[3] : ""; diff --git a/common/repositories/base/base_spells_new_repository.h b/common/repositories/base/base_spells_new_repository.h index 8d523c71d..1c61aab1f 100644 --- a/common/repositories/base/base_spells_new_repository.h +++ b/common/repositories/base/base_spells_new_repository.h @@ -19,7 +19,7 @@ class BaseSpellsNewRepository { public: struct SpellsNew { - int id; + int32_t id; std::string name; std::string player_1; std::string teleport_zone; @@ -28,234 +28,234 @@ public: std::string cast_on_you; std::string cast_on_other; std::string spell_fades; - int range; - int aoerange; - int pushback; - int pushup; - int cast_time; - int recovery_time; - int recast_time; - int buffdurationformula; - int buffduration; - int AEDuration; - int mana; - int effect_base_value1; - int effect_base_value2; - int effect_base_value3; - int effect_base_value4; - int effect_base_value5; - int effect_base_value6; - int effect_base_value7; - int effect_base_value8; - int effect_base_value9; - int effect_base_value10; - int effect_base_value11; - int effect_base_value12; - int effect_limit_value1; - int effect_limit_value2; - int effect_limit_value3; - int effect_limit_value4; - int effect_limit_value5; - int effect_limit_value6; - int effect_limit_value7; - int effect_limit_value8; - int effect_limit_value9; - int effect_limit_value10; - int effect_limit_value11; - int effect_limit_value12; - int max1; - int max2; - int max3; - int max4; - int max5; - int max6; - int max7; - int max8; - int max9; - int max10; - int max11; - int max12; - int icon; - int memicon; - int components1; - int components2; - int components3; - int components4; - int component_counts1; - int component_counts2; - int component_counts3; - int component_counts4; - int NoexpendReagent1; - int NoexpendReagent2; - int NoexpendReagent3; - int NoexpendReagent4; - int formula1; - int formula2; - int formula3; - int formula4; - int formula5; - int formula6; - int formula7; - int formula8; - int formula9; - int formula10; - int formula11; - int formula12; - int LightType; - int goodEffect; - int Activated; - int resisttype; - int effectid1; - int effectid2; - int effectid3; - int effectid4; - int effectid5; - int effectid6; - int effectid7; - int effectid8; - int effectid9; - int effectid10; - int effectid11; - int effectid12; - int targettype; - int basediff; - int skill; - int zonetype; - int EnvironmentType; - int TimeOfDay; - int classes1; - int classes2; - int classes3; - int classes4; - int classes5; - int classes6; - int classes7; - int classes8; - int classes9; - int classes10; - int classes11; - int classes12; - int classes13; - int classes14; - int classes15; - int classes16; - int CastingAnim; - int TargetAnim; - int TravelType; - int SpellAffectIndex; - int disallow_sit; - int deities0; - int deities1; - int deities2; - int deities3; - int deities4; - int deities5; - int deities6; - int deities7; - int deities8; - int deities9; - int deities10; - int deities11; - int deities12; - int deities13; - int deities14; - int deities15; - int deities16; - int field142; - int field143; - int new_icon; - int spellanim; - int uninterruptable; - int ResistDiff; - int dot_stacking_exempt; - int deleteable; - int RecourseLink; - int no_partial_resist; - int field152; - int field153; - int short_buff_box; - int descnum; - int typedescnum; - int effectdescnum; - int effectdescnum2; - int npc_no_los; - int field160; - int reflectable; - int bonushate; - int field163; - int field164; - int ldon_trap; - int EndurCost; - int EndurTimerIndex; - int IsDiscipline; - int field169; - int field170; - int field171; - int field172; - int HateAdded; - int EndurUpkeep; - int numhitstype; - int numhits; - int pvpresistbase; - int pvpresistcalc; - int pvpresistcap; - int spell_category; - int pvp_duration; - int pvp_duration_cap; - int pcnpc_only_flag; - int cast_not_standing; - int can_mgb; - int nodispell; - int npc_category; - int npc_usefulness; - int MinResist; - int MaxResist; - int viral_targets; - int viral_timer; - int nimbuseffect; - int ConeStartAngle; - int ConeStopAngle; - int sneaking; - int not_extendable; - int field198; - int field199; - int suspendable; - int viral_range; - int songcap; - int field203; - int field204; - int no_block; - int field206; - int spellgroup; - int rank; - int field209; - int field210; - int CastRestriction; - int allowrest; - int InCombat; - int OutofCombat; - int field215; - int field216; - int field217; - int aemaxtargets; - int maxtargets; - int field220; - int field221; - int field222; - int field223; - int persistdeath; - int field225; - int field226; + int32_t range; + int32_t aoerange; + int32_t pushback; + int32_t pushup; + int32_t cast_time; + int32_t recovery_time; + int32_t recast_time; + int32_t buffdurationformula; + int32_t buffduration; + int32_t AEDuration; + int32_t mana; + int32_t effect_base_value1; + int32_t effect_base_value2; + int32_t effect_base_value3; + int32_t effect_base_value4; + int32_t effect_base_value5; + int32_t effect_base_value6; + int32_t effect_base_value7; + int32_t effect_base_value8; + int32_t effect_base_value9; + int32_t effect_base_value10; + int32_t effect_base_value11; + int32_t effect_base_value12; + int32_t effect_limit_value1; + int32_t effect_limit_value2; + int32_t effect_limit_value3; + int32_t effect_limit_value4; + int32_t effect_limit_value5; + int32_t effect_limit_value6; + int32_t effect_limit_value7; + int32_t effect_limit_value8; + int32_t effect_limit_value9; + int32_t effect_limit_value10; + int32_t effect_limit_value11; + int32_t effect_limit_value12; + int32_t max1; + int32_t max2; + int32_t max3; + int32_t max4; + int32_t max5; + int32_t max6; + int32_t max7; + int32_t max8; + int32_t max9; + int32_t max10; + int32_t max11; + int32_t max12; + int32_t icon; + int32_t memicon; + int32_t components1; + int32_t components2; + int32_t components3; + int32_t components4; + int32_t component_counts1; + int32_t component_counts2; + int32_t component_counts3; + int32_t component_counts4; + int32_t NoexpendReagent1; + int32_t NoexpendReagent2; + int32_t NoexpendReagent3; + int32_t NoexpendReagent4; + int32_t formula1; + int32_t formula2; + int32_t formula3; + int32_t formula4; + int32_t formula5; + int32_t formula6; + int32_t formula7; + int32_t formula8; + int32_t formula9; + int32_t formula10; + int32_t formula11; + int32_t formula12; + int32_t LightType; + int32_t goodEffect; + int32_t Activated; + int32_t resisttype; + int32_t effectid1; + int32_t effectid2; + int32_t effectid3; + int32_t effectid4; + int32_t effectid5; + int32_t effectid6; + int32_t effectid7; + int32_t effectid8; + int32_t effectid9; + int32_t effectid10; + int32_t effectid11; + int32_t effectid12; + int32_t targettype; + int32_t basediff; + int32_t skill; + int32_t zonetype; + int32_t EnvironmentType; + int32_t TimeOfDay; + int32_t classes1; + int32_t classes2; + int32_t classes3; + int32_t classes4; + int32_t classes5; + int32_t classes6; + int32_t classes7; + int32_t classes8; + int32_t classes9; + int32_t classes10; + int32_t classes11; + int32_t classes12; + int32_t classes13; + int32_t classes14; + int32_t classes15; + int32_t classes16; + int32_t CastingAnim; + int32_t TargetAnim; + int32_t TravelType; + int32_t SpellAffectIndex; + int32_t disallow_sit; + int32_t deities0; + int32_t deities1; + int32_t deities2; + int32_t deities3; + int32_t deities4; + int32_t deities5; + int32_t deities6; + int32_t deities7; + int32_t deities8; + int32_t deities9; + int32_t deities10; + int32_t deities11; + int32_t deities12; + int32_t deities13; + int32_t deities14; + int32_t deities15; + int32_t deities16; + int32_t field142; + int32_t field143; + int32_t new_icon; + int32_t spellanim; + int32_t uninterruptable; + int32_t ResistDiff; + int32_t dot_stacking_exempt; + int32_t deleteable; + int32_t RecourseLink; + int32_t no_partial_resist; + int32_t field152; + int32_t field153; + int32_t short_buff_box; + int32_t descnum; + int32_t typedescnum; + int32_t effectdescnum; + int32_t effectdescnum2; + int32_t npc_no_los; + int32_t field160; + int32_t reflectable; + int32_t bonushate; + int32_t field163; + int32_t field164; + int32_t ldon_trap; + int32_t EndurCost; + int32_t EndurTimerIndex; + int32_t IsDiscipline; + int32_t field169; + int32_t field170; + int32_t field171; + int32_t field172; + int32_t HateAdded; + int32_t EndurUpkeep; + int32_t numhitstype; + int32_t numhits; + int32_t pvpresistbase; + int32_t pvpresistcalc; + int32_t pvpresistcap; + int32_t spell_category; + int32_t pvp_duration; + int32_t pvp_duration_cap; + int32_t pcnpc_only_flag; + int32_t cast_not_standing; + int32_t can_mgb; + int32_t nodispell; + int32_t npc_category; + int32_t npc_usefulness; + int32_t MinResist; + int32_t MaxResist; + int32_t viral_targets; + int32_t viral_timer; + int32_t nimbuseffect; + int32_t ConeStartAngle; + int32_t ConeStopAngle; + int32_t sneaking; + int32_t not_extendable; + int32_t field198; + int32_t field199; + int32_t suspendable; + int32_t viral_range; + int32_t songcap; + int32_t field203; + int32_t field204; + int32_t no_block; + int32_t field206; + int32_t spellgroup; + int32_t rank; + int32_t field209; + int32_t field210; + int32_t CastRestriction; + int32_t allowrest; + int32_t InCombat; + int32_t OutofCombat; + int32_t field215; + int32_t field216; + int32_t field217; + int32_t aemaxtargets; + int32_t maxtargets; + int32_t field220; + int32_t field221; + int32_t field222; + int32_t field223; + int32_t persistdeath; + int32_t field225; + int32_t field226; float min_dist; float min_dist_mod; float max_dist; float max_dist_mod; - int min_range; - int field232; - int field233; - int field234; - int field235; - int field236; + int32_t min_range; + int32_t field232; + int32_t field233; + int32_t field234; + int32_t field235; + int32_t field236; }; static std::string PrimaryKey() @@ -1058,7 +1058,7 @@ public: if (results.RowCount() == 1) { SpellsNew e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.player_1 = row[2] ? row[2] : ""; e.teleport_zone = row[3] ? row[3] : ""; @@ -1067,234 +1067,234 @@ public: e.cast_on_you = row[6] ? row[6] : ""; e.cast_on_other = row[7] ? row[7] : ""; e.spell_fades = row[8] ? row[8] : ""; - e.range = atoi(row[9]); - e.aoerange = atoi(row[10]); - e.pushback = atoi(row[11]); - e.pushup = atoi(row[12]); - e.cast_time = atoi(row[13]); - e.recovery_time = atoi(row[14]); - e.recast_time = atoi(row[15]); - e.buffdurationformula = atoi(row[16]); - e.buffduration = atoi(row[17]); - e.AEDuration = atoi(row[18]); - e.mana = atoi(row[19]); - e.effect_base_value1 = atoi(row[20]); - e.effect_base_value2 = atoi(row[21]); - e.effect_base_value3 = atoi(row[22]); - e.effect_base_value4 = atoi(row[23]); - e.effect_base_value5 = atoi(row[24]); - e.effect_base_value6 = atoi(row[25]); - e.effect_base_value7 = atoi(row[26]); - e.effect_base_value8 = atoi(row[27]); - e.effect_base_value9 = atoi(row[28]); - e.effect_base_value10 = atoi(row[29]); - e.effect_base_value11 = atoi(row[30]); - e.effect_base_value12 = atoi(row[31]); - e.effect_limit_value1 = atoi(row[32]); - e.effect_limit_value2 = atoi(row[33]); - e.effect_limit_value3 = atoi(row[34]); - e.effect_limit_value4 = atoi(row[35]); - e.effect_limit_value5 = atoi(row[36]); - e.effect_limit_value6 = atoi(row[37]); - e.effect_limit_value7 = atoi(row[38]); - e.effect_limit_value8 = atoi(row[39]); - e.effect_limit_value9 = atoi(row[40]); - e.effect_limit_value10 = atoi(row[41]); - e.effect_limit_value11 = atoi(row[42]); - e.effect_limit_value12 = atoi(row[43]); - e.max1 = atoi(row[44]); - e.max2 = atoi(row[45]); - e.max3 = atoi(row[46]); - e.max4 = atoi(row[47]); - e.max5 = atoi(row[48]); - e.max6 = atoi(row[49]); - e.max7 = atoi(row[50]); - e.max8 = atoi(row[51]); - e.max9 = atoi(row[52]); - e.max10 = atoi(row[53]); - e.max11 = atoi(row[54]); - e.max12 = atoi(row[55]); - e.icon = atoi(row[56]); - e.memicon = atoi(row[57]); - e.components1 = atoi(row[58]); - e.components2 = atoi(row[59]); - e.components3 = atoi(row[60]); - e.components4 = atoi(row[61]); - e.component_counts1 = atoi(row[62]); - e.component_counts2 = atoi(row[63]); - e.component_counts3 = atoi(row[64]); - e.component_counts4 = atoi(row[65]); - e.NoexpendReagent1 = atoi(row[66]); - e.NoexpendReagent2 = atoi(row[67]); - e.NoexpendReagent3 = atoi(row[68]); - e.NoexpendReagent4 = atoi(row[69]); - e.formula1 = atoi(row[70]); - e.formula2 = atoi(row[71]); - e.formula3 = atoi(row[72]); - e.formula4 = atoi(row[73]); - e.formula5 = atoi(row[74]); - e.formula6 = atoi(row[75]); - e.formula7 = atoi(row[76]); - e.formula8 = atoi(row[77]); - e.formula9 = atoi(row[78]); - e.formula10 = atoi(row[79]); - e.formula11 = atoi(row[80]); - e.formula12 = atoi(row[81]); - e.LightType = atoi(row[82]); - e.goodEffect = atoi(row[83]); - e.Activated = atoi(row[84]); - e.resisttype = atoi(row[85]); - e.effectid1 = atoi(row[86]); - e.effectid2 = atoi(row[87]); - e.effectid3 = atoi(row[88]); - e.effectid4 = atoi(row[89]); - e.effectid5 = atoi(row[90]); - e.effectid6 = atoi(row[91]); - e.effectid7 = atoi(row[92]); - e.effectid8 = atoi(row[93]); - e.effectid9 = atoi(row[94]); - e.effectid10 = atoi(row[95]); - e.effectid11 = atoi(row[96]); - e.effectid12 = atoi(row[97]); - e.targettype = atoi(row[98]); - e.basediff = atoi(row[99]); - e.skill = atoi(row[100]); - e.zonetype = atoi(row[101]); - e.EnvironmentType = atoi(row[102]); - e.TimeOfDay = atoi(row[103]); - e.classes1 = atoi(row[104]); - e.classes2 = atoi(row[105]); - e.classes3 = atoi(row[106]); - e.classes4 = atoi(row[107]); - e.classes5 = atoi(row[108]); - e.classes6 = atoi(row[109]); - e.classes7 = atoi(row[110]); - e.classes8 = atoi(row[111]); - e.classes9 = atoi(row[112]); - e.classes10 = atoi(row[113]); - e.classes11 = atoi(row[114]); - e.classes12 = atoi(row[115]); - e.classes13 = atoi(row[116]); - e.classes14 = atoi(row[117]); - e.classes15 = atoi(row[118]); - e.classes16 = atoi(row[119]); - e.CastingAnim = atoi(row[120]); - e.TargetAnim = atoi(row[121]); - e.TravelType = atoi(row[122]); - e.SpellAffectIndex = atoi(row[123]); - e.disallow_sit = atoi(row[124]); - e.deities0 = atoi(row[125]); - e.deities1 = atoi(row[126]); - e.deities2 = atoi(row[127]); - e.deities3 = atoi(row[128]); - e.deities4 = atoi(row[129]); - e.deities5 = atoi(row[130]); - e.deities6 = atoi(row[131]); - e.deities7 = atoi(row[132]); - e.deities8 = atoi(row[133]); - e.deities9 = atoi(row[134]); - e.deities10 = atoi(row[135]); - e.deities11 = atoi(row[136]); - e.deities12 = atoi(row[137]); - e.deities13 = atoi(row[138]); - e.deities14 = atoi(row[139]); - e.deities15 = atoi(row[140]); - e.deities16 = atoi(row[141]); - e.field142 = atoi(row[142]); - e.field143 = atoi(row[143]); - e.new_icon = atoi(row[144]); - e.spellanim = atoi(row[145]); - e.uninterruptable = atoi(row[146]); - e.ResistDiff = atoi(row[147]); - e.dot_stacking_exempt = atoi(row[148]); - e.deleteable = atoi(row[149]); - e.RecourseLink = atoi(row[150]); - e.no_partial_resist = atoi(row[151]); - e.field152 = atoi(row[152]); - e.field153 = atoi(row[153]); - e.short_buff_box = atoi(row[154]); - e.descnum = atoi(row[155]); - e.typedescnum = atoi(row[156]); - e.effectdescnum = atoi(row[157]); - e.effectdescnum2 = atoi(row[158]); - e.npc_no_los = atoi(row[159]); - e.field160 = atoi(row[160]); - e.reflectable = atoi(row[161]); - e.bonushate = atoi(row[162]); - e.field163 = atoi(row[163]); - e.field164 = atoi(row[164]); - e.ldon_trap = atoi(row[165]); - e.EndurCost = atoi(row[166]); - e.EndurTimerIndex = atoi(row[167]); - e.IsDiscipline = atoi(row[168]); - e.field169 = atoi(row[169]); - e.field170 = atoi(row[170]); - e.field171 = atoi(row[171]); - e.field172 = atoi(row[172]); - e.HateAdded = atoi(row[173]); - e.EndurUpkeep = atoi(row[174]); - e.numhitstype = atoi(row[175]); - e.numhits = atoi(row[176]); - e.pvpresistbase = atoi(row[177]); - e.pvpresistcalc = atoi(row[178]); - e.pvpresistcap = atoi(row[179]); - e.spell_category = atoi(row[180]); - e.pvp_duration = atoi(row[181]); - e.pvp_duration_cap = atoi(row[182]); - e.pcnpc_only_flag = atoi(row[183]); - e.cast_not_standing = atoi(row[184]); - e.can_mgb = atoi(row[185]); - e.nodispell = atoi(row[186]); - e.npc_category = atoi(row[187]); - e.npc_usefulness = atoi(row[188]); - e.MinResist = atoi(row[189]); - e.MaxResist = atoi(row[190]); - e.viral_targets = atoi(row[191]); - e.viral_timer = atoi(row[192]); - e.nimbuseffect = atoi(row[193]); - e.ConeStartAngle = atoi(row[194]); - e.ConeStopAngle = atoi(row[195]); - e.sneaking = atoi(row[196]); - e.not_extendable = atoi(row[197]); - e.field198 = atoi(row[198]); - e.field199 = atoi(row[199]); - e.suspendable = atoi(row[200]); - e.viral_range = atoi(row[201]); - e.songcap = atoi(row[202]); - e.field203 = atoi(row[203]); - e.field204 = atoi(row[204]); - e.no_block = atoi(row[205]); - e.field206 = atoi(row[206]); - e.spellgroup = atoi(row[207]); - e.rank = atoi(row[208]); - e.field209 = atoi(row[209]); - e.field210 = atoi(row[210]); - e.CastRestriction = atoi(row[211]); - e.allowrest = atoi(row[212]); - e.InCombat = atoi(row[213]); - e.OutofCombat = atoi(row[214]); - e.field215 = atoi(row[215]); - e.field216 = atoi(row[216]); - e.field217 = atoi(row[217]); - e.aemaxtargets = atoi(row[218]); - e.maxtargets = atoi(row[219]); - e.field220 = atoi(row[220]); - e.field221 = atoi(row[221]); - e.field222 = atoi(row[222]); - e.field223 = atoi(row[223]); - e.persistdeath = atoi(row[224]); - e.field225 = atoi(row[225]); - e.field226 = atoi(row[226]); - e.min_dist = static_cast(atof(row[227])); - e.min_dist_mod = static_cast(atof(row[228])); - e.max_dist = static_cast(atof(row[229])); - e.max_dist_mod = static_cast(atof(row[230])); - e.min_range = atoi(row[231]); - e.field232 = atoi(row[232]); - e.field233 = atoi(row[233]); - e.field234 = atoi(row[234]); - e.field235 = atoi(row[235]); - e.field236 = atoi(row[236]); + e.range = static_cast(atoi(row[9])); + e.aoerange = static_cast(atoi(row[10])); + e.pushback = static_cast(atoi(row[11])); + e.pushup = static_cast(atoi(row[12])); + e.cast_time = static_cast(atoi(row[13])); + e.recovery_time = static_cast(atoi(row[14])); + e.recast_time = static_cast(atoi(row[15])); + e.buffdurationformula = static_cast(atoi(row[16])); + e.buffduration = static_cast(atoi(row[17])); + e.AEDuration = static_cast(atoi(row[18])); + e.mana = static_cast(atoi(row[19])); + e.effect_base_value1 = static_cast(atoi(row[20])); + e.effect_base_value2 = static_cast(atoi(row[21])); + e.effect_base_value3 = static_cast(atoi(row[22])); + e.effect_base_value4 = static_cast(atoi(row[23])); + e.effect_base_value5 = static_cast(atoi(row[24])); + e.effect_base_value6 = static_cast(atoi(row[25])); + e.effect_base_value7 = static_cast(atoi(row[26])); + e.effect_base_value8 = static_cast(atoi(row[27])); + e.effect_base_value9 = static_cast(atoi(row[28])); + e.effect_base_value10 = static_cast(atoi(row[29])); + e.effect_base_value11 = static_cast(atoi(row[30])); + e.effect_base_value12 = static_cast(atoi(row[31])); + e.effect_limit_value1 = static_cast(atoi(row[32])); + e.effect_limit_value2 = static_cast(atoi(row[33])); + e.effect_limit_value3 = static_cast(atoi(row[34])); + e.effect_limit_value4 = static_cast(atoi(row[35])); + e.effect_limit_value5 = static_cast(atoi(row[36])); + e.effect_limit_value6 = static_cast(atoi(row[37])); + e.effect_limit_value7 = static_cast(atoi(row[38])); + e.effect_limit_value8 = static_cast(atoi(row[39])); + e.effect_limit_value9 = static_cast(atoi(row[40])); + e.effect_limit_value10 = static_cast(atoi(row[41])); + e.effect_limit_value11 = static_cast(atoi(row[42])); + e.effect_limit_value12 = static_cast(atoi(row[43])); + e.max1 = static_cast(atoi(row[44])); + e.max2 = static_cast(atoi(row[45])); + e.max3 = static_cast(atoi(row[46])); + e.max4 = static_cast(atoi(row[47])); + e.max5 = static_cast(atoi(row[48])); + e.max6 = static_cast(atoi(row[49])); + e.max7 = static_cast(atoi(row[50])); + e.max8 = static_cast(atoi(row[51])); + e.max9 = static_cast(atoi(row[52])); + e.max10 = static_cast(atoi(row[53])); + e.max11 = static_cast(atoi(row[54])); + e.max12 = static_cast(atoi(row[55])); + e.icon = static_cast(atoi(row[56])); + e.memicon = static_cast(atoi(row[57])); + e.components1 = static_cast(atoi(row[58])); + e.components2 = static_cast(atoi(row[59])); + e.components3 = static_cast(atoi(row[60])); + e.components4 = static_cast(atoi(row[61])); + e.component_counts1 = static_cast(atoi(row[62])); + e.component_counts2 = static_cast(atoi(row[63])); + e.component_counts3 = static_cast(atoi(row[64])); + e.component_counts4 = static_cast(atoi(row[65])); + e.NoexpendReagent1 = static_cast(atoi(row[66])); + e.NoexpendReagent2 = static_cast(atoi(row[67])); + e.NoexpendReagent3 = static_cast(atoi(row[68])); + e.NoexpendReagent4 = static_cast(atoi(row[69])); + e.formula1 = static_cast(atoi(row[70])); + e.formula2 = static_cast(atoi(row[71])); + e.formula3 = static_cast(atoi(row[72])); + e.formula4 = static_cast(atoi(row[73])); + e.formula5 = static_cast(atoi(row[74])); + e.formula6 = static_cast(atoi(row[75])); + e.formula7 = static_cast(atoi(row[76])); + e.formula8 = static_cast(atoi(row[77])); + e.formula9 = static_cast(atoi(row[78])); + e.formula10 = static_cast(atoi(row[79])); + e.formula11 = static_cast(atoi(row[80])); + e.formula12 = static_cast(atoi(row[81])); + e.LightType = static_cast(atoi(row[82])); + e.goodEffect = static_cast(atoi(row[83])); + e.Activated = static_cast(atoi(row[84])); + e.resisttype = static_cast(atoi(row[85])); + e.effectid1 = static_cast(atoi(row[86])); + e.effectid2 = static_cast(atoi(row[87])); + e.effectid3 = static_cast(atoi(row[88])); + e.effectid4 = static_cast(atoi(row[89])); + e.effectid5 = static_cast(atoi(row[90])); + e.effectid6 = static_cast(atoi(row[91])); + e.effectid7 = static_cast(atoi(row[92])); + e.effectid8 = static_cast(atoi(row[93])); + e.effectid9 = static_cast(atoi(row[94])); + e.effectid10 = static_cast(atoi(row[95])); + e.effectid11 = static_cast(atoi(row[96])); + e.effectid12 = static_cast(atoi(row[97])); + e.targettype = static_cast(atoi(row[98])); + e.basediff = static_cast(atoi(row[99])); + e.skill = static_cast(atoi(row[100])); + e.zonetype = static_cast(atoi(row[101])); + e.EnvironmentType = static_cast(atoi(row[102])); + e.TimeOfDay = static_cast(atoi(row[103])); + e.classes1 = static_cast(atoi(row[104])); + e.classes2 = static_cast(atoi(row[105])); + e.classes3 = static_cast(atoi(row[106])); + e.classes4 = static_cast(atoi(row[107])); + e.classes5 = static_cast(atoi(row[108])); + e.classes6 = static_cast(atoi(row[109])); + e.classes7 = static_cast(atoi(row[110])); + e.classes8 = static_cast(atoi(row[111])); + e.classes9 = static_cast(atoi(row[112])); + e.classes10 = static_cast(atoi(row[113])); + e.classes11 = static_cast(atoi(row[114])); + e.classes12 = static_cast(atoi(row[115])); + e.classes13 = static_cast(atoi(row[116])); + e.classes14 = static_cast(atoi(row[117])); + e.classes15 = static_cast(atoi(row[118])); + e.classes16 = static_cast(atoi(row[119])); + e.CastingAnim = static_cast(atoi(row[120])); + e.TargetAnim = static_cast(atoi(row[121])); + e.TravelType = static_cast(atoi(row[122])); + e.SpellAffectIndex = static_cast(atoi(row[123])); + e.disallow_sit = static_cast(atoi(row[124])); + e.deities0 = static_cast(atoi(row[125])); + e.deities1 = static_cast(atoi(row[126])); + e.deities2 = static_cast(atoi(row[127])); + e.deities3 = static_cast(atoi(row[128])); + e.deities4 = static_cast(atoi(row[129])); + e.deities5 = static_cast(atoi(row[130])); + e.deities6 = static_cast(atoi(row[131])); + e.deities7 = static_cast(atoi(row[132])); + e.deities8 = static_cast(atoi(row[133])); + e.deities9 = static_cast(atoi(row[134])); + e.deities10 = static_cast(atoi(row[135])); + e.deities11 = static_cast(atoi(row[136])); + e.deities12 = static_cast(atoi(row[137])); + e.deities13 = static_cast(atoi(row[138])); + e.deities14 = static_cast(atoi(row[139])); + e.deities15 = static_cast(atoi(row[140])); + e.deities16 = static_cast(atoi(row[141])); + e.field142 = static_cast(atoi(row[142])); + e.field143 = static_cast(atoi(row[143])); + e.new_icon = static_cast(atoi(row[144])); + e.spellanim = static_cast(atoi(row[145])); + e.uninterruptable = static_cast(atoi(row[146])); + e.ResistDiff = static_cast(atoi(row[147])); + e.dot_stacking_exempt = static_cast(atoi(row[148])); + e.deleteable = static_cast(atoi(row[149])); + e.RecourseLink = static_cast(atoi(row[150])); + e.no_partial_resist = static_cast(atoi(row[151])); + e.field152 = static_cast(atoi(row[152])); + e.field153 = static_cast(atoi(row[153])); + e.short_buff_box = static_cast(atoi(row[154])); + e.descnum = static_cast(atoi(row[155])); + e.typedescnum = static_cast(atoi(row[156])); + e.effectdescnum = static_cast(atoi(row[157])); + e.effectdescnum2 = static_cast(atoi(row[158])); + e.npc_no_los = static_cast(atoi(row[159])); + e.field160 = static_cast(atoi(row[160])); + e.reflectable = static_cast(atoi(row[161])); + e.bonushate = static_cast(atoi(row[162])); + e.field163 = static_cast(atoi(row[163])); + e.field164 = static_cast(atoi(row[164])); + e.ldon_trap = static_cast(atoi(row[165])); + e.EndurCost = static_cast(atoi(row[166])); + e.EndurTimerIndex = static_cast(atoi(row[167])); + e.IsDiscipline = static_cast(atoi(row[168])); + e.field169 = static_cast(atoi(row[169])); + e.field170 = static_cast(atoi(row[170])); + e.field171 = static_cast(atoi(row[171])); + e.field172 = static_cast(atoi(row[172])); + e.HateAdded = static_cast(atoi(row[173])); + e.EndurUpkeep = static_cast(atoi(row[174])); + e.numhitstype = static_cast(atoi(row[175])); + e.numhits = static_cast(atoi(row[176])); + e.pvpresistbase = static_cast(atoi(row[177])); + e.pvpresistcalc = static_cast(atoi(row[178])); + e.pvpresistcap = static_cast(atoi(row[179])); + e.spell_category = static_cast(atoi(row[180])); + e.pvp_duration = static_cast(atoi(row[181])); + e.pvp_duration_cap = static_cast(atoi(row[182])); + e.pcnpc_only_flag = static_cast(atoi(row[183])); + e.cast_not_standing = static_cast(atoi(row[184])); + e.can_mgb = static_cast(atoi(row[185])); + e.nodispell = static_cast(atoi(row[186])); + e.npc_category = static_cast(atoi(row[187])); + e.npc_usefulness = static_cast(atoi(row[188])); + e.MinResist = static_cast(atoi(row[189])); + e.MaxResist = static_cast(atoi(row[190])); + e.viral_targets = static_cast(atoi(row[191])); + e.viral_timer = static_cast(atoi(row[192])); + e.nimbuseffect = static_cast(atoi(row[193])); + e.ConeStartAngle = static_cast(atoi(row[194])); + e.ConeStopAngle = static_cast(atoi(row[195])); + e.sneaking = static_cast(atoi(row[196])); + e.not_extendable = static_cast(atoi(row[197])); + e.field198 = static_cast(atoi(row[198])); + e.field199 = static_cast(atoi(row[199])); + e.suspendable = static_cast(atoi(row[200])); + e.viral_range = static_cast(atoi(row[201])); + e.songcap = static_cast(atoi(row[202])); + e.field203 = static_cast(atoi(row[203])); + e.field204 = static_cast(atoi(row[204])); + e.no_block = static_cast(atoi(row[205])); + e.field206 = static_cast(atoi(row[206])); + e.spellgroup = static_cast(atoi(row[207])); + e.rank = static_cast(atoi(row[208])); + e.field209 = static_cast(atoi(row[209])); + e.field210 = static_cast(atoi(row[210])); + e.CastRestriction = static_cast(atoi(row[211])); + e.allowrest = static_cast(atoi(row[212])); + e.InCombat = static_cast(atoi(row[213])); + e.OutofCombat = static_cast(atoi(row[214])); + e.field215 = static_cast(atoi(row[215])); + e.field216 = static_cast(atoi(row[216])); + e.field217 = static_cast(atoi(row[217])); + e.aemaxtargets = static_cast(atoi(row[218])); + e.maxtargets = static_cast(atoi(row[219])); + e.field220 = static_cast(atoi(row[220])); + e.field221 = static_cast(atoi(row[221])); + e.field222 = static_cast(atoi(row[222])); + e.field223 = static_cast(atoi(row[223])); + e.persistdeath = static_cast(atoi(row[224])); + e.field225 = static_cast(atoi(row[225])); + e.field226 = static_cast(atoi(row[226])); + e.min_dist = strtof(row[227], nullptr); + e.min_dist_mod = strtof(row[228], nullptr); + e.max_dist = strtof(row[229], nullptr); + e.max_dist_mod = strtof(row[230], nullptr); + e.min_range = static_cast(atoi(row[231])); + e.field232 = static_cast(atoi(row[232])); + e.field233 = static_cast(atoi(row[233])); + e.field234 = static_cast(atoi(row[234])); + e.field235 = static_cast(atoi(row[235])); + e.field236 = static_cast(atoi(row[236])); return e; } @@ -2122,7 +2122,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellsNew e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.player_1 = row[2] ? row[2] : ""; e.teleport_zone = row[3] ? row[3] : ""; @@ -2131,234 +2131,234 @@ public: e.cast_on_you = row[6] ? row[6] : ""; e.cast_on_other = row[7] ? row[7] : ""; e.spell_fades = row[8] ? row[8] : ""; - e.range = atoi(row[9]); - e.aoerange = atoi(row[10]); - e.pushback = atoi(row[11]); - e.pushup = atoi(row[12]); - e.cast_time = atoi(row[13]); - e.recovery_time = atoi(row[14]); - e.recast_time = atoi(row[15]); - e.buffdurationformula = atoi(row[16]); - e.buffduration = atoi(row[17]); - e.AEDuration = atoi(row[18]); - e.mana = atoi(row[19]); - e.effect_base_value1 = atoi(row[20]); - e.effect_base_value2 = atoi(row[21]); - e.effect_base_value3 = atoi(row[22]); - e.effect_base_value4 = atoi(row[23]); - e.effect_base_value5 = atoi(row[24]); - e.effect_base_value6 = atoi(row[25]); - e.effect_base_value7 = atoi(row[26]); - e.effect_base_value8 = atoi(row[27]); - e.effect_base_value9 = atoi(row[28]); - e.effect_base_value10 = atoi(row[29]); - e.effect_base_value11 = atoi(row[30]); - e.effect_base_value12 = atoi(row[31]); - e.effect_limit_value1 = atoi(row[32]); - e.effect_limit_value2 = atoi(row[33]); - e.effect_limit_value3 = atoi(row[34]); - e.effect_limit_value4 = atoi(row[35]); - e.effect_limit_value5 = atoi(row[36]); - e.effect_limit_value6 = atoi(row[37]); - e.effect_limit_value7 = atoi(row[38]); - e.effect_limit_value8 = atoi(row[39]); - e.effect_limit_value9 = atoi(row[40]); - e.effect_limit_value10 = atoi(row[41]); - e.effect_limit_value11 = atoi(row[42]); - e.effect_limit_value12 = atoi(row[43]); - e.max1 = atoi(row[44]); - e.max2 = atoi(row[45]); - e.max3 = atoi(row[46]); - e.max4 = atoi(row[47]); - e.max5 = atoi(row[48]); - e.max6 = atoi(row[49]); - e.max7 = atoi(row[50]); - e.max8 = atoi(row[51]); - e.max9 = atoi(row[52]); - e.max10 = atoi(row[53]); - e.max11 = atoi(row[54]); - e.max12 = atoi(row[55]); - e.icon = atoi(row[56]); - e.memicon = atoi(row[57]); - e.components1 = atoi(row[58]); - e.components2 = atoi(row[59]); - e.components3 = atoi(row[60]); - e.components4 = atoi(row[61]); - e.component_counts1 = atoi(row[62]); - e.component_counts2 = atoi(row[63]); - e.component_counts3 = atoi(row[64]); - e.component_counts4 = atoi(row[65]); - e.NoexpendReagent1 = atoi(row[66]); - e.NoexpendReagent2 = atoi(row[67]); - e.NoexpendReagent3 = atoi(row[68]); - e.NoexpendReagent4 = atoi(row[69]); - e.formula1 = atoi(row[70]); - e.formula2 = atoi(row[71]); - e.formula3 = atoi(row[72]); - e.formula4 = atoi(row[73]); - e.formula5 = atoi(row[74]); - e.formula6 = atoi(row[75]); - e.formula7 = atoi(row[76]); - e.formula8 = atoi(row[77]); - e.formula9 = atoi(row[78]); - e.formula10 = atoi(row[79]); - e.formula11 = atoi(row[80]); - e.formula12 = atoi(row[81]); - e.LightType = atoi(row[82]); - e.goodEffect = atoi(row[83]); - e.Activated = atoi(row[84]); - e.resisttype = atoi(row[85]); - e.effectid1 = atoi(row[86]); - e.effectid2 = atoi(row[87]); - e.effectid3 = atoi(row[88]); - e.effectid4 = atoi(row[89]); - e.effectid5 = atoi(row[90]); - e.effectid6 = atoi(row[91]); - e.effectid7 = atoi(row[92]); - e.effectid8 = atoi(row[93]); - e.effectid9 = atoi(row[94]); - e.effectid10 = atoi(row[95]); - e.effectid11 = atoi(row[96]); - e.effectid12 = atoi(row[97]); - e.targettype = atoi(row[98]); - e.basediff = atoi(row[99]); - e.skill = atoi(row[100]); - e.zonetype = atoi(row[101]); - e.EnvironmentType = atoi(row[102]); - e.TimeOfDay = atoi(row[103]); - e.classes1 = atoi(row[104]); - e.classes2 = atoi(row[105]); - e.classes3 = atoi(row[106]); - e.classes4 = atoi(row[107]); - e.classes5 = atoi(row[108]); - e.classes6 = atoi(row[109]); - e.classes7 = atoi(row[110]); - e.classes8 = atoi(row[111]); - e.classes9 = atoi(row[112]); - e.classes10 = atoi(row[113]); - e.classes11 = atoi(row[114]); - e.classes12 = atoi(row[115]); - e.classes13 = atoi(row[116]); - e.classes14 = atoi(row[117]); - e.classes15 = atoi(row[118]); - e.classes16 = atoi(row[119]); - e.CastingAnim = atoi(row[120]); - e.TargetAnim = atoi(row[121]); - e.TravelType = atoi(row[122]); - e.SpellAffectIndex = atoi(row[123]); - e.disallow_sit = atoi(row[124]); - e.deities0 = atoi(row[125]); - e.deities1 = atoi(row[126]); - e.deities2 = atoi(row[127]); - e.deities3 = atoi(row[128]); - e.deities4 = atoi(row[129]); - e.deities5 = atoi(row[130]); - e.deities6 = atoi(row[131]); - e.deities7 = atoi(row[132]); - e.deities8 = atoi(row[133]); - e.deities9 = atoi(row[134]); - e.deities10 = atoi(row[135]); - e.deities11 = atoi(row[136]); - e.deities12 = atoi(row[137]); - e.deities13 = atoi(row[138]); - e.deities14 = atoi(row[139]); - e.deities15 = atoi(row[140]); - e.deities16 = atoi(row[141]); - e.field142 = atoi(row[142]); - e.field143 = atoi(row[143]); - e.new_icon = atoi(row[144]); - e.spellanim = atoi(row[145]); - e.uninterruptable = atoi(row[146]); - e.ResistDiff = atoi(row[147]); - e.dot_stacking_exempt = atoi(row[148]); - e.deleteable = atoi(row[149]); - e.RecourseLink = atoi(row[150]); - e.no_partial_resist = atoi(row[151]); - e.field152 = atoi(row[152]); - e.field153 = atoi(row[153]); - e.short_buff_box = atoi(row[154]); - e.descnum = atoi(row[155]); - e.typedescnum = atoi(row[156]); - e.effectdescnum = atoi(row[157]); - e.effectdescnum2 = atoi(row[158]); - e.npc_no_los = atoi(row[159]); - e.field160 = atoi(row[160]); - e.reflectable = atoi(row[161]); - e.bonushate = atoi(row[162]); - e.field163 = atoi(row[163]); - e.field164 = atoi(row[164]); - e.ldon_trap = atoi(row[165]); - e.EndurCost = atoi(row[166]); - e.EndurTimerIndex = atoi(row[167]); - e.IsDiscipline = atoi(row[168]); - e.field169 = atoi(row[169]); - e.field170 = atoi(row[170]); - e.field171 = atoi(row[171]); - e.field172 = atoi(row[172]); - e.HateAdded = atoi(row[173]); - e.EndurUpkeep = atoi(row[174]); - e.numhitstype = atoi(row[175]); - e.numhits = atoi(row[176]); - e.pvpresistbase = atoi(row[177]); - e.pvpresistcalc = atoi(row[178]); - e.pvpresistcap = atoi(row[179]); - e.spell_category = atoi(row[180]); - e.pvp_duration = atoi(row[181]); - e.pvp_duration_cap = atoi(row[182]); - e.pcnpc_only_flag = atoi(row[183]); - e.cast_not_standing = atoi(row[184]); - e.can_mgb = atoi(row[185]); - e.nodispell = atoi(row[186]); - e.npc_category = atoi(row[187]); - e.npc_usefulness = atoi(row[188]); - e.MinResist = atoi(row[189]); - e.MaxResist = atoi(row[190]); - e.viral_targets = atoi(row[191]); - e.viral_timer = atoi(row[192]); - e.nimbuseffect = atoi(row[193]); - e.ConeStartAngle = atoi(row[194]); - e.ConeStopAngle = atoi(row[195]); - e.sneaking = atoi(row[196]); - e.not_extendable = atoi(row[197]); - e.field198 = atoi(row[198]); - e.field199 = atoi(row[199]); - e.suspendable = atoi(row[200]); - e.viral_range = atoi(row[201]); - e.songcap = atoi(row[202]); - e.field203 = atoi(row[203]); - e.field204 = atoi(row[204]); - e.no_block = atoi(row[205]); - e.field206 = atoi(row[206]); - e.spellgroup = atoi(row[207]); - e.rank = atoi(row[208]); - e.field209 = atoi(row[209]); - e.field210 = atoi(row[210]); - e.CastRestriction = atoi(row[211]); - e.allowrest = atoi(row[212]); - e.InCombat = atoi(row[213]); - e.OutofCombat = atoi(row[214]); - e.field215 = atoi(row[215]); - e.field216 = atoi(row[216]); - e.field217 = atoi(row[217]); - e.aemaxtargets = atoi(row[218]); - e.maxtargets = atoi(row[219]); - e.field220 = atoi(row[220]); - e.field221 = atoi(row[221]); - e.field222 = atoi(row[222]); - e.field223 = atoi(row[223]); - e.persistdeath = atoi(row[224]); - e.field225 = atoi(row[225]); - e.field226 = atoi(row[226]); - e.min_dist = static_cast(atof(row[227])); - e.min_dist_mod = static_cast(atof(row[228])); - e.max_dist = static_cast(atof(row[229])); - e.max_dist_mod = static_cast(atof(row[230])); - e.min_range = atoi(row[231]); - e.field232 = atoi(row[232]); - e.field233 = atoi(row[233]); - e.field234 = atoi(row[234]); - e.field235 = atoi(row[235]); - e.field236 = atoi(row[236]); + e.range = static_cast(atoi(row[9])); + e.aoerange = static_cast(atoi(row[10])); + e.pushback = static_cast(atoi(row[11])); + e.pushup = static_cast(atoi(row[12])); + e.cast_time = static_cast(atoi(row[13])); + e.recovery_time = static_cast(atoi(row[14])); + e.recast_time = static_cast(atoi(row[15])); + e.buffdurationformula = static_cast(atoi(row[16])); + e.buffduration = static_cast(atoi(row[17])); + e.AEDuration = static_cast(atoi(row[18])); + e.mana = static_cast(atoi(row[19])); + e.effect_base_value1 = static_cast(atoi(row[20])); + e.effect_base_value2 = static_cast(atoi(row[21])); + e.effect_base_value3 = static_cast(atoi(row[22])); + e.effect_base_value4 = static_cast(atoi(row[23])); + e.effect_base_value5 = static_cast(atoi(row[24])); + e.effect_base_value6 = static_cast(atoi(row[25])); + e.effect_base_value7 = static_cast(atoi(row[26])); + e.effect_base_value8 = static_cast(atoi(row[27])); + e.effect_base_value9 = static_cast(atoi(row[28])); + e.effect_base_value10 = static_cast(atoi(row[29])); + e.effect_base_value11 = static_cast(atoi(row[30])); + e.effect_base_value12 = static_cast(atoi(row[31])); + e.effect_limit_value1 = static_cast(atoi(row[32])); + e.effect_limit_value2 = static_cast(atoi(row[33])); + e.effect_limit_value3 = static_cast(atoi(row[34])); + e.effect_limit_value4 = static_cast(atoi(row[35])); + e.effect_limit_value5 = static_cast(atoi(row[36])); + e.effect_limit_value6 = static_cast(atoi(row[37])); + e.effect_limit_value7 = static_cast(atoi(row[38])); + e.effect_limit_value8 = static_cast(atoi(row[39])); + e.effect_limit_value9 = static_cast(atoi(row[40])); + e.effect_limit_value10 = static_cast(atoi(row[41])); + e.effect_limit_value11 = static_cast(atoi(row[42])); + e.effect_limit_value12 = static_cast(atoi(row[43])); + e.max1 = static_cast(atoi(row[44])); + e.max2 = static_cast(atoi(row[45])); + e.max3 = static_cast(atoi(row[46])); + e.max4 = static_cast(atoi(row[47])); + e.max5 = static_cast(atoi(row[48])); + e.max6 = static_cast(atoi(row[49])); + e.max7 = static_cast(atoi(row[50])); + e.max8 = static_cast(atoi(row[51])); + e.max9 = static_cast(atoi(row[52])); + e.max10 = static_cast(atoi(row[53])); + e.max11 = static_cast(atoi(row[54])); + e.max12 = static_cast(atoi(row[55])); + e.icon = static_cast(atoi(row[56])); + e.memicon = static_cast(atoi(row[57])); + e.components1 = static_cast(atoi(row[58])); + e.components2 = static_cast(atoi(row[59])); + e.components3 = static_cast(atoi(row[60])); + e.components4 = static_cast(atoi(row[61])); + e.component_counts1 = static_cast(atoi(row[62])); + e.component_counts2 = static_cast(atoi(row[63])); + e.component_counts3 = static_cast(atoi(row[64])); + e.component_counts4 = static_cast(atoi(row[65])); + e.NoexpendReagent1 = static_cast(atoi(row[66])); + e.NoexpendReagent2 = static_cast(atoi(row[67])); + e.NoexpendReagent3 = static_cast(atoi(row[68])); + e.NoexpendReagent4 = static_cast(atoi(row[69])); + e.formula1 = static_cast(atoi(row[70])); + e.formula2 = static_cast(atoi(row[71])); + e.formula3 = static_cast(atoi(row[72])); + e.formula4 = static_cast(atoi(row[73])); + e.formula5 = static_cast(atoi(row[74])); + e.formula6 = static_cast(atoi(row[75])); + e.formula7 = static_cast(atoi(row[76])); + e.formula8 = static_cast(atoi(row[77])); + e.formula9 = static_cast(atoi(row[78])); + e.formula10 = static_cast(atoi(row[79])); + e.formula11 = static_cast(atoi(row[80])); + e.formula12 = static_cast(atoi(row[81])); + e.LightType = static_cast(atoi(row[82])); + e.goodEffect = static_cast(atoi(row[83])); + e.Activated = static_cast(atoi(row[84])); + e.resisttype = static_cast(atoi(row[85])); + e.effectid1 = static_cast(atoi(row[86])); + e.effectid2 = static_cast(atoi(row[87])); + e.effectid3 = static_cast(atoi(row[88])); + e.effectid4 = static_cast(atoi(row[89])); + e.effectid5 = static_cast(atoi(row[90])); + e.effectid6 = static_cast(atoi(row[91])); + e.effectid7 = static_cast(atoi(row[92])); + e.effectid8 = static_cast(atoi(row[93])); + e.effectid9 = static_cast(atoi(row[94])); + e.effectid10 = static_cast(atoi(row[95])); + e.effectid11 = static_cast(atoi(row[96])); + e.effectid12 = static_cast(atoi(row[97])); + e.targettype = static_cast(atoi(row[98])); + e.basediff = static_cast(atoi(row[99])); + e.skill = static_cast(atoi(row[100])); + e.zonetype = static_cast(atoi(row[101])); + e.EnvironmentType = static_cast(atoi(row[102])); + e.TimeOfDay = static_cast(atoi(row[103])); + e.classes1 = static_cast(atoi(row[104])); + e.classes2 = static_cast(atoi(row[105])); + e.classes3 = static_cast(atoi(row[106])); + e.classes4 = static_cast(atoi(row[107])); + e.classes5 = static_cast(atoi(row[108])); + e.classes6 = static_cast(atoi(row[109])); + e.classes7 = static_cast(atoi(row[110])); + e.classes8 = static_cast(atoi(row[111])); + e.classes9 = static_cast(atoi(row[112])); + e.classes10 = static_cast(atoi(row[113])); + e.classes11 = static_cast(atoi(row[114])); + e.classes12 = static_cast(atoi(row[115])); + e.classes13 = static_cast(atoi(row[116])); + e.classes14 = static_cast(atoi(row[117])); + e.classes15 = static_cast(atoi(row[118])); + e.classes16 = static_cast(atoi(row[119])); + e.CastingAnim = static_cast(atoi(row[120])); + e.TargetAnim = static_cast(atoi(row[121])); + e.TravelType = static_cast(atoi(row[122])); + e.SpellAffectIndex = static_cast(atoi(row[123])); + e.disallow_sit = static_cast(atoi(row[124])); + e.deities0 = static_cast(atoi(row[125])); + e.deities1 = static_cast(atoi(row[126])); + e.deities2 = static_cast(atoi(row[127])); + e.deities3 = static_cast(atoi(row[128])); + e.deities4 = static_cast(atoi(row[129])); + e.deities5 = static_cast(atoi(row[130])); + e.deities6 = static_cast(atoi(row[131])); + e.deities7 = static_cast(atoi(row[132])); + e.deities8 = static_cast(atoi(row[133])); + e.deities9 = static_cast(atoi(row[134])); + e.deities10 = static_cast(atoi(row[135])); + e.deities11 = static_cast(atoi(row[136])); + e.deities12 = static_cast(atoi(row[137])); + e.deities13 = static_cast(atoi(row[138])); + e.deities14 = static_cast(atoi(row[139])); + e.deities15 = static_cast(atoi(row[140])); + e.deities16 = static_cast(atoi(row[141])); + e.field142 = static_cast(atoi(row[142])); + e.field143 = static_cast(atoi(row[143])); + e.new_icon = static_cast(atoi(row[144])); + e.spellanim = static_cast(atoi(row[145])); + e.uninterruptable = static_cast(atoi(row[146])); + e.ResistDiff = static_cast(atoi(row[147])); + e.dot_stacking_exempt = static_cast(atoi(row[148])); + e.deleteable = static_cast(atoi(row[149])); + e.RecourseLink = static_cast(atoi(row[150])); + e.no_partial_resist = static_cast(atoi(row[151])); + e.field152 = static_cast(atoi(row[152])); + e.field153 = static_cast(atoi(row[153])); + e.short_buff_box = static_cast(atoi(row[154])); + e.descnum = static_cast(atoi(row[155])); + e.typedescnum = static_cast(atoi(row[156])); + e.effectdescnum = static_cast(atoi(row[157])); + e.effectdescnum2 = static_cast(atoi(row[158])); + e.npc_no_los = static_cast(atoi(row[159])); + e.field160 = static_cast(atoi(row[160])); + e.reflectable = static_cast(atoi(row[161])); + e.bonushate = static_cast(atoi(row[162])); + e.field163 = static_cast(atoi(row[163])); + e.field164 = static_cast(atoi(row[164])); + e.ldon_trap = static_cast(atoi(row[165])); + e.EndurCost = static_cast(atoi(row[166])); + e.EndurTimerIndex = static_cast(atoi(row[167])); + e.IsDiscipline = static_cast(atoi(row[168])); + e.field169 = static_cast(atoi(row[169])); + e.field170 = static_cast(atoi(row[170])); + e.field171 = static_cast(atoi(row[171])); + e.field172 = static_cast(atoi(row[172])); + e.HateAdded = static_cast(atoi(row[173])); + e.EndurUpkeep = static_cast(atoi(row[174])); + e.numhitstype = static_cast(atoi(row[175])); + e.numhits = static_cast(atoi(row[176])); + e.pvpresistbase = static_cast(atoi(row[177])); + e.pvpresistcalc = static_cast(atoi(row[178])); + e.pvpresistcap = static_cast(atoi(row[179])); + e.spell_category = static_cast(atoi(row[180])); + e.pvp_duration = static_cast(atoi(row[181])); + e.pvp_duration_cap = static_cast(atoi(row[182])); + e.pcnpc_only_flag = static_cast(atoi(row[183])); + e.cast_not_standing = static_cast(atoi(row[184])); + e.can_mgb = static_cast(atoi(row[185])); + e.nodispell = static_cast(atoi(row[186])); + e.npc_category = static_cast(atoi(row[187])); + e.npc_usefulness = static_cast(atoi(row[188])); + e.MinResist = static_cast(atoi(row[189])); + e.MaxResist = static_cast(atoi(row[190])); + e.viral_targets = static_cast(atoi(row[191])); + e.viral_timer = static_cast(atoi(row[192])); + e.nimbuseffect = static_cast(atoi(row[193])); + e.ConeStartAngle = static_cast(atoi(row[194])); + e.ConeStopAngle = static_cast(atoi(row[195])); + e.sneaking = static_cast(atoi(row[196])); + e.not_extendable = static_cast(atoi(row[197])); + e.field198 = static_cast(atoi(row[198])); + e.field199 = static_cast(atoi(row[199])); + e.suspendable = static_cast(atoi(row[200])); + e.viral_range = static_cast(atoi(row[201])); + e.songcap = static_cast(atoi(row[202])); + e.field203 = static_cast(atoi(row[203])); + e.field204 = static_cast(atoi(row[204])); + e.no_block = static_cast(atoi(row[205])); + e.field206 = static_cast(atoi(row[206])); + e.spellgroup = static_cast(atoi(row[207])); + e.rank = static_cast(atoi(row[208])); + e.field209 = static_cast(atoi(row[209])); + e.field210 = static_cast(atoi(row[210])); + e.CastRestriction = static_cast(atoi(row[211])); + e.allowrest = static_cast(atoi(row[212])); + e.InCombat = static_cast(atoi(row[213])); + e.OutofCombat = static_cast(atoi(row[214])); + e.field215 = static_cast(atoi(row[215])); + e.field216 = static_cast(atoi(row[216])); + e.field217 = static_cast(atoi(row[217])); + e.aemaxtargets = static_cast(atoi(row[218])); + e.maxtargets = static_cast(atoi(row[219])); + e.field220 = static_cast(atoi(row[220])); + e.field221 = static_cast(atoi(row[221])); + e.field222 = static_cast(atoi(row[222])); + e.field223 = static_cast(atoi(row[223])); + e.persistdeath = static_cast(atoi(row[224])); + e.field225 = static_cast(atoi(row[225])); + e.field226 = static_cast(atoi(row[226])); + e.min_dist = strtof(row[227], nullptr); + e.min_dist_mod = strtof(row[228], nullptr); + e.max_dist = strtof(row[229], nullptr); + e.max_dist_mod = strtof(row[230], nullptr); + e.min_range = static_cast(atoi(row[231])); + e.field232 = static_cast(atoi(row[232])); + e.field233 = static_cast(atoi(row[233])); + e.field234 = static_cast(atoi(row[234])); + e.field235 = static_cast(atoi(row[235])); + e.field236 = static_cast(atoi(row[236])); all_entries.push_back(e); } @@ -2383,7 +2383,7 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { SpellsNew e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; e.player_1 = row[2] ? row[2] : ""; e.teleport_zone = row[3] ? row[3] : ""; @@ -2392,234 +2392,234 @@ public: e.cast_on_you = row[6] ? row[6] : ""; e.cast_on_other = row[7] ? row[7] : ""; e.spell_fades = row[8] ? row[8] : ""; - e.range = atoi(row[9]); - e.aoerange = atoi(row[10]); - e.pushback = atoi(row[11]); - e.pushup = atoi(row[12]); - e.cast_time = atoi(row[13]); - e.recovery_time = atoi(row[14]); - e.recast_time = atoi(row[15]); - e.buffdurationformula = atoi(row[16]); - e.buffduration = atoi(row[17]); - e.AEDuration = atoi(row[18]); - e.mana = atoi(row[19]); - e.effect_base_value1 = atoi(row[20]); - e.effect_base_value2 = atoi(row[21]); - e.effect_base_value3 = atoi(row[22]); - e.effect_base_value4 = atoi(row[23]); - e.effect_base_value5 = atoi(row[24]); - e.effect_base_value6 = atoi(row[25]); - e.effect_base_value7 = atoi(row[26]); - e.effect_base_value8 = atoi(row[27]); - e.effect_base_value9 = atoi(row[28]); - e.effect_base_value10 = atoi(row[29]); - e.effect_base_value11 = atoi(row[30]); - e.effect_base_value12 = atoi(row[31]); - e.effect_limit_value1 = atoi(row[32]); - e.effect_limit_value2 = atoi(row[33]); - e.effect_limit_value3 = atoi(row[34]); - e.effect_limit_value4 = atoi(row[35]); - e.effect_limit_value5 = atoi(row[36]); - e.effect_limit_value6 = atoi(row[37]); - e.effect_limit_value7 = atoi(row[38]); - e.effect_limit_value8 = atoi(row[39]); - e.effect_limit_value9 = atoi(row[40]); - e.effect_limit_value10 = atoi(row[41]); - e.effect_limit_value11 = atoi(row[42]); - e.effect_limit_value12 = atoi(row[43]); - e.max1 = atoi(row[44]); - e.max2 = atoi(row[45]); - e.max3 = atoi(row[46]); - e.max4 = atoi(row[47]); - e.max5 = atoi(row[48]); - e.max6 = atoi(row[49]); - e.max7 = atoi(row[50]); - e.max8 = atoi(row[51]); - e.max9 = atoi(row[52]); - e.max10 = atoi(row[53]); - e.max11 = atoi(row[54]); - e.max12 = atoi(row[55]); - e.icon = atoi(row[56]); - e.memicon = atoi(row[57]); - e.components1 = atoi(row[58]); - e.components2 = atoi(row[59]); - e.components3 = atoi(row[60]); - e.components4 = atoi(row[61]); - e.component_counts1 = atoi(row[62]); - e.component_counts2 = atoi(row[63]); - e.component_counts3 = atoi(row[64]); - e.component_counts4 = atoi(row[65]); - e.NoexpendReagent1 = atoi(row[66]); - e.NoexpendReagent2 = atoi(row[67]); - e.NoexpendReagent3 = atoi(row[68]); - e.NoexpendReagent4 = atoi(row[69]); - e.formula1 = atoi(row[70]); - e.formula2 = atoi(row[71]); - e.formula3 = atoi(row[72]); - e.formula4 = atoi(row[73]); - e.formula5 = atoi(row[74]); - e.formula6 = atoi(row[75]); - e.formula7 = atoi(row[76]); - e.formula8 = atoi(row[77]); - e.formula9 = atoi(row[78]); - e.formula10 = atoi(row[79]); - e.formula11 = atoi(row[80]); - e.formula12 = atoi(row[81]); - e.LightType = atoi(row[82]); - e.goodEffect = atoi(row[83]); - e.Activated = atoi(row[84]); - e.resisttype = atoi(row[85]); - e.effectid1 = atoi(row[86]); - e.effectid2 = atoi(row[87]); - e.effectid3 = atoi(row[88]); - e.effectid4 = atoi(row[89]); - e.effectid5 = atoi(row[90]); - e.effectid6 = atoi(row[91]); - e.effectid7 = atoi(row[92]); - e.effectid8 = atoi(row[93]); - e.effectid9 = atoi(row[94]); - e.effectid10 = atoi(row[95]); - e.effectid11 = atoi(row[96]); - e.effectid12 = atoi(row[97]); - e.targettype = atoi(row[98]); - e.basediff = atoi(row[99]); - e.skill = atoi(row[100]); - e.zonetype = atoi(row[101]); - e.EnvironmentType = atoi(row[102]); - e.TimeOfDay = atoi(row[103]); - e.classes1 = atoi(row[104]); - e.classes2 = atoi(row[105]); - e.classes3 = atoi(row[106]); - e.classes4 = atoi(row[107]); - e.classes5 = atoi(row[108]); - e.classes6 = atoi(row[109]); - e.classes7 = atoi(row[110]); - e.classes8 = atoi(row[111]); - e.classes9 = atoi(row[112]); - e.classes10 = atoi(row[113]); - e.classes11 = atoi(row[114]); - e.classes12 = atoi(row[115]); - e.classes13 = atoi(row[116]); - e.classes14 = atoi(row[117]); - e.classes15 = atoi(row[118]); - e.classes16 = atoi(row[119]); - e.CastingAnim = atoi(row[120]); - e.TargetAnim = atoi(row[121]); - e.TravelType = atoi(row[122]); - e.SpellAffectIndex = atoi(row[123]); - e.disallow_sit = atoi(row[124]); - e.deities0 = atoi(row[125]); - e.deities1 = atoi(row[126]); - e.deities2 = atoi(row[127]); - e.deities3 = atoi(row[128]); - e.deities4 = atoi(row[129]); - e.deities5 = atoi(row[130]); - e.deities6 = atoi(row[131]); - e.deities7 = atoi(row[132]); - e.deities8 = atoi(row[133]); - e.deities9 = atoi(row[134]); - e.deities10 = atoi(row[135]); - e.deities11 = atoi(row[136]); - e.deities12 = atoi(row[137]); - e.deities13 = atoi(row[138]); - e.deities14 = atoi(row[139]); - e.deities15 = atoi(row[140]); - e.deities16 = atoi(row[141]); - e.field142 = atoi(row[142]); - e.field143 = atoi(row[143]); - e.new_icon = atoi(row[144]); - e.spellanim = atoi(row[145]); - e.uninterruptable = atoi(row[146]); - e.ResistDiff = atoi(row[147]); - e.dot_stacking_exempt = atoi(row[148]); - e.deleteable = atoi(row[149]); - e.RecourseLink = atoi(row[150]); - e.no_partial_resist = atoi(row[151]); - e.field152 = atoi(row[152]); - e.field153 = atoi(row[153]); - e.short_buff_box = atoi(row[154]); - e.descnum = atoi(row[155]); - e.typedescnum = atoi(row[156]); - e.effectdescnum = atoi(row[157]); - e.effectdescnum2 = atoi(row[158]); - e.npc_no_los = atoi(row[159]); - e.field160 = atoi(row[160]); - e.reflectable = atoi(row[161]); - e.bonushate = atoi(row[162]); - e.field163 = atoi(row[163]); - e.field164 = atoi(row[164]); - e.ldon_trap = atoi(row[165]); - e.EndurCost = atoi(row[166]); - e.EndurTimerIndex = atoi(row[167]); - e.IsDiscipline = atoi(row[168]); - e.field169 = atoi(row[169]); - e.field170 = atoi(row[170]); - e.field171 = atoi(row[171]); - e.field172 = atoi(row[172]); - e.HateAdded = atoi(row[173]); - e.EndurUpkeep = atoi(row[174]); - e.numhitstype = atoi(row[175]); - e.numhits = atoi(row[176]); - e.pvpresistbase = atoi(row[177]); - e.pvpresistcalc = atoi(row[178]); - e.pvpresistcap = atoi(row[179]); - e.spell_category = atoi(row[180]); - e.pvp_duration = atoi(row[181]); - e.pvp_duration_cap = atoi(row[182]); - e.pcnpc_only_flag = atoi(row[183]); - e.cast_not_standing = atoi(row[184]); - e.can_mgb = atoi(row[185]); - e.nodispell = atoi(row[186]); - e.npc_category = atoi(row[187]); - e.npc_usefulness = atoi(row[188]); - e.MinResist = atoi(row[189]); - e.MaxResist = atoi(row[190]); - e.viral_targets = atoi(row[191]); - e.viral_timer = atoi(row[192]); - e.nimbuseffect = atoi(row[193]); - e.ConeStartAngle = atoi(row[194]); - e.ConeStopAngle = atoi(row[195]); - e.sneaking = atoi(row[196]); - e.not_extendable = atoi(row[197]); - e.field198 = atoi(row[198]); - e.field199 = atoi(row[199]); - e.suspendable = atoi(row[200]); - e.viral_range = atoi(row[201]); - e.songcap = atoi(row[202]); - e.field203 = atoi(row[203]); - e.field204 = atoi(row[204]); - e.no_block = atoi(row[205]); - e.field206 = atoi(row[206]); - e.spellgroup = atoi(row[207]); - e.rank = atoi(row[208]); - e.field209 = atoi(row[209]); - e.field210 = atoi(row[210]); - e.CastRestriction = atoi(row[211]); - e.allowrest = atoi(row[212]); - e.InCombat = atoi(row[213]); - e.OutofCombat = atoi(row[214]); - e.field215 = atoi(row[215]); - e.field216 = atoi(row[216]); - e.field217 = atoi(row[217]); - e.aemaxtargets = atoi(row[218]); - e.maxtargets = atoi(row[219]); - e.field220 = atoi(row[220]); - e.field221 = atoi(row[221]); - e.field222 = atoi(row[222]); - e.field223 = atoi(row[223]); - e.persistdeath = atoi(row[224]); - e.field225 = atoi(row[225]); - e.field226 = atoi(row[226]); - e.min_dist = static_cast(atof(row[227])); - e.min_dist_mod = static_cast(atof(row[228])); - e.max_dist = static_cast(atof(row[229])); - e.max_dist_mod = static_cast(atof(row[230])); - e.min_range = atoi(row[231]); - e.field232 = atoi(row[232]); - e.field233 = atoi(row[233]); - e.field234 = atoi(row[234]); - e.field235 = atoi(row[235]); - e.field236 = atoi(row[236]); + e.range = static_cast(atoi(row[9])); + e.aoerange = static_cast(atoi(row[10])); + e.pushback = static_cast(atoi(row[11])); + e.pushup = static_cast(atoi(row[12])); + e.cast_time = static_cast(atoi(row[13])); + e.recovery_time = static_cast(atoi(row[14])); + e.recast_time = static_cast(atoi(row[15])); + e.buffdurationformula = static_cast(atoi(row[16])); + e.buffduration = static_cast(atoi(row[17])); + e.AEDuration = static_cast(atoi(row[18])); + e.mana = static_cast(atoi(row[19])); + e.effect_base_value1 = static_cast(atoi(row[20])); + e.effect_base_value2 = static_cast(atoi(row[21])); + e.effect_base_value3 = static_cast(atoi(row[22])); + e.effect_base_value4 = static_cast(atoi(row[23])); + e.effect_base_value5 = static_cast(atoi(row[24])); + e.effect_base_value6 = static_cast(atoi(row[25])); + e.effect_base_value7 = static_cast(atoi(row[26])); + e.effect_base_value8 = static_cast(atoi(row[27])); + e.effect_base_value9 = static_cast(atoi(row[28])); + e.effect_base_value10 = static_cast(atoi(row[29])); + e.effect_base_value11 = static_cast(atoi(row[30])); + e.effect_base_value12 = static_cast(atoi(row[31])); + e.effect_limit_value1 = static_cast(atoi(row[32])); + e.effect_limit_value2 = static_cast(atoi(row[33])); + e.effect_limit_value3 = static_cast(atoi(row[34])); + e.effect_limit_value4 = static_cast(atoi(row[35])); + e.effect_limit_value5 = static_cast(atoi(row[36])); + e.effect_limit_value6 = static_cast(atoi(row[37])); + e.effect_limit_value7 = static_cast(atoi(row[38])); + e.effect_limit_value8 = static_cast(atoi(row[39])); + e.effect_limit_value9 = static_cast(atoi(row[40])); + e.effect_limit_value10 = static_cast(atoi(row[41])); + e.effect_limit_value11 = static_cast(atoi(row[42])); + e.effect_limit_value12 = static_cast(atoi(row[43])); + e.max1 = static_cast(atoi(row[44])); + e.max2 = static_cast(atoi(row[45])); + e.max3 = static_cast(atoi(row[46])); + e.max4 = static_cast(atoi(row[47])); + e.max5 = static_cast(atoi(row[48])); + e.max6 = static_cast(atoi(row[49])); + e.max7 = static_cast(atoi(row[50])); + e.max8 = static_cast(atoi(row[51])); + e.max9 = static_cast(atoi(row[52])); + e.max10 = static_cast(atoi(row[53])); + e.max11 = static_cast(atoi(row[54])); + e.max12 = static_cast(atoi(row[55])); + e.icon = static_cast(atoi(row[56])); + e.memicon = static_cast(atoi(row[57])); + e.components1 = static_cast(atoi(row[58])); + e.components2 = static_cast(atoi(row[59])); + e.components3 = static_cast(atoi(row[60])); + e.components4 = static_cast(atoi(row[61])); + e.component_counts1 = static_cast(atoi(row[62])); + e.component_counts2 = static_cast(atoi(row[63])); + e.component_counts3 = static_cast(atoi(row[64])); + e.component_counts4 = static_cast(atoi(row[65])); + e.NoexpendReagent1 = static_cast(atoi(row[66])); + e.NoexpendReagent2 = static_cast(atoi(row[67])); + e.NoexpendReagent3 = static_cast(atoi(row[68])); + e.NoexpendReagent4 = static_cast(atoi(row[69])); + e.formula1 = static_cast(atoi(row[70])); + e.formula2 = static_cast(atoi(row[71])); + e.formula3 = static_cast(atoi(row[72])); + e.formula4 = static_cast(atoi(row[73])); + e.formula5 = static_cast(atoi(row[74])); + e.formula6 = static_cast(atoi(row[75])); + e.formula7 = static_cast(atoi(row[76])); + e.formula8 = static_cast(atoi(row[77])); + e.formula9 = static_cast(atoi(row[78])); + e.formula10 = static_cast(atoi(row[79])); + e.formula11 = static_cast(atoi(row[80])); + e.formula12 = static_cast(atoi(row[81])); + e.LightType = static_cast(atoi(row[82])); + e.goodEffect = static_cast(atoi(row[83])); + e.Activated = static_cast(atoi(row[84])); + e.resisttype = static_cast(atoi(row[85])); + e.effectid1 = static_cast(atoi(row[86])); + e.effectid2 = static_cast(atoi(row[87])); + e.effectid3 = static_cast(atoi(row[88])); + e.effectid4 = static_cast(atoi(row[89])); + e.effectid5 = static_cast(atoi(row[90])); + e.effectid6 = static_cast(atoi(row[91])); + e.effectid7 = static_cast(atoi(row[92])); + e.effectid8 = static_cast(atoi(row[93])); + e.effectid9 = static_cast(atoi(row[94])); + e.effectid10 = static_cast(atoi(row[95])); + e.effectid11 = static_cast(atoi(row[96])); + e.effectid12 = static_cast(atoi(row[97])); + e.targettype = static_cast(atoi(row[98])); + e.basediff = static_cast(atoi(row[99])); + e.skill = static_cast(atoi(row[100])); + e.zonetype = static_cast(atoi(row[101])); + e.EnvironmentType = static_cast(atoi(row[102])); + e.TimeOfDay = static_cast(atoi(row[103])); + e.classes1 = static_cast(atoi(row[104])); + e.classes2 = static_cast(atoi(row[105])); + e.classes3 = static_cast(atoi(row[106])); + e.classes4 = static_cast(atoi(row[107])); + e.classes5 = static_cast(atoi(row[108])); + e.classes6 = static_cast(atoi(row[109])); + e.classes7 = static_cast(atoi(row[110])); + e.classes8 = static_cast(atoi(row[111])); + e.classes9 = static_cast(atoi(row[112])); + e.classes10 = static_cast(atoi(row[113])); + e.classes11 = static_cast(atoi(row[114])); + e.classes12 = static_cast(atoi(row[115])); + e.classes13 = static_cast(atoi(row[116])); + e.classes14 = static_cast(atoi(row[117])); + e.classes15 = static_cast(atoi(row[118])); + e.classes16 = static_cast(atoi(row[119])); + e.CastingAnim = static_cast(atoi(row[120])); + e.TargetAnim = static_cast(atoi(row[121])); + e.TravelType = static_cast(atoi(row[122])); + e.SpellAffectIndex = static_cast(atoi(row[123])); + e.disallow_sit = static_cast(atoi(row[124])); + e.deities0 = static_cast(atoi(row[125])); + e.deities1 = static_cast(atoi(row[126])); + e.deities2 = static_cast(atoi(row[127])); + e.deities3 = static_cast(atoi(row[128])); + e.deities4 = static_cast(atoi(row[129])); + e.deities5 = static_cast(atoi(row[130])); + e.deities6 = static_cast(atoi(row[131])); + e.deities7 = static_cast(atoi(row[132])); + e.deities8 = static_cast(atoi(row[133])); + e.deities9 = static_cast(atoi(row[134])); + e.deities10 = static_cast(atoi(row[135])); + e.deities11 = static_cast(atoi(row[136])); + e.deities12 = static_cast(atoi(row[137])); + e.deities13 = static_cast(atoi(row[138])); + e.deities14 = static_cast(atoi(row[139])); + e.deities15 = static_cast(atoi(row[140])); + e.deities16 = static_cast(atoi(row[141])); + e.field142 = static_cast(atoi(row[142])); + e.field143 = static_cast(atoi(row[143])); + e.new_icon = static_cast(atoi(row[144])); + e.spellanim = static_cast(atoi(row[145])); + e.uninterruptable = static_cast(atoi(row[146])); + e.ResistDiff = static_cast(atoi(row[147])); + e.dot_stacking_exempt = static_cast(atoi(row[148])); + e.deleteable = static_cast(atoi(row[149])); + e.RecourseLink = static_cast(atoi(row[150])); + e.no_partial_resist = static_cast(atoi(row[151])); + e.field152 = static_cast(atoi(row[152])); + e.field153 = static_cast(atoi(row[153])); + e.short_buff_box = static_cast(atoi(row[154])); + e.descnum = static_cast(atoi(row[155])); + e.typedescnum = static_cast(atoi(row[156])); + e.effectdescnum = static_cast(atoi(row[157])); + e.effectdescnum2 = static_cast(atoi(row[158])); + e.npc_no_los = static_cast(atoi(row[159])); + e.field160 = static_cast(atoi(row[160])); + e.reflectable = static_cast(atoi(row[161])); + e.bonushate = static_cast(atoi(row[162])); + e.field163 = static_cast(atoi(row[163])); + e.field164 = static_cast(atoi(row[164])); + e.ldon_trap = static_cast(atoi(row[165])); + e.EndurCost = static_cast(atoi(row[166])); + e.EndurTimerIndex = static_cast(atoi(row[167])); + e.IsDiscipline = static_cast(atoi(row[168])); + e.field169 = static_cast(atoi(row[169])); + e.field170 = static_cast(atoi(row[170])); + e.field171 = static_cast(atoi(row[171])); + e.field172 = static_cast(atoi(row[172])); + e.HateAdded = static_cast(atoi(row[173])); + e.EndurUpkeep = static_cast(atoi(row[174])); + e.numhitstype = static_cast(atoi(row[175])); + e.numhits = static_cast(atoi(row[176])); + e.pvpresistbase = static_cast(atoi(row[177])); + e.pvpresistcalc = static_cast(atoi(row[178])); + e.pvpresistcap = static_cast(atoi(row[179])); + e.spell_category = static_cast(atoi(row[180])); + e.pvp_duration = static_cast(atoi(row[181])); + e.pvp_duration_cap = static_cast(atoi(row[182])); + e.pcnpc_only_flag = static_cast(atoi(row[183])); + e.cast_not_standing = static_cast(atoi(row[184])); + e.can_mgb = static_cast(atoi(row[185])); + e.nodispell = static_cast(atoi(row[186])); + e.npc_category = static_cast(atoi(row[187])); + e.npc_usefulness = static_cast(atoi(row[188])); + e.MinResist = static_cast(atoi(row[189])); + e.MaxResist = static_cast(atoi(row[190])); + e.viral_targets = static_cast(atoi(row[191])); + e.viral_timer = static_cast(atoi(row[192])); + e.nimbuseffect = static_cast(atoi(row[193])); + e.ConeStartAngle = static_cast(atoi(row[194])); + e.ConeStopAngle = static_cast(atoi(row[195])); + e.sneaking = static_cast(atoi(row[196])); + e.not_extendable = static_cast(atoi(row[197])); + e.field198 = static_cast(atoi(row[198])); + e.field199 = static_cast(atoi(row[199])); + e.suspendable = static_cast(atoi(row[200])); + e.viral_range = static_cast(atoi(row[201])); + e.songcap = static_cast(atoi(row[202])); + e.field203 = static_cast(atoi(row[203])); + e.field204 = static_cast(atoi(row[204])); + e.no_block = static_cast(atoi(row[205])); + e.field206 = static_cast(atoi(row[206])); + e.spellgroup = static_cast(atoi(row[207])); + e.rank = static_cast(atoi(row[208])); + e.field209 = static_cast(atoi(row[209])); + e.field210 = static_cast(atoi(row[210])); + e.CastRestriction = static_cast(atoi(row[211])); + e.allowrest = static_cast(atoi(row[212])); + e.InCombat = static_cast(atoi(row[213])); + e.OutofCombat = static_cast(atoi(row[214])); + e.field215 = static_cast(atoi(row[215])); + e.field216 = static_cast(atoi(row[216])); + e.field217 = static_cast(atoi(row[217])); + e.aemaxtargets = static_cast(atoi(row[218])); + e.maxtargets = static_cast(atoi(row[219])); + e.field220 = static_cast(atoi(row[220])); + e.field221 = static_cast(atoi(row[221])); + e.field222 = static_cast(atoi(row[222])); + e.field223 = static_cast(atoi(row[223])); + e.persistdeath = static_cast(atoi(row[224])); + e.field225 = static_cast(atoi(row[225])); + e.field226 = static_cast(atoi(row[226])); + e.min_dist = strtof(row[227], nullptr); + e.min_dist_mod = strtof(row[228], nullptr); + e.max_dist = strtof(row[229], nullptr); + e.max_dist_mod = strtof(row[230], nullptr); + e.min_range = static_cast(atoi(row[231])); + e.field232 = static_cast(atoi(row[232])); + e.field233 = static_cast(atoi(row[233])); + e.field234 = static_cast(atoi(row[234])); + e.field235 = static_cast(atoi(row[235])); + e.field236 = static_cast(atoi(row[236])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_start_zones_repository.h b/common/repositories/base/base_start_zones_repository.h index 15fe05484..124ff9ecb 100644 --- a/common/repositories/base/base_start_zones_repository.h +++ b/common/repositories/base/base_start_zones_repository.h @@ -23,19 +23,19 @@ public: float y; float z; float heading; - int zone_id; - int bind_id; - int player_choice; - int player_class; - int player_deity; - int player_race; - int start_zone; + int32_t zone_id; + int32_t bind_id; + int32_t player_choice; + int32_t player_class; + int32_t player_deity; + int32_t player_race; + int32_t start_zone; float bind_x; float bind_y; float bind_z; - int select_rank; - int min_expansion; - int max_expansion; + uint8_t select_rank; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -186,23 +186,23 @@ public: if (results.RowCount() == 1) { StartZones e{}; - e.x = static_cast(atof(row[0])); - e.y = static_cast(atof(row[1])); - e.z = static_cast(atof(row[2])); - e.heading = static_cast(atof(row[3])); - e.zone_id = atoi(row[4]); - e.bind_id = atoi(row[5]); - e.player_choice = atoi(row[6]); - e.player_class = atoi(row[7]); - e.player_deity = atoi(row[8]); - e.player_race = atoi(row[9]); - e.start_zone = atoi(row[10]); - e.bind_x = static_cast(atof(row[11])); - e.bind_y = static_cast(atof(row[12])); - e.bind_z = static_cast(atof(row[13])); - e.select_rank = atoi(row[14]); - e.min_expansion = atoi(row[15]); - e.max_expansion = atoi(row[16]); + e.x = strtof(row[0], nullptr); + e.y = strtof(row[1], nullptr); + e.z = strtof(row[2], nullptr); + e.heading = strtof(row[3], nullptr); + e.zone_id = static_cast(atoi(row[4])); + e.bind_id = static_cast(atoi(row[5])); + e.player_choice = static_cast(atoi(row[6])); + e.player_class = static_cast(atoi(row[7])); + e.player_deity = static_cast(atoi(row[8])); + e.player_race = static_cast(atoi(row[9])); + e.start_zone = static_cast(atoi(row[10])); + e.bind_x = strtof(row[11], nullptr); + e.bind_y = strtof(row[12], nullptr); + e.bind_z = strtof(row[13], nullptr); + e.select_rank = static_cast(strtoul(row[14], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[15])); + e.max_expansion = static_cast(atoi(row[16])); e.content_flags = row[17] ? row[17] : ""; e.content_flags_disabled = row[18] ? row[18] : ""; @@ -378,23 +378,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { StartZones e{}; - e.x = static_cast(atof(row[0])); - e.y = static_cast(atof(row[1])); - e.z = static_cast(atof(row[2])); - e.heading = static_cast(atof(row[3])); - e.zone_id = atoi(row[4]); - e.bind_id = atoi(row[5]); - e.player_choice = atoi(row[6]); - e.player_class = atoi(row[7]); - e.player_deity = atoi(row[8]); - e.player_race = atoi(row[9]); - e.start_zone = atoi(row[10]); - e.bind_x = static_cast(atof(row[11])); - e.bind_y = static_cast(atof(row[12])); - e.bind_z = static_cast(atof(row[13])); - e.select_rank = atoi(row[14]); - e.min_expansion = atoi(row[15]); - e.max_expansion = atoi(row[16]); + e.x = strtof(row[0], nullptr); + e.y = strtof(row[1], nullptr); + e.z = strtof(row[2], nullptr); + e.heading = strtof(row[3], nullptr); + e.zone_id = static_cast(atoi(row[4])); + e.bind_id = static_cast(atoi(row[5])); + e.player_choice = static_cast(atoi(row[6])); + e.player_class = static_cast(atoi(row[7])); + e.player_deity = static_cast(atoi(row[8])); + e.player_race = static_cast(atoi(row[9])); + e.start_zone = static_cast(atoi(row[10])); + e.bind_x = strtof(row[11], nullptr); + e.bind_y = strtof(row[12], nullptr); + e.bind_z = strtof(row[13], nullptr); + e.select_rank = static_cast(strtoul(row[14], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[15])); + e.max_expansion = static_cast(atoi(row[16])); e.content_flags = row[17] ? row[17] : ""; e.content_flags_disabled = row[18] ? row[18] : ""; @@ -421,23 +421,23 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { StartZones e{}; - e.x = static_cast(atof(row[0])); - e.y = static_cast(atof(row[1])); - e.z = static_cast(atof(row[2])); - e.heading = static_cast(atof(row[3])); - e.zone_id = atoi(row[4]); - e.bind_id = atoi(row[5]); - e.player_choice = atoi(row[6]); - e.player_class = atoi(row[7]); - e.player_deity = atoi(row[8]); - e.player_race = atoi(row[9]); - e.start_zone = atoi(row[10]); - e.bind_x = static_cast(atof(row[11])); - e.bind_y = static_cast(atof(row[12])); - e.bind_z = static_cast(atof(row[13])); - e.select_rank = atoi(row[14]); - e.min_expansion = atoi(row[15]); - e.max_expansion = atoi(row[16]); + e.x = strtof(row[0], nullptr); + e.y = strtof(row[1], nullptr); + e.z = strtof(row[2], nullptr); + e.heading = strtof(row[3], nullptr); + e.zone_id = static_cast(atoi(row[4])); + e.bind_id = static_cast(atoi(row[5])); + e.player_choice = static_cast(atoi(row[6])); + e.player_class = static_cast(atoi(row[7])); + e.player_deity = static_cast(atoi(row[8])); + e.player_race = static_cast(atoi(row[9])); + e.start_zone = static_cast(atoi(row[10])); + e.bind_x = strtof(row[11], nullptr); + e.bind_y = strtof(row[12], nullptr); + e.bind_z = strtof(row[13], nullptr); + e.select_rank = static_cast(strtoul(row[14], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[15])); + e.max_expansion = static_cast(atoi(row[16])); e.content_flags = row[17] ? row[17] : ""; e.content_flags_disabled = row[18] ? row[18] : ""; diff --git a/common/repositories/base/base_starting_items_repository.h b/common/repositories/base/base_starting_items_repository.h index 413fd140f..33711b462 100644 --- a/common/repositories/base/base_starting_items_repository.h +++ b/common/repositories/base/base_starting_items_repository.h @@ -19,17 +19,17 @@ class BaseStartingItemsRepository { public: struct StartingItems { - int id; - int race; - int class_; - int deityid; - int zoneid; - int itemid; - int item_charges; - int gm; - int slot; - int min_expansion; - int max_expansion; + uint32_t id; + int32_t race; + int32_t class_; + int32_t deityid; + int32_t zoneid; + int32_t itemid; + uint8_t item_charges; + int8_t gm; + int32_t slot; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -162,17 +162,17 @@ public: if (results.RowCount() == 1) { StartingItems e{}; - e.id = atoi(row[0]); - e.race = atoi(row[1]); - e.class_ = atoi(row[2]); - e.deityid = atoi(row[3]); - e.zoneid = atoi(row[4]); - e.itemid = atoi(row[5]); - e.item_charges = atoi(row[6]); - e.gm = atoi(row[7]); - e.slot = atoi(row[8]); - e.min_expansion = atoi(row[9]); - e.max_expansion = atoi(row[10]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.race = static_cast(atoi(row[1])); + e.class_ = static_cast(atoi(row[2])); + e.deityid = static_cast(atoi(row[3])); + e.zoneid = static_cast(atoi(row[4])); + e.itemid = static_cast(atoi(row[5])); + e.item_charges = static_cast(strtoul(row[6], nullptr, 10)); + e.gm = static_cast(atoi(row[7])); + e.slot = static_cast(atoi(row[8])); + e.min_expansion = static_cast(atoi(row[9])); + e.max_expansion = static_cast(atoi(row[10])); e.content_flags = row[11] ? row[11] : ""; e.content_flags_disabled = row[12] ? row[12] : ""; @@ -329,17 +329,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { StartingItems e{}; - e.id = atoi(row[0]); - e.race = atoi(row[1]); - e.class_ = atoi(row[2]); - e.deityid = atoi(row[3]); - e.zoneid = atoi(row[4]); - e.itemid = atoi(row[5]); - e.item_charges = atoi(row[6]); - e.gm = atoi(row[7]); - e.slot = atoi(row[8]); - e.min_expansion = atoi(row[9]); - e.max_expansion = atoi(row[10]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.race = static_cast(atoi(row[1])); + e.class_ = static_cast(atoi(row[2])); + e.deityid = static_cast(atoi(row[3])); + e.zoneid = static_cast(atoi(row[4])); + e.itemid = static_cast(atoi(row[5])); + e.item_charges = static_cast(strtoul(row[6], nullptr, 10)); + e.gm = static_cast(atoi(row[7])); + e.slot = static_cast(atoi(row[8])); + e.min_expansion = static_cast(atoi(row[9])); + e.max_expansion = static_cast(atoi(row[10])); e.content_flags = row[11] ? row[11] : ""; e.content_flags_disabled = row[12] ? row[12] : ""; @@ -366,17 +366,17 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { StartingItems e{}; - e.id = atoi(row[0]); - e.race = atoi(row[1]); - e.class_ = atoi(row[2]); - e.deityid = atoi(row[3]); - e.zoneid = atoi(row[4]); - e.itemid = atoi(row[5]); - e.item_charges = atoi(row[6]); - e.gm = atoi(row[7]); - e.slot = atoi(row[8]); - e.min_expansion = atoi(row[9]); - e.max_expansion = atoi(row[10]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.race = static_cast(atoi(row[1])); + e.class_ = static_cast(atoi(row[2])); + e.deityid = static_cast(atoi(row[3])); + e.zoneid = static_cast(atoi(row[4])); + e.itemid = static_cast(atoi(row[5])); + e.item_charges = static_cast(strtoul(row[6], nullptr, 10)); + e.gm = static_cast(atoi(row[7])); + e.slot = static_cast(atoi(row[8])); + e.min_expansion = static_cast(atoi(row[9])); + e.max_expansion = static_cast(atoi(row[10])); e.content_flags = row[11] ? row[11] : ""; e.content_flags_disabled = row[12] ? row[12] : ""; diff --git a/common/repositories/base/base_task_activities_repository.h b/common/repositories/base/base_task_activities_repository.h index c908c25a9..451699336 100644 --- a/common/repositories/base/base_task_activities_repository.h +++ b/common/repositories/base/base_task_activities_repository.h @@ -19,24 +19,24 @@ class BaseTaskActivitiesRepository { public: struct TaskActivities { - int taskid; - int activityid; - int req_activity_id; - int step; - int activitytype; + uint32_t taskid; + uint32_t activityid; + int32_t req_activity_id; + int32_t step; + uint8_t activitytype; std::string target_name; std::string item_list; std::string skill_list; std::string spell_list; std::string description_override; - int goalid; + uint32_t goalid; std::string goal_match_list; - int goalmethod; - int goalcount; - int delivertonpc; + uint32_t goalmethod; + int32_t goalcount; + uint32_t delivertonpc; std::string zones; - int zone_version; - int optional; + int32_t zone_version; + int8_t optional; }; static std::string PrimaryKey() @@ -182,24 +182,24 @@ public: if (results.RowCount() == 1) { TaskActivities e{}; - e.taskid = atoi(row[0]); - e.activityid = atoi(row[1]); - e.req_activity_id = atoi(row[2]); - e.step = atoi(row[3]); - e.activitytype = atoi(row[4]); + e.taskid = static_cast(strtoul(row[0], nullptr, 10)); + e.activityid = static_cast(strtoul(row[1], nullptr, 10)); + e.req_activity_id = static_cast(atoi(row[2])); + e.step = static_cast(atoi(row[3])); + e.activitytype = static_cast(strtoul(row[4], nullptr, 10)); e.target_name = row[5] ? row[5] : ""; e.item_list = row[6] ? row[6] : ""; e.skill_list = row[7] ? row[7] : ""; e.spell_list = row[8] ? row[8] : ""; e.description_override = row[9] ? row[9] : ""; - e.goalid = atoi(row[10]); + e.goalid = static_cast(strtoul(row[10], nullptr, 10)); e.goal_match_list = row[11] ? row[11] : ""; - e.goalmethod = atoi(row[12]); - e.goalcount = atoi(row[13]); - e.delivertonpc = atoi(row[14]); + e.goalmethod = static_cast(strtoul(row[12], nullptr, 10)); + e.goalcount = static_cast(atoi(row[13])); + e.delivertonpc = static_cast(strtoul(row[14], nullptr, 10)); e.zones = row[15] ? row[15] : ""; - e.zone_version = atoi(row[16]); - e.optional = atoi(row[17]); + e.zone_version = static_cast(atoi(row[16])); + e.optional = static_cast(atoi(row[17])); return e; } @@ -370,24 +370,24 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TaskActivities e{}; - e.taskid = atoi(row[0]); - e.activityid = atoi(row[1]); - e.req_activity_id = atoi(row[2]); - e.step = atoi(row[3]); - e.activitytype = atoi(row[4]); + e.taskid = static_cast(strtoul(row[0], nullptr, 10)); + e.activityid = static_cast(strtoul(row[1], nullptr, 10)); + e.req_activity_id = static_cast(atoi(row[2])); + e.step = static_cast(atoi(row[3])); + e.activitytype = static_cast(strtoul(row[4], nullptr, 10)); e.target_name = row[5] ? row[5] : ""; e.item_list = row[6] ? row[6] : ""; e.skill_list = row[7] ? row[7] : ""; e.spell_list = row[8] ? row[8] : ""; e.description_override = row[9] ? row[9] : ""; - e.goalid = atoi(row[10]); + e.goalid = static_cast(strtoul(row[10], nullptr, 10)); e.goal_match_list = row[11] ? row[11] : ""; - e.goalmethod = atoi(row[12]); - e.goalcount = atoi(row[13]); - e.delivertonpc = atoi(row[14]); + e.goalmethod = static_cast(strtoul(row[12], nullptr, 10)); + e.goalcount = static_cast(atoi(row[13])); + e.delivertonpc = static_cast(strtoul(row[14], nullptr, 10)); e.zones = row[15] ? row[15] : ""; - e.zone_version = atoi(row[16]); - e.optional = atoi(row[17]); + e.zone_version = static_cast(atoi(row[16])); + e.optional = static_cast(atoi(row[17])); all_entries.push_back(e); } @@ -412,24 +412,24 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TaskActivities e{}; - e.taskid = atoi(row[0]); - e.activityid = atoi(row[1]); - e.req_activity_id = atoi(row[2]); - e.step = atoi(row[3]); - e.activitytype = atoi(row[4]); + e.taskid = static_cast(strtoul(row[0], nullptr, 10)); + e.activityid = static_cast(strtoul(row[1], nullptr, 10)); + e.req_activity_id = static_cast(atoi(row[2])); + e.step = static_cast(atoi(row[3])); + e.activitytype = static_cast(strtoul(row[4], nullptr, 10)); e.target_name = row[5] ? row[5] : ""; e.item_list = row[6] ? row[6] : ""; e.skill_list = row[7] ? row[7] : ""; e.spell_list = row[8] ? row[8] : ""; e.description_override = row[9] ? row[9] : ""; - e.goalid = atoi(row[10]); + e.goalid = static_cast(strtoul(row[10], nullptr, 10)); e.goal_match_list = row[11] ? row[11] : ""; - e.goalmethod = atoi(row[12]); - e.goalcount = atoi(row[13]); - e.delivertonpc = atoi(row[14]); + e.goalmethod = static_cast(strtoul(row[12], nullptr, 10)); + e.goalcount = static_cast(atoi(row[13])); + e.delivertonpc = static_cast(strtoul(row[14], nullptr, 10)); e.zones = row[15] ? row[15] : ""; - e.zone_version = atoi(row[16]); - e.optional = atoi(row[17]); + e.zone_version = static_cast(atoi(row[16])); + e.optional = static_cast(atoi(row[17])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_tasks_repository.h b/common/repositories/base/base_tasks_repository.h index 82848855f..592962b78 100644 --- a/common/repositories/base/base_tasks_repository.h +++ b/common/repositories/base/base_tasks_repository.h @@ -19,33 +19,33 @@ class BaseTasksRepository { public: struct Tasks { - int id; - int type; - int duration; - int duration_code; + uint32_t id; + int8_t type; + uint32_t duration; + int8_t duration_code; std::string title; std::string description; std::string reward; - int rewardid; - int cashreward; - int xpreward; - int rewardmethod; - int reward_points; - int reward_point_type; - int minlevel; - int maxlevel; - int level_spread; - int min_players; - int max_players; - int repeatable; - int faction_reward; + uint32_t rewardid; + uint32_t cashreward; + int32_t xpreward; + uint8_t rewardmethod; + int32_t reward_points; + int32_t reward_point_type; + uint8_t minlevel; + uint8_t maxlevel; + uint32_t level_spread; + uint32_t min_players; + uint32_t max_players; + uint8_t repeatable; + int32_t faction_reward; std::string completion_emote; - int replay_timer_group; - int replay_timer_seconds; - int request_timer_group; - int request_timer_seconds; - int dz_template_id; - int lock_activity_id; + uint32_t replay_timer_group; + uint32_t replay_timer_seconds; + uint32_t request_timer_group; + uint32_t request_timer_seconds; + uint32_t dz_template_id; + int32_t lock_activity_id; }; static std::string PrimaryKey() @@ -218,33 +218,33 @@ public: if (results.RowCount() == 1) { Tasks e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); - e.duration = atoi(row[2]); - e.duration_code = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(atoi(row[1])); + e.duration = static_cast(strtoul(row[2], nullptr, 10)); + e.duration_code = static_cast(atoi(row[3])); e.title = row[4] ? row[4] : ""; e.description = row[5] ? row[5] : ""; e.reward = row[6] ? row[6] : ""; - e.rewardid = atoi(row[7]); - e.cashreward = atoi(row[8]); - e.xpreward = atoi(row[9]); - e.rewardmethod = atoi(row[10]); - e.reward_points = atoi(row[11]); - e.reward_point_type = atoi(row[12]); - e.minlevel = atoi(row[13]); - e.maxlevel = atoi(row[14]); - e.level_spread = atoi(row[15]); - e.min_players = atoi(row[16]); - e.max_players = atoi(row[17]); - e.repeatable = atoi(row[18]); - e.faction_reward = atoi(row[19]); + e.rewardid = static_cast(strtoul(row[7], nullptr, 10)); + e.cashreward = static_cast(strtoul(row[8], nullptr, 10)); + e.xpreward = static_cast(atoi(row[9])); + e.rewardmethod = static_cast(strtoul(row[10], nullptr, 10)); + e.reward_points = static_cast(atoi(row[11])); + e.reward_point_type = static_cast(atoi(row[12])); + e.minlevel = static_cast(strtoul(row[13], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[14], nullptr, 10)); + e.level_spread = static_cast(strtoul(row[15], nullptr, 10)); + e.min_players = static_cast(strtoul(row[16], nullptr, 10)); + e.max_players = static_cast(strtoul(row[17], nullptr, 10)); + e.repeatable = static_cast(strtoul(row[18], nullptr, 10)); + e.faction_reward = static_cast(atoi(row[19])); e.completion_emote = row[20] ? row[20] : ""; - e.replay_timer_group = atoi(row[21]); - e.replay_timer_seconds = atoi(row[22]); - e.request_timer_group = atoi(row[23]); - e.request_timer_seconds = atoi(row[24]); - e.dz_template_id = atoi(row[25]); - e.lock_activity_id = atoi(row[26]); + e.replay_timer_group = static_cast(strtoul(row[21], nullptr, 10)); + e.replay_timer_seconds = static_cast(strtoul(row[22], nullptr, 10)); + e.request_timer_group = static_cast(strtoul(row[23], nullptr, 10)); + e.request_timer_seconds = static_cast(strtoul(row[24], nullptr, 10)); + e.dz_template_id = static_cast(strtoul(row[25], nullptr, 10)); + e.lock_activity_id = static_cast(atoi(row[26])); return e; } @@ -442,33 +442,33 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Tasks e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); - e.duration = atoi(row[2]); - e.duration_code = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(atoi(row[1])); + e.duration = static_cast(strtoul(row[2], nullptr, 10)); + e.duration_code = static_cast(atoi(row[3])); e.title = row[4] ? row[4] : ""; e.description = row[5] ? row[5] : ""; e.reward = row[6] ? row[6] : ""; - e.rewardid = atoi(row[7]); - e.cashreward = atoi(row[8]); - e.xpreward = atoi(row[9]); - e.rewardmethod = atoi(row[10]); - e.reward_points = atoi(row[11]); - e.reward_point_type = atoi(row[12]); - e.minlevel = atoi(row[13]); - e.maxlevel = atoi(row[14]); - e.level_spread = atoi(row[15]); - e.min_players = atoi(row[16]); - e.max_players = atoi(row[17]); - e.repeatable = atoi(row[18]); - e.faction_reward = atoi(row[19]); + e.rewardid = static_cast(strtoul(row[7], nullptr, 10)); + e.cashreward = static_cast(strtoul(row[8], nullptr, 10)); + e.xpreward = static_cast(atoi(row[9])); + e.rewardmethod = static_cast(strtoul(row[10], nullptr, 10)); + e.reward_points = static_cast(atoi(row[11])); + e.reward_point_type = static_cast(atoi(row[12])); + e.minlevel = static_cast(strtoul(row[13], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[14], nullptr, 10)); + e.level_spread = static_cast(strtoul(row[15], nullptr, 10)); + e.min_players = static_cast(strtoul(row[16], nullptr, 10)); + e.max_players = static_cast(strtoul(row[17], nullptr, 10)); + e.repeatable = static_cast(strtoul(row[18], nullptr, 10)); + e.faction_reward = static_cast(atoi(row[19])); e.completion_emote = row[20] ? row[20] : ""; - e.replay_timer_group = atoi(row[21]); - e.replay_timer_seconds = atoi(row[22]); - e.request_timer_group = atoi(row[23]); - e.request_timer_seconds = atoi(row[24]); - e.dz_template_id = atoi(row[25]); - e.lock_activity_id = atoi(row[26]); + e.replay_timer_group = static_cast(strtoul(row[21], nullptr, 10)); + e.replay_timer_seconds = static_cast(strtoul(row[22], nullptr, 10)); + e.request_timer_group = static_cast(strtoul(row[23], nullptr, 10)); + e.request_timer_seconds = static_cast(strtoul(row[24], nullptr, 10)); + e.dz_template_id = static_cast(strtoul(row[25], nullptr, 10)); + e.lock_activity_id = static_cast(atoi(row[26])); all_entries.push_back(e); } @@ -493,33 +493,33 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Tasks e{}; - e.id = atoi(row[0]); - e.type = atoi(row[1]); - e.duration = atoi(row[2]); - e.duration_code = atoi(row[3]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.type = static_cast(atoi(row[1])); + e.duration = static_cast(strtoul(row[2], nullptr, 10)); + e.duration_code = static_cast(atoi(row[3])); e.title = row[4] ? row[4] : ""; e.description = row[5] ? row[5] : ""; e.reward = row[6] ? row[6] : ""; - e.rewardid = atoi(row[7]); - e.cashreward = atoi(row[8]); - e.xpreward = atoi(row[9]); - e.rewardmethod = atoi(row[10]); - e.reward_points = atoi(row[11]); - e.reward_point_type = atoi(row[12]); - e.minlevel = atoi(row[13]); - e.maxlevel = atoi(row[14]); - e.level_spread = atoi(row[15]); - e.min_players = atoi(row[16]); - e.max_players = atoi(row[17]); - e.repeatable = atoi(row[18]); - e.faction_reward = atoi(row[19]); + e.rewardid = static_cast(strtoul(row[7], nullptr, 10)); + e.cashreward = static_cast(strtoul(row[8], nullptr, 10)); + e.xpreward = static_cast(atoi(row[9])); + e.rewardmethod = static_cast(strtoul(row[10], nullptr, 10)); + e.reward_points = static_cast(atoi(row[11])); + e.reward_point_type = static_cast(atoi(row[12])); + e.minlevel = static_cast(strtoul(row[13], nullptr, 10)); + e.maxlevel = static_cast(strtoul(row[14], nullptr, 10)); + e.level_spread = static_cast(strtoul(row[15], nullptr, 10)); + e.min_players = static_cast(strtoul(row[16], nullptr, 10)); + e.max_players = static_cast(strtoul(row[17], nullptr, 10)); + e.repeatable = static_cast(strtoul(row[18], nullptr, 10)); + e.faction_reward = static_cast(atoi(row[19])); e.completion_emote = row[20] ? row[20] : ""; - e.replay_timer_group = atoi(row[21]); - e.replay_timer_seconds = atoi(row[22]); - e.request_timer_group = atoi(row[23]); - e.request_timer_seconds = atoi(row[24]); - e.dz_template_id = atoi(row[25]); - e.lock_activity_id = atoi(row[26]); + e.replay_timer_group = static_cast(strtoul(row[21], nullptr, 10)); + e.replay_timer_seconds = static_cast(strtoul(row[22], nullptr, 10)); + e.request_timer_group = static_cast(strtoul(row[23], nullptr, 10)); + e.request_timer_seconds = static_cast(strtoul(row[24], nullptr, 10)); + e.dz_template_id = static_cast(strtoul(row[25], nullptr, 10)); + e.lock_activity_id = static_cast(atoi(row[26])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_tasksets_repository.h b/common/repositories/base/base_tasksets_repository.h index c771b46b2..396d5fdee 100644 --- a/common/repositories/base/base_tasksets_repository.h +++ b/common/repositories/base/base_tasksets_repository.h @@ -19,8 +19,8 @@ class BaseTasksetsRepository { public: struct Tasksets { - int id; - int taskid; + uint32_t id; + uint32_t taskid; }; static std::string PrimaryKey() @@ -118,8 +118,8 @@ public: if (results.RowCount() == 1) { Tasksets e{}; - e.id = atoi(row[0]); - e.taskid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); return e; } @@ -242,8 +242,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Tasksets e{}; - e.id = atoi(row[0]); - e.taskid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } @@ -268,8 +268,8 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Tasksets e{}; - e.id = atoi(row[0]); - e.taskid = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.taskid = static_cast(strtoul(row[1], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_timers_repository.h b/common/repositories/base/base_timers_repository.h index 9cf1121b3..cfe951099 100644 --- a/common/repositories/base/base_timers_repository.h +++ b/common/repositories/base/base_timers_repository.h @@ -19,11 +19,11 @@ class BaseTimersRepository { public: struct Timers { - int char_id; - int type; - int start; - int duration; - int enable; + int32_t char_id; + uint32_t type; + uint32_t start; + uint32_t duration; + int8_t enable; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { Timers e{}; - e.char_id = atoi(row[0]); - e.type = atoi(row[1]); - e.start = atoi(row[2]); - e.duration = atoi(row[3]); - e.enable = atoi(row[4]); + e.char_id = static_cast(atoi(row[0])); + e.type = static_cast(strtoul(row[1], nullptr, 10)); + e.start = static_cast(strtoul(row[2], nullptr, 10)); + e.duration = static_cast(strtoul(row[3], nullptr, 10)); + e.enable = static_cast(atoi(row[4])); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Timers e{}; - e.char_id = atoi(row[0]); - e.type = atoi(row[1]); - e.start = atoi(row[2]); - e.duration = atoi(row[3]); - e.enable = atoi(row[4]); + e.char_id = static_cast(atoi(row[0])); + e.type = static_cast(strtoul(row[1], nullptr, 10)); + e.start = static_cast(strtoul(row[2], nullptr, 10)); + e.duration = static_cast(strtoul(row[3], nullptr, 10)); + e.enable = static_cast(atoi(row[4])); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Timers e{}; - e.char_id = atoi(row[0]); - e.type = atoi(row[1]); - e.start = atoi(row[2]); - e.duration = atoi(row[3]); - e.enable = atoi(row[4]); + e.char_id = static_cast(atoi(row[0])); + e.type = static_cast(strtoul(row[1], nullptr, 10)); + e.start = static_cast(strtoul(row[2], nullptr, 10)); + e.duration = static_cast(strtoul(row[3], nullptr, 10)); + e.enable = static_cast(atoi(row[4])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_titles_repository.h b/common/repositories/base/base_titles_repository.h index 68513eb8d..851f4729e 100644 --- a/common/repositories/base/base_titles_repository.h +++ b/common/repositories/base/base_titles_repository.h @@ -19,20 +19,20 @@ class BaseTitlesRepository { public: struct Titles { - int id; - int skill_id; - int min_skill_value; - int max_skill_value; - int min_aa_points; - int max_aa_points; - int class_; - int gender; - int char_id; - int status; - int item_id; + uint32_t id; + int8_t skill_id; + int32_t min_skill_value; + int32_t max_skill_value; + int32_t min_aa_points; + int32_t max_aa_points; + int8_t class_; + int8_t gender; + int32_t char_id; + int32_t status; + int32_t item_id; std::string prefix; std::string suffix; - int title_set; + int32_t title_set; }; static std::string PrimaryKey() @@ -166,20 +166,20 @@ public: if (results.RowCount() == 1) { Titles e{}; - e.id = atoi(row[0]); - e.skill_id = atoi(row[1]); - e.min_skill_value = atoi(row[2]); - e.max_skill_value = atoi(row[3]); - e.min_aa_points = atoi(row[4]); - e.max_aa_points = atoi(row[5]); - e.class_ = atoi(row[6]); - e.gender = atoi(row[7]); - e.char_id = atoi(row[8]); - e.status = atoi(row[9]); - e.item_id = atoi(row[10]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.skill_id = static_cast(atoi(row[1])); + e.min_skill_value = static_cast(atoi(row[2])); + e.max_skill_value = static_cast(atoi(row[3])); + e.min_aa_points = static_cast(atoi(row[4])); + e.max_aa_points = static_cast(atoi(row[5])); + e.class_ = static_cast(atoi(row[6])); + e.gender = static_cast(atoi(row[7])); + e.char_id = static_cast(atoi(row[8])); + e.status = static_cast(atoi(row[9])); + e.item_id = static_cast(atoi(row[10])); e.prefix = row[11] ? row[11] : ""; e.suffix = row[12] ? row[12] : ""; - e.title_set = atoi(row[13]); + e.title_set = static_cast(atoi(row[13])); return e; } @@ -337,20 +337,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Titles e{}; - e.id = atoi(row[0]); - e.skill_id = atoi(row[1]); - e.min_skill_value = atoi(row[2]); - e.max_skill_value = atoi(row[3]); - e.min_aa_points = atoi(row[4]); - e.max_aa_points = atoi(row[5]); - e.class_ = atoi(row[6]); - e.gender = atoi(row[7]); - e.char_id = atoi(row[8]); - e.status = atoi(row[9]); - e.item_id = atoi(row[10]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.skill_id = static_cast(atoi(row[1])); + e.min_skill_value = static_cast(atoi(row[2])); + e.max_skill_value = static_cast(atoi(row[3])); + e.min_aa_points = static_cast(atoi(row[4])); + e.max_aa_points = static_cast(atoi(row[5])); + e.class_ = static_cast(atoi(row[6])); + e.gender = static_cast(atoi(row[7])); + e.char_id = static_cast(atoi(row[8])); + e.status = static_cast(atoi(row[9])); + e.item_id = static_cast(atoi(row[10])); e.prefix = row[11] ? row[11] : ""; e.suffix = row[12] ? row[12] : ""; - e.title_set = atoi(row[13]); + e.title_set = static_cast(atoi(row[13])); all_entries.push_back(e); } @@ -375,20 +375,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Titles e{}; - e.id = atoi(row[0]); - e.skill_id = atoi(row[1]); - e.min_skill_value = atoi(row[2]); - e.max_skill_value = atoi(row[3]); - e.min_aa_points = atoi(row[4]); - e.max_aa_points = atoi(row[5]); - e.class_ = atoi(row[6]); - e.gender = atoi(row[7]); - e.char_id = atoi(row[8]); - e.status = atoi(row[9]); - e.item_id = atoi(row[10]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.skill_id = static_cast(atoi(row[1])); + e.min_skill_value = static_cast(atoi(row[2])); + e.max_skill_value = static_cast(atoi(row[3])); + e.min_aa_points = static_cast(atoi(row[4])); + e.max_aa_points = static_cast(atoi(row[5])); + e.class_ = static_cast(atoi(row[6])); + e.gender = static_cast(atoi(row[7])); + e.char_id = static_cast(atoi(row[8])); + e.status = static_cast(atoi(row[9])); + e.item_id = static_cast(atoi(row[10])); e.prefix = row[11] ? row[11] : ""; e.suffix = row[12] ? row[12] : ""; - e.title_set = atoi(row[13]); + e.title_set = static_cast(atoi(row[13])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_trader_repository.h b/common/repositories/base/base_trader_repository.h index 6ad78439d..a057b6bc6 100644 --- a/common/repositories/base/base_trader_repository.h +++ b/common/repositories/base/base_trader_repository.h @@ -19,12 +19,12 @@ class BaseTraderRepository { public: struct Trader { - int char_id; - int item_id; - int serialnumber; - int charges; - int item_cost; - int slot_id; + uint32_t char_id; + uint32_t item_id; + uint32_t serialnumber; + int32_t charges; + uint32_t item_cost; + uint8_t slot_id; }; static std::string PrimaryKey() @@ -134,12 +134,12 @@ public: if (results.RowCount() == 1) { Trader e{}; - e.char_id = atoi(row[0]); - e.item_id = atoi(row[1]); - e.serialnumber = atoi(row[2]); - e.charges = atoi(row[3]); - e.item_cost = atoi(row[4]); - e.slot_id = atoi(row[5]); + e.char_id = static_cast(strtoul(row[0], nullptr, 10)); + e.item_id = static_cast(strtoul(row[1], nullptr, 10)); + e.serialnumber = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(atoi(row[3])); + e.item_cost = static_cast(strtoul(row[4], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[5], nullptr, 10)); return e; } @@ -274,12 +274,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Trader e{}; - e.char_id = atoi(row[0]); - e.item_id = atoi(row[1]); - e.serialnumber = atoi(row[2]); - e.charges = atoi(row[3]); - e.item_cost = atoi(row[4]); - e.slot_id = atoi(row[5]); + e.char_id = static_cast(strtoul(row[0], nullptr, 10)); + e.item_id = static_cast(strtoul(row[1], nullptr, 10)); + e.serialnumber = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(atoi(row[3])); + e.item_cost = static_cast(strtoul(row[4], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[5], nullptr, 10)); all_entries.push_back(e); } @@ -304,12 +304,12 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Trader e{}; - e.char_id = atoi(row[0]); - e.item_id = atoi(row[1]); - e.serialnumber = atoi(row[2]); - e.charges = atoi(row[3]); - e.item_cost = atoi(row[4]); - e.slot_id = atoi(row[5]); + e.char_id = static_cast(strtoul(row[0], nullptr, 10)); + e.item_id = static_cast(strtoul(row[1], nullptr, 10)); + e.serialnumber = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(atoi(row[3])); + e.item_cost = static_cast(strtoul(row[4], nullptr, 10)); + e.slot_id = static_cast(strtoul(row[5], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_tradeskill_recipe_entries_repository.h b/common/repositories/base/base_tradeskill_recipe_entries_repository.h index fe275b41e..77a0f1942 100644 --- a/common/repositories/base/base_tradeskill_recipe_entries_repository.h +++ b/common/repositories/base/base_tradeskill_recipe_entries_repository.h @@ -19,14 +19,14 @@ class BaseTradeskillRecipeEntriesRepository { public: struct TradeskillRecipeEntries { - int id; - int recipe_id; - int item_id; - int successcount; - int failcount; - int componentcount; - int salvagecount; - int iscontainer; + int32_t id; + int32_t recipe_id; + int32_t item_id; + int8_t successcount; + int8_t failcount; + int8_t componentcount; + int8_t salvagecount; + int8_t iscontainer; }; static std::string PrimaryKey() @@ -142,14 +142,14 @@ public: if (results.RowCount() == 1) { TradeskillRecipeEntries e{}; - e.id = atoi(row[0]); - e.recipe_id = atoi(row[1]); - e.item_id = atoi(row[2]); - e.successcount = atoi(row[3]); - e.failcount = atoi(row[4]); - e.componentcount = atoi(row[5]); - e.salvagecount = atoi(row[6]); - e.iscontainer = atoi(row[7]); + e.id = static_cast(atoi(row[0])); + e.recipe_id = static_cast(atoi(row[1])); + e.item_id = static_cast(atoi(row[2])); + e.successcount = static_cast(atoi(row[3])); + e.failcount = static_cast(atoi(row[4])); + e.componentcount = static_cast(atoi(row[5])); + e.salvagecount = static_cast(atoi(row[6])); + e.iscontainer = static_cast(atoi(row[7])); return e; } @@ -289,14 +289,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TradeskillRecipeEntries e{}; - e.id = atoi(row[0]); - e.recipe_id = atoi(row[1]); - e.item_id = atoi(row[2]); - e.successcount = atoi(row[3]); - e.failcount = atoi(row[4]); - e.componentcount = atoi(row[5]); - e.salvagecount = atoi(row[6]); - e.iscontainer = atoi(row[7]); + e.id = static_cast(atoi(row[0])); + e.recipe_id = static_cast(atoi(row[1])); + e.item_id = static_cast(atoi(row[2])); + e.successcount = static_cast(atoi(row[3])); + e.failcount = static_cast(atoi(row[4])); + e.componentcount = static_cast(atoi(row[5])); + e.salvagecount = static_cast(atoi(row[6])); + e.iscontainer = static_cast(atoi(row[7])); all_entries.push_back(e); } @@ -321,14 +321,14 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TradeskillRecipeEntries e{}; - e.id = atoi(row[0]); - e.recipe_id = atoi(row[1]); - e.item_id = atoi(row[2]); - e.successcount = atoi(row[3]); - e.failcount = atoi(row[4]); - e.componentcount = atoi(row[5]); - e.salvagecount = atoi(row[6]); - e.iscontainer = atoi(row[7]); + e.id = static_cast(atoi(row[0])); + e.recipe_id = static_cast(atoi(row[1])); + e.item_id = static_cast(atoi(row[2])); + e.successcount = static_cast(atoi(row[3])); + e.failcount = static_cast(atoi(row[4])); + e.componentcount = static_cast(atoi(row[5])); + e.salvagecount = static_cast(atoi(row[6])); + e.iscontainer = static_cast(atoi(row[7])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_tradeskill_recipe_repository.h b/common/repositories/base/base_tradeskill_recipe_repository.h index 4d9420aa6..2abb76dc3 100644 --- a/common/repositories/base/base_tradeskill_recipe_repository.h +++ b/common/repositories/base/base_tradeskill_recipe_repository.h @@ -19,19 +19,19 @@ class BaseTradeskillRecipeRepository { public: struct TradeskillRecipe { - int id; + int32_t id; std::string name; - int tradeskill; - int skillneeded; - int trivial; - int nofail; - int replace_container; + int16_t tradeskill; + int16_t skillneeded; + int16_t trivial; + int8_t nofail; + int8_t replace_container; std::string notes; - int must_learn; - int quest; - int enabled; - int min_expansion; - int max_expansion; + int8_t must_learn; + int8_t quest; + int8_t enabled; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -170,19 +170,19 @@ public: if (results.RowCount() == 1) { TradeskillRecipe e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.tradeskill = atoi(row[2]); - e.skillneeded = atoi(row[3]); - e.trivial = atoi(row[4]); - e.nofail = atoi(row[5]); - e.replace_container = atoi(row[6]); + e.tradeskill = static_cast(atoi(row[2])); + e.skillneeded = static_cast(atoi(row[3])); + e.trivial = static_cast(atoi(row[4])); + e.nofail = static_cast(atoi(row[5])); + e.replace_container = static_cast(atoi(row[6])); e.notes = row[7] ? row[7] : ""; - e.must_learn = atoi(row[8]); - e.quest = atoi(row[9]); - e.enabled = atoi(row[10]); - e.min_expansion = atoi(row[11]); - e.max_expansion = atoi(row[12]); + e.must_learn = static_cast(atoi(row[8])); + e.quest = static_cast(atoi(row[9])); + e.enabled = static_cast(atoi(row[10])); + e.min_expansion = static_cast(atoi(row[11])); + e.max_expansion = static_cast(atoi(row[12])); e.content_flags = row[13] ? row[13] : ""; e.content_flags_disabled = row[14] ? row[14] : ""; @@ -345,19 +345,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TradeskillRecipe e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.tradeskill = atoi(row[2]); - e.skillneeded = atoi(row[3]); - e.trivial = atoi(row[4]); - e.nofail = atoi(row[5]); - e.replace_container = atoi(row[6]); + e.tradeskill = static_cast(atoi(row[2])); + e.skillneeded = static_cast(atoi(row[3])); + e.trivial = static_cast(atoi(row[4])); + e.nofail = static_cast(atoi(row[5])); + e.replace_container = static_cast(atoi(row[6])); e.notes = row[7] ? row[7] : ""; - e.must_learn = atoi(row[8]); - e.quest = atoi(row[9]); - e.enabled = atoi(row[10]); - e.min_expansion = atoi(row[11]); - e.max_expansion = atoi(row[12]); + e.must_learn = static_cast(atoi(row[8])); + e.quest = static_cast(atoi(row[9])); + e.enabled = static_cast(atoi(row[10])); + e.min_expansion = static_cast(atoi(row[11])); + e.max_expansion = static_cast(atoi(row[12])); e.content_flags = row[13] ? row[13] : ""; e.content_flags_disabled = row[14] ? row[14] : ""; @@ -384,19 +384,19 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TradeskillRecipe e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.name = row[1] ? row[1] : ""; - e.tradeskill = atoi(row[2]); - e.skillneeded = atoi(row[3]); - e.trivial = atoi(row[4]); - e.nofail = atoi(row[5]); - e.replace_container = atoi(row[6]); + e.tradeskill = static_cast(atoi(row[2])); + e.skillneeded = static_cast(atoi(row[3])); + e.trivial = static_cast(atoi(row[4])); + e.nofail = static_cast(atoi(row[5])); + e.replace_container = static_cast(atoi(row[6])); e.notes = row[7] ? row[7] : ""; - e.must_learn = atoi(row[8]); - e.quest = atoi(row[9]); - e.enabled = atoi(row[10]); - e.min_expansion = atoi(row[11]); - e.max_expansion = atoi(row[12]); + e.must_learn = static_cast(atoi(row[8])); + e.quest = static_cast(atoi(row[9])); + e.enabled = static_cast(atoi(row[10])); + e.min_expansion = static_cast(atoi(row[11])); + e.max_expansion = static_cast(atoi(row[12])); e.content_flags = row[13] ? row[13] : ""; e.content_flags_disabled = row[14] ? row[14] : ""; diff --git a/common/repositories/base/base_traps_repository.h b/common/repositories/base/base_traps_repository.h index a156fd792..b40ad30b8 100644 --- a/common/repositories/base/base_traps_repository.h +++ b/common/repositories/base/base_traps_repository.h @@ -19,29 +19,29 @@ class BaseTrapsRepository { public: struct Traps { - int id; + int32_t id; std::string zone; - int version; - int x; - int y; - int z; - int chance; + uint16_t version; + int32_t x; + int32_t y; + int32_t z; + int8_t chance; float maxzdiff; float radius; - int effect; - int effectvalue; - int effectvalue2; + int32_t effect; + int32_t effectvalue; + int32_t effectvalue2; std::string message; - int skill; - int level; - int respawn_time; - int respawn_var; - int triggered_number; - int group; - int despawn_when_triggered; - int undetectable; - int min_expansion; - int max_expansion; + int32_t skill; + uint32_t level; + uint32_t respawn_time; + uint32_t respawn_var; + int8_t triggered_number; + int8_t group; + int8_t despawn_when_triggered; + int8_t undetectable; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; }; @@ -210,29 +210,29 @@ public: if (results.RowCount() == 1) { Traps e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.zone = row[1] ? row[1] : ""; - e.version = atoi(row[2]); - e.x = atoi(row[3]); - e.y = atoi(row[4]); - e.z = atoi(row[5]); - e.chance = atoi(row[6]); - e.maxzdiff = static_cast(atof(row[7])); - e.radius = static_cast(atof(row[8])); - e.effect = atoi(row[9]); - e.effectvalue = atoi(row[10]); - e.effectvalue2 = atoi(row[11]); + e.version = static_cast(strtoul(row[2], nullptr, 10)); + e.x = static_cast(atoi(row[3])); + e.y = static_cast(atoi(row[4])); + e.z = static_cast(atoi(row[5])); + e.chance = static_cast(atoi(row[6])); + e.maxzdiff = strtof(row[7], nullptr); + e.radius = strtof(row[8], nullptr); + e.effect = static_cast(atoi(row[9])); + e.effectvalue = static_cast(atoi(row[10])); + e.effectvalue2 = static_cast(atoi(row[11])); e.message = row[12] ? row[12] : ""; - e.skill = atoi(row[13]); - e.level = atoi(row[14]); - e.respawn_time = atoi(row[15]); - e.respawn_var = atoi(row[16]); - e.triggered_number = atoi(row[17]); - e.group = atoi(row[18]); - e.despawn_when_triggered = atoi(row[19]); - e.undetectable = atoi(row[20]); - e.min_expansion = atoi(row[21]); - e.max_expansion = atoi(row[22]); + e.skill = static_cast(atoi(row[13])); + e.level = static_cast(strtoul(row[14], nullptr, 10)); + e.respawn_time = static_cast(strtoul(row[15], nullptr, 10)); + e.respawn_var = static_cast(strtoul(row[16], nullptr, 10)); + e.triggered_number = static_cast(atoi(row[17])); + e.group = static_cast(atoi(row[18])); + e.despawn_when_triggered = static_cast(atoi(row[19])); + e.undetectable = static_cast(atoi(row[20])); + e.min_expansion = static_cast(atoi(row[21])); + e.max_expansion = static_cast(atoi(row[22])); e.content_flags = row[23] ? row[23] : ""; e.content_flags_disabled = row[24] ? row[24] : ""; @@ -425,29 +425,29 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Traps e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.zone = row[1] ? row[1] : ""; - e.version = atoi(row[2]); - e.x = atoi(row[3]); - e.y = atoi(row[4]); - e.z = atoi(row[5]); - e.chance = atoi(row[6]); - e.maxzdiff = static_cast(atof(row[7])); - e.radius = static_cast(atof(row[8])); - e.effect = atoi(row[9]); - e.effectvalue = atoi(row[10]); - e.effectvalue2 = atoi(row[11]); + e.version = static_cast(strtoul(row[2], nullptr, 10)); + e.x = static_cast(atoi(row[3])); + e.y = static_cast(atoi(row[4])); + e.z = static_cast(atoi(row[5])); + e.chance = static_cast(atoi(row[6])); + e.maxzdiff = strtof(row[7], nullptr); + e.radius = strtof(row[8], nullptr); + e.effect = static_cast(atoi(row[9])); + e.effectvalue = static_cast(atoi(row[10])); + e.effectvalue2 = static_cast(atoi(row[11])); e.message = row[12] ? row[12] : ""; - e.skill = atoi(row[13]); - e.level = atoi(row[14]); - e.respawn_time = atoi(row[15]); - e.respawn_var = atoi(row[16]); - e.triggered_number = atoi(row[17]); - e.group = atoi(row[18]); - e.despawn_when_triggered = atoi(row[19]); - e.undetectable = atoi(row[20]); - e.min_expansion = atoi(row[21]); - e.max_expansion = atoi(row[22]); + e.skill = static_cast(atoi(row[13])); + e.level = static_cast(strtoul(row[14], nullptr, 10)); + e.respawn_time = static_cast(strtoul(row[15], nullptr, 10)); + e.respawn_var = static_cast(strtoul(row[16], nullptr, 10)); + e.triggered_number = static_cast(atoi(row[17])); + e.group = static_cast(atoi(row[18])); + e.despawn_when_triggered = static_cast(atoi(row[19])); + e.undetectable = static_cast(atoi(row[20])); + e.min_expansion = static_cast(atoi(row[21])); + e.max_expansion = static_cast(atoi(row[22])); e.content_flags = row[23] ? row[23] : ""; e.content_flags_disabled = row[24] ? row[24] : ""; @@ -474,29 +474,29 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Traps e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.zone = row[1] ? row[1] : ""; - e.version = atoi(row[2]); - e.x = atoi(row[3]); - e.y = atoi(row[4]); - e.z = atoi(row[5]); - e.chance = atoi(row[6]); - e.maxzdiff = static_cast(atof(row[7])); - e.radius = static_cast(atof(row[8])); - e.effect = atoi(row[9]); - e.effectvalue = atoi(row[10]); - e.effectvalue2 = atoi(row[11]); + e.version = static_cast(strtoul(row[2], nullptr, 10)); + e.x = static_cast(atoi(row[3])); + e.y = static_cast(atoi(row[4])); + e.z = static_cast(atoi(row[5])); + e.chance = static_cast(atoi(row[6])); + e.maxzdiff = strtof(row[7], nullptr); + e.radius = strtof(row[8], nullptr); + e.effect = static_cast(atoi(row[9])); + e.effectvalue = static_cast(atoi(row[10])); + e.effectvalue2 = static_cast(atoi(row[11])); e.message = row[12] ? row[12] : ""; - e.skill = atoi(row[13]); - e.level = atoi(row[14]); - e.respawn_time = atoi(row[15]); - e.respawn_var = atoi(row[16]); - e.triggered_number = atoi(row[17]); - e.group = atoi(row[18]); - e.despawn_when_triggered = atoi(row[19]); - e.undetectable = atoi(row[20]); - e.min_expansion = atoi(row[21]); - e.max_expansion = atoi(row[22]); + e.skill = static_cast(atoi(row[13])); + e.level = static_cast(strtoul(row[14], nullptr, 10)); + e.respawn_time = static_cast(strtoul(row[15], nullptr, 10)); + e.respawn_var = static_cast(strtoul(row[16], nullptr, 10)); + e.triggered_number = static_cast(atoi(row[17])); + e.group = static_cast(atoi(row[18])); + e.despawn_when_triggered = static_cast(atoi(row[19])); + e.undetectable = static_cast(atoi(row[20])); + e.min_expansion = static_cast(atoi(row[21])); + e.max_expansion = static_cast(atoi(row[22])); e.content_flags = row[23] ? row[23] : ""; e.content_flags_disabled = row[24] ? row[24] : ""; diff --git a/common/repositories/base/base_tribute_levels_repository.h b/common/repositories/base/base_tribute_levels_repository.h index a115c5d84..52ab42899 100644 --- a/common/repositories/base/base_tribute_levels_repository.h +++ b/common/repositories/base/base_tribute_levels_repository.h @@ -19,10 +19,10 @@ class BaseTributeLevelsRepository { public: struct TributeLevels { - int tribute_id; - int level; - int cost; - int item_id; + uint32_t tribute_id; + uint32_t level; + uint32_t cost; + uint32_t item_id; }; static std::string PrimaryKey() @@ -126,10 +126,10 @@ public: if (results.RowCount() == 1) { TributeLevels e{}; - e.tribute_id = atoi(row[0]); - e.level = atoi(row[1]); - e.cost = atoi(row[2]); - e.item_id = atoi(row[3]); + e.tribute_id = static_cast(strtoul(row[0], nullptr, 10)); + e.level = static_cast(strtoul(row[1], nullptr, 10)); + e.cost = static_cast(strtoul(row[2], nullptr, 10)); + e.item_id = static_cast(strtoul(row[3], nullptr, 10)); return e; } @@ -258,10 +258,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TributeLevels e{}; - e.tribute_id = atoi(row[0]); - e.level = atoi(row[1]); - e.cost = atoi(row[2]); - e.item_id = atoi(row[3]); + e.tribute_id = static_cast(strtoul(row[0], nullptr, 10)); + e.level = static_cast(strtoul(row[1], nullptr, 10)); + e.cost = static_cast(strtoul(row[2], nullptr, 10)); + e.item_id = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } @@ -286,10 +286,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { TributeLevels e{}; - e.tribute_id = atoi(row[0]); - e.level = atoi(row[1]); - e.cost = atoi(row[2]); - e.item_id = atoi(row[3]); + e.tribute_id = static_cast(strtoul(row[0], nullptr, 10)); + e.level = static_cast(strtoul(row[1], nullptr, 10)); + e.cost = static_cast(strtoul(row[2], nullptr, 10)); + e.item_id = static_cast(strtoul(row[3], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_tributes_repository.h b/common/repositories/base/base_tributes_repository.h index bddf9c63a..81d9e6489 100644 --- a/common/repositories/base/base_tributes_repository.h +++ b/common/repositories/base/base_tributes_repository.h @@ -19,11 +19,11 @@ class BaseTributesRepository { public: struct Tributes { - int id; - int unknown; + uint32_t id; + uint32_t unknown; std::string name; std::string descr; - int isguild; + int8_t isguild; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { Tributes e{}; - e.id = atoi(row[0]); - e.unknown = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.unknown = static_cast(strtoul(row[1], nullptr, 10)); e.name = row[2] ? row[2] : ""; e.descr = row[3] ? row[3] : ""; - e.isguild = atoi(row[4]); + e.isguild = static_cast(atoi(row[4])); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Tributes e{}; - e.id = atoi(row[0]); - e.unknown = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.unknown = static_cast(strtoul(row[1], nullptr, 10)); e.name = row[2] ? row[2] : ""; e.descr = row[3] ? row[3] : ""; - e.isguild = atoi(row[4]); + e.isguild = static_cast(atoi(row[4])); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { Tributes e{}; - e.id = atoi(row[0]); - e.unknown = atoi(row[1]); + e.id = static_cast(strtoul(row[0], nullptr, 10)); + e.unknown = static_cast(strtoul(row[1], nullptr, 10)); e.name = row[2] ? row[2] : ""; e.descr = row[3] ? row[3] : ""; - e.isguild = atoi(row[4]); + e.isguild = static_cast(atoi(row[4])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_veteran_reward_templates_repository.h b/common/repositories/base/base_veteran_reward_templates_repository.h index 03db670e2..c3233a3d5 100644 --- a/common/repositories/base/base_veteran_reward_templates_repository.h +++ b/common/repositories/base/base_veteran_reward_templates_repository.h @@ -19,11 +19,11 @@ class BaseVeteranRewardTemplatesRepository { public: struct VeteranRewardTemplates { - int claim_id; + uint32_t claim_id; std::string name; - int item_id; - int charges; - int reward_slot; + uint32_t item_id; + uint16_t charges; + uint8_t reward_slot; }; static std::string PrimaryKey() @@ -130,11 +130,11 @@ public: if (results.RowCount() == 1) { VeteranRewardTemplates e{}; - e.claim_id = atoi(row[0]); + e.claim_id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.item_id = atoi(row[2]); - e.charges = atoi(row[3]); - e.reward_slot = atoi(row[4]); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.reward_slot = static_cast(strtoul(row[4], nullptr, 10)); return e; } @@ -266,11 +266,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { VeteranRewardTemplates e{}; - e.claim_id = atoi(row[0]); + e.claim_id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.item_id = atoi(row[2]); - e.charges = atoi(row[3]); - e.reward_slot = atoi(row[4]); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.reward_slot = static_cast(strtoul(row[4], nullptr, 10)); all_entries.push_back(e); } @@ -295,11 +295,11 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { VeteranRewardTemplates e{}; - e.claim_id = atoi(row[0]); + e.claim_id = static_cast(strtoul(row[0], nullptr, 10)); e.name = row[1] ? row[1] : ""; - e.item_id = atoi(row[2]); - e.charges = atoi(row[3]); - e.reward_slot = atoi(row[4]); + e.item_id = static_cast(strtoul(row[2], nullptr, 10)); + e.charges = static_cast(strtoul(row[3], nullptr, 10)); + e.reward_slot = static_cast(strtoul(row[4], nullptr, 10)); all_entries.push_back(e); } diff --git a/common/repositories/base/base_zone_points_repository.h b/common/repositories/base/base_zone_points_repository.h index b227ce562..286159d0c 100644 --- a/common/repositories/base/base_zone_points_repository.h +++ b/common/repositories/base/base_zone_points_repository.h @@ -19,10 +19,10 @@ class BaseZonePointsRepository { public: struct ZonePoints { - int id; + int32_t id; std::string zone; - int version; - int number; + int32_t version; + uint16_t number; float y; float x; float z; @@ -31,18 +31,18 @@ public: float target_x; float target_z; float target_heading; - int zoneinst; - int target_zone_id; - int target_instance; + uint16_t zoneinst; + uint32_t target_zone_id; + uint32_t target_instance; float buffer; - int client_version_mask; - int min_expansion; - int max_expansion; + uint32_t client_version_mask; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; - int is_virtual; - int height; - int width; + int8_t is_virtual; + int32_t height; + int32_t width; }; static std::string PrimaryKey() @@ -206,30 +206,30 @@ public: if (results.RowCount() == 1) { ZonePoints e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.zone = row[1] ? row[1] : ""; - e.version = atoi(row[2]); - e.number = atoi(row[3]); - e.y = static_cast(atof(row[4])); - e.x = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); - e.target_y = static_cast(atof(row[8])); - e.target_x = static_cast(atof(row[9])); - e.target_z = static_cast(atof(row[10])); - e.target_heading = static_cast(atof(row[11])); - e.zoneinst = atoi(row[12]); - e.target_zone_id = atoi(row[13]); - e.target_instance = atoi(row[14]); - e.buffer = static_cast(atof(row[15])); - e.client_version_mask = atoi(row[16]); - e.min_expansion = atoi(row[17]); - e.max_expansion = atoi(row[18]); + e.version = static_cast(atoi(row[2])); + e.number = static_cast(strtoul(row[3], nullptr, 10)); + e.y = strtof(row[4], nullptr); + e.x = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); + e.target_y = strtof(row[8], nullptr); + e.target_x = strtof(row[9], nullptr); + e.target_z = strtof(row[10], nullptr); + e.target_heading = strtof(row[11], nullptr); + e.zoneinst = static_cast(strtoul(row[12], nullptr, 10)); + e.target_zone_id = static_cast(strtoul(row[13], nullptr, 10)); + e.target_instance = static_cast(strtoul(row[14], nullptr, 10)); + e.buffer = strtof(row[15], nullptr); + e.client_version_mask = static_cast(strtoul(row[16], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[17])); + e.max_expansion = static_cast(atoi(row[18])); e.content_flags = row[19] ? row[19] : ""; e.content_flags_disabled = row[20] ? row[20] : ""; - e.is_virtual = atoi(row[21]); - e.height = atoi(row[22]); - e.width = atoi(row[23]); + e.is_virtual = static_cast(atoi(row[21])); + e.height = static_cast(atoi(row[22])); + e.width = static_cast(atoi(row[23])); return e; } @@ -417,30 +417,30 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ZonePoints e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.zone = row[1] ? row[1] : ""; - e.version = atoi(row[2]); - e.number = atoi(row[3]); - e.y = static_cast(atof(row[4])); - e.x = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); - e.target_y = static_cast(atof(row[8])); - e.target_x = static_cast(atof(row[9])); - e.target_z = static_cast(atof(row[10])); - e.target_heading = static_cast(atof(row[11])); - e.zoneinst = atoi(row[12]); - e.target_zone_id = atoi(row[13]); - e.target_instance = atoi(row[14]); - e.buffer = static_cast(atof(row[15])); - e.client_version_mask = atoi(row[16]); - e.min_expansion = atoi(row[17]); - e.max_expansion = atoi(row[18]); + e.version = static_cast(atoi(row[2])); + e.number = static_cast(strtoul(row[3], nullptr, 10)); + e.y = strtof(row[4], nullptr); + e.x = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); + e.target_y = strtof(row[8], nullptr); + e.target_x = strtof(row[9], nullptr); + e.target_z = strtof(row[10], nullptr); + e.target_heading = strtof(row[11], nullptr); + e.zoneinst = static_cast(strtoul(row[12], nullptr, 10)); + e.target_zone_id = static_cast(strtoul(row[13], nullptr, 10)); + e.target_instance = static_cast(strtoul(row[14], nullptr, 10)); + e.buffer = strtof(row[15], nullptr); + e.client_version_mask = static_cast(strtoul(row[16], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[17])); + e.max_expansion = static_cast(atoi(row[18])); e.content_flags = row[19] ? row[19] : ""; e.content_flags_disabled = row[20] ? row[20] : ""; - e.is_virtual = atoi(row[21]); - e.height = atoi(row[22]); - e.width = atoi(row[23]); + e.is_virtual = static_cast(atoi(row[21])); + e.height = static_cast(atoi(row[22])); + e.width = static_cast(atoi(row[23])); all_entries.push_back(e); } @@ -465,30 +465,30 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { ZonePoints e{}; - e.id = atoi(row[0]); + e.id = static_cast(atoi(row[0])); e.zone = row[1] ? row[1] : ""; - e.version = atoi(row[2]); - e.number = atoi(row[3]); - e.y = static_cast(atof(row[4])); - e.x = static_cast(atof(row[5])); - e.z = static_cast(atof(row[6])); - e.heading = static_cast(atof(row[7])); - e.target_y = static_cast(atof(row[8])); - e.target_x = static_cast(atof(row[9])); - e.target_z = static_cast(atof(row[10])); - e.target_heading = static_cast(atof(row[11])); - e.zoneinst = atoi(row[12]); - e.target_zone_id = atoi(row[13]); - e.target_instance = atoi(row[14]); - e.buffer = static_cast(atof(row[15])); - e.client_version_mask = atoi(row[16]); - e.min_expansion = atoi(row[17]); - e.max_expansion = atoi(row[18]); + e.version = static_cast(atoi(row[2])); + e.number = static_cast(strtoul(row[3], nullptr, 10)); + e.y = strtof(row[4], nullptr); + e.x = strtof(row[5], nullptr); + e.z = strtof(row[6], nullptr); + e.heading = strtof(row[7], nullptr); + e.target_y = strtof(row[8], nullptr); + e.target_x = strtof(row[9], nullptr); + e.target_z = strtof(row[10], nullptr); + e.target_heading = strtof(row[11], nullptr); + e.zoneinst = static_cast(strtoul(row[12], nullptr, 10)); + e.target_zone_id = static_cast(strtoul(row[13], nullptr, 10)); + e.target_instance = static_cast(strtoul(row[14], nullptr, 10)); + e.buffer = strtof(row[15], nullptr); + e.client_version_mask = static_cast(strtoul(row[16], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[17])); + e.max_expansion = static_cast(atoi(row[18])); e.content_flags = row[19] ? row[19] : ""; e.content_flags_disabled = row[20] ? row[20] : ""; - e.is_virtual = atoi(row[21]); - e.height = atoi(row[22]); - e.width = atoi(row[23]); + e.is_virtual = static_cast(atoi(row[21])); + e.height = static_cast(atoi(row[22])); + e.width = static_cast(atoi(row[23])); all_entries.push_back(e); } diff --git a/common/repositories/base/base_zone_repository.h b/common/repositories/base/base_zone_repository.h index 75c16594b..53a14320d 100644 --- a/common/repositories/base/base_zone_repository.h +++ b/common/repositories/base/base_zone_repository.h @@ -20,7 +20,7 @@ class BaseZoneRepository { public: struct Zone { std::string short_name; - int id; + int32_t id; std::string file_name; std::string long_name; std::string map_file_name; @@ -29,91 +29,91 @@ public: float safe_z; float safe_heading; float graveyard_id; - int min_level; - int min_status; - int zoneidnumber; - int version; - int timezone; - int maxclients; - int ruleset; + uint8_t min_level; + uint8_t min_status; + int32_t zoneidnumber; + uint8_t version; + int32_t timezone; + int32_t maxclients; + uint32_t ruleset; std::string note; float underworld; float minclip; float maxclip; float fog_minclip; float fog_maxclip; - int fog_blue; - int fog_red; - int fog_green; - int sky; - int ztype; + uint8_t fog_blue; + uint8_t fog_red; + uint8_t fog_green; + uint8_t sky; + uint8_t ztype; float zone_exp_multiplier; float walkspeed; - int time_type; - int fog_red1; - int fog_green1; - int fog_blue1; + uint8_t time_type; + uint8_t fog_red1; + uint8_t fog_green1; + uint8_t fog_blue1; float fog_minclip1; float fog_maxclip1; - int fog_red2; - int fog_green2; - int fog_blue2; + uint8_t fog_red2; + uint8_t fog_green2; + uint8_t fog_blue2; float fog_minclip2; float fog_maxclip2; - int fog_red3; - int fog_green3; - int fog_blue3; + uint8_t fog_red3; + uint8_t fog_green3; + uint8_t fog_blue3; float fog_minclip3; float fog_maxclip3; - int fog_red4; - int fog_green4; - int fog_blue4; + uint8_t fog_red4; + uint8_t fog_green4; + uint8_t fog_blue4; float fog_minclip4; float fog_maxclip4; float fog_density; std::string flag_needed; - int canbind; - int cancombat; - int canlevitate; - int castoutdoor; - int hotzone; - int insttype; - int64 shutdowndelay; - int peqzone; - int suspendbuffs; - int rain_chance1; - int rain_chance2; - int rain_chance3; - int rain_chance4; - int rain_duration1; - int rain_duration2; - int rain_duration3; - int rain_duration4; - int snow_chance1; - int snow_chance2; - int snow_chance3; - int snow_chance4; - int snow_duration1; - int snow_duration2; - int snow_duration3; - int snow_duration4; + int8_t canbind; + int8_t cancombat; + int8_t canlevitate; + int8_t castoutdoor; + uint8_t hotzone; + uint8_t insttype; + uint64_t shutdowndelay; + int8_t peqzone; + uint8_t suspendbuffs; + int32_t rain_chance1; + int32_t rain_chance2; + int32_t rain_chance3; + int32_t rain_chance4; + int32_t rain_duration1; + int32_t rain_duration2; + int32_t rain_duration3; + int32_t rain_duration4; + int32_t snow_chance1; + int32_t snow_chance2; + int32_t snow_chance3; + int32_t snow_chance4; + int32_t snow_duration1; + int32_t snow_duration2; + int32_t snow_duration3; + int32_t snow_duration4; float gravity; - int type; - int skylock; - int fast_regen_hp; - int fast_regen_mana; - int fast_regen_endurance; - int npc_max_aggro_dist; - int max_movement_update_range; - int min_expansion; - int max_expansion; + int32_t type; + int8_t skylock; + int32_t fast_regen_hp; + int32_t fast_regen_mana; + int32_t fast_regen_endurance; + int32_t npc_max_aggro_dist; + uint32_t max_movement_update_range; + int8_t min_expansion; + int8_t max_expansion; std::string content_flags; std::string content_flags_disabled; - int underworld_teleport_index; - int lava_damage; - int min_lava_damage; - int expansion; - int bypass_expansion_check; + int32_t underworld_teleport_index; + int32_t lava_damage; + int32_t min_lava_damage; + int8_t expansion; + int8_t bypass_expansion_check; }; static std::string PrimaryKey() @@ -491,100 +491,100 @@ public: Zone e{}; e.short_name = row[0] ? row[0] : ""; - e.id = atoi(row[1]); + e.id = static_cast(atoi(row[1])); e.file_name = row[2] ? row[2] : ""; e.long_name = row[3] ? row[3] : ""; e.map_file_name = row[4] ? row[4] : ""; - e.safe_x = static_cast(atof(row[5])); - e.safe_y = static_cast(atof(row[6])); - e.safe_z = static_cast(atof(row[7])); - e.safe_heading = static_cast(atof(row[8])); - e.graveyard_id = static_cast(atof(row[9])); - e.min_level = atoi(row[10]); - e.min_status = atoi(row[11]); - e.zoneidnumber = atoi(row[12]); - e.version = atoi(row[13]); - e.timezone = atoi(row[14]); - e.maxclients = atoi(row[15]); - e.ruleset = atoi(row[16]); + e.safe_x = strtof(row[5], nullptr); + e.safe_y = strtof(row[6], nullptr); + e.safe_z = strtof(row[7], nullptr); + e.safe_heading = strtof(row[8], nullptr); + e.graveyard_id = strtof(row[9], nullptr); + e.min_level = static_cast(strtoul(row[10], nullptr, 10)); + e.min_status = static_cast(strtoul(row[11], nullptr, 10)); + e.zoneidnumber = static_cast(atoi(row[12])); + e.version = static_cast(strtoul(row[13], nullptr, 10)); + e.timezone = static_cast(atoi(row[14])); + e.maxclients = static_cast(atoi(row[15])); + e.ruleset = static_cast(strtoul(row[16], nullptr, 10)); e.note = row[17] ? row[17] : ""; - e.underworld = static_cast(atof(row[18])); - e.minclip = static_cast(atof(row[19])); - e.maxclip = static_cast(atof(row[20])); - e.fog_minclip = static_cast(atof(row[21])); - e.fog_maxclip = static_cast(atof(row[22])); - e.fog_blue = atoi(row[23]); - e.fog_red = atoi(row[24]); - e.fog_green = atoi(row[25]); - e.sky = atoi(row[26]); - e.ztype = atoi(row[27]); - e.zone_exp_multiplier = static_cast(atof(row[28])); - e.walkspeed = static_cast(atof(row[29])); - e.time_type = atoi(row[30]); - e.fog_red1 = atoi(row[31]); - e.fog_green1 = atoi(row[32]); - e.fog_blue1 = atoi(row[33]); - e.fog_minclip1 = static_cast(atof(row[34])); - e.fog_maxclip1 = static_cast(atof(row[35])); - e.fog_red2 = atoi(row[36]); - e.fog_green2 = atoi(row[37]); - e.fog_blue2 = atoi(row[38]); - e.fog_minclip2 = static_cast(atof(row[39])); - e.fog_maxclip2 = static_cast(atof(row[40])); - e.fog_red3 = atoi(row[41]); - e.fog_green3 = atoi(row[42]); - e.fog_blue3 = atoi(row[43]); - e.fog_minclip3 = static_cast(atof(row[44])); - e.fog_maxclip3 = static_cast(atof(row[45])); - e.fog_red4 = atoi(row[46]); - e.fog_green4 = atoi(row[47]); - e.fog_blue4 = atoi(row[48]); - e.fog_minclip4 = static_cast(atof(row[49])); - e.fog_maxclip4 = static_cast(atof(row[50])); - e.fog_density = static_cast(atof(row[51])); + e.underworld = strtof(row[18], nullptr); + e.minclip = strtof(row[19], nullptr); + e.maxclip = strtof(row[20], nullptr); + e.fog_minclip = strtof(row[21], nullptr); + e.fog_maxclip = strtof(row[22], nullptr); + e.fog_blue = static_cast(strtoul(row[23], nullptr, 10)); + e.fog_red = static_cast(strtoul(row[24], nullptr, 10)); + e.fog_green = static_cast(strtoul(row[25], nullptr, 10)); + e.sky = static_cast(strtoul(row[26], nullptr, 10)); + e.ztype = static_cast(strtoul(row[27], nullptr, 10)); + e.zone_exp_multiplier = strtof(row[28], nullptr); + e.walkspeed = strtof(row[29], nullptr); + e.time_type = static_cast(strtoul(row[30], nullptr, 10)); + e.fog_red1 = static_cast(strtoul(row[31], nullptr, 10)); + e.fog_green1 = static_cast(strtoul(row[32], nullptr, 10)); + e.fog_blue1 = static_cast(strtoul(row[33], nullptr, 10)); + e.fog_minclip1 = strtof(row[34], nullptr); + e.fog_maxclip1 = strtof(row[35], nullptr); + e.fog_red2 = static_cast(strtoul(row[36], nullptr, 10)); + e.fog_green2 = static_cast(strtoul(row[37], nullptr, 10)); + e.fog_blue2 = static_cast(strtoul(row[38], nullptr, 10)); + e.fog_minclip2 = strtof(row[39], nullptr); + e.fog_maxclip2 = strtof(row[40], nullptr); + e.fog_red3 = static_cast(strtoul(row[41], nullptr, 10)); + e.fog_green3 = static_cast(strtoul(row[42], nullptr, 10)); + e.fog_blue3 = static_cast(strtoul(row[43], nullptr, 10)); + e.fog_minclip3 = strtof(row[44], nullptr); + e.fog_maxclip3 = strtof(row[45], nullptr); + e.fog_red4 = static_cast(strtoul(row[46], nullptr, 10)); + e.fog_green4 = static_cast(strtoul(row[47], nullptr, 10)); + e.fog_blue4 = static_cast(strtoul(row[48], nullptr, 10)); + e.fog_minclip4 = strtof(row[49], nullptr); + e.fog_maxclip4 = strtof(row[50], nullptr); + e.fog_density = strtof(row[51], nullptr); e.flag_needed = row[52] ? row[52] : ""; - e.canbind = atoi(row[53]); - e.cancombat = atoi(row[54]); - e.canlevitate = atoi(row[55]); - e.castoutdoor = atoi(row[56]); - e.hotzone = atoi(row[57]); - e.insttype = atoi(row[58]); - e.shutdowndelay = strtoll(row[59], nullptr, 10); - e.peqzone = atoi(row[60]); - e.suspendbuffs = atoi(row[61]); - e.rain_chance1 = atoi(row[62]); - e.rain_chance2 = atoi(row[63]); - e.rain_chance3 = atoi(row[64]); - e.rain_chance4 = atoi(row[65]); - e.rain_duration1 = atoi(row[66]); - e.rain_duration2 = atoi(row[67]); - e.rain_duration3 = atoi(row[68]); - e.rain_duration4 = atoi(row[69]); - e.snow_chance1 = atoi(row[70]); - e.snow_chance2 = atoi(row[71]); - e.snow_chance3 = atoi(row[72]); - e.snow_chance4 = atoi(row[73]); - e.snow_duration1 = atoi(row[74]); - e.snow_duration2 = atoi(row[75]); - e.snow_duration3 = atoi(row[76]); - e.snow_duration4 = atoi(row[77]); - e.gravity = static_cast(atof(row[78])); - e.type = atoi(row[79]); - e.skylock = atoi(row[80]); - e.fast_regen_hp = atoi(row[81]); - e.fast_regen_mana = atoi(row[82]); - e.fast_regen_endurance = atoi(row[83]); - e.npc_max_aggro_dist = atoi(row[84]); - e.max_movement_update_range = atoi(row[85]); - e.min_expansion = atoi(row[86]); - e.max_expansion = atoi(row[87]); + e.canbind = static_cast(atoi(row[53])); + e.cancombat = static_cast(atoi(row[54])); + e.canlevitate = static_cast(atoi(row[55])); + e.castoutdoor = static_cast(atoi(row[56])); + e.hotzone = static_cast(strtoul(row[57], nullptr, 10)); + e.insttype = static_cast(strtoul(row[58], nullptr, 10)); + e.shutdowndelay = strtoull(row[59], nullptr, 10); + e.peqzone = static_cast(atoi(row[60])); + e.suspendbuffs = static_cast(strtoul(row[61], nullptr, 10)); + e.rain_chance1 = static_cast(atoi(row[62])); + e.rain_chance2 = static_cast(atoi(row[63])); + e.rain_chance3 = static_cast(atoi(row[64])); + e.rain_chance4 = static_cast(atoi(row[65])); + e.rain_duration1 = static_cast(atoi(row[66])); + e.rain_duration2 = static_cast(atoi(row[67])); + e.rain_duration3 = static_cast(atoi(row[68])); + e.rain_duration4 = static_cast(atoi(row[69])); + e.snow_chance1 = static_cast(atoi(row[70])); + e.snow_chance2 = static_cast(atoi(row[71])); + e.snow_chance3 = static_cast(atoi(row[72])); + e.snow_chance4 = static_cast(atoi(row[73])); + e.snow_duration1 = static_cast(atoi(row[74])); + e.snow_duration2 = static_cast(atoi(row[75])); + e.snow_duration3 = static_cast(atoi(row[76])); + e.snow_duration4 = static_cast(atoi(row[77])); + e.gravity = strtof(row[78], nullptr); + e.type = static_cast(atoi(row[79])); + e.skylock = static_cast(atoi(row[80])); + e.fast_regen_hp = static_cast(atoi(row[81])); + e.fast_regen_mana = static_cast(atoi(row[82])); + e.fast_regen_endurance = static_cast(atoi(row[83])); + e.npc_max_aggro_dist = static_cast(atoi(row[84])); + e.max_movement_update_range = static_cast(strtoul(row[85], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[86])); + e.max_expansion = static_cast(atoi(row[87])); e.content_flags = row[88] ? row[88] : ""; e.content_flags_disabled = row[89] ? row[89] : ""; - e.underworld_teleport_index = atoi(row[90]); - e.lava_damage = atoi(row[91]); - e.min_lava_damage = atoi(row[92]); - e.expansion = atoi(row[93]); - e.bypass_expansion_check = atoi(row[94]); + e.underworld_teleport_index = static_cast(atoi(row[90])); + e.lava_damage = static_cast(atoi(row[91])); + e.min_lava_damage = static_cast(atoi(row[92])); + e.expansion = static_cast(atoi(row[93])); + e.bypass_expansion_check = static_cast(atoi(row[94])); return e; } @@ -986,100 +986,100 @@ public: Zone e{}; e.short_name = row[0] ? row[0] : ""; - e.id = atoi(row[1]); + e.id = static_cast(atoi(row[1])); e.file_name = row[2] ? row[2] : ""; e.long_name = row[3] ? row[3] : ""; e.map_file_name = row[4] ? row[4] : ""; - e.safe_x = static_cast(atof(row[5])); - e.safe_y = static_cast(atof(row[6])); - e.safe_z = static_cast(atof(row[7])); - e.safe_heading = static_cast(atof(row[8])); - e.graveyard_id = static_cast(atof(row[9])); - e.min_level = atoi(row[10]); - e.min_status = atoi(row[11]); - e.zoneidnumber = atoi(row[12]); - e.version = atoi(row[13]); - e.timezone = atoi(row[14]); - e.maxclients = atoi(row[15]); - e.ruleset = atoi(row[16]); + e.safe_x = strtof(row[5], nullptr); + e.safe_y = strtof(row[6], nullptr); + e.safe_z = strtof(row[7], nullptr); + e.safe_heading = strtof(row[8], nullptr); + e.graveyard_id = strtof(row[9], nullptr); + e.min_level = static_cast(strtoul(row[10], nullptr, 10)); + e.min_status = static_cast(strtoul(row[11], nullptr, 10)); + e.zoneidnumber = static_cast(atoi(row[12])); + e.version = static_cast(strtoul(row[13], nullptr, 10)); + e.timezone = static_cast(atoi(row[14])); + e.maxclients = static_cast(atoi(row[15])); + e.ruleset = static_cast(strtoul(row[16], nullptr, 10)); e.note = row[17] ? row[17] : ""; - e.underworld = static_cast(atof(row[18])); - e.minclip = static_cast(atof(row[19])); - e.maxclip = static_cast(atof(row[20])); - e.fog_minclip = static_cast(atof(row[21])); - e.fog_maxclip = static_cast(atof(row[22])); - e.fog_blue = atoi(row[23]); - e.fog_red = atoi(row[24]); - e.fog_green = atoi(row[25]); - e.sky = atoi(row[26]); - e.ztype = atoi(row[27]); - e.zone_exp_multiplier = static_cast(atof(row[28])); - e.walkspeed = static_cast(atof(row[29])); - e.time_type = atoi(row[30]); - e.fog_red1 = atoi(row[31]); - e.fog_green1 = atoi(row[32]); - e.fog_blue1 = atoi(row[33]); - e.fog_minclip1 = static_cast(atof(row[34])); - e.fog_maxclip1 = static_cast(atof(row[35])); - e.fog_red2 = atoi(row[36]); - e.fog_green2 = atoi(row[37]); - e.fog_blue2 = atoi(row[38]); - e.fog_minclip2 = static_cast(atof(row[39])); - e.fog_maxclip2 = static_cast(atof(row[40])); - e.fog_red3 = atoi(row[41]); - e.fog_green3 = atoi(row[42]); - e.fog_blue3 = atoi(row[43]); - e.fog_minclip3 = static_cast(atof(row[44])); - e.fog_maxclip3 = static_cast(atof(row[45])); - e.fog_red4 = atoi(row[46]); - e.fog_green4 = atoi(row[47]); - e.fog_blue4 = atoi(row[48]); - e.fog_minclip4 = static_cast(atof(row[49])); - e.fog_maxclip4 = static_cast(atof(row[50])); - e.fog_density = static_cast(atof(row[51])); + e.underworld = strtof(row[18], nullptr); + e.minclip = strtof(row[19], nullptr); + e.maxclip = strtof(row[20], nullptr); + e.fog_minclip = strtof(row[21], nullptr); + e.fog_maxclip = strtof(row[22], nullptr); + e.fog_blue = static_cast(strtoul(row[23], nullptr, 10)); + e.fog_red = static_cast(strtoul(row[24], nullptr, 10)); + e.fog_green = static_cast(strtoul(row[25], nullptr, 10)); + e.sky = static_cast(strtoul(row[26], nullptr, 10)); + e.ztype = static_cast(strtoul(row[27], nullptr, 10)); + e.zone_exp_multiplier = strtof(row[28], nullptr); + e.walkspeed = strtof(row[29], nullptr); + e.time_type = static_cast(strtoul(row[30], nullptr, 10)); + e.fog_red1 = static_cast(strtoul(row[31], nullptr, 10)); + e.fog_green1 = static_cast(strtoul(row[32], nullptr, 10)); + e.fog_blue1 = static_cast(strtoul(row[33], nullptr, 10)); + e.fog_minclip1 = strtof(row[34], nullptr); + e.fog_maxclip1 = strtof(row[35], nullptr); + e.fog_red2 = static_cast(strtoul(row[36], nullptr, 10)); + e.fog_green2 = static_cast(strtoul(row[37], nullptr, 10)); + e.fog_blue2 = static_cast(strtoul(row[38], nullptr, 10)); + e.fog_minclip2 = strtof(row[39], nullptr); + e.fog_maxclip2 = strtof(row[40], nullptr); + e.fog_red3 = static_cast(strtoul(row[41], nullptr, 10)); + e.fog_green3 = static_cast(strtoul(row[42], nullptr, 10)); + e.fog_blue3 = static_cast(strtoul(row[43], nullptr, 10)); + e.fog_minclip3 = strtof(row[44], nullptr); + e.fog_maxclip3 = strtof(row[45], nullptr); + e.fog_red4 = static_cast(strtoul(row[46], nullptr, 10)); + e.fog_green4 = static_cast(strtoul(row[47], nullptr, 10)); + e.fog_blue4 = static_cast(strtoul(row[48], nullptr, 10)); + e.fog_minclip4 = strtof(row[49], nullptr); + e.fog_maxclip4 = strtof(row[50], nullptr); + e.fog_density = strtof(row[51], nullptr); e.flag_needed = row[52] ? row[52] : ""; - e.canbind = atoi(row[53]); - e.cancombat = atoi(row[54]); - e.canlevitate = atoi(row[55]); - e.castoutdoor = atoi(row[56]); - e.hotzone = atoi(row[57]); - e.insttype = atoi(row[58]); - e.shutdowndelay = strtoll(row[59], nullptr, 10); - e.peqzone = atoi(row[60]); - e.suspendbuffs = atoi(row[61]); - e.rain_chance1 = atoi(row[62]); - e.rain_chance2 = atoi(row[63]); - e.rain_chance3 = atoi(row[64]); - e.rain_chance4 = atoi(row[65]); - e.rain_duration1 = atoi(row[66]); - e.rain_duration2 = atoi(row[67]); - e.rain_duration3 = atoi(row[68]); - e.rain_duration4 = atoi(row[69]); - e.snow_chance1 = atoi(row[70]); - e.snow_chance2 = atoi(row[71]); - e.snow_chance3 = atoi(row[72]); - e.snow_chance4 = atoi(row[73]); - e.snow_duration1 = atoi(row[74]); - e.snow_duration2 = atoi(row[75]); - e.snow_duration3 = atoi(row[76]); - e.snow_duration4 = atoi(row[77]); - e.gravity = static_cast(atof(row[78])); - e.type = atoi(row[79]); - e.skylock = atoi(row[80]); - e.fast_regen_hp = atoi(row[81]); - e.fast_regen_mana = atoi(row[82]); - e.fast_regen_endurance = atoi(row[83]); - e.npc_max_aggro_dist = atoi(row[84]); - e.max_movement_update_range = atoi(row[85]); - e.min_expansion = atoi(row[86]); - e.max_expansion = atoi(row[87]); + e.canbind = static_cast(atoi(row[53])); + e.cancombat = static_cast(atoi(row[54])); + e.canlevitate = static_cast(atoi(row[55])); + e.castoutdoor = static_cast(atoi(row[56])); + e.hotzone = static_cast(strtoul(row[57], nullptr, 10)); + e.insttype = static_cast(strtoul(row[58], nullptr, 10)); + e.shutdowndelay = strtoull(row[59], nullptr, 10); + e.peqzone = static_cast(atoi(row[60])); + e.suspendbuffs = static_cast(strtoul(row[61], nullptr, 10)); + e.rain_chance1 = static_cast(atoi(row[62])); + e.rain_chance2 = static_cast(atoi(row[63])); + e.rain_chance3 = static_cast(atoi(row[64])); + e.rain_chance4 = static_cast(atoi(row[65])); + e.rain_duration1 = static_cast(atoi(row[66])); + e.rain_duration2 = static_cast(atoi(row[67])); + e.rain_duration3 = static_cast(atoi(row[68])); + e.rain_duration4 = static_cast(atoi(row[69])); + e.snow_chance1 = static_cast(atoi(row[70])); + e.snow_chance2 = static_cast(atoi(row[71])); + e.snow_chance3 = static_cast(atoi(row[72])); + e.snow_chance4 = static_cast(atoi(row[73])); + e.snow_duration1 = static_cast(atoi(row[74])); + e.snow_duration2 = static_cast(atoi(row[75])); + e.snow_duration3 = static_cast(atoi(row[76])); + e.snow_duration4 = static_cast(atoi(row[77])); + e.gravity = strtof(row[78], nullptr); + e.type = static_cast(atoi(row[79])); + e.skylock = static_cast(atoi(row[80])); + e.fast_regen_hp = static_cast(atoi(row[81])); + e.fast_regen_mana = static_cast(atoi(row[82])); + e.fast_regen_endurance = static_cast(atoi(row[83])); + e.npc_max_aggro_dist = static_cast(atoi(row[84])); + e.max_movement_update_range = static_cast(strtoul(row[85], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[86])); + e.max_expansion = static_cast(atoi(row[87])); e.content_flags = row[88] ? row[88] : ""; e.content_flags_disabled = row[89] ? row[89] : ""; - e.underworld_teleport_index = atoi(row[90]); - e.lava_damage = atoi(row[91]); - e.min_lava_damage = atoi(row[92]); - e.expansion = atoi(row[93]); - e.bypass_expansion_check = atoi(row[94]); + e.underworld_teleport_index = static_cast(atoi(row[90])); + e.lava_damage = static_cast(atoi(row[91])); + e.min_lava_damage = static_cast(atoi(row[92])); + e.expansion = static_cast(atoi(row[93])); + e.bypass_expansion_check = static_cast(atoi(row[94])); all_entries.push_back(e); } @@ -1105,100 +1105,100 @@ public: Zone e{}; e.short_name = row[0] ? row[0] : ""; - e.id = atoi(row[1]); + e.id = static_cast(atoi(row[1])); e.file_name = row[2] ? row[2] : ""; e.long_name = row[3] ? row[3] : ""; e.map_file_name = row[4] ? row[4] : ""; - e.safe_x = static_cast(atof(row[5])); - e.safe_y = static_cast(atof(row[6])); - e.safe_z = static_cast(atof(row[7])); - e.safe_heading = static_cast(atof(row[8])); - e.graveyard_id = static_cast(atof(row[9])); - e.min_level = atoi(row[10]); - e.min_status = atoi(row[11]); - e.zoneidnumber = atoi(row[12]); - e.version = atoi(row[13]); - e.timezone = atoi(row[14]); - e.maxclients = atoi(row[15]); - e.ruleset = atoi(row[16]); + e.safe_x = strtof(row[5], nullptr); + e.safe_y = strtof(row[6], nullptr); + e.safe_z = strtof(row[7], nullptr); + e.safe_heading = strtof(row[8], nullptr); + e.graveyard_id = strtof(row[9], nullptr); + e.min_level = static_cast(strtoul(row[10], nullptr, 10)); + e.min_status = static_cast(strtoul(row[11], nullptr, 10)); + e.zoneidnumber = static_cast(atoi(row[12])); + e.version = static_cast(strtoul(row[13], nullptr, 10)); + e.timezone = static_cast(atoi(row[14])); + e.maxclients = static_cast(atoi(row[15])); + e.ruleset = static_cast(strtoul(row[16], nullptr, 10)); e.note = row[17] ? row[17] : ""; - e.underworld = static_cast(atof(row[18])); - e.minclip = static_cast(atof(row[19])); - e.maxclip = static_cast(atof(row[20])); - e.fog_minclip = static_cast(atof(row[21])); - e.fog_maxclip = static_cast(atof(row[22])); - e.fog_blue = atoi(row[23]); - e.fog_red = atoi(row[24]); - e.fog_green = atoi(row[25]); - e.sky = atoi(row[26]); - e.ztype = atoi(row[27]); - e.zone_exp_multiplier = static_cast(atof(row[28])); - e.walkspeed = static_cast(atof(row[29])); - e.time_type = atoi(row[30]); - e.fog_red1 = atoi(row[31]); - e.fog_green1 = atoi(row[32]); - e.fog_blue1 = atoi(row[33]); - e.fog_minclip1 = static_cast(atof(row[34])); - e.fog_maxclip1 = static_cast(atof(row[35])); - e.fog_red2 = atoi(row[36]); - e.fog_green2 = atoi(row[37]); - e.fog_blue2 = atoi(row[38]); - e.fog_minclip2 = static_cast(atof(row[39])); - e.fog_maxclip2 = static_cast(atof(row[40])); - e.fog_red3 = atoi(row[41]); - e.fog_green3 = atoi(row[42]); - e.fog_blue3 = atoi(row[43]); - e.fog_minclip3 = static_cast(atof(row[44])); - e.fog_maxclip3 = static_cast(atof(row[45])); - e.fog_red4 = atoi(row[46]); - e.fog_green4 = atoi(row[47]); - e.fog_blue4 = atoi(row[48]); - e.fog_minclip4 = static_cast(atof(row[49])); - e.fog_maxclip4 = static_cast(atof(row[50])); - e.fog_density = static_cast(atof(row[51])); + e.underworld = strtof(row[18], nullptr); + e.minclip = strtof(row[19], nullptr); + e.maxclip = strtof(row[20], nullptr); + e.fog_minclip = strtof(row[21], nullptr); + e.fog_maxclip = strtof(row[22], nullptr); + e.fog_blue = static_cast(strtoul(row[23], nullptr, 10)); + e.fog_red = static_cast(strtoul(row[24], nullptr, 10)); + e.fog_green = static_cast(strtoul(row[25], nullptr, 10)); + e.sky = static_cast(strtoul(row[26], nullptr, 10)); + e.ztype = static_cast(strtoul(row[27], nullptr, 10)); + e.zone_exp_multiplier = strtof(row[28], nullptr); + e.walkspeed = strtof(row[29], nullptr); + e.time_type = static_cast(strtoul(row[30], nullptr, 10)); + e.fog_red1 = static_cast(strtoul(row[31], nullptr, 10)); + e.fog_green1 = static_cast(strtoul(row[32], nullptr, 10)); + e.fog_blue1 = static_cast(strtoul(row[33], nullptr, 10)); + e.fog_minclip1 = strtof(row[34], nullptr); + e.fog_maxclip1 = strtof(row[35], nullptr); + e.fog_red2 = static_cast(strtoul(row[36], nullptr, 10)); + e.fog_green2 = static_cast(strtoul(row[37], nullptr, 10)); + e.fog_blue2 = static_cast(strtoul(row[38], nullptr, 10)); + e.fog_minclip2 = strtof(row[39], nullptr); + e.fog_maxclip2 = strtof(row[40], nullptr); + e.fog_red3 = static_cast(strtoul(row[41], nullptr, 10)); + e.fog_green3 = static_cast(strtoul(row[42], nullptr, 10)); + e.fog_blue3 = static_cast(strtoul(row[43], nullptr, 10)); + e.fog_minclip3 = strtof(row[44], nullptr); + e.fog_maxclip3 = strtof(row[45], nullptr); + e.fog_red4 = static_cast(strtoul(row[46], nullptr, 10)); + e.fog_green4 = static_cast(strtoul(row[47], nullptr, 10)); + e.fog_blue4 = static_cast(strtoul(row[48], nullptr, 10)); + e.fog_minclip4 = strtof(row[49], nullptr); + e.fog_maxclip4 = strtof(row[50], nullptr); + e.fog_density = strtof(row[51], nullptr); e.flag_needed = row[52] ? row[52] : ""; - e.canbind = atoi(row[53]); - e.cancombat = atoi(row[54]); - e.canlevitate = atoi(row[55]); - e.castoutdoor = atoi(row[56]); - e.hotzone = atoi(row[57]); - e.insttype = atoi(row[58]); - e.shutdowndelay = strtoll(row[59], nullptr, 10); - e.peqzone = atoi(row[60]); - e.suspendbuffs = atoi(row[61]); - e.rain_chance1 = atoi(row[62]); - e.rain_chance2 = atoi(row[63]); - e.rain_chance3 = atoi(row[64]); - e.rain_chance4 = atoi(row[65]); - e.rain_duration1 = atoi(row[66]); - e.rain_duration2 = atoi(row[67]); - e.rain_duration3 = atoi(row[68]); - e.rain_duration4 = atoi(row[69]); - e.snow_chance1 = atoi(row[70]); - e.snow_chance2 = atoi(row[71]); - e.snow_chance3 = atoi(row[72]); - e.snow_chance4 = atoi(row[73]); - e.snow_duration1 = atoi(row[74]); - e.snow_duration2 = atoi(row[75]); - e.snow_duration3 = atoi(row[76]); - e.snow_duration4 = atoi(row[77]); - e.gravity = static_cast(atof(row[78])); - e.type = atoi(row[79]); - e.skylock = atoi(row[80]); - e.fast_regen_hp = atoi(row[81]); - e.fast_regen_mana = atoi(row[82]); - e.fast_regen_endurance = atoi(row[83]); - e.npc_max_aggro_dist = atoi(row[84]); - e.max_movement_update_range = atoi(row[85]); - e.min_expansion = atoi(row[86]); - e.max_expansion = atoi(row[87]); + e.canbind = static_cast(atoi(row[53])); + e.cancombat = static_cast(atoi(row[54])); + e.canlevitate = static_cast(atoi(row[55])); + e.castoutdoor = static_cast(atoi(row[56])); + e.hotzone = static_cast(strtoul(row[57], nullptr, 10)); + e.insttype = static_cast(strtoul(row[58], nullptr, 10)); + e.shutdowndelay = strtoull(row[59], nullptr, 10); + e.peqzone = static_cast(atoi(row[60])); + e.suspendbuffs = static_cast(strtoul(row[61], nullptr, 10)); + e.rain_chance1 = static_cast(atoi(row[62])); + e.rain_chance2 = static_cast(atoi(row[63])); + e.rain_chance3 = static_cast(atoi(row[64])); + e.rain_chance4 = static_cast(atoi(row[65])); + e.rain_duration1 = static_cast(atoi(row[66])); + e.rain_duration2 = static_cast(atoi(row[67])); + e.rain_duration3 = static_cast(atoi(row[68])); + e.rain_duration4 = static_cast(atoi(row[69])); + e.snow_chance1 = static_cast(atoi(row[70])); + e.snow_chance2 = static_cast(atoi(row[71])); + e.snow_chance3 = static_cast(atoi(row[72])); + e.snow_chance4 = static_cast(atoi(row[73])); + e.snow_duration1 = static_cast(atoi(row[74])); + e.snow_duration2 = static_cast(atoi(row[75])); + e.snow_duration3 = static_cast(atoi(row[76])); + e.snow_duration4 = static_cast(atoi(row[77])); + e.gravity = strtof(row[78], nullptr); + e.type = static_cast(atoi(row[79])); + e.skylock = static_cast(atoi(row[80])); + e.fast_regen_hp = static_cast(atoi(row[81])); + e.fast_regen_mana = static_cast(atoi(row[82])); + e.fast_regen_endurance = static_cast(atoi(row[83])); + e.npc_max_aggro_dist = static_cast(atoi(row[84])); + e.max_movement_update_range = static_cast(strtoul(row[85], nullptr, 10)); + e.min_expansion = static_cast(atoi(row[86])); + e.max_expansion = static_cast(atoi(row[87])); e.content_flags = row[88] ? row[88] : ""; e.content_flags_disabled = row[89] ? row[89] : ""; - e.underworld_teleport_index = atoi(row[90]); - e.lava_damage = atoi(row[91]); - e.min_lava_damage = atoi(row[92]); - e.expansion = atoi(row[93]); - e.bypass_expansion_check = atoi(row[94]); + e.underworld_teleport_index = static_cast(atoi(row[90])); + e.lava_damage = static_cast(atoi(row[91])); + e.min_lava_damage = static_cast(atoi(row[92])); + e.expansion = static_cast(atoi(row[93])); + e.bypass_expansion_check = static_cast(atoi(row[94])); all_entries.push_back(e); } diff --git a/common/shared_tasks.h b/common/shared_tasks.h index 119cdb826..826d58911 100644 --- a/common/shared_tasks.h +++ b/common/shared_tasks.h @@ -80,8 +80,8 @@ struct SharedTaskMember { // used in shared task requests to validate group/raid members struct SharedTaskRequest { - int lowest_level; - int highest_level; + uint32_t lowest_level; + uint32_t highest_level; uint32_t leader_id; SharedTaskRequestGroupType group_type; std::vector character_ids; diff --git a/common/version.h b/common/version.h index cccc71eba..f5a6cd1d6 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 9201 +#define CURRENT_BINARY_DATABASE_VERSION 9202 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9029 diff --git a/utils/scripts/generators/repository-generator.pl b/utils/scripts/generators/repository-generator.pl index 4708beec7..8ce5a8b69 100644 --- a/utils/scripts/generators/repository-generator.pl +++ b/utils/scripts/generators/repository-generator.pl @@ -188,12 +188,13 @@ foreach my $table_to_generate (@tables) { my $column_name = $row[0]; my $column_name_formatted = format_column_name_for_cpp_var($column_name); my $data_type = $row[2]; + my $column_type = $row[3]; if ($longest_column_length < length($column_name_formatted)) { $longest_column_length = length($column_name_formatted); } - my $struct_data_type = translate_mysql_data_type_to_c($data_type); + my $struct_data_type = translate_mysql_data_type_to_c($data_type, $column_type); if ($longest_data_type_length < length($struct_data_type)) { $longest_data_type_length = length($struct_data_type); @@ -252,7 +253,7 @@ foreach my $table_to_generate (@tables) { $default_value = 0; } - my $struct_data_type = translate_mysql_data_type_to_c($data_type); + my $struct_data_type = translate_mysql_data_type_to_c($data_type, $column_type); # struct $table_struct_columns .= sprintf("\t\t\%-${longest_data_type_length}s %s;\n", $struct_data_type, $column_name_formatted); @@ -299,7 +300,18 @@ foreach my $table_to_generate (@tables) { $insert_many_entries .= sprintf("\t\t\tv.push_back(%s);\n", $value); # find one / all (select) - if ($data_type =~ /bigint/) { + + if ($column_type =~ /unsigned/) { + if ($data_type =~ /bigint/) { + $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtoull(row[%s], nullptr, 10);\n", $column_name_formatted, $index); + $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtoull(row[%s], nullptr, 10);\n", $column_name_formatted, $index); + } + elsif ($data_type =~ /int/) { + $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = static_cast<%s>(strtoul(row[%s], nullptr, 10));\n", $column_name_formatted, $struct_data_type, $index); + $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = static_cast<%s>(strtoul(row[%s], nullptr, 10));\n", $column_name_formatted, $struct_data_type, $index); + } + } + elsif ($data_type =~ /bigint/) { $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtoll(row[%s], nullptr, 10);\n", $column_name_formatted, $index); $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtoll(row[%s], nullptr, 10);\n", $column_name_formatted, $index); } @@ -308,12 +320,16 @@ foreach my $table_to_generate (@tables) { $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtoll(row[%s] ? row[%s] : \"-1\", nullptr, 10);\n", $column_name_formatted, $index, $index); } elsif ($data_type =~ /int/) { - $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name_formatted, $index); - $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name_formatted, $index); + $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = static_cast<%s>(atoi(row[%s]));\n", $column_name_formatted, $struct_data_type, $index); + $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = static_cast<%s>(atoi(row[%s]));\n", $column_name_formatted, $struct_data_type, $index); } - elsif ($data_type =~ /float|double|decimal/) { - $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = static_cast(atof(row[%s]));\n", $column_name_formatted, $index); - $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = static_cast(atof(row[%s]));\n", $column_name_formatted, $index); + elsif ($data_type =~ /float|decimal/) { + $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtof(row[%s], nullptr);\n", $column_name_formatted, $index); + $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtof(row[%s], nullptr);\n", $column_name_formatted, $index); + } + elsif ($data_type =~ /double/) { + $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtod(row[%s], nullptr);\n", $column_name_formatted, $index); + $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = strtod(row[%s], nullptr);\n", $column_name_formatted, $index); } else { $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = row[%s] ? row[%s] : \"\";\n", $column_name_formatted, $index, $index); @@ -491,23 +507,41 @@ sub trim { sub translate_mysql_data_type_to_c { my $mysql_data_type = $_[0]; + my $mysql_column_type = $_[1]; my $struct_data_type = "std::string"; - if ($mysql_data_type =~ /tinyint/) { - $struct_data_type = 'int'; - } - elsif ($mysql_data_type =~ /smallint/) { - $struct_data_type = 'int'; + if ($mysql_column_type =~ /unsigned/) { + if ($mysql_data_type =~ /bigint/) { + $struct_data_type = 'uint64_t'; + } + elsif ($mysql_data_type =~ /tinyint/) { + $struct_data_type = 'uint8_t'; + } + elsif ($mysql_data_type =~ /smallint/) { + $struct_data_type = 'uint16_t'; + } + elsif ($mysql_data_type =~ /int/) { + $struct_data_type = 'uint32_t'; + } } elsif ($mysql_data_type =~ /bigint/) { - $struct_data_type = 'int64'; + $struct_data_type = 'int64_t'; + } + elsif ($mysql_data_type =~ /tinyint/) { + $struct_data_type = 'int8_t'; + } + elsif ($mysql_data_type =~ /smallint/) { + $struct_data_type = 'int16_t'; } elsif ($mysql_data_type =~ /int/) { - $struct_data_type = 'int'; + $struct_data_type = 'int32_t'; } - elsif ($mysql_data_type =~ /float|double|decimal/) { + elsif ($mysql_data_type =~ /float|decimal/) { $struct_data_type = 'float'; } + elsif ($mysql_data_type =~ /double/) { + $struct_data_type = 'double'; + } elsif ($mysql_data_type =~ /datetime/) { $struct_data_type = 'time_t'; } diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 8dfbbdc4a..122d8a369 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -455,6 +455,7 @@ 9199|2022_08_08_task_req_activity_id.sql|SHOW COLUMNS FROM `task_activities` LIKE 'req_activity_id'|empty| 9200|2022_08_19_zone_expansion_consistency.sql|SELECT * FROM db_version WHERE version >= 9200|empty| 9201|2022_08_22_npc_types_heroic_strikethrough.sql|SHOW COLUMNS FROM `npc_types` LIKE 'heroic_strikethrough'|empty| +9202|2022_08_24_task_activities_step.sql|SHOW COLUMNS FROM `task_activities` LIKE 'step'|contains|unsigned # 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_08_24_task_activities_step.sql b/utils/sql/git/required/2022_08_24_task_activities_step.sql new file mode 100644 index 000000000..b0d5019ef --- /dev/null +++ b/utils/sql/git/required/2022_08_24_task_activities_step.sql @@ -0,0 +1 @@ +ALTER TABLE `task_activities` MODIFY `step` INT(11) NOT NULL DEFAULT '0'; diff --git a/world/shared_task_manager.cpp b/world/shared_task_manager.cpp index 1febff643..3f9bdd215 100644 --- a/world/shared_task_manager.cpp +++ b/world/shared_task_manager.cpp @@ -1456,8 +1456,8 @@ bool SharedTaskManager::CanAddPlayer(SharedTask *s, uint32_t character_id, std:: ) ); - int lowest_level = cle->level(); - int highest_level = cle->level(); + auto lowest_level = static_cast(cle->level()); + auto highest_level = lowest_level; for (const auto &character : characters) { lowest_level = std::min(lowest_level, character.level);