mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-27 13:02:28 +00:00
Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c982df0e3 | |||
| fa783c3c6b | |||
| 5377bb3f49 | |||
| f98c79fdba | |||
| ae79022e06 | |||
| bc59882a65 | |||
| 2e0ed82986 | |||
| 8e3218aaf7 | |||
| 9276966418 | |||
| b89772ca91 | |||
| a1f2a21c99 | |||
| 1cb72642ac | |||
| a38fd8f986 | |||
| 337b6f38e0 | |||
| b4414d3052 | |||
| bfeeb0ce05 | |||
| e640e3cad3 | |||
| c09a3a5bba | |||
| ce907c9519 | |||
| 7a770e0e08 | |||
| 97c3205657 | |||
| ff2e56abc7 | |||
| 9ee16f8bf7 | |||
| 5b43bf4a5e | |||
| 4c769c46b3 | |||
| 8a87e00b66 | |||
| 0ebc7f9bb6 | |||
| 9ac25338bb | |||
| e9285fd2ca | |||
| 5b85f89c21 | |||
| 7fed8fc8c8 | |||
| 26769f40d9 | |||
| f6148b9b8d | |||
| ca1299bf1d | |||
| 3fb24dc0a3 | |||
| dcd7bffa54 | |||
| 5298abe6bc | |||
| fbc2b7c152 | |||
| 86705000b0 | |||
| 748e37dbdf | |||
| 27256215b8 | |||
| 59cbe1a152 | |||
| 3e50427bb7 | |||
| 883b3b5826 | |||
| 135ee6b2b7 | |||
| 906879ce2e |
+149
@@ -1,3 +1,152 @@
|
||||
## [22.43.3] - 1/30/2024
|
||||
|
||||
### API
|
||||
|
||||
* Add lock_status method to world API ([#4028](https://github.com/EQEmu/Server/pull/4028)) @Akkadius 2024-01-29
|
||||
|
||||
### Alternate Currency
|
||||
|
||||
* Convert Load of Alternate Currencies to Repositories ([#3993](https://github.com/EQEmu/Server/pull/3993)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Beacon
|
||||
|
||||
* Cleanup Beacons Code ([#4024](https://github.com/EQEmu/Server/pull/4024)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Bots
|
||||
|
||||
* Convert Bot Database Methods to Repositories ([#4023](https://github.com/EQEmu/Server/pull/4023)) @Kinglykrab 2024-01-29
|
||||
* Missing boolean returns on DeletePetStats and SaveInspectMessage ([#4031](https://github.com/EQEmu/Server/pull/4031)) @joligario 2024-01-30
|
||||
|
||||
### Code
|
||||
|
||||
* Add Raid Loot Type Constants ([#4022](https://github.com/EQEmu/Server/pull/4022)) @Kinglykrab 2024-01-29
|
||||
* Cleanup cross-zone/world-wide OPCode handling ([#4003](https://github.com/EQEmu/Server/pull/4003)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Commands
|
||||
|
||||
* Cleanup #petitems Command ([#4005](https://github.com/EQEmu/Server/pull/4005)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Crash Fix
|
||||
|
||||
* Fix Possible Crash in HateList::Find ([#4027](https://github.com/EQEmu/Server/pull/4027)) @Kinglykrab 2024-01-28
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix NPC After Death Emotes ([#4021](https://github.com/EQEmu/Server/pull/4021)) @Kinglykrab 2024-01-29
|
||||
* Fix database loading routines ([#4030](https://github.com/EQEmu/Server/pull/4030)) @Akkadius 2024-01-29
|
||||
* Fix issue in character_corpses Repository Query ([#4029](https://github.com/EQEmu/Server/pull/4029)) @Kinglykrab 2024-01-29
|
||||
* Limit Pet Taunt Distance ([#4018](https://github.com/EQEmu/Server/pull/4018)) @fryguy503 2024-01-26
|
||||
* Limit Player Taunt Distance ([#4019](https://github.com/EQEmu/Server/pull/4019)) @fryguy503 2024-01-26
|
||||
* Patch for recent change to DEATH ([#4032](https://github.com/EQEmu/Server/pull/4032)) @noudess 2024-01-30
|
||||
* spawn_conditions map was being emptied by mistake ([#4033](https://github.com/EQEmu/Server/pull/4033)) @noudess 2024-01-30
|
||||
|
||||
### Grids
|
||||
|
||||
* Convert Grid/Grid Entries to Repositories ([#4011](https://github.com/EQEmu/Server/pull/4011)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Mercenaries
|
||||
|
||||
* Add expansion settings update to Mercs:Enable ([#4001](https://github.com/EQEmu/Server/pull/4001)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Merchants
|
||||
|
||||
* Convert Merchant Load to Repositories ([#4007](https://github.com/EQEmu/Server/pull/4007)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Pets
|
||||
|
||||
* Convert Load of Pets Beastlord Data to Repositories ([#3995](https://github.com/EQEmu/Server/pull/3995)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Quests
|
||||
|
||||
* Use separate variable for quest idle override. ([#4026](https://github.com/EQEmu/Server/pull/4026)) @noudess 2024-01-27
|
||||
|
||||
### Rules
|
||||
|
||||
* Add rules for cross-zone/world-wide casts to affect Bots/Mercenaries/Pets ([#4002](https://github.com/EQEmu/Server/pull/4002)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Spawn2
|
||||
|
||||
* Convert Spawn2 Methods to Repositories ([#4014](https://github.com/EQEmu/Server/pull/4014)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Traps
|
||||
|
||||
* Convert Load/Set of Traps to Repositories ([#3994](https://github.com/EQEmu/Server/pull/3994)) @Kinglykrab 2024-01-29
|
||||
|
||||
### Zone
|
||||
|
||||
* Convert Fishing/Foraging to Repositories ([#4008](https://github.com/EQEmu/Server/pull/4008)) @Kinglykrab 2024-01-30
|
||||
|
||||
## [22.43.2] - 1/25/2024
|
||||
|
||||
### Bots
|
||||
|
||||
* ^mez command spell list fix ([#3998](https://github.com/EQEmu/Server/pull/3998)) @dariusuknuis 2024-01-19
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup position methods ([#4015](https://github.com/EQEmu/Server/pull/4015)) @Kinglykrab 2024-01-25
|
||||
|
||||
### Commands
|
||||
|
||||
* Add `#npcedit set_grid [Grid ID]` to `#npcedit` ([#4004](https://github.com/EQEmu/Server/pull/4004)) @Kinglykrab 2024-01-22
|
||||
|
||||
### Crash Fix
|
||||
|
||||
* Fix crash when creating Frogloks/Drakkin ([#4016](https://github.com/EQEmu/Server/pull/4016)) @Kinglykrab 2024-01-25
|
||||
* Reverting PR #3877 ([#3997](https://github.com/EQEmu/Server/pull/3997)) @fryguy503 2024-01-17
|
||||
|
||||
### Database
|
||||
|
||||
* Drop deprecated item_tick table ([#3977](https://github.com/EQEmu/Server/pull/3977)) @Akkadius 2024-01-14
|
||||
* Drop item_tick if exists tweak in manifest ([#3985](https://github.com/EQEmu/Server/pull/3985)) @Akkadius 2024-01-15
|
||||
* Increase max spawngroup name from 50 to 200 ([#3991](https://github.com/EQEmu/Server/pull/3991)) @Akkadius 2024-01-22
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix Mercenaries Buffs/Zoning Issues ([#4000](https://github.com/EQEmu/Server/pull/4000)) @Kinglykrab 2024-01-22
|
||||
* Fix zone database update manifest ([#3972](https://github.com/EQEmu/Server/pull/3972)) @Kinglykrab 2024-01-13
|
||||
* Fixes to zone idle while empty changes. ([#4006](https://github.com/EQEmu/Server/pull/4006)) @noudess 2024-01-23
|
||||
* Reversed logic on InLiquid ([#3979](https://github.com/EQEmu/Server/pull/3979)) @fryguy503 2024-01-14
|
||||
|
||||
### Instances
|
||||
|
||||
* Convert Instance Quest Methods to Repositories ([#4012](https://github.com/EQEmu/Server/pull/4012)) @Kinglykrab 2024-01-25
|
||||
|
||||
### Logging
|
||||
|
||||
* Force Info category to be always on in file/console logs ([#3990](https://github.com/EQEmu/Server/pull/3990)) @Akkadius 2024-01-22
|
||||
|
||||
### Merchants
|
||||
|
||||
* Change database structure for merchant slots ([#3974](https://github.com/EQEmu/Server/pull/3974)) @joligario 2024-01-14
|
||||
|
||||
### Messages
|
||||
|
||||
* Fix disciple message added by previous patch. ([#3986](https://github.com/EQEmu/Server/pull/3986)) @noudess 2024-01-15
|
||||
|
||||
### Quest API
|
||||
|
||||
* QuestReward should now summon item to the inventory instead of the cursor. ([#3996](https://github.com/EQEmu/Server/pull/3996)) @regneq 2024-01-22
|
||||
|
||||
### Repositories
|
||||
|
||||
* Add `rank` to reserved words ([#3982](https://github.com/EQEmu/Server/pull/3982)) @Akkadius 2024-01-15
|
||||
* Fix datetime zero-value save behavior ([#3976](https://github.com/EQEmu/Server/pull/3976)) @Akkadius 2024-01-14
|
||||
|
||||
### Spawn2
|
||||
|
||||
* Spawn condition value should default spawn_conditions value ([#3980](https://github.com/EQEmu/Server/pull/3980)) @noudess 2024-01-14
|
||||
|
||||
### Zoning
|
||||
|
||||
* Additional logs for zoning under instance checks ([#3989](https://github.com/EQEmu/Server/pull/3989)) @Akkadius 2024-01-22
|
||||
|
||||
## [22.43.1] - 1/14/2024
|
||||
|
||||
### Repositories
|
||||
|
||||
* Revert #3976 - fix character corpses @Akkadius 2024-01-14
|
||||
|
||||
## [22.43.0] - 1/14/2024
|
||||
|
||||
### Database
|
||||
|
||||
@@ -5229,7 +5229,18 @@ ALTER TABLE `merchantlist_temp`
|
||||
.condition = "not_empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
DROP TABLE item_tick
|
||||
DROP TABLE IF EXISTS item_tick
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9256,
|
||||
.description = "2024_01_16_increase_spawngroup_size.sql",
|
||||
.check = "SHOW COLUMNS FROM `spawngroup` LIKE 'name'",
|
||||
.condition = "contains",
|
||||
.match = "varchar(50)",
|
||||
.sql = R"(
|
||||
ALTER TABLE `spawngroup`
|
||||
MODIFY COLUMN `name` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `id`;
|
||||
)"
|
||||
}
|
||||
// -- template; copy/paste this when you need to create a new entry
|
||||
|
||||
@@ -104,6 +104,25 @@ ALTER TABLE `bot_timers`
|
||||
DROP PRIMARY KEY;
|
||||
ALTER TABLE `bot_timers`
|
||||
ADD PRIMARY KEY (`bot_id`, `timer_id`, `spell_id`, `item_id`);
|
||||
)"
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9042,
|
||||
.description = "2024_01_27_delete_bot_foreign_keys.sql",
|
||||
.check = "SHOW CREATE TABLE `bot_stances`",
|
||||
.condition = "contains",
|
||||
.match = "FOREIGN",
|
||||
.sql = R"(
|
||||
ALTER TABLE `bot_buffs` DROP FOREIGN KEY `FK_bot_buffs_1`;
|
||||
ALTER TABLE `bot_heal_rotations` DROP FOREIGN KEY `FK_bot_heal_rotations`;
|
||||
ALTER TABLE `bot_heal_rotation_members` DROP FOREIGN KEY `FK_bot_heal_rotation_members_1`;
|
||||
ALTER TABLE `bot_heal_rotation_members` DROP FOREIGN KEY `FK_bot_heal_rotation_members_2`;
|
||||
ALTER TABLE `bot_heal_rotation_targets` DROP FOREIGN KEY `FK_bot_heal_rotation_targets`;
|
||||
ALTER TABLE `bot_inventories` DROP FOREIGN KEY `FK_bot_inventories_1`;
|
||||
ALTER TABLE `bot_pets` DROP FOREIGN KEY `FK_bot_pets_1`;
|
||||
ALTER TABLE `bot_pet_buffs` DROP FOREIGN KEY `FK_bot_pet_buffs_1`;
|
||||
ALTER TABLE `bot_pet_inventories` DROP FOREIGN KEY `FK_bot_pet_inventories_1`;
|
||||
ALTER TABLE `bot_stances` DROP FOREIGN KEY `FK_bot_stances_1`;
|
||||
)"
|
||||
}
|
||||
// -- template; copy/paste this when you need to create a new entry
|
||||
|
||||
@@ -1120,4 +1120,11 @@ enum MoneySubtypes
|
||||
SharedBank // Platinum Only
|
||||
};
|
||||
|
||||
namespace RaidLootType {
|
||||
constexpr uint32 LeaderOnly = 1;
|
||||
constexpr uint32 LeaderAndGroupLeadersOnly = 2;
|
||||
constexpr uint32 LeaderSelected = 3;
|
||||
constexpr uint32 EntireRaid = 4;
|
||||
}
|
||||
|
||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||
|
||||
@@ -631,6 +631,12 @@ struct ConsentResponse_Struct {
|
||||
char zonename[32];
|
||||
};
|
||||
|
||||
struct NameApproval_Struct {
|
||||
char name[64];
|
||||
uint32 race_id;
|
||||
uint32 class_id;
|
||||
};
|
||||
|
||||
/*
|
||||
** Name Generator Struct
|
||||
** Length: 72 bytes
|
||||
|
||||
@@ -701,6 +701,8 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
||||
log_settings[Logs::Crash].log_to_console = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Crash].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Crash].log_to_file = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Info].log_to_file = static_cast<uint8>(Logs::General);
|
||||
log_settings[Logs::Info].log_to_console = static_cast<uint8>(Logs::General);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
v.push_back(columns[14] + " = '" + Strings::Escape(e.minilogin_ip) + "'");
|
||||
v.push_back(columns[15] + " = " + std::to_string(e.hideme));
|
||||
v.push_back(columns[16] + " = " + std::to_string(e.rulesflag));
|
||||
v.push_back(columns[17] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[17] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
||||
v.push_back(columns[18] + " = " + std::to_string(e.time_creation));
|
||||
v.push_back(columns[19] + " = '" + Strings::Escape(e.ban_reason) + "'");
|
||||
v.push_back(columns[20] + " = '" + Strings::Escape(e.suspend_reason) + "'");
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
|
||||
v.push_back(std::to_string(e.hideme));
|
||||
v.push_back(std::to_string(e.rulesflag));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
||||
v.push_back(std::to_string(e.time_creation));
|
||||
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
|
||||
@@ -378,7 +378,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
|
||||
v.push_back(std::to_string(e.hideme));
|
||||
v.push_back(std::to_string(e.rulesflag));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
||||
v.push_back(std::to_string(e.time_creation));
|
||||
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
|
||||
@@ -581,7 +581,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
|
||||
v.push_back(std::to_string(e.hideme));
|
||||
v.push_back(std::to_string(e.rulesflag));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
||||
v.push_back(std::to_string(e.time_creation));
|
||||
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
|
||||
@@ -627,7 +627,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.minilogin_ip) + "'");
|
||||
v.push_back(std::to_string(e.hideme));
|
||||
v.push_back(std::to_string(e.rulesflag));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
|
||||
v.push_back(std::to_string(e.time_creation));
|
||||
v.push_back("'" + Strings::Escape(e.ban_reason) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.suspend_reason) + "'");
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_BUFFS_REPOSITORY_H
|
||||
@@ -180,8 +180,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_buffs_id
|
||||
)
|
||||
);
|
||||
@@ -190,26 +191,26 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotBuffs e{};
|
||||
|
||||
e.buffs_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.caster_level = static_cast<uint8_t>(strtoul(row[3], nullptr, 10));
|
||||
e.duration_formula = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.tics_remaining = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.poison_counters = static_cast<uint32_t>(strtoul(row[6], nullptr, 10));
|
||||
e.disease_counters = static_cast<uint32_t>(strtoul(row[7], nullptr, 10));
|
||||
e.curse_counters = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.corruption_counters = static_cast<uint32_t>(strtoul(row[9], nullptr, 10));
|
||||
e.numhits = static_cast<uint32_t>(strtoul(row[10], nullptr, 10));
|
||||
e.melee_rune = static_cast<uint32_t>(strtoul(row[11], nullptr, 10));
|
||||
e.magic_rune = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.dot_rune = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.persistent = static_cast<int8_t>(atoi(row[14]));
|
||||
e.caston_x = static_cast<int32_t>(atoi(row[15]));
|
||||
e.caston_y = static_cast<int32_t>(atoi(row[16]));
|
||||
e.caston_z = static_cast<int32_t>(atoi(row[17]));
|
||||
e.extra_di_chance = static_cast<uint32_t>(strtoul(row[18], nullptr, 10));
|
||||
e.instrument_mod = static_cast<int32_t>(atoi(row[19]));
|
||||
e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.duration_formula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.tics_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.poison_counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.disease_counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.curse_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.corruption_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.numhits = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||
e.melee_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.magic_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.persistent = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
|
||||
e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
|
||||
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
|
||||
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
|
||||
e.extra_di_chance = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
|
||||
e.instrument_mod = row[19] ? static_cast<int32_t>(atoi(row[19])) : 10;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -385,26 +386,26 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotBuffs e{};
|
||||
|
||||
e.buffs_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.caster_level = static_cast<uint8_t>(strtoul(row[3], nullptr, 10));
|
||||
e.duration_formula = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.tics_remaining = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.poison_counters = static_cast<uint32_t>(strtoul(row[6], nullptr, 10));
|
||||
e.disease_counters = static_cast<uint32_t>(strtoul(row[7], nullptr, 10));
|
||||
e.curse_counters = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.corruption_counters = static_cast<uint32_t>(strtoul(row[9], nullptr, 10));
|
||||
e.numhits = static_cast<uint32_t>(strtoul(row[10], nullptr, 10));
|
||||
e.melee_rune = static_cast<uint32_t>(strtoul(row[11], nullptr, 10));
|
||||
e.magic_rune = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.dot_rune = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.persistent = static_cast<int8_t>(atoi(row[14]));
|
||||
e.caston_x = static_cast<int32_t>(atoi(row[15]));
|
||||
e.caston_y = static_cast<int32_t>(atoi(row[16]));
|
||||
e.caston_z = static_cast<int32_t>(atoi(row[17]));
|
||||
e.extra_di_chance = static_cast<uint32_t>(strtoul(row[18], nullptr, 10));
|
||||
e.instrument_mod = static_cast<int32_t>(atoi(row[19]));
|
||||
e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.duration_formula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.tics_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.poison_counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.disease_counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.curse_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.corruption_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.numhits = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||
e.melee_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.magic_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.persistent = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
|
||||
e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
|
||||
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
|
||||
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
|
||||
e.extra_di_chance = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
|
||||
e.instrument_mod = row[19] ? static_cast<int32_t>(atoi(row[19])) : 10;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -429,26 +430,26 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotBuffs e{};
|
||||
|
||||
e.buffs_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.caster_level = static_cast<uint8_t>(strtoul(row[3], nullptr, 10));
|
||||
e.duration_formula = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.tics_remaining = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.poison_counters = static_cast<uint32_t>(strtoul(row[6], nullptr, 10));
|
||||
e.disease_counters = static_cast<uint32_t>(strtoul(row[7], nullptr, 10));
|
||||
e.curse_counters = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.corruption_counters = static_cast<uint32_t>(strtoul(row[9], nullptr, 10));
|
||||
e.numhits = static_cast<uint32_t>(strtoul(row[10], nullptr, 10));
|
||||
e.melee_rune = static_cast<uint32_t>(strtoul(row[11], nullptr, 10));
|
||||
e.magic_rune = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.dot_rune = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.persistent = static_cast<int8_t>(atoi(row[14]));
|
||||
e.caston_x = static_cast<int32_t>(atoi(row[15]));
|
||||
e.caston_y = static_cast<int32_t>(atoi(row[16]));
|
||||
e.caston_z = static_cast<int32_t>(atoi(row[17]));
|
||||
e.extra_di_chance = static_cast<uint32_t>(strtoul(row[18], nullptr, 10));
|
||||
e.instrument_mod = static_cast<int32_t>(atoi(row[19]));
|
||||
e.buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.duration_formula = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.tics_remaining = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.poison_counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.disease_counters = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.curse_counters = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.corruption_counters = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.numhits = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||
e.melee_rune = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.magic_rune = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.dot_rune = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.persistent = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
|
||||
e.caston_x = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
|
||||
e.caston_y = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
|
||||
e.caston_z = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
|
||||
e.extra_di_chance = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
|
||||
e.instrument_mod = row[19] ? static_cast<int32_t>(atoi(row[19])) : 10;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -507,6 +508,100 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotBuffs &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.buffs_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.caster_level));
|
||||
v.push_back(std::to_string(e.duration_formula));
|
||||
v.push_back(std::to_string(e.tics_remaining));
|
||||
v.push_back(std::to_string(e.poison_counters));
|
||||
v.push_back(std::to_string(e.disease_counters));
|
||||
v.push_back(std::to_string(e.curse_counters));
|
||||
v.push_back(std::to_string(e.corruption_counters));
|
||||
v.push_back(std::to_string(e.numhits));
|
||||
v.push_back(std::to_string(e.melee_rune));
|
||||
v.push_back(std::to_string(e.magic_rune));
|
||||
v.push_back(std::to_string(e.dot_rune));
|
||||
v.push_back(std::to_string(e.persistent));
|
||||
v.push_back(std::to_string(e.caston_x));
|
||||
v.push_back(std::to_string(e.caston_y));
|
||||
v.push_back(std::to_string(e.caston_z));
|
||||
v.push_back(std::to_string(e.extra_di_chance));
|
||||
v.push_back(std::to_string(e.instrument_mod));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotBuffs> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.buffs_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.caster_level));
|
||||
v.push_back(std::to_string(e.duration_formula));
|
||||
v.push_back(std::to_string(e.tics_remaining));
|
||||
v.push_back(std::to_string(e.poison_counters));
|
||||
v.push_back(std::to_string(e.disease_counters));
|
||||
v.push_back(std::to_string(e.curse_counters));
|
||||
v.push_back(std::to_string(e.corruption_counters));
|
||||
v.push_back(std::to_string(e.numhits));
|
||||
v.push_back(std::to_string(e.melee_rune));
|
||||
v.push_back(std::to_string(e.magic_rune));
|
||||
v.push_back(std::to_string(e.dot_rune));
|
||||
v.push_back(std::to_string(e.persistent));
|
||||
v.push_back(std::to_string(e.caston_x));
|
||||
v.push_back(std::to_string(e.caston_y));
|
||||
v.push_back(std::to_string(e.caston_z));
|
||||
v.push_back(std::to_string(e.extra_di_chance));
|
||||
v.push_back(std::to_string(e.instrument_mod));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_BUFFS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_CREATE_COMBINATIONS_REPOSITORY_H
|
||||
@@ -108,8 +108,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_create_combinations_id
|
||||
)
|
||||
);
|
||||
@@ -118,8 +119,8 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotCreateCombinations e{};
|
||||
|
||||
e.race = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.classes = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.race = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.classes = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -242,8 +243,8 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotCreateCombinations e{};
|
||||
|
||||
e.race = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.classes = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.race = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.classes = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -268,8 +269,8 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotCreateCombinations e{};
|
||||
|
||||
e.race = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.classes = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.race = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.classes = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -328,6 +329,64 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotCreateCombinations &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.race));
|
||||
v.push_back(std::to_string(e.classes));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotCreateCombinations> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.race));
|
||||
v.push_back(std::to_string(e.classes));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_CREATE_COMBINATIONS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_DATA_REPOSITORY_H
|
||||
@@ -278,7 +278,7 @@ public:
|
||||
e.expansion_bitmask = -1;
|
||||
e.enforce_spell_settings = 0;
|
||||
e.archery_setting = 0;
|
||||
e.caster_range = 0;
|
||||
e.caster_range = 300;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -315,57 +315,57 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotData e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.owner_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spells_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.owner_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spells_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.name = row[3] ? row[3] : "";
|
||||
e.last_name = row[4] ? row[4] : "";
|
||||
e.title = row[5] ? row[5] : "";
|
||||
e.suffix = row[6] ? row[6] : "";
|
||||
e.zone_id = static_cast<int16_t>(atoi(row[7]));
|
||||
e.gender = static_cast<int8_t>(atoi(row[8]));
|
||||
e.race = static_cast<int16_t>(atoi(row[9]));
|
||||
e.class_ = static_cast<int8_t>(atoi(row[10]));
|
||||
e.level = static_cast<uint8_t>(strtoul(row[11], nullptr, 10));
|
||||
e.deity = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.creation_day = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.last_spawn = static_cast<uint32_t>(strtoul(row[14], nullptr, 10));
|
||||
e.time_spawned = static_cast<uint32_t>(strtoul(row[15], nullptr, 10));
|
||||
e.size = strtof(row[16], nullptr);
|
||||
e.face = static_cast<int32_t>(atoi(row[17]));
|
||||
e.hair_color = static_cast<int32_t>(atoi(row[18]));
|
||||
e.hair_style = static_cast<int32_t>(atoi(row[19]));
|
||||
e.beard = static_cast<int32_t>(atoi(row[20]));
|
||||
e.beard_color = static_cast<int32_t>(atoi(row[21]));
|
||||
e.eye_color_1 = static_cast<int32_t>(atoi(row[22]));
|
||||
e.eye_color_2 = static_cast<int32_t>(atoi(row[23]));
|
||||
e.drakkin_heritage = static_cast<int32_t>(atoi(row[24]));
|
||||
e.drakkin_tattoo = static_cast<int32_t>(atoi(row[25]));
|
||||
e.drakkin_details = static_cast<int32_t>(atoi(row[26]));
|
||||
e.ac = static_cast<int16_t>(atoi(row[27]));
|
||||
e.atk = static_cast<int32_t>(atoi(row[28]));
|
||||
e.hp = static_cast<int32_t>(atoi(row[29]));
|
||||
e.mana = static_cast<int32_t>(atoi(row[30]));
|
||||
e.str = static_cast<int32_t>(atoi(row[31]));
|
||||
e.sta = static_cast<int32_t>(atoi(row[32]));
|
||||
e.cha = static_cast<int32_t>(atoi(row[33]));
|
||||
e.dex = static_cast<int32_t>(atoi(row[34]));
|
||||
e.int_ = static_cast<int32_t>(atoi(row[35]));
|
||||
e.agi = static_cast<int32_t>(atoi(row[36]));
|
||||
e.wis = static_cast<int32_t>(atoi(row[37]));
|
||||
e.fire = static_cast<int16_t>(atoi(row[38]));
|
||||
e.cold = static_cast<int16_t>(atoi(row[39]));
|
||||
e.magic = static_cast<int16_t>(atoi(row[40]));
|
||||
e.poison = static_cast<int16_t>(atoi(row[41]));
|
||||
e.disease = static_cast<int16_t>(atoi(row[42]));
|
||||
e.corruption = static_cast<int16_t>(atoi(row[43]));
|
||||
e.show_helm = static_cast<uint32_t>(strtoul(row[44], nullptr, 10));
|
||||
e.follow_distance = static_cast<uint32_t>(strtoul(row[45], nullptr, 10));
|
||||
e.stop_melee_level = static_cast<uint8_t>(strtoul(row[46], nullptr, 10));
|
||||
e.expansion_bitmask = static_cast<int32_t>(atoi(row[47]));
|
||||
e.enforce_spell_settings = static_cast<uint8_t>(strtoul(row[48], nullptr, 10));
|
||||
e.archery_setting = static_cast<uint8_t>(strtoul(row[49], nullptr, 10));
|
||||
e.caster_range = static_cast<uint32_t>(strtoul(row[50], nullptr, 10));
|
||||
e.zone_id = row[7] ? static_cast<int16_t>(atoi(row[7])) : 0;
|
||||
e.gender = row[8] ? static_cast<int8_t>(atoi(row[8])) : 0;
|
||||
e.race = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
|
||||
e.class_ = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
||||
e.level = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.deity = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.creation_day = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.last_spawn = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.time_spawned = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.size = row[16] ? strtof(row[16], nullptr) : 0;
|
||||
e.face = row[17] ? static_cast<int32_t>(atoi(row[17])) : 1;
|
||||
e.hair_color = row[18] ? static_cast<int32_t>(atoi(row[18])) : 1;
|
||||
e.hair_style = row[19] ? static_cast<int32_t>(atoi(row[19])) : 1;
|
||||
e.beard = row[20] ? static_cast<int32_t>(atoi(row[20])) : 0;
|
||||
e.beard_color = row[21] ? static_cast<int32_t>(atoi(row[21])) : 1;
|
||||
e.eye_color_1 = row[22] ? static_cast<int32_t>(atoi(row[22])) : 1;
|
||||
e.eye_color_2 = row[23] ? static_cast<int32_t>(atoi(row[23])) : 1;
|
||||
e.drakkin_heritage = row[24] ? static_cast<int32_t>(atoi(row[24])) : 0;
|
||||
e.drakkin_tattoo = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
|
||||
e.drakkin_details = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
|
||||
e.ac = row[27] ? static_cast<int16_t>(atoi(row[27])) : 0;
|
||||
e.atk = row[28] ? static_cast<int32_t>(atoi(row[28])) : 0;
|
||||
e.hp = row[29] ? static_cast<int32_t>(atoi(row[29])) : 0;
|
||||
e.mana = row[30] ? static_cast<int32_t>(atoi(row[30])) : 0;
|
||||
e.str = row[31] ? static_cast<int32_t>(atoi(row[31])) : 75;
|
||||
e.sta = row[32] ? static_cast<int32_t>(atoi(row[32])) : 75;
|
||||
e.cha = row[33] ? static_cast<int32_t>(atoi(row[33])) : 75;
|
||||
e.dex = row[34] ? static_cast<int32_t>(atoi(row[34])) : 75;
|
||||
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
||||
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
||||
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
||||
e.fire = row[38] ? static_cast<int16_t>(atoi(row[38])) : 0;
|
||||
e.cold = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
||||
e.magic = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
||||
e.poison = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
||||
e.disease = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||
e.corruption = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||
e.show_helm = row[44] ? static_cast<uint32_t>(strtoul(row[44], nullptr, 10)) : 0;
|
||||
e.follow_distance = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 200;
|
||||
e.stop_melee_level = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 255;
|
||||
e.expansion_bitmask = row[47] ? static_cast<int32_t>(atoi(row[47])) : -1;
|
||||
e.enforce_spell_settings = row[48] ? static_cast<uint8_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||
e.archery_setting = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||
e.caster_range = row[50] ? static_cast<uint32_t>(strtoul(row[50], nullptr, 10)) : 300;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -634,57 +634,57 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotData e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.owner_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spells_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.owner_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spells_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.name = row[3] ? row[3] : "";
|
||||
e.last_name = row[4] ? row[4] : "";
|
||||
e.title = row[5] ? row[5] : "";
|
||||
e.suffix = row[6] ? row[6] : "";
|
||||
e.zone_id = static_cast<int16_t>(atoi(row[7]));
|
||||
e.gender = static_cast<int8_t>(atoi(row[8]));
|
||||
e.race = static_cast<int16_t>(atoi(row[9]));
|
||||
e.class_ = static_cast<int8_t>(atoi(row[10]));
|
||||
e.level = static_cast<uint8_t>(strtoul(row[11], nullptr, 10));
|
||||
e.deity = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.creation_day = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.last_spawn = static_cast<uint32_t>(strtoul(row[14], nullptr, 10));
|
||||
e.time_spawned = static_cast<uint32_t>(strtoul(row[15], nullptr, 10));
|
||||
e.size = strtof(row[16], nullptr);
|
||||
e.face = static_cast<int32_t>(atoi(row[17]));
|
||||
e.hair_color = static_cast<int32_t>(atoi(row[18]));
|
||||
e.hair_style = static_cast<int32_t>(atoi(row[19]));
|
||||
e.beard = static_cast<int32_t>(atoi(row[20]));
|
||||
e.beard_color = static_cast<int32_t>(atoi(row[21]));
|
||||
e.eye_color_1 = static_cast<int32_t>(atoi(row[22]));
|
||||
e.eye_color_2 = static_cast<int32_t>(atoi(row[23]));
|
||||
e.drakkin_heritage = static_cast<int32_t>(atoi(row[24]));
|
||||
e.drakkin_tattoo = static_cast<int32_t>(atoi(row[25]));
|
||||
e.drakkin_details = static_cast<int32_t>(atoi(row[26]));
|
||||
e.ac = static_cast<int16_t>(atoi(row[27]));
|
||||
e.atk = static_cast<int32_t>(atoi(row[28]));
|
||||
e.hp = static_cast<int32_t>(atoi(row[29]));
|
||||
e.mana = static_cast<int32_t>(atoi(row[30]));
|
||||
e.str = static_cast<int32_t>(atoi(row[31]));
|
||||
e.sta = static_cast<int32_t>(atoi(row[32]));
|
||||
e.cha = static_cast<int32_t>(atoi(row[33]));
|
||||
e.dex = static_cast<int32_t>(atoi(row[34]));
|
||||
e.int_ = static_cast<int32_t>(atoi(row[35]));
|
||||
e.agi = static_cast<int32_t>(atoi(row[36]));
|
||||
e.wis = static_cast<int32_t>(atoi(row[37]));
|
||||
e.fire = static_cast<int16_t>(atoi(row[38]));
|
||||
e.cold = static_cast<int16_t>(atoi(row[39]));
|
||||
e.magic = static_cast<int16_t>(atoi(row[40]));
|
||||
e.poison = static_cast<int16_t>(atoi(row[41]));
|
||||
e.disease = static_cast<int16_t>(atoi(row[42]));
|
||||
e.corruption = static_cast<int16_t>(atoi(row[43]));
|
||||
e.show_helm = static_cast<uint32_t>(strtoul(row[44], nullptr, 10));
|
||||
e.follow_distance = static_cast<uint32_t>(strtoul(row[45], nullptr, 10));
|
||||
e.stop_melee_level = static_cast<uint8_t>(strtoul(row[46], nullptr, 10));
|
||||
e.expansion_bitmask = static_cast<int32_t>(atoi(row[47]));
|
||||
e.enforce_spell_settings = static_cast<uint8_t>(strtoul(row[48], nullptr, 10));
|
||||
e.archery_setting = static_cast<uint8_t>(strtoul(row[49], nullptr, 10));
|
||||
e.caster_range = static_cast<uint32_t>(strtoul(row[50], nullptr, 10));
|
||||
e.zone_id = row[7] ? static_cast<int16_t>(atoi(row[7])) : 0;
|
||||
e.gender = row[8] ? static_cast<int8_t>(atoi(row[8])) : 0;
|
||||
e.race = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
|
||||
e.class_ = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
||||
e.level = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.deity = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.creation_day = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.last_spawn = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.time_spawned = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.size = row[16] ? strtof(row[16], nullptr) : 0;
|
||||
e.face = row[17] ? static_cast<int32_t>(atoi(row[17])) : 1;
|
||||
e.hair_color = row[18] ? static_cast<int32_t>(atoi(row[18])) : 1;
|
||||
e.hair_style = row[19] ? static_cast<int32_t>(atoi(row[19])) : 1;
|
||||
e.beard = row[20] ? static_cast<int32_t>(atoi(row[20])) : 0;
|
||||
e.beard_color = row[21] ? static_cast<int32_t>(atoi(row[21])) : 1;
|
||||
e.eye_color_1 = row[22] ? static_cast<int32_t>(atoi(row[22])) : 1;
|
||||
e.eye_color_2 = row[23] ? static_cast<int32_t>(atoi(row[23])) : 1;
|
||||
e.drakkin_heritage = row[24] ? static_cast<int32_t>(atoi(row[24])) : 0;
|
||||
e.drakkin_tattoo = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
|
||||
e.drakkin_details = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
|
||||
e.ac = row[27] ? static_cast<int16_t>(atoi(row[27])) : 0;
|
||||
e.atk = row[28] ? static_cast<int32_t>(atoi(row[28])) : 0;
|
||||
e.hp = row[29] ? static_cast<int32_t>(atoi(row[29])) : 0;
|
||||
e.mana = row[30] ? static_cast<int32_t>(atoi(row[30])) : 0;
|
||||
e.str = row[31] ? static_cast<int32_t>(atoi(row[31])) : 75;
|
||||
e.sta = row[32] ? static_cast<int32_t>(atoi(row[32])) : 75;
|
||||
e.cha = row[33] ? static_cast<int32_t>(atoi(row[33])) : 75;
|
||||
e.dex = row[34] ? static_cast<int32_t>(atoi(row[34])) : 75;
|
||||
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
||||
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
||||
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
||||
e.fire = row[38] ? static_cast<int16_t>(atoi(row[38])) : 0;
|
||||
e.cold = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
||||
e.magic = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
||||
e.poison = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
||||
e.disease = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||
e.corruption = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||
e.show_helm = row[44] ? static_cast<uint32_t>(strtoul(row[44], nullptr, 10)) : 0;
|
||||
e.follow_distance = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 200;
|
||||
e.stop_melee_level = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 255;
|
||||
e.expansion_bitmask = row[47] ? static_cast<int32_t>(atoi(row[47])) : -1;
|
||||
e.enforce_spell_settings = row[48] ? static_cast<uint8_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||
e.archery_setting = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||
e.caster_range = row[50] ? static_cast<uint32_t>(strtoul(row[50], nullptr, 10)) : 300;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -709,57 +709,57 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotData e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.owner_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spells_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.owner_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spells_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.name = row[3] ? row[3] : "";
|
||||
e.last_name = row[4] ? row[4] : "";
|
||||
e.title = row[5] ? row[5] : "";
|
||||
e.suffix = row[6] ? row[6] : "";
|
||||
e.zone_id = static_cast<int16_t>(atoi(row[7]));
|
||||
e.gender = static_cast<int8_t>(atoi(row[8]));
|
||||
e.race = static_cast<int16_t>(atoi(row[9]));
|
||||
e.class_ = static_cast<int8_t>(atoi(row[10]));
|
||||
e.level = static_cast<uint8_t>(strtoul(row[11], nullptr, 10));
|
||||
e.deity = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.creation_day = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.last_spawn = static_cast<uint32_t>(strtoul(row[14], nullptr, 10));
|
||||
e.time_spawned = static_cast<uint32_t>(strtoul(row[15], nullptr, 10));
|
||||
e.size = strtof(row[16], nullptr);
|
||||
e.face = static_cast<int32_t>(atoi(row[17]));
|
||||
e.hair_color = static_cast<int32_t>(atoi(row[18]));
|
||||
e.hair_style = static_cast<int32_t>(atoi(row[19]));
|
||||
e.beard = static_cast<int32_t>(atoi(row[20]));
|
||||
e.beard_color = static_cast<int32_t>(atoi(row[21]));
|
||||
e.eye_color_1 = static_cast<int32_t>(atoi(row[22]));
|
||||
e.eye_color_2 = static_cast<int32_t>(atoi(row[23]));
|
||||
e.drakkin_heritage = static_cast<int32_t>(atoi(row[24]));
|
||||
e.drakkin_tattoo = static_cast<int32_t>(atoi(row[25]));
|
||||
e.drakkin_details = static_cast<int32_t>(atoi(row[26]));
|
||||
e.ac = static_cast<int16_t>(atoi(row[27]));
|
||||
e.atk = static_cast<int32_t>(atoi(row[28]));
|
||||
e.hp = static_cast<int32_t>(atoi(row[29]));
|
||||
e.mana = static_cast<int32_t>(atoi(row[30]));
|
||||
e.str = static_cast<int32_t>(atoi(row[31]));
|
||||
e.sta = static_cast<int32_t>(atoi(row[32]));
|
||||
e.cha = static_cast<int32_t>(atoi(row[33]));
|
||||
e.dex = static_cast<int32_t>(atoi(row[34]));
|
||||
e.int_ = static_cast<int32_t>(atoi(row[35]));
|
||||
e.agi = static_cast<int32_t>(atoi(row[36]));
|
||||
e.wis = static_cast<int32_t>(atoi(row[37]));
|
||||
e.fire = static_cast<int16_t>(atoi(row[38]));
|
||||
e.cold = static_cast<int16_t>(atoi(row[39]));
|
||||
e.magic = static_cast<int16_t>(atoi(row[40]));
|
||||
e.poison = static_cast<int16_t>(atoi(row[41]));
|
||||
e.disease = static_cast<int16_t>(atoi(row[42]));
|
||||
e.corruption = static_cast<int16_t>(atoi(row[43]));
|
||||
e.show_helm = static_cast<uint32_t>(strtoul(row[44], nullptr, 10));
|
||||
e.follow_distance = static_cast<uint32_t>(strtoul(row[45], nullptr, 10));
|
||||
e.stop_melee_level = static_cast<uint8_t>(strtoul(row[46], nullptr, 10));
|
||||
e.expansion_bitmask = static_cast<int32_t>(atoi(row[47]));
|
||||
e.enforce_spell_settings = static_cast<uint8_t>(strtoul(row[48], nullptr, 10));
|
||||
e.archery_setting = static_cast<uint8_t>(strtoul(row[49], nullptr, 10));
|
||||
e.caster_range = static_cast<uint32_t>(strtoul(row[50], nullptr, 10));
|
||||
e.zone_id = row[7] ? static_cast<int16_t>(atoi(row[7])) : 0;
|
||||
e.gender = row[8] ? static_cast<int8_t>(atoi(row[8])) : 0;
|
||||
e.race = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
|
||||
e.class_ = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
|
||||
e.level = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.deity = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.creation_day = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.last_spawn = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.time_spawned = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.size = row[16] ? strtof(row[16], nullptr) : 0;
|
||||
e.face = row[17] ? static_cast<int32_t>(atoi(row[17])) : 1;
|
||||
e.hair_color = row[18] ? static_cast<int32_t>(atoi(row[18])) : 1;
|
||||
e.hair_style = row[19] ? static_cast<int32_t>(atoi(row[19])) : 1;
|
||||
e.beard = row[20] ? static_cast<int32_t>(atoi(row[20])) : 0;
|
||||
e.beard_color = row[21] ? static_cast<int32_t>(atoi(row[21])) : 1;
|
||||
e.eye_color_1 = row[22] ? static_cast<int32_t>(atoi(row[22])) : 1;
|
||||
e.eye_color_2 = row[23] ? static_cast<int32_t>(atoi(row[23])) : 1;
|
||||
e.drakkin_heritage = row[24] ? static_cast<int32_t>(atoi(row[24])) : 0;
|
||||
e.drakkin_tattoo = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
|
||||
e.drakkin_details = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
|
||||
e.ac = row[27] ? static_cast<int16_t>(atoi(row[27])) : 0;
|
||||
e.atk = row[28] ? static_cast<int32_t>(atoi(row[28])) : 0;
|
||||
e.hp = row[29] ? static_cast<int32_t>(atoi(row[29])) : 0;
|
||||
e.mana = row[30] ? static_cast<int32_t>(atoi(row[30])) : 0;
|
||||
e.str = row[31] ? static_cast<int32_t>(atoi(row[31])) : 75;
|
||||
e.sta = row[32] ? static_cast<int32_t>(atoi(row[32])) : 75;
|
||||
e.cha = row[33] ? static_cast<int32_t>(atoi(row[33])) : 75;
|
||||
e.dex = row[34] ? static_cast<int32_t>(atoi(row[34])) : 75;
|
||||
e.int_ = row[35] ? static_cast<int32_t>(atoi(row[35])) : 75;
|
||||
e.agi = row[36] ? static_cast<int32_t>(atoi(row[36])) : 75;
|
||||
e.wis = row[37] ? static_cast<int32_t>(atoi(row[37])) : 75;
|
||||
e.fire = row[38] ? static_cast<int16_t>(atoi(row[38])) : 0;
|
||||
e.cold = row[39] ? static_cast<int16_t>(atoi(row[39])) : 0;
|
||||
e.magic = row[40] ? static_cast<int16_t>(atoi(row[40])) : 0;
|
||||
e.poison = row[41] ? static_cast<int16_t>(atoi(row[41])) : 0;
|
||||
e.disease = row[42] ? static_cast<int16_t>(atoi(row[42])) : 0;
|
||||
e.corruption = row[43] ? static_cast<int16_t>(atoi(row[43])) : 0;
|
||||
e.show_helm = row[44] ? static_cast<uint32_t>(strtoul(row[44], nullptr, 10)) : 0;
|
||||
e.follow_distance = row[45] ? static_cast<uint32_t>(strtoul(row[45], nullptr, 10)) : 200;
|
||||
e.stop_melee_level = row[46] ? static_cast<uint8_t>(strtoul(row[46], nullptr, 10)) : 255;
|
||||
e.expansion_bitmask = row[47] ? static_cast<int32_t>(atoi(row[47])) : -1;
|
||||
e.enforce_spell_settings = row[48] ? static_cast<uint8_t>(strtoul(row[48], nullptr, 10)) : 0;
|
||||
e.archery_setting = row[49] ? static_cast<uint8_t>(strtoul(row[49], nullptr, 10)) : 0;
|
||||
e.caster_range = row[50] ? static_cast<uint32_t>(strtoul(row[50], nullptr, 10)) : 300;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -818,6 +818,162 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotData &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.owner_id));
|
||||
v.push_back(std::to_string(e.spells_id));
|
||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.title) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.suffix) + "'");
|
||||
v.push_back(std::to_string(e.zone_id));
|
||||
v.push_back(std::to_string(e.gender));
|
||||
v.push_back(std::to_string(e.race));
|
||||
v.push_back(std::to_string(e.class_));
|
||||
v.push_back(std::to_string(e.level));
|
||||
v.push_back(std::to_string(e.deity));
|
||||
v.push_back(std::to_string(e.creation_day));
|
||||
v.push_back(std::to_string(e.last_spawn));
|
||||
v.push_back(std::to_string(e.time_spawned));
|
||||
v.push_back(std::to_string(e.size));
|
||||
v.push_back(std::to_string(e.face));
|
||||
v.push_back(std::to_string(e.hair_color));
|
||||
v.push_back(std::to_string(e.hair_style));
|
||||
v.push_back(std::to_string(e.beard));
|
||||
v.push_back(std::to_string(e.beard_color));
|
||||
v.push_back(std::to_string(e.eye_color_1));
|
||||
v.push_back(std::to_string(e.eye_color_2));
|
||||
v.push_back(std::to_string(e.drakkin_heritage));
|
||||
v.push_back(std::to_string(e.drakkin_tattoo));
|
||||
v.push_back(std::to_string(e.drakkin_details));
|
||||
v.push_back(std::to_string(e.ac));
|
||||
v.push_back(std::to_string(e.atk));
|
||||
v.push_back(std::to_string(e.hp));
|
||||
v.push_back(std::to_string(e.mana));
|
||||
v.push_back(std::to_string(e.str));
|
||||
v.push_back(std::to_string(e.sta));
|
||||
v.push_back(std::to_string(e.cha));
|
||||
v.push_back(std::to_string(e.dex));
|
||||
v.push_back(std::to_string(e.int_));
|
||||
v.push_back(std::to_string(e.agi));
|
||||
v.push_back(std::to_string(e.wis));
|
||||
v.push_back(std::to_string(e.fire));
|
||||
v.push_back(std::to_string(e.cold));
|
||||
v.push_back(std::to_string(e.magic));
|
||||
v.push_back(std::to_string(e.poison));
|
||||
v.push_back(std::to_string(e.disease));
|
||||
v.push_back(std::to_string(e.corruption));
|
||||
v.push_back(std::to_string(e.show_helm));
|
||||
v.push_back(std::to_string(e.follow_distance));
|
||||
v.push_back(std::to_string(e.stop_melee_level));
|
||||
v.push_back(std::to_string(e.expansion_bitmask));
|
||||
v.push_back(std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(std::to_string(e.archery_setting));
|
||||
v.push_back(std::to_string(e.caster_range));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotData> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.owner_id));
|
||||
v.push_back(std::to_string(e.spells_id));
|
||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.title) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.suffix) + "'");
|
||||
v.push_back(std::to_string(e.zone_id));
|
||||
v.push_back(std::to_string(e.gender));
|
||||
v.push_back(std::to_string(e.race));
|
||||
v.push_back(std::to_string(e.class_));
|
||||
v.push_back(std::to_string(e.level));
|
||||
v.push_back(std::to_string(e.deity));
|
||||
v.push_back(std::to_string(e.creation_day));
|
||||
v.push_back(std::to_string(e.last_spawn));
|
||||
v.push_back(std::to_string(e.time_spawned));
|
||||
v.push_back(std::to_string(e.size));
|
||||
v.push_back(std::to_string(e.face));
|
||||
v.push_back(std::to_string(e.hair_color));
|
||||
v.push_back(std::to_string(e.hair_style));
|
||||
v.push_back(std::to_string(e.beard));
|
||||
v.push_back(std::to_string(e.beard_color));
|
||||
v.push_back(std::to_string(e.eye_color_1));
|
||||
v.push_back(std::to_string(e.eye_color_2));
|
||||
v.push_back(std::to_string(e.drakkin_heritage));
|
||||
v.push_back(std::to_string(e.drakkin_tattoo));
|
||||
v.push_back(std::to_string(e.drakkin_details));
|
||||
v.push_back(std::to_string(e.ac));
|
||||
v.push_back(std::to_string(e.atk));
|
||||
v.push_back(std::to_string(e.hp));
|
||||
v.push_back(std::to_string(e.mana));
|
||||
v.push_back(std::to_string(e.str));
|
||||
v.push_back(std::to_string(e.sta));
|
||||
v.push_back(std::to_string(e.cha));
|
||||
v.push_back(std::to_string(e.dex));
|
||||
v.push_back(std::to_string(e.int_));
|
||||
v.push_back(std::to_string(e.agi));
|
||||
v.push_back(std::to_string(e.wis));
|
||||
v.push_back(std::to_string(e.fire));
|
||||
v.push_back(std::to_string(e.cold));
|
||||
v.push_back(std::to_string(e.magic));
|
||||
v.push_back(std::to_string(e.poison));
|
||||
v.push_back(std::to_string(e.disease));
|
||||
v.push_back(std::to_string(e.corruption));
|
||||
v.push_back(std::to_string(e.show_helm));
|
||||
v.push_back(std::to_string(e.follow_distance));
|
||||
v.push_back(std::to_string(e.stop_melee_level));
|
||||
v.push_back(std::to_string(e.expansion_bitmask));
|
||||
v.push_back(std::to_string(e.enforce_spell_settings));
|
||||
v.push_back(std::to_string(e.archery_setting));
|
||||
v.push_back(std::to_string(e.caster_range));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_DATA_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_HEAL_ROTATION_MEMBERS_REPOSITORY_H
|
||||
@@ -112,8 +112,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_heal_rotation_members_id
|
||||
)
|
||||
);
|
||||
@@ -122,9 +123,9 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotHealRotationMembers e{};
|
||||
|
||||
e.member_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.member_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.heal_rotation_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -249,9 +250,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotHealRotationMembers e{};
|
||||
|
||||
e.member_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.member_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.heal_rotation_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -276,9 +277,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotHealRotationMembers e{};
|
||||
|
||||
e.member_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.member_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.heal_rotation_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -337,6 +338,66 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotHealRotationMembers &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.member_index));
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotHealRotationMembers> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.member_index));
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_HEAL_ROTATION_MEMBERS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_HEAL_ROTATION_TARGETS_REPOSITORY_H
|
||||
@@ -112,8 +112,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_heal_rotation_targets_id
|
||||
)
|
||||
);
|
||||
@@ -122,8 +123,8 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotHealRotationTargets e{};
|
||||
|
||||
e.target_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.target_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.heal_rotation_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.target_name = row[2] ? row[2] : "";
|
||||
|
||||
return e;
|
||||
@@ -249,8 +250,8 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotHealRotationTargets e{};
|
||||
|
||||
e.target_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.target_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.heal_rotation_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.target_name = row[2] ? row[2] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
@@ -276,8 +277,8 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotHealRotationTargets e{};
|
||||
|
||||
e.target_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.target_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.heal_rotation_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.target_name = row[2] ? row[2] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
@@ -337,6 +338,66 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotHealRotationTargets &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.target_index));
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back("'" + Strings::Escape(e.target_name) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotHealRotationTargets> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.target_index));
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back("'" + Strings::Escape(e.target_name) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_HEAL_ROTATION_TARGETS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_HEAL_ROTATIONS_REPOSITORY_H
|
||||
@@ -19,22 +19,22 @@
|
||||
class BaseBotHealRotationsRepository {
|
||||
public:
|
||||
struct BotHealRotations {
|
||||
uint32_t heal_rotation_index;
|
||||
uint32_t bot_id;
|
||||
uint32_t interval;
|
||||
uint32_t fast_heals;
|
||||
uint32_t adaptive_targeting;
|
||||
uint32_t casting_override;
|
||||
std::string safe_hp_base;
|
||||
std::string safe_hp_cloth;
|
||||
std::string safe_hp_leather;
|
||||
std::string safe_hp_chain;
|
||||
std::string safe_hp_plate;
|
||||
std::string critical_hp_base;
|
||||
std::string critical_hp_cloth;
|
||||
std::string critical_hp_leather;
|
||||
std::string critical_hp_chain;
|
||||
std::string critical_hp_plate;
|
||||
uint32_t heal_rotation_index;
|
||||
uint32_t bot_id;
|
||||
uint32_t interval_;
|
||||
uint32_t fast_heals;
|
||||
uint32_t adaptive_targeting;
|
||||
uint32_t casting_override;
|
||||
float safe_hp_base;
|
||||
float safe_hp_cloth;
|
||||
float safe_hp_leather;
|
||||
float safe_hp_chain;
|
||||
float safe_hp_plate;
|
||||
float critical_hp_base;
|
||||
float critical_hp_cloth;
|
||||
float critical_hp_leather;
|
||||
float critical_hp_chain;
|
||||
float critical_hp_plate;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
return {
|
||||
"heal_rotation_index",
|
||||
"bot_id",
|
||||
"interval",
|
||||
"`interval`",
|
||||
"fast_heals",
|
||||
"adaptive_targeting",
|
||||
"casting_override",
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
return {
|
||||
"heal_rotation_index",
|
||||
"bot_id",
|
||||
"interval",
|
||||
"`interval`",
|
||||
"fast_heals",
|
||||
"adaptive_targeting",
|
||||
"casting_override",
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
|
||||
e.heal_rotation_index = 0;
|
||||
e.bot_id = 0;
|
||||
e.interval = 0;
|
||||
e.interval_ = 0;
|
||||
e.fast_heals = 0;
|
||||
e.adaptive_targeting = 0;
|
||||
e.casting_override = 0;
|
||||
@@ -164,8 +164,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_heal_rotations_id
|
||||
)
|
||||
);
|
||||
@@ -174,12 +175,12 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotHealRotations e{};
|
||||
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.interval = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.fast_heals = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.adaptive_targeting = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.casting_override = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.heal_rotation_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.interval_ = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -214,7 +215,7 @@ public:
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.bot_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.interval));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.interval_));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.fast_heals));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.adaptive_targeting));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.casting_override));
|
||||
@@ -251,7 +252,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.interval));
|
||||
v.push_back(std::to_string(e.interval_));
|
||||
v.push_back(std::to_string(e.fast_heals));
|
||||
v.push_back(std::to_string(e.adaptive_targeting));
|
||||
v.push_back(std::to_string(e.casting_override));
|
||||
@@ -296,7 +297,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.interval));
|
||||
v.push_back(std::to_string(e.interval_));
|
||||
v.push_back(std::to_string(e.fast_heals));
|
||||
v.push_back(std::to_string(e.adaptive_targeting));
|
||||
v.push_back(std::to_string(e.casting_override));
|
||||
@@ -343,12 +344,12 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotHealRotations e{};
|
||||
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.interval = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.fast_heals = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.adaptive_targeting = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.casting_override = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.heal_rotation_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.interval_ = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -373,12 +374,12 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotHealRotations e{};
|
||||
|
||||
e.heal_rotation_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.interval = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.fast_heals = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.adaptive_targeting = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.casting_override = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.heal_rotation_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.interval_ = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.fast_heals = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.adaptive_targeting = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.casting_override = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -437,6 +438,92 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotHealRotations &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.interval_));
|
||||
v.push_back(std::to_string(e.fast_heals));
|
||||
v.push_back(std::to_string(e.adaptive_targeting));
|
||||
v.push_back(std::to_string(e.casting_override));
|
||||
v.push_back(std::to_string(e.safe_hp_base));
|
||||
v.push_back(std::to_string(e.safe_hp_cloth));
|
||||
v.push_back(std::to_string(e.safe_hp_leather));
|
||||
v.push_back(std::to_string(e.safe_hp_chain));
|
||||
v.push_back(std::to_string(e.safe_hp_plate));
|
||||
v.push_back(std::to_string(e.critical_hp_base));
|
||||
v.push_back(std::to_string(e.critical_hp_cloth));
|
||||
v.push_back(std::to_string(e.critical_hp_leather));
|
||||
v.push_back(std::to_string(e.critical_hp_chain));
|
||||
v.push_back(std::to_string(e.critical_hp_plate));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotHealRotations> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.heal_rotation_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.interval_));
|
||||
v.push_back(std::to_string(e.fast_heals));
|
||||
v.push_back(std::to_string(e.adaptive_targeting));
|
||||
v.push_back(std::to_string(e.casting_override));
|
||||
v.push_back(std::to_string(e.safe_hp_base));
|
||||
v.push_back(std::to_string(e.safe_hp_cloth));
|
||||
v.push_back(std::to_string(e.safe_hp_leather));
|
||||
v.push_back(std::to_string(e.safe_hp_chain));
|
||||
v.push_back(std::to_string(e.safe_hp_plate));
|
||||
v.push_back(std::to_string(e.critical_hp_base));
|
||||
v.push_back(std::to_string(e.critical_hp_cloth));
|
||||
v.push_back(std::to_string(e.critical_hp_leather));
|
||||
v.push_back(std::to_string(e.critical_hp_chain));
|
||||
v.push_back(std::to_string(e.critical_hp_plate));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_HEAL_ROTATIONS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_INSPECT_MESSAGES_REPOSITORY_H
|
||||
@@ -108,8 +108,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_inspect_messages_id
|
||||
)
|
||||
);
|
||||
@@ -118,7 +119,7 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotInspectMessages e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.inspect_message = row[1] ? row[1] : "";
|
||||
|
||||
return e;
|
||||
@@ -242,7 +243,7 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotInspectMessages e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.inspect_message = row[1] ? row[1] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
@@ -268,7 +269,7 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotInspectMessages e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.inspect_message = row[1] ? row[1] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
@@ -328,6 +329,64 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotInspectMessages &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back("'" + Strings::Escape(e.inspect_message) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotInspectMessages> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back("'" + Strings::Escape(e.inspect_message) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_INSPECT_MESSAGES_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_INVENTORIES_REPOSITORY_H
|
||||
@@ -168,8 +168,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_inventories_id
|
||||
)
|
||||
);
|
||||
@@ -178,23 +179,23 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotInventories e{};
|
||||
|
||||
e.inventories_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.slot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.inst_charges = static_cast<uint16_t>(strtoul(row[4], nullptr, 10));
|
||||
e.inst_color = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.inst_no_drop = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.inventories_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.slot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.inst_charges = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.inst_color = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.inst_no_drop = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.inst_custom_data = row[7] ? row[7] : "";
|
||||
e.ornament_icon = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.ornament_id_file = static_cast<uint32_t>(strtoul(row[9], nullptr, 10));
|
||||
e.ornament_hero_model = static_cast<int32_t>(atoi(row[10]));
|
||||
e.augment_1 = static_cast<uint32_t>(strtoul(row[11], nullptr, 10));
|
||||
e.augment_2 = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.augment_3 = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.augment_4 = static_cast<uint32_t>(strtoul(row[14], nullptr, 10));
|
||||
e.augment_5 = static_cast<uint32_t>(strtoul(row[15], nullptr, 10));
|
||||
e.augment_6 = static_cast<uint32_t>(strtoul(row[16], nullptr, 10));
|
||||
e.ornament_icon = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.ornament_id_file = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.ornament_hero_model = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||
e.augment_1 = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.augment_2 = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.augment_3 = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.augment_4 = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.augment_5 = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.augment_6 = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -361,23 +362,23 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotInventories e{};
|
||||
|
||||
e.inventories_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.slot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.inst_charges = static_cast<uint16_t>(strtoul(row[4], nullptr, 10));
|
||||
e.inst_color = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.inst_no_drop = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.inventories_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.slot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.inst_charges = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.inst_color = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.inst_no_drop = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.inst_custom_data = row[7] ? row[7] : "";
|
||||
e.ornament_icon = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.ornament_id_file = static_cast<uint32_t>(strtoul(row[9], nullptr, 10));
|
||||
e.ornament_hero_model = static_cast<int32_t>(atoi(row[10]));
|
||||
e.augment_1 = static_cast<uint32_t>(strtoul(row[11], nullptr, 10));
|
||||
e.augment_2 = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.augment_3 = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.augment_4 = static_cast<uint32_t>(strtoul(row[14], nullptr, 10));
|
||||
e.augment_5 = static_cast<uint32_t>(strtoul(row[15], nullptr, 10));
|
||||
e.augment_6 = static_cast<uint32_t>(strtoul(row[16], nullptr, 10));
|
||||
e.ornament_icon = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.ornament_id_file = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.ornament_hero_model = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||
e.augment_1 = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.augment_2 = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.augment_3 = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.augment_4 = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.augment_5 = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.augment_6 = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -402,23 +403,23 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotInventories e{};
|
||||
|
||||
e.inventories_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.slot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.inst_charges = static_cast<uint16_t>(strtoul(row[4], nullptr, 10));
|
||||
e.inst_color = static_cast<uint32_t>(strtoul(row[5], nullptr, 10));
|
||||
e.inst_no_drop = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.inventories_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.slot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.inst_charges = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.inst_color = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.inst_no_drop = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.inst_custom_data = row[7] ? row[7] : "";
|
||||
e.ornament_icon = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.ornament_id_file = static_cast<uint32_t>(strtoul(row[9], nullptr, 10));
|
||||
e.ornament_hero_model = static_cast<int32_t>(atoi(row[10]));
|
||||
e.augment_1 = static_cast<uint32_t>(strtoul(row[11], nullptr, 10));
|
||||
e.augment_2 = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||
e.augment_3 = static_cast<uint32_t>(strtoul(row[13], nullptr, 10));
|
||||
e.augment_4 = static_cast<uint32_t>(strtoul(row[14], nullptr, 10));
|
||||
e.augment_5 = static_cast<uint32_t>(strtoul(row[15], nullptr, 10));
|
||||
e.augment_6 = static_cast<uint32_t>(strtoul(row[16], nullptr, 10));
|
||||
e.ornament_icon = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.ornament_id_file = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.ornament_hero_model = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
|
||||
e.augment_1 = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.augment_2 = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.augment_3 = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.augment_4 = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.augment_5 = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.augment_6 = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -477,6 +478,94 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotInventories &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.inventories_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.slot_id));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.inst_charges));
|
||||
v.push_back(std::to_string(e.inst_color));
|
||||
v.push_back(std::to_string(e.inst_no_drop));
|
||||
v.push_back("'" + Strings::Escape(e.inst_custom_data) + "'");
|
||||
v.push_back(std::to_string(e.ornament_icon));
|
||||
v.push_back(std::to_string(e.ornament_id_file));
|
||||
v.push_back(std::to_string(e.ornament_hero_model));
|
||||
v.push_back(std::to_string(e.augment_1));
|
||||
v.push_back(std::to_string(e.augment_2));
|
||||
v.push_back(std::to_string(e.augment_3));
|
||||
v.push_back(std::to_string(e.augment_4));
|
||||
v.push_back(std::to_string(e.augment_5));
|
||||
v.push_back(std::to_string(e.augment_6));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotInventories> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.inventories_index));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.slot_id));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.inst_charges));
|
||||
v.push_back(std::to_string(e.inst_color));
|
||||
v.push_back(std::to_string(e.inst_no_drop));
|
||||
v.push_back("'" + Strings::Escape(e.inst_custom_data) + "'");
|
||||
v.push_back(std::to_string(e.ornament_icon));
|
||||
v.push_back(std::to_string(e.ornament_id_file));
|
||||
v.push_back(std::to_string(e.ornament_hero_model));
|
||||
v.push_back(std::to_string(e.augment_1));
|
||||
v.push_back(std::to_string(e.augment_2));
|
||||
v.push_back(std::to_string(e.augment_3));
|
||||
v.push_back(std::to_string(e.augment_4));
|
||||
v.push_back(std::to_string(e.augment_5));
|
||||
v.push_back(std::to_string(e.augment_6));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_INVENTORIES_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_OWNER_OPTIONS_REPOSITORY_H
|
||||
@@ -112,8 +112,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_owner_options_id
|
||||
)
|
||||
);
|
||||
@@ -122,9 +123,9 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotOwnerOptions e{};
|
||||
|
||||
e.owner_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.option_type = static_cast<uint16_t>(strtoul(row[1], nullptr, 10));
|
||||
e.option_value = static_cast<uint16_t>(strtoul(row[2], nullptr, 10));
|
||||
e.owner_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.option_type = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.option_value = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -250,9 +251,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotOwnerOptions e{};
|
||||
|
||||
e.owner_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.option_type = static_cast<uint16_t>(strtoul(row[1], nullptr, 10));
|
||||
e.option_value = static_cast<uint16_t>(strtoul(row[2], nullptr, 10));
|
||||
e.owner_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.option_type = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.option_value = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -277,9 +278,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotOwnerOptions e{};
|
||||
|
||||
e.owner_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.option_type = static_cast<uint16_t>(strtoul(row[1], nullptr, 10));
|
||||
e.option_value = static_cast<uint16_t>(strtoul(row[2], nullptr, 10));
|
||||
e.owner_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.option_type = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.option_value = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -338,6 +339,66 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotOwnerOptions &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.owner_id));
|
||||
v.push_back(std::to_string(e.option_type));
|
||||
v.push_back(std::to_string(e.option_value));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotOwnerOptions> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.owner_id));
|
||||
v.push_back(std::to_string(e.option_type));
|
||||
v.push_back(std::to_string(e.option_value));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_OWNER_OPTIONS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_PET_BUFFS_REPOSITORY_H
|
||||
@@ -120,8 +120,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_pet_buffs_id
|
||||
)
|
||||
);
|
||||
@@ -130,11 +131,11 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotPetBuffs e{};
|
||||
|
||||
e.pet_buffs_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.caster_level = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.duration = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.duration = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -265,11 +266,11 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotPetBuffs e{};
|
||||
|
||||
e.pet_buffs_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.caster_level = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.duration = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.duration = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -294,11 +295,11 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotPetBuffs e{};
|
||||
|
||||
e.pet_buffs_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.caster_level = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.duration = static_cast<uint32_t>(strtoul(row[4], nullptr, 10));
|
||||
e.pet_buffs_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.spell_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.caster_level = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.duration = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -357,6 +358,70 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotPetBuffs &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.pet_buffs_index));
|
||||
v.push_back(std::to_string(e.pets_index));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.caster_level));
|
||||
v.push_back(std::to_string(e.duration));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotPetBuffs> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.pet_buffs_index));
|
||||
v.push_back(std::to_string(e.pets_index));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.caster_level));
|
||||
v.push_back(std::to_string(e.duration));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_PET_BUFFS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_PET_INVENTORIES_REPOSITORY_H
|
||||
@@ -112,8 +112,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_pet_inventories_id
|
||||
)
|
||||
);
|
||||
@@ -122,9 +123,9 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotPetInventories e{};
|
||||
|
||||
e.pet_inventories_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.pet_inventories_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -249,9 +250,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotPetInventories e{};
|
||||
|
||||
e.pet_inventories_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.pet_inventories_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -276,9 +277,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotPetInventories e{};
|
||||
|
||||
e.pet_inventories_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.pet_inventories_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.pets_index = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -337,6 +338,66 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotPetInventories &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.pet_inventories_index));
|
||||
v.push_back(std::to_string(e.pets_index));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotPetInventories> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.pet_inventories_index));
|
||||
v.push_back(std::to_string(e.pets_index));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_PET_INVENTORIES_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_PETS_REPOSITORY_H
|
||||
@@ -124,8 +124,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_pets_id
|
||||
)
|
||||
);
|
||||
@@ -134,12 +135,12 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotPets e{};
|
||||
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.spell_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.name = row[3] ? row[3] : "";
|
||||
e.mana = static_cast<int32_t>(atoi(row[4]));
|
||||
e.hp = static_cast<int32_t>(atoi(row[5]));
|
||||
e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
|
||||
e.hp = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -273,12 +274,12 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotPets e{};
|
||||
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.spell_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.name = row[3] ? row[3] : "";
|
||||
e.mana = static_cast<int32_t>(atoi(row[4]));
|
||||
e.hp = static_cast<int32_t>(atoi(row[5]));
|
||||
e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
|
||||
e.hp = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -303,12 +304,12 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotPets e{};
|
||||
|
||||
e.pets_index = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.pets_index = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.spell_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.bot_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.name = row[3] ? row[3] : "";
|
||||
e.mana = static_cast<int32_t>(atoi(row[4]));
|
||||
e.hp = static_cast<int32_t>(atoi(row[5]));
|
||||
e.mana = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
|
||||
e.hp = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -367,6 +368,72 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotPets &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.pets_index));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||
v.push_back(std::to_string(e.mana));
|
||||
v.push_back(std::to_string(e.hp));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotPets> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.pets_index));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back("'" + Strings::Escape(e.name) + "'");
|
||||
v.push_back(std::to_string(e.mana));
|
||||
v.push_back(std::to_string(e.hp));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_PETS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_SPELL_CASTING_CHANCES_REPOSITORY_H
|
||||
@@ -180,8 +180,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_spell_casting_chances_id
|
||||
)
|
||||
);
|
||||
@@ -190,26 +191,26 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotSpellCastingChances e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spell_type_index = static_cast<uint8_t>(strtoul(row[1], nullptr, 10));
|
||||
e.class_id = static_cast<uint8_t>(strtoul(row[2], nullptr, 10));
|
||||
e.stance_index = static_cast<uint8_t>(strtoul(row[3], nullptr, 10));
|
||||
e.nHSND_value = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.pH_value = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.pS_value = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.pHS_value = static_cast<uint8_t>(strtoul(row[7], nullptr, 10));
|
||||
e.pN_value = static_cast<uint8_t>(strtoul(row[8], nullptr, 10));
|
||||
e.pHN_value = static_cast<uint8_t>(strtoul(row[9], nullptr, 10));
|
||||
e.pSN_value = static_cast<uint8_t>(strtoul(row[10], nullptr, 10));
|
||||
e.pHSN_value = static_cast<uint8_t>(strtoul(row[11], nullptr, 10));
|
||||
e.pD_value = static_cast<uint8_t>(strtoul(row[12], nullptr, 10));
|
||||
e.pHD_value = static_cast<uint8_t>(strtoul(row[13], nullptr, 10));
|
||||
e.pSD_value = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.pHSD_value = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
||||
e.pND_value = static_cast<uint8_t>(strtoul(row[16], nullptr, 10));
|
||||
e.pHND_value = static_cast<uint8_t>(strtoul(row[17], nullptr, 10));
|
||||
e.pSND_value = static_cast<uint8_t>(strtoul(row[18], nullptr, 10));
|
||||
e.pHSND_value = static_cast<uint8_t>(strtoul(row[19], nullptr, 10));
|
||||
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||
e.spell_type_index = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.class_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.stance_index = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.nHSND_value = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.pH_value = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.pS_value = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.pHS_value = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.pN_value = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.pHN_value = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.pSN_value = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||
e.pHSN_value = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.pD_value = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.pHD_value = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.pSD_value = row[14] ? static_cast<uint8_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.pHSD_value = row[15] ? static_cast<uint8_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.pND_value = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
e.pHND_value = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
|
||||
e.pSND_value = row[18] ? static_cast<uint8_t>(strtoul(row[18], nullptr, 10)) : 0;
|
||||
e.pHSND_value = row[19] ? static_cast<uint8_t>(strtoul(row[19], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -385,26 +386,26 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSpellCastingChances e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spell_type_index = static_cast<uint8_t>(strtoul(row[1], nullptr, 10));
|
||||
e.class_id = static_cast<uint8_t>(strtoul(row[2], nullptr, 10));
|
||||
e.stance_index = static_cast<uint8_t>(strtoul(row[3], nullptr, 10));
|
||||
e.nHSND_value = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.pH_value = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.pS_value = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.pHS_value = static_cast<uint8_t>(strtoul(row[7], nullptr, 10));
|
||||
e.pN_value = static_cast<uint8_t>(strtoul(row[8], nullptr, 10));
|
||||
e.pHN_value = static_cast<uint8_t>(strtoul(row[9], nullptr, 10));
|
||||
e.pSN_value = static_cast<uint8_t>(strtoul(row[10], nullptr, 10));
|
||||
e.pHSN_value = static_cast<uint8_t>(strtoul(row[11], nullptr, 10));
|
||||
e.pD_value = static_cast<uint8_t>(strtoul(row[12], nullptr, 10));
|
||||
e.pHD_value = static_cast<uint8_t>(strtoul(row[13], nullptr, 10));
|
||||
e.pSD_value = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.pHSD_value = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
||||
e.pND_value = static_cast<uint8_t>(strtoul(row[16], nullptr, 10));
|
||||
e.pHND_value = static_cast<uint8_t>(strtoul(row[17], nullptr, 10));
|
||||
e.pSND_value = static_cast<uint8_t>(strtoul(row[18], nullptr, 10));
|
||||
e.pHSND_value = static_cast<uint8_t>(strtoul(row[19], nullptr, 10));
|
||||
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||
e.spell_type_index = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.class_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.stance_index = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.nHSND_value = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.pH_value = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.pS_value = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.pHS_value = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.pN_value = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.pHN_value = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.pSN_value = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||
e.pHSN_value = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.pD_value = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.pHD_value = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.pSD_value = row[14] ? static_cast<uint8_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.pHSD_value = row[15] ? static_cast<uint8_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.pND_value = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
e.pHND_value = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
|
||||
e.pSND_value = row[18] ? static_cast<uint8_t>(strtoul(row[18], nullptr, 10)) : 0;
|
||||
e.pHSND_value = row[19] ? static_cast<uint8_t>(strtoul(row[19], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -429,26 +430,26 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSpellCastingChances e{};
|
||||
|
||||
e.id = static_cast<int32_t>(atoi(row[0]));
|
||||
e.spell_type_index = static_cast<uint8_t>(strtoul(row[1], nullptr, 10));
|
||||
e.class_id = static_cast<uint8_t>(strtoul(row[2], nullptr, 10));
|
||||
e.stance_index = static_cast<uint8_t>(strtoul(row[3], nullptr, 10));
|
||||
e.nHSND_value = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.pH_value = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.pS_value = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.pHS_value = static_cast<uint8_t>(strtoul(row[7], nullptr, 10));
|
||||
e.pN_value = static_cast<uint8_t>(strtoul(row[8], nullptr, 10));
|
||||
e.pHN_value = static_cast<uint8_t>(strtoul(row[9], nullptr, 10));
|
||||
e.pSN_value = static_cast<uint8_t>(strtoul(row[10], nullptr, 10));
|
||||
e.pHSN_value = static_cast<uint8_t>(strtoul(row[11], nullptr, 10));
|
||||
e.pD_value = static_cast<uint8_t>(strtoul(row[12], nullptr, 10));
|
||||
e.pHD_value = static_cast<uint8_t>(strtoul(row[13], nullptr, 10));
|
||||
e.pSD_value = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.pHSD_value = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
||||
e.pND_value = static_cast<uint8_t>(strtoul(row[16], nullptr, 10));
|
||||
e.pHND_value = static_cast<uint8_t>(strtoul(row[17], nullptr, 10));
|
||||
e.pSND_value = static_cast<uint8_t>(strtoul(row[18], nullptr, 10));
|
||||
e.pHSND_value = static_cast<uint8_t>(strtoul(row[19], nullptr, 10));
|
||||
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||
e.spell_type_index = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.class_id = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.stance_index = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.nHSND_value = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.pH_value = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.pS_value = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.pHS_value = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.pN_value = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
e.pHN_value = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||
e.pSN_value = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||
e.pHSN_value = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||
e.pD_value = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||
e.pHD_value = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
|
||||
e.pSD_value = row[14] ? static_cast<uint8_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
e.pHSD_value = row[15] ? static_cast<uint8_t>(strtoul(row[15], nullptr, 10)) : 0;
|
||||
e.pND_value = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
e.pHND_value = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
|
||||
e.pSND_value = row[18] ? static_cast<uint8_t>(strtoul(row[18], nullptr, 10)) : 0;
|
||||
e.pHSND_value = row[19] ? static_cast<uint8_t>(strtoul(row[19], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -507,6 +508,100 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotSpellCastingChances &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.spell_type_index));
|
||||
v.push_back(std::to_string(e.class_id));
|
||||
v.push_back(std::to_string(e.stance_index));
|
||||
v.push_back(std::to_string(e.nHSND_value));
|
||||
v.push_back(std::to_string(e.pH_value));
|
||||
v.push_back(std::to_string(e.pS_value));
|
||||
v.push_back(std::to_string(e.pHS_value));
|
||||
v.push_back(std::to_string(e.pN_value));
|
||||
v.push_back(std::to_string(e.pHN_value));
|
||||
v.push_back(std::to_string(e.pSN_value));
|
||||
v.push_back(std::to_string(e.pHSN_value));
|
||||
v.push_back(std::to_string(e.pD_value));
|
||||
v.push_back(std::to_string(e.pHD_value));
|
||||
v.push_back(std::to_string(e.pSD_value));
|
||||
v.push_back(std::to_string(e.pHSD_value));
|
||||
v.push_back(std::to_string(e.pND_value));
|
||||
v.push_back(std::to_string(e.pHND_value));
|
||||
v.push_back(std::to_string(e.pSND_value));
|
||||
v.push_back(std::to_string(e.pHSND_value));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotSpellCastingChances> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.spell_type_index));
|
||||
v.push_back(std::to_string(e.class_id));
|
||||
v.push_back(std::to_string(e.stance_index));
|
||||
v.push_back(std::to_string(e.nHSND_value));
|
||||
v.push_back(std::to_string(e.pH_value));
|
||||
v.push_back(std::to_string(e.pS_value));
|
||||
v.push_back(std::to_string(e.pHS_value));
|
||||
v.push_back(std::to_string(e.pN_value));
|
||||
v.push_back(std::to_string(e.pHN_value));
|
||||
v.push_back(std::to_string(e.pSN_value));
|
||||
v.push_back(std::to_string(e.pHSN_value));
|
||||
v.push_back(std::to_string(e.pD_value));
|
||||
v.push_back(std::to_string(e.pHD_value));
|
||||
v.push_back(std::to_string(e.pSD_value));
|
||||
v.push_back(std::to_string(e.pHSD_value));
|
||||
v.push_back(std::to_string(e.pND_value));
|
||||
v.push_back(std::to_string(e.pHND_value));
|
||||
v.push_back(std::to_string(e.pSND_value));
|
||||
v.push_back(std::to_string(e.pHSND_value));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_SPELL_CASTING_CHANCES_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_SPELL_SETTINGS_REPOSITORY_H
|
||||
@@ -128,8 +128,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_spell_settings_id
|
||||
)
|
||||
);
|
||||
@@ -138,13 +139,13 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotSpellSettings e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.spell_id = static_cast<int16_t>(atoi(row[2]));
|
||||
e.priority = static_cast<int16_t>(atoi(row[3]));
|
||||
e.min_hp = static_cast<int16_t>(atoi(row[4]));
|
||||
e.max_hp = static_cast<int16_t>(atoi(row[5]));
|
||||
e.is_enabled = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||
e.spell_id = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
||||
e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
|
||||
e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
|
||||
e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
|
||||
e.is_enabled = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -281,13 +282,13 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSpellSettings e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.spell_id = static_cast<int16_t>(atoi(row[2]));
|
||||
e.priority = static_cast<int16_t>(atoi(row[3]));
|
||||
e.min_hp = static_cast<int16_t>(atoi(row[4]));
|
||||
e.max_hp = static_cast<int16_t>(atoi(row[5]));
|
||||
e.is_enabled = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||
e.spell_id = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
||||
e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
|
||||
e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
|
||||
e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
|
||||
e.is_enabled = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -312,13 +313,13 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSpellSettings e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.bot_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.spell_id = static_cast<int16_t>(atoi(row[2]));
|
||||
e.priority = static_cast<int16_t>(atoi(row[3]));
|
||||
e.min_hp = static_cast<int16_t>(atoi(row[4]));
|
||||
e.max_hp = static_cast<int16_t>(atoi(row[5]));
|
||||
e.is_enabled = static_cast<uint8_t>(strtoul(row[6], nullptr, 10));
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.bot_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||
e.spell_id = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
||||
e.priority = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
|
||||
e.min_hp = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
|
||||
e.max_hp = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
|
||||
e.is_enabled = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -377,6 +378,74 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotSpellSettings &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.priority));
|
||||
v.push_back(std::to_string(e.min_hp));
|
||||
v.push_back(std::to_string(e.max_hp));
|
||||
v.push_back(std::to_string(e.is_enabled));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotSpellSettings> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.priority));
|
||||
v.push_back(std::to_string(e.min_hp));
|
||||
v.push_back(std::to_string(e.max_hp));
|
||||
v.push_back(std::to_string(e.is_enabled));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_SPELL_SETTINGS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_SPELLS_ENTRIES_REPOSITORY_H
|
||||
@@ -160,8 +160,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_spells_entries_id
|
||||
)
|
||||
);
|
||||
@@ -170,21 +171,21 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotSpellsEntries e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.npc_spells_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.spellid = static_cast<int16_t>(atoi(row[2]));
|
||||
e.type = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.minlevel = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.maxlevel = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.manacost = static_cast<int16_t>(atoi(row[6]));
|
||||
e.recast_delay = static_cast<int32_t>(atoi(row[7]));
|
||||
e.priority = static_cast<int16_t>(atoi(row[8]));
|
||||
e.resist_adjust = static_cast<int32_t>(atoi(row[9]));
|
||||
e.min_hp = static_cast<int16_t>(atoi(row[10]));
|
||||
e.max_hp = static_cast<int16_t>(atoi(row[11]));
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||
e.spellid = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
||||
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
||||
e.manacost = row[6] ? static_cast<int16_t>(atoi(row[6])) : -1;
|
||||
e.recast_delay = row[7] ? static_cast<int32_t>(atoi(row[7])) : -1;
|
||||
e.priority = row[8] ? static_cast<int16_t>(atoi(row[8])) : 0;
|
||||
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
||||
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
||||
e.bucket_name = row[12] ? row[12] : "";
|
||||
e.bucket_value = row[13] ? row[13] : "";
|
||||
e.bucket_comparison = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.bucket_comparison = row[14] ? static_cast<uint8_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -345,21 +346,21 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSpellsEntries e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.npc_spells_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.spellid = static_cast<int16_t>(atoi(row[2]));
|
||||
e.type = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.minlevel = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.maxlevel = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.manacost = static_cast<int16_t>(atoi(row[6]));
|
||||
e.recast_delay = static_cast<int32_t>(atoi(row[7]));
|
||||
e.priority = static_cast<int16_t>(atoi(row[8]));
|
||||
e.resist_adjust = static_cast<int32_t>(atoi(row[9]));
|
||||
e.min_hp = static_cast<int16_t>(atoi(row[10]));
|
||||
e.max_hp = static_cast<int16_t>(atoi(row[11]));
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||
e.spellid = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
||||
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
||||
e.manacost = row[6] ? static_cast<int16_t>(atoi(row[6])) : -1;
|
||||
e.recast_delay = row[7] ? static_cast<int32_t>(atoi(row[7])) : -1;
|
||||
e.priority = row[8] ? static_cast<int16_t>(atoi(row[8])) : 0;
|
||||
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
||||
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
||||
e.bucket_name = row[12] ? row[12] : "";
|
||||
e.bucket_value = row[13] ? row[13] : "";
|
||||
e.bucket_comparison = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.bucket_comparison = row[14] ? static_cast<uint8_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -384,21 +385,21 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotSpellsEntries e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.npc_spells_id = static_cast<int32_t>(atoi(row[1]));
|
||||
e.spellid = static_cast<int16_t>(atoi(row[2]));
|
||||
e.type = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.minlevel = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.maxlevel = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.manacost = static_cast<int16_t>(atoi(row[6]));
|
||||
e.recast_delay = static_cast<int32_t>(atoi(row[7]));
|
||||
e.priority = static_cast<int16_t>(atoi(row[8]));
|
||||
e.resist_adjust = static_cast<int32_t>(atoi(row[9]));
|
||||
e.min_hp = static_cast<int16_t>(atoi(row[10]));
|
||||
e.max_hp = static_cast<int16_t>(atoi(row[11]));
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||
e.spellid = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
||||
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
||||
e.manacost = row[6] ? static_cast<int16_t>(atoi(row[6])) : -1;
|
||||
e.recast_delay = row[7] ? static_cast<int32_t>(atoi(row[7])) : -1;
|
||||
e.priority = row[8] ? static_cast<int16_t>(atoi(row[8])) : 0;
|
||||
e.resist_adjust = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
|
||||
e.min_hp = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
|
||||
e.max_hp = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
|
||||
e.bucket_name = row[12] ? row[12] : "";
|
||||
e.bucket_value = row[13] ? row[13] : "";
|
||||
e.bucket_comparison = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||
e.bucket_comparison = row[14] ? static_cast<uint8_t>(strtoul(row[14], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -457,6 +458,90 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotSpellsEntries &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.npc_spells_id));
|
||||
v.push_back(std::to_string(e.spellid));
|
||||
v.push_back(std::to_string(e.type));
|
||||
v.push_back(std::to_string(e.minlevel));
|
||||
v.push_back(std::to_string(e.maxlevel));
|
||||
v.push_back(std::to_string(e.manacost));
|
||||
v.push_back(std::to_string(e.recast_delay));
|
||||
v.push_back(std::to_string(e.priority));
|
||||
v.push_back(std::to_string(e.resist_adjust));
|
||||
v.push_back(std::to_string(e.min_hp));
|
||||
v.push_back(std::to_string(e.max_hp));
|
||||
v.push_back("'" + Strings::Escape(e.bucket_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.bucket_value) + "'");
|
||||
v.push_back(std::to_string(e.bucket_comparison));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotSpellsEntries> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.npc_spells_id));
|
||||
v.push_back(std::to_string(e.spellid));
|
||||
v.push_back(std::to_string(e.type));
|
||||
v.push_back(std::to_string(e.minlevel));
|
||||
v.push_back(std::to_string(e.maxlevel));
|
||||
v.push_back(std::to_string(e.manacost));
|
||||
v.push_back(std::to_string(e.recast_delay));
|
||||
v.push_back(std::to_string(e.priority));
|
||||
v.push_back(std::to_string(e.resist_adjust));
|
||||
v.push_back(std::to_string(e.min_hp));
|
||||
v.push_back(std::to_string(e.max_hp));
|
||||
v.push_back("'" + Strings::Escape(e.bucket_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.bucket_value) + "'");
|
||||
v.push_back(std::to_string(e.bucket_comparison));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_SPELLS_ENTRIES_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_STANCES_REPOSITORY_H
|
||||
@@ -108,8 +108,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
bot_stances_id
|
||||
)
|
||||
);
|
||||
@@ -118,8 +119,8 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotStances e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.stance_id = static_cast<uint8_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.stance_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -242,8 +243,8 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotStances e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.stance_id = static_cast<uint8_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.stance_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -268,8 +269,8 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotStances e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.stance_id = static_cast<uint8_t>(strtoul(row[1], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.stance_id = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -328,6 +329,64 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotStances &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.stance_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotStances> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.stance_id));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_STANCES_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseBotStartingItemsRepository {
|
||||
public:
|
||||
struct BotStartingItems {
|
||||
@@ -25,6 +24,7 @@ public:
|
||||
uint32_t classes;
|
||||
uint32_t item_id;
|
||||
uint8_t item_charges;
|
||||
uint8_t min_status;
|
||||
int32_t slot_id;
|
||||
int8_t min_expansion;
|
||||
int8_t max_expansion;
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
"classes",
|
||||
"item_id",
|
||||
"item_charges",
|
||||
"min_status",
|
||||
"slot_id",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
@@ -61,6 +62,7 @@ public:
|
||||
"classes",
|
||||
"item_id",
|
||||
"item_charges",
|
||||
"min_status",
|
||||
"slot_id",
|
||||
"min_expansion",
|
||||
"max_expansion",
|
||||
@@ -111,6 +113,7 @@ public:
|
||||
e.classes = 0;
|
||||
e.item_id = 0;
|
||||
e.item_charges = 1;
|
||||
e.min_status = 0;
|
||||
e.slot_id = -1;
|
||||
e.min_expansion = -1;
|
||||
e.max_expansion = -1;
|
||||
@@ -152,16 +155,17 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotStartingItems e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.races = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.classes = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.item_charges = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.slot_id = static_cast<int32_t>(atoi(row[5]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||
e.content_flags = row[8] ? row[8] : "";
|
||||
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.races = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
||||
e.min_status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.slot_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : -1;
|
||||
e.min_expansion = row[7] ? static_cast<int8_t>(atoi(row[7])) : -1;
|
||||
e.max_expansion = row[8] ? static_cast<int8_t>(atoi(row[8])) : -1;
|
||||
e.content_flags = row[9] ? row[9] : "";
|
||||
e.content_flags_disabled = row[10] ? row[10] : "";
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -199,11 +203,12 @@ public:
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.classes));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.item_id));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.item_charges));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.slot_id));
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[8] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[9] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.min_status));
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.slot_id));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.min_expansion));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.max_expansion));
|
||||
v.push_back(columns[9] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back(columns[10] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -230,6 +235,7 @@ public:
|
||||
v.push_back(std::to_string(e.classes));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.item_charges));
|
||||
v.push_back(std::to_string(e.min_status));
|
||||
v.push_back(std::to_string(e.slot_id));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
@@ -269,6 +275,7 @@ public:
|
||||
v.push_back(std::to_string(e.classes));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.item_charges));
|
||||
v.push_back(std::to_string(e.min_status));
|
||||
v.push_back(std::to_string(e.slot_id));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
@@ -307,16 +314,17 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotStartingItems e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.races = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.classes = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.item_charges = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.slot_id = static_cast<int32_t>(atoi(row[5]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||
e.content_flags = row[8] ? row[8] : "";
|
||||
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.races = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
||||
e.min_status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.slot_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : -1;
|
||||
e.min_expansion = row[7] ? static_cast<int8_t>(atoi(row[7])) : -1;
|
||||
e.max_expansion = row[8] ? static_cast<int8_t>(atoi(row[8])) : -1;
|
||||
e.content_flags = row[9] ? row[9] : "";
|
||||
e.content_flags_disabled = row[10] ? row[10] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -341,16 +349,17 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotStartingItems e{};
|
||||
|
||||
e.id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.races = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.classes = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.item_charges = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.slot_id = static_cast<int32_t>(atoi(row[5]));
|
||||
e.min_expansion = static_cast<int8_t>(atoi(row[6]));
|
||||
e.max_expansion = static_cast<int8_t>(atoi(row[7]));
|
||||
e.content_flags = row[8] ? row[8] : "";
|
||||
e.content_flags_disabled = row[9] ? row[9] : "";
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.races = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
||||
e.min_status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.slot_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : -1;
|
||||
e.min_expansion = row[7] ? static_cast<int8_t>(atoi(row[7])) : -1;
|
||||
e.max_expansion = row[8] ? static_cast<int8_t>(atoi(row[8])) : -1;
|
||||
e.content_flags = row[9] ? row[9] : "";
|
||||
e.content_flags_disabled = row[10] ? row[10] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -409,6 +418,82 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotStartingItems &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.races));
|
||||
v.push_back(std::to_string(e.classes));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.item_charges));
|
||||
v.push_back(std::to_string(e.min_status));
|
||||
v.push_back(std::to_string(e.slot_id));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotStartingItems> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.races));
|
||||
v.push_back(std::to_string(e.classes));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
v.push_back(std::to_string(e.item_charges));
|
||||
v.push_back(std::to_string(e.min_status));
|
||||
v.push_back(std::to_string(e.slot_id));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
v.push_back(std::to_string(e.max_expansion));
|
||||
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_STARTING_ITEMS_REPOSITORY_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Any modifications to base repositories are to be made by the generator only
|
||||
*
|
||||
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||
* @docs https://docs.eqemu.io/developer/repositories
|
||||
*/
|
||||
|
||||
#ifndef EQEMU_BASE_BOT_TIMERS_REPOSITORY_H
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseBotTimersRepository {
|
||||
public:
|
||||
struct BotTimers {
|
||||
@@ -148,15 +147,15 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
BotTimers e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.timer_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.timer_value = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.recast_time = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.is_spell = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.is_disc = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[6], nullptr, 10));
|
||||
e.is_item = static_cast<uint8_t>(strtoul(row[7], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.timer_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.timer_value = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.spell_id = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -300,15 +299,15 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotTimers e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.timer_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.timer_value = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.recast_time = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.is_spell = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.is_disc = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[6], nullptr, 10));
|
||||
e.is_item = static_cast<uint8_t>(strtoul(row[7], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.timer_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.timer_value = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.spell_id = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -333,15 +332,15 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
BotTimers e{};
|
||||
|
||||
e.bot_id = static_cast<uint32_t>(strtoul(row[0], nullptr, 10));
|
||||
e.timer_id = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
e.timer_value = static_cast<uint32_t>(strtoul(row[2], nullptr, 10));
|
||||
e.recast_time = static_cast<uint32_t>(strtoul(row[3], nullptr, 10));
|
||||
e.is_spell = static_cast<uint8_t>(strtoul(row[4], nullptr, 10));
|
||||
e.is_disc = static_cast<uint8_t>(strtoul(row[5], nullptr, 10));
|
||||
e.spell_id = static_cast<uint32_t>(strtoul(row[6], nullptr, 10));
|
||||
e.is_item = static_cast<uint8_t>(strtoul(row[7], nullptr, 10));
|
||||
e.item_id = static_cast<uint32_t>(strtoul(row[8], nullptr, 10));
|
||||
e.bot_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.timer_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.timer_value = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.recast_time = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.is_spell = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.is_disc = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
e.spell_id = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||
e.is_item = row[7] ? static_cast<uint8_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||
e.item_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -400,6 +399,78 @@ public:
|
||||
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||
}
|
||||
|
||||
static std::string BaseReplace()
|
||||
{
|
||||
return fmt::format(
|
||||
"REPLACE INTO {} ({}) ",
|
||||
TableName(),
|
||||
ColumnsRaw()
|
||||
);
|
||||
}
|
||||
|
||||
static int ReplaceOne(
|
||||
Database& db,
|
||||
const BotTimers &e
|
||||
)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.timer_id));
|
||||
v.push_back(std::to_string(e.timer_value));
|
||||
v.push_back(std::to_string(e.recast_time));
|
||||
v.push_back(std::to_string(e.is_spell));
|
||||
v.push_back(std::to_string(e.is_disc));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.is_item));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES ({})",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", v)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
|
||||
static int ReplaceMany(
|
||||
Database& db,
|
||||
const std::vector<BotTimers> &entries
|
||||
)
|
||||
{
|
||||
std::vector<std::string> insert_chunks;
|
||||
|
||||
for (auto &e: entries) {
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.bot_id));
|
||||
v.push_back(std::to_string(e.timer_id));
|
||||
v.push_back(std::to_string(e.timer_value));
|
||||
v.push_back(std::to_string(e.recast_time));
|
||||
v.push_back(std::to_string(e.is_spell));
|
||||
v.push_back(std::to_string(e.is_disc));
|
||||
v.push_back(std::to_string(e.spell_id));
|
||||
v.push_back(std::to_string(e.is_item));
|
||||
v.push_back(std::to_string(e.item_id));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
std::vector<std::string> v;
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} VALUES {}",
|
||||
BaseReplace(),
|
||||
Strings::Implode(",", insert_chunks)
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BASE_BOT_TIMERS_REPOSITORY_H
|
||||
|
||||
@@ -330,9 +330,9 @@ public:
|
||||
v.push_back(columns[24] + " = " + std::to_string(e._unknown_value));
|
||||
v.push_back(columns[25] + " = '" + Strings::Escape(e.bug_report) + "'");
|
||||
v.push_back(columns[26] + " = '" + Strings::Escape(e.system_info) + "'");
|
||||
v.push_back(columns[27] + " = FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[27] + " = FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
|
||||
v.push_back(columns[28] + " = " + std::to_string(e.bug_status));
|
||||
v.push_back(columns[29] + " = FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[29] + " = FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
|
||||
v.push_back(columns[30] + " = '" + Strings::Escape(e.last_reviewer) + "'");
|
||||
v.push_back(columns[31] + " = '" + Strings::Escape(e.reviewer_notes) + "'");
|
||||
|
||||
@@ -383,9 +383,9 @@ public:
|
||||
v.push_back(std::to_string(e._unknown_value));
|
||||
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.system_info) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.bug_status));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");
|
||||
|
||||
@@ -444,9 +444,9 @@ public:
|
||||
v.push_back(std::to_string(e._unknown_value));
|
||||
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.system_info) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.bug_status));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");
|
||||
|
||||
@@ -671,9 +671,9 @@ public:
|
||||
v.push_back(std::to_string(e._unknown_value));
|
||||
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.system_info) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.bug_status));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");
|
||||
|
||||
@@ -725,9 +725,9 @@ public:
|
||||
v.push_back(std::to_string(e._unknown_value));
|
||||
v.push_back("'" + Strings::Escape(e.bug_report) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.system_info) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.report_datetime > 0 ? std::to_string(e.report_datetime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.bug_status));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_review > 0 ? std::to_string(e.last_review) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_reviewer) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.reviewer_notes) + "'");
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.y));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.z));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.heading));
|
||||
v.push_back(columns[9] + " = FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[9] + " = FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
|
||||
v.push_back(columns[10] + " = " + std::to_string(e.guild_consent_id));
|
||||
v.push_back(columns[11] + " = " + std::to_string(e.is_rezzed));
|
||||
v.push_back(columns[12] + " = " + std::to_string(e.is_buried));
|
||||
@@ -455,7 +455,7 @@ public:
|
||||
v.push_back(std::to_string(e.y));
|
||||
v.push_back(std::to_string(e.z));
|
||||
v.push_back(std::to_string(e.heading));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
|
||||
v.push_back(std::to_string(e.guild_consent_id));
|
||||
v.push_back(std::to_string(e.is_rezzed));
|
||||
v.push_back(std::to_string(e.is_buried));
|
||||
@@ -531,7 +531,7 @@ public:
|
||||
v.push_back(std::to_string(e.y));
|
||||
v.push_back(std::to_string(e.z));
|
||||
v.push_back(std::to_string(e.heading));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
|
||||
v.push_back(std::to_string(e.guild_consent_id));
|
||||
v.push_back(std::to_string(e.is_rezzed));
|
||||
v.push_back(std::to_string(e.is_buried));
|
||||
@@ -803,7 +803,7 @@ public:
|
||||
v.push_back(std::to_string(e.y));
|
||||
v.push_back(std::to_string(e.z));
|
||||
v.push_back(std::to_string(e.heading));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
|
||||
v.push_back(std::to_string(e.guild_consent_id));
|
||||
v.push_back(std::to_string(e.is_rezzed));
|
||||
v.push_back(std::to_string(e.is_buried));
|
||||
@@ -872,7 +872,7 @@ public:
|
||||
v.push_back(std::to_string(e.y));
|
||||
v.push_back(std::to_string(e.z));
|
||||
v.push_back(std::to_string(e.heading));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.time_of_death > 0 ? std::to_string(e.time_of_death) : "null") + ")");
|
||||
v.push_back(std::to_string(e.guild_consent_id));
|
||||
v.push_back(std::to_string(e.is_rezzed));
|
||||
v.push_back(std::to_string(e.is_buried));
|
||||
|
||||
@@ -760,7 +760,7 @@ public:
|
||||
v.push_back(columns[99] + " = " + std::to_string(e.aa_points_spent_old));
|
||||
v.push_back(columns[100] + " = " + std::to_string(e.aa_points_old));
|
||||
v.push_back(columns[101] + " = " + std::to_string(e.e_last_invsnapshot));
|
||||
v.push_back(columns[102] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[102] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -884,7 +884,7 @@ public:
|
||||
v.push_back(std::to_string(e.aa_points_spent_old));
|
||||
v.push_back(std::to_string(e.aa_points_old));
|
||||
v.push_back(std::to_string(e.e_last_invsnapshot));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -1016,7 +1016,7 @@ public:
|
||||
v.push_back(std::to_string(e.aa_points_spent_old));
|
||||
v.push_back(std::to_string(e.aa_points_old));
|
||||
v.push_back(std::to_string(e.e_last_invsnapshot));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -1456,7 +1456,7 @@ public:
|
||||
v.push_back(std::to_string(e.aa_points_spent_old));
|
||||
v.push_back(std::to_string(e.aa_points_old));
|
||||
v.push_back(std::to_string(e.e_last_invsnapshot));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -1581,7 +1581,7 @@ public:
|
||||
v.push_back(std::to_string(e.aa_points_spent_old));
|
||||
v.push_back(std::to_string(e.aa_points_old));
|
||||
v.push_back(std::to_string(e.e_last_invsnapshot));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.character_id));
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.expedition_name) + "'");
|
||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.duration));
|
||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
v.push_back(std::to_string(e.character_id));
|
||||
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
v.push_back(std::to_string(e.character_id));
|
||||
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -398,7 +398,7 @@ public:
|
||||
v.push_back(std::to_string(e.character_id));
|
||||
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
v.push_back(std::to_string(e.character_id));
|
||||
v.push_back("'" + Strings::Escape(e.expedition_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
struct CharacterLeadershipAbilities {
|
||||
uint32_t id;
|
||||
uint16_t slot;
|
||||
uint16_t rank;
|
||||
uint16_t rank_;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
return {
|
||||
"id",
|
||||
"slot",
|
||||
"rank",
|
||||
"`rank`",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
return {
|
||||
"id",
|
||||
"slot",
|
||||
"rank",
|
||||
"`rank`",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ public:
|
||||
{
|
||||
CharacterLeadershipAbilities e{};
|
||||
|
||||
e.id = 0;
|
||||
e.slot = 0;
|
||||
e.rank = 0;
|
||||
e.id = 0;
|
||||
e.slot = 0;
|
||||
e.rank_ = 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -123,9 +123,9 @@ public:
|
||||
if (results.RowCount() == 1) {
|
||||
CharacterLeadershipAbilities e{};
|
||||
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.slot = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.slot = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank_ = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.slot));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.rank));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.rank_));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.slot));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.slot));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -251,9 +251,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterLeadershipAbilities e{};
|
||||
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.slot = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.slot = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank_ = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -278,9 +278,9 @@ public:
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
CharacterLeadershipAbilities e{};
|
||||
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.slot = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.slot = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank_ = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
|
||||
all_entries.push_back(e);
|
||||
}
|
||||
@@ -357,7 +357,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.slot));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -382,7 +382,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.slot));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -586,8 +586,8 @@ public:
|
||||
v.push_back(columns[69] + " = " + std::to_string(e.alcohol));
|
||||
v.push_back(columns[70] + " = " + std::to_string(e.fishing));
|
||||
v.push_back(columns[71] + " = " + std::to_string(e.tinkering));
|
||||
v.push_back(columns[72] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[73] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[72] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back(columns[73] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -681,8 +681,8 @@ public:
|
||||
v.push_back(std::to_string(e.alcohol));
|
||||
v.push_back(std::to_string(e.fishing));
|
||||
v.push_back(std::to_string(e.tinkering));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -784,8 +784,8 @@ public:
|
||||
v.push_back(std::to_string(e.alcohol));
|
||||
v.push_back(std::to_string(e.fishing));
|
||||
v.push_back(std::to_string(e.tinkering));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -1137,8 +1137,8 @@ public:
|
||||
v.push_back(std::to_string(e.alcohol));
|
||||
v.push_back(std::to_string(e.fishing));
|
||||
v.push_back(std::to_string(e.tinkering));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -1233,8 +1233,8 @@ public:
|
||||
v.push_back(std::to_string(e.alcohol));
|
||||
v.push_back(std::to_string(e.fishing));
|
||||
v.push_back(std::to_string(e.tinkering));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.task_id));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.timer_type));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.timer_group));
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back(std::to_string(e.timer_type));
|
||||
v.push_back(std::to_string(e.timer_group));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back(std::to_string(e.timer_type));
|
||||
v.push_back(std::to_string(e.timer_group));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back(std::to_string(e.timer_type));
|
||||
v.push_back(std::to_string(e.timer_group));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back(std::to_string(e.timer_type));
|
||||
v.push_back(std::to_string(e.timer_group));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -172,8 +172,8 @@ public:
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.shared_task_id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.activity_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.done_count));
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -198,8 +198,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -232,8 +232,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -378,8 +378,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -405,8 +405,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -176,9 +176,9 @@ public:
|
||||
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.task_id));
|
||||
v.push_back(columns[2] + " = FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[2] + " = FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -203,9 +203,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -238,9 +238,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
@@ -387,9 +387,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -415,9 +415,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
|
||||
@@ -171,8 +171,8 @@ public:
|
||||
|
||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.webhook_name) + "'");
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.webhook_url) + "'");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -197,8 +197,8 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back("'" + Strings::Escape(e.webhook_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.webhook_url) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -231,8 +231,8 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back("'" + Strings::Escape(e.webhook_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.webhook_url) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -377,8 +377,8 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back("'" + Strings::Escape(e.webhook_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.webhook_url) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -404,8 +404,8 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back("'" + Strings::Escape(e.webhook_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.webhook_url) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.expedition_id));
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.duration));
|
||||
v.push_back(columns[5] + " = '" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.expedition_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.expedition_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.expedition_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
@@ -415,7 +415,7 @@ public:
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.expedition_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_name) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.duration));
|
||||
v.push_back("'" + Strings::Escape(e.from_expedition_uuid) + "'");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
struct GuildMembers {
|
||||
int32_t char_id;
|
||||
uint32_t guild_id;
|
||||
uint8_t rank;
|
||||
uint8_t rank_;
|
||||
uint8_t tribute_enable;
|
||||
uint32_t total_tribute;
|
||||
uint32_t last_tribute;
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
return {
|
||||
"char_id",
|
||||
"guild_id",
|
||||
"rank",
|
||||
"`rank`",
|
||||
"tribute_enable",
|
||||
"total_tribute",
|
||||
"last_tribute",
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
return {
|
||||
"char_id",
|
||||
"guild_id",
|
||||
"rank",
|
||||
"`rank`",
|
||||
"tribute_enable",
|
||||
"total_tribute",
|
||||
"last_tribute",
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
e.char_id = 0;
|
||||
e.guild_id = 0;
|
||||
e.rank = 0;
|
||||
e.rank_ = 0;
|
||||
e.tribute_enable = 0;
|
||||
e.total_tribute = 0;
|
||||
e.last_tribute = 0;
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
|
||||
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||
e.guild_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.rank_ = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.tribute_enable = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.total_tribute = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.last_tribute = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.char_id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.guild_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.rank));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.rank_));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.tribute_enable));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.total_tribute));
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.last_tribute));
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.tribute_enable));
|
||||
v.push_back(std::to_string(e.total_tribute));
|
||||
v.push_back(std::to_string(e.last_tribute));
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.tribute_enable));
|
||||
v.push_back(std::to_string(e.total_tribute));
|
||||
v.push_back(std::to_string(e.last_tribute));
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
|
||||
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||
e.guild_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.rank_ = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.tribute_enable = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.total_tribute = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.last_tribute = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
@@ -343,7 +343,7 @@ public:
|
||||
|
||||
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||
e.guild_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.rank_ = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||
e.tribute_enable = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||
e.total_tribute = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||
e.last_tribute = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.tribute_enable));
|
||||
v.push_back(std::to_string(e.total_tribute));
|
||||
v.push_back(std::to_string(e.last_tribute));
|
||||
@@ -459,7 +459,7 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.char_id));
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.tribute_enable));
|
||||
v.push_back(std::to_string(e.total_tribute));
|
||||
v.push_back(std::to_string(e.last_tribute));
|
||||
|
||||
@@ -20,7 +20,7 @@ class BaseGuildRanksRepository {
|
||||
public:
|
||||
struct GuildRanks {
|
||||
uint32_t guild_id;
|
||||
uint8_t rank;
|
||||
uint8_t rank_;
|
||||
std::string title;
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
{
|
||||
return {
|
||||
"guild_id",
|
||||
"rank",
|
||||
"`rank`",
|
||||
"title",
|
||||
};
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
{
|
||||
return {
|
||||
"guild_id",
|
||||
"rank",
|
||||
"`rank`",
|
||||
"title",
|
||||
};
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
GuildRanks e{};
|
||||
|
||||
e.guild_id = 0;
|
||||
e.rank = 0;
|
||||
e.rank_ = 0;
|
||||
e.title = "";
|
||||
|
||||
return e;
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
GuildRanks e{};
|
||||
|
||||
e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.rank = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.title = row[2] ? row[2] : "";
|
||||
|
||||
return e;
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.guild_id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.rank));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.rank_));
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.title) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back("'" + Strings::Escape(e.title) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back("'" + Strings::Escape(e.title) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
GuildRanks e{};
|
||||
|
||||
e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.rank = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.title = row[2] ? row[2] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
GuildRanks e{};
|
||||
|
||||
e.guild_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||
e.rank = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.rank_ = row[1] ? static_cast<uint8_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||
e.title = row[2] ? row[2] : "";
|
||||
|
||||
all_entries.push_back(e);
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back("'" + Strings::Escape(e.title) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
std::vector<std::string> v;
|
||||
|
||||
v.push_back(std::to_string(e.guild_id));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back("'" + Strings::Escape(e.title) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
|
||||
@@ -1703,7 +1703,7 @@ public:
|
||||
v.push_back(columns[131] + " = " + std::to_string(e.UNK124));
|
||||
v.push_back(columns[132] + " = " + std::to_string(e.attuneable));
|
||||
v.push_back(columns[133] + " = " + std::to_string(e.nopet));
|
||||
v.push_back(columns[134] + " = FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[134] + " = FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "null") + ")");
|
||||
v.push_back(columns[135] + " = '" + Strings::Escape(e.comment) + "'");
|
||||
v.push_back(columns[136] + " = " + std::to_string(e.UNK127));
|
||||
v.push_back(columns[137] + " = " + std::to_string(e.pointtype));
|
||||
@@ -1733,8 +1733,8 @@ public:
|
||||
v.push_back(columns[161] + " = " + std::to_string(e.scrolllevel2));
|
||||
v.push_back(columns[162] + " = " + std::to_string(e.scrolllevel));
|
||||
v.push_back(columns[163] + " = " + std::to_string(e.UNK157));
|
||||
v.push_back(columns[164] + " = FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[165] + " = FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[164] + " = FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "null") + ")");
|
||||
v.push_back(columns[165] + " = FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "null") + ")");
|
||||
v.push_back(columns[166] + " = '" + Strings::Escape(e.serialization) + "'");
|
||||
v.push_back(columns[167] + " = '" + Strings::Escape(e.source) + "'");
|
||||
v.push_back(columns[168] + " = " + std::to_string(e.UNK033));
|
||||
@@ -2009,7 +2009,7 @@ public:
|
||||
v.push_back(std::to_string(e.UNK124));
|
||||
v.push_back(std::to_string(e.attuneable));
|
||||
v.push_back(std::to_string(e.nopet));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.comment) + "'");
|
||||
v.push_back(std::to_string(e.UNK127));
|
||||
v.push_back(std::to_string(e.pointtype));
|
||||
@@ -2039,8 +2039,8 @@ public:
|
||||
v.push_back(std::to_string(e.scrolllevel2));
|
||||
v.push_back(std::to_string(e.scrolllevel));
|
||||
v.push_back(std::to_string(e.UNK157));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.serialization) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source) + "'");
|
||||
v.push_back(std::to_string(e.UNK033));
|
||||
@@ -2323,7 +2323,7 @@ public:
|
||||
v.push_back(std::to_string(e.UNK124));
|
||||
v.push_back(std::to_string(e.attuneable));
|
||||
v.push_back(std::to_string(e.nopet));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.comment) + "'");
|
||||
v.push_back(std::to_string(e.UNK127));
|
||||
v.push_back(std::to_string(e.pointtype));
|
||||
@@ -2353,8 +2353,8 @@ public:
|
||||
v.push_back(std::to_string(e.scrolllevel2));
|
||||
v.push_back(std::to_string(e.scrolllevel));
|
||||
v.push_back(std::to_string(e.UNK157));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.serialization) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source) + "'");
|
||||
v.push_back(std::to_string(e.UNK033));
|
||||
@@ -3309,7 +3309,7 @@ public:
|
||||
v.push_back(std::to_string(e.UNK124));
|
||||
v.push_back(std::to_string(e.attuneable));
|
||||
v.push_back(std::to_string(e.nopet));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.comment) + "'");
|
||||
v.push_back(std::to_string(e.UNK127));
|
||||
v.push_back(std::to_string(e.pointtype));
|
||||
@@ -3339,8 +3339,8 @@ public:
|
||||
v.push_back(std::to_string(e.scrolllevel2));
|
||||
v.push_back(std::to_string(e.scrolllevel));
|
||||
v.push_back(std::to_string(e.UNK157));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.serialization) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source) + "'");
|
||||
v.push_back(std::to_string(e.UNK033));
|
||||
@@ -3616,7 +3616,7 @@ public:
|
||||
v.push_back(std::to_string(e.UNK124));
|
||||
v.push_back(std::to_string(e.attuneable));
|
||||
v.push_back(std::to_string(e.nopet));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated > 0 ? std::to_string(e.updated) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.comment) + "'");
|
||||
v.push_back(std::to_string(e.UNK127));
|
||||
v.push_back(std::to_string(e.pointtype));
|
||||
@@ -3646,8 +3646,8 @@ public:
|
||||
v.push_back(std::to_string(e.scrolllevel2));
|
||||
v.push_back(std::to_string(e.scrolllevel));
|
||||
v.push_back(std::to_string(e.UNK157));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.serialized > 0 ? std::to_string(e.serialized) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.verified > 0 ? std::to_string(e.verified) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.serialization) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source) + "'");
|
||||
v.push_back(std::to_string(e.UNK033));
|
||||
|
||||
@@ -195,9 +195,9 @@ public:
|
||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.account_email) + "'");
|
||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.source_loginserver) + "'");
|
||||
v.push_back(columns[5] + " = '" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back(columns[6] + " = FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[7] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[8] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[6] + " = FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back(columns[7] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back(columns[8] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -225,9 +225,9 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.account_email) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source_loginserver) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -263,9 +263,9 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.account_email) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source_loginserver) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -421,9 +421,9 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.account_email) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source_loginserver) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -452,9 +452,9 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.account_email) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.source_loginserver) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ public:
|
||||
v.push_back(columns[1] + " = '" + Strings::Escape(e.token) + "'");
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.can_write));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.can_read));
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -204,8 +204,8 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.token) + "'");
|
||||
v.push_back(std::to_string(e.can_write));
|
||||
v.push_back(std::to_string(e.can_read));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -239,8 +239,8 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.token) + "'");
|
||||
v.push_back(std::to_string(e.can_write));
|
||||
v.push_back(std::to_string(e.can_read));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -388,8 +388,8 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.token) + "'");
|
||||
v.push_back(std::to_string(e.can_write));
|
||||
v.push_back(std::to_string(e.can_read));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -416,8 +416,8 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.token) + "'");
|
||||
v.push_back(std::to_string(e.can_write));
|
||||
v.push_back(std::to_string(e.can_read));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_at > 0 ? std::to_string(e.updated_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.first_name) + "'");
|
||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back(columns[5] + " = '" + Strings::Escape(e.email) + "'");
|
||||
v.push_back(columns[6] + " = FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[6] + " = FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "null") + ")");
|
||||
v.push_back(columns[7] + " = '" + Strings::Escape(e.registration_ip_address) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.first_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.email) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.registration_ip_address) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.first_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.email) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.registration_ip_address) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
@@ -410,7 +410,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.first_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.email) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.registration_ip_address) + "'");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -440,7 +440,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.first_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.last_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.email) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.registration_date > 0 ? std::to_string(e.registration_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.registration_ip_address) + "'");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
v.push_back(columns[2] + " = '" + Strings::Escape(e.short_name) + "'");
|
||||
v.push_back(columns[3] + " = '" + Strings::Escape(e.tag_description) + "'");
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.login_server_list_type_id));
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.login_server_admin_id));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.is_server_trusted));
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.short_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.tag_description) + "'");
|
||||
v.push_back(std::to_string(e.login_server_list_type_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back(std::to_string(e.login_server_admin_id));
|
||||
v.push_back(std::to_string(e.is_server_trusted));
|
||||
@@ -268,7 +268,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.short_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.tag_description) + "'");
|
||||
v.push_back(std::to_string(e.login_server_list_type_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back(std::to_string(e.login_server_admin_id));
|
||||
v.push_back(std::to_string(e.is_server_trusted));
|
||||
@@ -429,7 +429,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.short_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.tag_description) + "'");
|
||||
v.push_back(std::to_string(e.login_server_list_type_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back(std::to_string(e.login_server_admin_id));
|
||||
v.push_back(std::to_string(e.is_server_trusted));
|
||||
@@ -461,7 +461,7 @@ public:
|
||||
v.push_back("'" + Strings::Escape(e.short_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.tag_description) + "'");
|
||||
v.push_back(std::to_string(e.login_server_list_type_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.last_login_date > 0 ? std::to_string(e.last_login_date) : "null") + ")");
|
||||
v.push_back("'" + Strings::Escape(e.last_ip_address) + "'");
|
||||
v.push_back(std::to_string(e.login_server_admin_id));
|
||||
v.push_back(std::to_string(e.is_server_trusted));
|
||||
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.bagidx));
|
||||
v.push_back(columns[3] + " = " + std::to_string(e.itemid));
|
||||
v.push_back(columns[4] + " = " + std::to_string(e.charges));
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[5] + " = FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "null") + ")");
|
||||
v.push_back(columns[6] + " = " + std::to_string(e.augslot1));
|
||||
v.push_back(columns[7] + " = " + std::to_string(e.augslot2));
|
||||
v.push_back(columns[8] + " = " + std::to_string(e.augslot3));
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
v.push_back(std::to_string(e.bagidx));
|
||||
v.push_back(std::to_string(e.itemid));
|
||||
v.push_back(std::to_string(e.charges));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.augslot1));
|
||||
v.push_back(std::to_string(e.augslot2));
|
||||
v.push_back(std::to_string(e.augslot3));
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
v.push_back(std::to_string(e.bagidx));
|
||||
v.push_back(std::to_string(e.itemid));
|
||||
v.push_back(std::to_string(e.charges));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.augslot1));
|
||||
v.push_back(std::to_string(e.augslot2));
|
||||
v.push_back(std::to_string(e.augslot3));
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
v.push_back(std::to_string(e.bagidx));
|
||||
v.push_back(std::to_string(e.itemid));
|
||||
v.push_back(std::to_string(e.charges));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.augslot1));
|
||||
v.push_back(std::to_string(e.augslot2));
|
||||
v.push_back(std::to_string(e.augslot3));
|
||||
@@ -484,7 +484,7 @@ public:
|
||||
v.push_back(std::to_string(e.bagidx));
|
||||
v.push_back(std::to_string(e.itemid));
|
||||
v.push_back(std::to_string(e.charges));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.droptime > 0 ? std::to_string(e.droptime) : "null") + ")");
|
||||
v.push_back(std::to_string(e.augslot1));
|
||||
v.push_back(std::to_string(e.augslot2));
|
||||
v.push_back(std::to_string(e.augslot3));
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
class BasePetsBeastlordDataRepository {
|
||||
public:
|
||||
struct PetsBeastlordData {
|
||||
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;
|
||||
uint32_t player_race;
|
||||
uint32_t pet_race;
|
||||
uint8_t texture;
|
||||
uint8_t helm_texture;
|
||||
uint8_t gender;
|
||||
float size_modifier;
|
||||
uint8_t face;
|
||||
};
|
||||
|
||||
static std::string PrimaryKey()
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
v.push_back(columns[9] + " = " + std::to_string(e.event_type_id));
|
||||
v.push_back(columns[10] + " = '" + Strings::Escape(e.event_type_name) + "'");
|
||||
v.push_back(columns[11] + " = '" + Strings::Escape(e.event_data) + "'");
|
||||
v.push_back(columns[12] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[12] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -275,7 +275,7 @@ public:
|
||||
v.push_back(std::to_string(e.event_type_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_type_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_data) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -317,7 +317,7 @@ public:
|
||||
v.push_back(std::to_string(e.event_type_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_type_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_data) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -487,7 +487,7 @@ public:
|
||||
v.push_back(std::to_string(e.event_type_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_type_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_data) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -522,7 +522,7 @@ public:
|
||||
v.push_back(std::to_string(e.event_type_id));
|
||||
v.push_back("'" + Strings::Escape(e.event_type_name) + "'");
|
||||
v.push_back("'" + Strings::Escape(e.event_data) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -243,8 +243,8 @@ public:
|
||||
v.push_back(columns[12] + " = " + std::to_string(e.month_end));
|
||||
v.push_back(columns[13] + " = " + std::to_string(e.year_end));
|
||||
v.push_back(columns[14] + " = '" + Strings::Escape(e.cron_expression) + "'");
|
||||
v.push_back(columns[15] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[16] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[15] + " = FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back(columns[16] + " = FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -281,8 +281,8 @@ public:
|
||||
v.push_back(std::to_string(e.month_end));
|
||||
v.push_back(std::to_string(e.year_end));
|
||||
v.push_back("'" + Strings::Escape(e.cron_expression) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -327,8 +327,8 @@ public:
|
||||
v.push_back(std::to_string(e.month_end));
|
||||
v.push_back(std::to_string(e.year_end));
|
||||
v.push_back("'" + Strings::Escape(e.cron_expression) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -509,8 +509,8 @@ public:
|
||||
v.push_back(std::to_string(e.month_end));
|
||||
v.push_back(std::to_string(e.year_end));
|
||||
v.push_back("'" + Strings::Escape(e.cron_expression) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -548,8 +548,8 @@ public:
|
||||
v.push_back(std::to_string(e.month_end));
|
||||
v.push_back(std::to_string(e.year_end));
|
||||
v.push_back("'" + Strings::Escape(e.cron_expression) + "'");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.created_at > 0 ? std::to_string(e.created_at) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.deleted_at > 0 ? std::to_string(e.deleted_at) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -172,8 +172,8 @@ public:
|
||||
v.push_back(columns[0] + " = " + std::to_string(e.shared_task_id));
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.activity_id));
|
||||
v.push_back(columns[2] + " = " + std::to_string(e.done_count));
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -198,8 +198,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -232,8 +232,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
@@ -378,8 +378,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
@@ -405,8 +405,8 @@ public:
|
||||
v.push_back(std::to_string(e.shared_task_id));
|
||||
v.push_back(std::to_string(e.activity_id));
|
||||
v.push_back(std::to_string(e.done_count));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.updated_time > 0 ? std::to_string(e.updated_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completed_time > 0 ? std::to_string(e.completed_time) : "null") + ")");
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
}
|
||||
|
||||
@@ -175,9 +175,9 @@ public:
|
||||
auto columns = Columns();
|
||||
|
||||
v.push_back(columns[1] + " = " + std::to_string(e.task_id));
|
||||
v.push_back(columns[2] + " = FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back(columns[2] + " = FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back(columns[3] + " = FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back(columns[4] + " = FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(columns[5] + " = " + std::to_string(e.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -202,9 +202,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -237,9 +237,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
@@ -386,9 +386,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
auto results = db.QueryDatabase(
|
||||
@@ -414,9 +414,9 @@ public:
|
||||
|
||||
v.push_back(std::to_string(e.id));
|
||||
v.push_back(std::to_string(e.task_id));
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "UNIX_TIMESTAMP()") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.accepted_time > 0 ? std::to_string(e.accepted_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.expire_time > 0 ? std::to_string(e.expire_time) : "null") + ")");
|
||||
v.push_back("FROM_UNIXTIME(" + (e.completion_time > 0 ? std::to_string(e.completion_time) : "null") + ")");
|
||||
v.push_back(std::to_string(e.is_locked));
|
||||
|
||||
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
int32_t no_block;
|
||||
int32_t field206;
|
||||
int32_t spellgroup;
|
||||
int32_t rank;
|
||||
int32_t rank_;
|
||||
int32_t field209;
|
||||
int32_t field210;
|
||||
int32_t CastRestriction;
|
||||
@@ -474,7 +474,7 @@ public:
|
||||
"no_block",
|
||||
"field206",
|
||||
"spellgroup",
|
||||
"rank",
|
||||
"`rank`",
|
||||
"field209",
|
||||
"field210",
|
||||
"CastRestriction",
|
||||
@@ -717,7 +717,7 @@ public:
|
||||
"no_block",
|
||||
"field206",
|
||||
"spellgroup",
|
||||
"rank",
|
||||
"`rank`",
|
||||
"field209",
|
||||
"field210",
|
||||
"CastRestriction",
|
||||
@@ -994,7 +994,7 @@ public:
|
||||
e.no_block = 0;
|
||||
e.field206 = -1;
|
||||
e.spellgroup = 0;
|
||||
e.rank = 0;
|
||||
e.rank_ = 0;
|
||||
e.field209 = 0;
|
||||
e.field210 = 1;
|
||||
e.CastRestriction = 0;
|
||||
@@ -1267,7 +1267,7 @@ public:
|
||||
e.no_block = row[205] ? static_cast<int32_t>(atoi(row[205])) : 0;
|
||||
e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1;
|
||||
e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0;
|
||||
e.rank = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
|
||||
e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
|
||||
e.field209 = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0;
|
||||
e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1;
|
||||
e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0;
|
||||
@@ -1537,7 +1537,7 @@ public:
|
||||
v.push_back(columns[205] + " = " + std::to_string(e.no_block));
|
||||
v.push_back(columns[206] + " = " + std::to_string(e.field206));
|
||||
v.push_back(columns[207] + " = " + std::to_string(e.spellgroup));
|
||||
v.push_back(columns[208] + " = " + std::to_string(e.rank));
|
||||
v.push_back(columns[208] + " = " + std::to_string(e.rank_));
|
||||
v.push_back(columns[209] + " = " + std::to_string(e.field209));
|
||||
v.push_back(columns[210] + " = " + std::to_string(e.field210));
|
||||
v.push_back(columns[211] + " = " + std::to_string(e.CastRestriction));
|
||||
@@ -1795,7 +1795,7 @@ public:
|
||||
v.push_back(std::to_string(e.no_block));
|
||||
v.push_back(std::to_string(e.field206));
|
||||
v.push_back(std::to_string(e.spellgroup));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.field209));
|
||||
v.push_back(std::to_string(e.field210));
|
||||
v.push_back(std::to_string(e.CastRestriction));
|
||||
@@ -2061,7 +2061,7 @@ public:
|
||||
v.push_back(std::to_string(e.no_block));
|
||||
v.push_back(std::to_string(e.field206));
|
||||
v.push_back(std::to_string(e.spellgroup));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.field209));
|
||||
v.push_back(std::to_string(e.field210));
|
||||
v.push_back(std::to_string(e.CastRestriction));
|
||||
@@ -2331,7 +2331,7 @@ public:
|
||||
e.no_block = row[205] ? static_cast<int32_t>(atoi(row[205])) : 0;
|
||||
e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1;
|
||||
e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0;
|
||||
e.rank = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
|
||||
e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
|
||||
e.field209 = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0;
|
||||
e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1;
|
||||
e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0;
|
||||
@@ -2592,7 +2592,7 @@ public:
|
||||
e.no_block = row[205] ? static_cast<int32_t>(atoi(row[205])) : 0;
|
||||
e.field206 = row[206] ? static_cast<int32_t>(atoi(row[206])) : -1;
|
||||
e.spellgroup = row[207] ? static_cast<int32_t>(atoi(row[207])) : 0;
|
||||
e.rank = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
|
||||
e.rank_ = row[208] ? static_cast<int32_t>(atoi(row[208])) : 0;
|
||||
e.field209 = row[209] ? static_cast<int32_t>(atoi(row[209])) : 0;
|
||||
e.field210 = row[210] ? static_cast<int32_t>(atoi(row[210])) : 1;
|
||||
e.CastRestriction = row[211] ? static_cast<int32_t>(atoi(row[211])) : 0;
|
||||
@@ -2903,7 +2903,7 @@ public:
|
||||
v.push_back(std::to_string(e.no_block));
|
||||
v.push_back(std::to_string(e.field206));
|
||||
v.push_back(std::to_string(e.spellgroup));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.field209));
|
||||
v.push_back(std::to_string(e.field210));
|
||||
v.push_back(std::to_string(e.CastRestriction));
|
||||
@@ -3162,7 +3162,7 @@ public:
|
||||
v.push_back(std::to_string(e.no_block));
|
||||
v.push_back(std::to_string(e.field206));
|
||||
v.push_back(std::to_string(e.spellgroup));
|
||||
v.push_back(std::to_string(e.rank));
|
||||
v.push_back(std::to_string(e.rank_));
|
||||
v.push_back(std::to_string(e.field209));
|
||||
v.push_back(std::to_string(e.field210));
|
||||
v.push_back(std::to_string(e.CastRestriction));
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
uint32_t respawn_time;
|
||||
uint32_t respawn_var;
|
||||
int8_t triggered_number;
|
||||
int8_t group;
|
||||
int8_t group_;
|
||||
int8_t despawn_when_triggered;
|
||||
int8_t undetectable;
|
||||
int8_t min_expansion;
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
"respawn_time",
|
||||
"respawn_var",
|
||||
"triggered_number",
|
||||
"group",
|
||||
"`group`",
|
||||
"despawn_when_triggered",
|
||||
"undetectable",
|
||||
"min_expansion",
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
"respawn_time",
|
||||
"respawn_var",
|
||||
"triggered_number",
|
||||
"group",
|
||||
"`group`",
|
||||
"despawn_when_triggered",
|
||||
"undetectable",
|
||||
"min_expansion",
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
e.respawn_time = 60;
|
||||
e.respawn_var = 0;
|
||||
e.triggered_number = 0;
|
||||
e.group = 0;
|
||||
e.group_ = 0;
|
||||
e.despawn_when_triggered = 0;
|
||||
e.undetectable = 0;
|
||||
e.min_expansion = -1;
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
e.respawn_time = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 60;
|
||||
e.respawn_var = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
e.triggered_number = row[17] ? static_cast<int8_t>(atoi(row[17])) : 0;
|
||||
e.group = row[18] ? static_cast<int8_t>(atoi(row[18])) : 0;
|
||||
e.group_ = row[18] ? static_cast<int8_t>(atoi(row[18])) : 0;
|
||||
e.despawn_when_triggered = row[19] ? static_cast<int8_t>(atoi(row[19])) : 0;
|
||||
e.undetectable = row[20] ? static_cast<int8_t>(atoi(row[20])) : 0;
|
||||
e.min_expansion = row[21] ? static_cast<int8_t>(atoi(row[21])) : -1;
|
||||
@@ -286,7 +286,7 @@ public:
|
||||
v.push_back(columns[15] + " = " + std::to_string(e.respawn_time));
|
||||
v.push_back(columns[16] + " = " + std::to_string(e.respawn_var));
|
||||
v.push_back(columns[17] + " = " + std::to_string(e.triggered_number));
|
||||
v.push_back(columns[18] + " = " + std::to_string(e.group));
|
||||
v.push_back(columns[18] + " = " + std::to_string(e.group_));
|
||||
v.push_back(columns[19] + " = " + std::to_string(e.despawn_when_triggered));
|
||||
v.push_back(columns[20] + " = " + std::to_string(e.undetectable));
|
||||
v.push_back(columns[21] + " = " + std::to_string(e.min_expansion));
|
||||
@@ -332,7 +332,7 @@ public:
|
||||
v.push_back(std::to_string(e.respawn_time));
|
||||
v.push_back(std::to_string(e.respawn_var));
|
||||
v.push_back(std::to_string(e.triggered_number));
|
||||
v.push_back(std::to_string(e.group));
|
||||
v.push_back(std::to_string(e.group_));
|
||||
v.push_back(std::to_string(e.despawn_when_triggered));
|
||||
v.push_back(std::to_string(e.undetectable));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
v.push_back(std::to_string(e.respawn_time));
|
||||
v.push_back(std::to_string(e.respawn_var));
|
||||
v.push_back(std::to_string(e.triggered_number));
|
||||
v.push_back(std::to_string(e.group));
|
||||
v.push_back(std::to_string(e.group_));
|
||||
v.push_back(std::to_string(e.despawn_when_triggered));
|
||||
v.push_back(std::to_string(e.undetectable));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
@@ -444,7 +444,7 @@ public:
|
||||
e.respawn_time = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 60;
|
||||
e.respawn_var = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
e.triggered_number = row[17] ? static_cast<int8_t>(atoi(row[17])) : 0;
|
||||
e.group = row[18] ? static_cast<int8_t>(atoi(row[18])) : 0;
|
||||
e.group_ = row[18] ? static_cast<int8_t>(atoi(row[18])) : 0;
|
||||
e.despawn_when_triggered = row[19] ? static_cast<int8_t>(atoi(row[19])) : 0;
|
||||
e.undetectable = row[20] ? static_cast<int8_t>(atoi(row[20])) : 0;
|
||||
e.min_expansion = row[21] ? static_cast<int8_t>(atoi(row[21])) : -1;
|
||||
@@ -493,7 +493,7 @@ public:
|
||||
e.respawn_time = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 60;
|
||||
e.respawn_var = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
|
||||
e.triggered_number = row[17] ? static_cast<int8_t>(atoi(row[17])) : 0;
|
||||
e.group = row[18] ? static_cast<int8_t>(atoi(row[18])) : 0;
|
||||
e.group_ = row[18] ? static_cast<int8_t>(atoi(row[18])) : 0;
|
||||
e.despawn_when_triggered = row[19] ? static_cast<int8_t>(atoi(row[19])) : 0;
|
||||
e.undetectable = row[20] ? static_cast<int8_t>(atoi(row[20])) : 0;
|
||||
e.min_expansion = row[21] ? static_cast<int8_t>(atoi(row[21])) : -1;
|
||||
@@ -592,7 +592,7 @@ public:
|
||||
v.push_back(std::to_string(e.respawn_time));
|
||||
v.push_back(std::to_string(e.respawn_var));
|
||||
v.push_back(std::to_string(e.triggered_number));
|
||||
v.push_back(std::to_string(e.group));
|
||||
v.push_back(std::to_string(e.group_));
|
||||
v.push_back(std::to_string(e.despawn_when_triggered));
|
||||
v.push_back(std::to_string(e.undetectable));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
@@ -639,7 +639,7 @@ public:
|
||||
v.push_back(std::to_string(e.respawn_time));
|
||||
v.push_back(std::to_string(e.respawn_var));
|
||||
v.push_back(std::to_string(e.triggered_number));
|
||||
v.push_back(std::to_string(e.group));
|
||||
v.push_back(std::to_string(e.group_));
|
||||
v.push_back(std::to_string(e.despawn_when_triggered));
|
||||
v.push_back(std::to_string(e.undetectable));
|
||||
v.push_back(std::to_string(e.min_expansion));
|
||||
|
||||
@@ -44,7 +44,46 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static bool SaveAllHelmAppearances(Database& db, const uint32 owner_id, const bool show_flag)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `show_helm` = {} WHERE `owner_id` = {}",
|
||||
TableName(),
|
||||
show_flag ? 1 : 0,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool ToggleAllHelmAppearances(Database& db, const uint32 owner_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `show_helm` = (`show_helm` XOR '1') WHERE `owner_id` = {}",
|
||||
TableName(),
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool SaveAllFollowDistances(Database& db, const uint32 owner_id, const uint32 follow_distance)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `follow_distance` = {} WHERE `owner_id` = {}",
|
||||
TableName(),
|
||||
follow_distance,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BOT_DATA_REPOSITORY_H
|
||||
|
||||
@@ -44,7 +44,36 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static bool SaveAllInspectMessages(Database& db, const uint32 owner_id, const std::string& inspect_message)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
SQL(
|
||||
INSERT INTO `bot_inspect_messages` (`bot_id`, `inspect_message`) VALUES
|
||||
(SELECT `bot_id`, '{}' inspect_message FROM `bot_data` WHERE `owner_id` = {})
|
||||
),
|
||||
inspect_message,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool DeleteAllInspectMessages(Database& db, const uint32 owner_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
SQL(
|
||||
DELETE FROM `bot_inspect_messages`
|
||||
WHERE `bot_id` IN (SELECT `bot_id` FROM `bot_data` WHERE `owner_id` = {})
|
||||
),
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BOT_INSPECT_MESSAGES_REPOSITORY_H
|
||||
|
||||
@@ -44,7 +44,57 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static bool UpdateItemColors(Database& db, const uint32 bot_id, const uint32 color, const std::string& where_clause)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `inst_color` = {} WHERE `bot_id` = {} AND `slot_id` {}",
|
||||
TableName(),
|
||||
color,
|
||||
bot_id,
|
||||
where_clause
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool SaveAllArmorColors(Database& db, const uint32 owner_id, const uint32 color)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `inst_color` = {} WHERE `slot_id` IN ({}, {}, {}, {}, {}, {}, {}) AND `bot_id` IN (SELECT `bot_id` FROM `bot_data` WHERE `owner_id` = {})",
|
||||
TableName(),
|
||||
color,
|
||||
EQ::invslot::slotHead,
|
||||
EQ::invslot::slotChest,
|
||||
EQ::invslot::slotArms,
|
||||
EQ::invslot::slotWrist1,
|
||||
EQ::invslot::slotWrist2,
|
||||
EQ::invslot::slotHands,
|
||||
EQ::invslot::slotLegs,
|
||||
EQ::invslot::slotFeet,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
|
||||
static bool SaveAllArmorColorsBySlot(Database& db, const uint32 owner_id, const int16 slot_id, const uint32 color)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `inst_color` = {} WHERE `slot_id` = {} AND `bot_id` IN (SELECT `bot_id` FROM `bot_data` WHERE `owner_id` = {})",
|
||||
TableName(),
|
||||
color,
|
||||
slot_id,
|
||||
owner_id
|
||||
)
|
||||
);
|
||||
|
||||
return results.Success();
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_BOT_INVENTORIES_REPOSITORY_H
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
{
|
||||
db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `zone_id` = {}, `instance_id` = 0, `x` = {:.2f}, `y` = {:.2f}, `z` = {:.2f}`, `heading` = {:.2f}, `was_at_graveyard` = 1 WHERE `instance_id` = {}",
|
||||
"UPDATE `{}` SET `zone_id` = {}, `instance_id` = 0, `x` = {:.2f}, `y` = {:.2f}, `z` = {:.2f}, `heading` = {:.2f}, `was_at_graveyard` = 1 WHERE `instance_id` = {}",
|
||||
TableName(),
|
||||
graveyard_zone_id,
|
||||
position.x,
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
{
|
||||
db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `zone_id` = {}, `instance_id` = {}, `x` = {:.2f}, `y` = {:.2f}, `z` = {:.2f}`, `heading` = {:.2f}, `was_at_graveyard` = 1 WHERE `{}` = {}",
|
||||
"UPDATE `{}` SET `zone_id` = {}, `instance_id` = {}, `x` = {:.2f}, `y` = {:.2f}, `z` = {:.2f}, `heading` = {:.2f}, `was_at_graveyard` = 1 WHERE `{}` = {}",
|
||||
TableName(),
|
||||
zone_id,
|
||||
instance_id,
|
||||
|
||||
@@ -76,6 +76,48 @@ public:
|
||||
return grid_entries;
|
||||
}
|
||||
|
||||
static int GetHighestWaypoint(Database& db, uint32 zone_id, uint32 grid_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
SQL(
|
||||
SELECT COALESCE(MAX(`number`), 0) FROM `{}`
|
||||
WHERE `zoneid` = {} AND `gridid` = {}
|
||||
),
|
||||
TableName(),
|
||||
zone_id,
|
||||
grid_id
|
||||
)
|
||||
);
|
||||
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
|
||||
static int GetNextWaypoint(Database& db, uint32 zone_id, uint32 grid_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"SELECT MAX(`number`) FROM `{}` WHERE `zoneid` = {} AND `gridid` = {}",
|
||||
TableName(),
|
||||
zone_id,
|
||||
grid_id
|
||||
)
|
||||
);
|
||||
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToInt(row[0]) + 1;
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_GRID_ENTRIES_REPOSITORY_H
|
||||
|
||||
@@ -71,6 +71,27 @@ public:
|
||||
return grids;
|
||||
}
|
||||
|
||||
static int GetHighestGrid(Database& db, uint32 zone_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
SQL(
|
||||
SELECT COALESCE(MAX(`id`), 0) FROM `{}`
|
||||
WHERE `zoneid` = {}
|
||||
),
|
||||
TableName(),
|
||||
zone_id
|
||||
)
|
||||
);
|
||||
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToInt(row[0]);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_GRID_REPOSITORY_H
|
||||
|
||||
@@ -45,14 +45,41 @@ public:
|
||||
|
||||
// Custom extended repository methods here
|
||||
|
||||
static int UpdateDuration(Database& db, int instance_id, uint32_t new_duration)
|
||||
static int UpdateDuration(Database& db, uint16 instance_id, uint32_t new_duration)
|
||||
{
|
||||
auto results = db.QueryDatabase(fmt::format(
|
||||
"UPDATE {} SET duration = {} WHERE {} = {};",
|
||||
TableName(), new_duration, PrimaryKey(), instance_id
|
||||
));
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `{}` SET `duration` = {} WHERE `{}` = {}",
|
||||
TableName(),
|
||||
new_duration,
|
||||
PrimaryKey(),
|
||||
instance_id
|
||||
)
|
||||
);
|
||||
|
||||
return (results.Success() ? results.RowsAffected() : 0);
|
||||
return results.Success() ? results.RowsAffected() : 0;
|
||||
}
|
||||
|
||||
static uint32 GetRemainingTimeByInstanceID(Database& db, uint16 instance_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
SQL(
|
||||
SELECT ((start_time + duration) - UNIX_TIMESTAMP()) AS `remaining` FROM `{}`
|
||||
WHERE `id` = {}
|
||||
),
|
||||
TableName(),
|
||||
instance_id
|
||||
)
|
||||
);
|
||||
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,35 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static uint32 GetPathGridBySpawn2ID(Database& db, uint32 spawn2_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"SELECT `pathgrid` FROM `{}` WHERE `id` = {}",
|
||||
TableName(),
|
||||
spawn2_id
|
||||
)
|
||||
);
|
||||
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToUnsignedInt(row[0]);
|
||||
}
|
||||
|
||||
static void SetPathGridBySpawn2ID(Database& db, uint32 spawn2_id, uint32 grid_id)
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE `spawn2` SET `pathgrid` = {} WHERE `id` = {}",
|
||||
grid_id,
|
||||
spawn2_id
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_SPAWN2_REPOSITORY_H
|
||||
|
||||
@@ -259,6 +259,7 @@ RULE_BOOL(Skills, RequireTomeHandin, false, "Disable click-to-learn and force ha
|
||||
RULE_INT(Skills, TradeSkillClamp, 0, "Legacy tradeskills would clamp at 252 regardless of item modifiers and skill combination. DEFAULT: 0 will bypass clamp. Legacy value 252")
|
||||
RULE_BOOL(Skills, UseAltSinisterStrikeFormula, false, "Enabling will utilize a formula derived from 2004 monkey business post which makes the AA actually worth something.")
|
||||
RULE_BOOL(Skills, TrackingAutoRefreshSkillUps, true, "Disable to prevent tracking auto-refresh from giving skill-ups. Classic Style")
|
||||
RULE_INT(Skills, MaximumTauntDistance, 150, "Maximum player taunt distance.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Pets)
|
||||
@@ -269,6 +270,7 @@ RULE_BOOL(Pets, CanTakeNoDrop, false, "Setting whether anyone can give no-drop i
|
||||
RULE_BOOL(Pets, CanTakeQuestItems, true, "Setting whether anyone can give quest items to pets")
|
||||
RULE_BOOL(Pets, LivelikeBreakCharmOnInvis, true, "Default: true will break charm on any type of invis (hide/ivu/iva/etc) false will only break if the pet can not see you (ex. you have an undead pet and cast IVU")
|
||||
RULE_BOOL(Pets, ClientPetsUseOwnerNameInLastName, true, "Disable this to keep client pet's last names from being owner_name's pet")
|
||||
RULE_INT(Pets, PetTauntRange, 150, "Range at which a pet will taunt targets.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(GM)
|
||||
@@ -340,6 +342,9 @@ RULE_INT(Zone, GlobalLootMultiplier, 1, "Sets Global Loot drop multiplier for da
|
||||
RULE_BOOL(Zone, KillProcessOnDynamicShutdown, true, "When process has booted a zone and has hit its zone shut down timer, it will hard kill the process to free memory back to the OS")
|
||||
RULE_INT(Zone, SpawnEventMin, 3, "When strict is set in spawn_events, specifies the max EQ minutes into the trigger hour a spawn_event will fire. Going below 3 may cause the spawn_event to not fire.")
|
||||
RULE_INT(Zone, ForageChance, 25, "Chance of foraging from zone table vs global table")
|
||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnBots, false, "Set to true to allow cross zone spells (cast/remove) to affect bots")
|
||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnMercs, false, "Set to true to allow cross zone spells (cast/remove) to affect mercenaries")
|
||||
RULE_BOOL(Zone, AllowCrossZoneSpellsOnPets, false, "Set to true to allow cross zone spells (cast/remove) to affect pets")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Map)
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@
|
||||
|
||||
// Build variables
|
||||
// these get injected during the build pipeline
|
||||
#define CURRENT_VERSION "22.43.0-dev" // always append -dev to the current version for custom-builds
|
||||
#define CURRENT_VERSION "22.43.3-dev" // always append -dev to the current version for custom-builds
|
||||
#define LOGIN_VERSION "0.8.0"
|
||||
#define COMPILE_DATE __DATE__
|
||||
#define COMPILE_TIME __TIME__
|
||||
@@ -42,9 +42,9 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9255
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9256
|
||||
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9041
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9042
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eqemu-server",
|
||||
"version": "22.43.0",
|
||||
"version": "22.43.3",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EQEmu/Server.git"
|
||||
|
||||
@@ -398,6 +398,5 @@ void QSDatabase::GeneralQueryReceive(ServerPacket *pack)
|
||||
LogInfo("[{}]", query.c_str());
|
||||
}
|
||||
|
||||
safe_delete(pack);
|
||||
safe_delete_array(queryBuffer);
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ foreach my $table_to_generate (@tables) {
|
||||
$query_value = sprintf('" + std::to_string(e.%s));', $column_name_formatted);
|
||||
}
|
||||
elsif ($data_type =~ /datetime/) {
|
||||
$query_value = sprintf('FROM_UNIXTIME(" + (e.%s > 0 ? std::to_string(e.%s) : "UNIX_TIMESTAMP()") + ")");', $column_name_formatted, $column_name_formatted);
|
||||
$query_value = sprintf('FROM_UNIXTIME(" + (e.%s > 0 ? std::to_string(e.%s) : "null") + ")");', $column_name_formatted, $column_name_formatted);
|
||||
}
|
||||
|
||||
$update_one_entries .= sprintf(
|
||||
@@ -310,7 +310,7 @@ foreach my $table_to_generate (@tables) {
|
||||
$value = sprintf('std::to_string(e.%s)', $column_name_formatted);
|
||||
}
|
||||
elsif ($data_type =~ /datetime/) {
|
||||
$value = sprintf('"FROM_UNIXTIME(" + (e.%s > 0 ? std::to_string(e.%s) : "UNIX_TIMESTAMP()") + ")"', $column_name_formatted, $column_name_formatted);
|
||||
$value = sprintf('"FROM_UNIXTIME(" + (e.%s > 0 ? std::to_string(e.%s) : "null") + ")"', $column_name_formatted, $column_name_formatted);
|
||||
}
|
||||
|
||||
$insert_one_entries .= sprintf("\t\tv.push_back(%s);\n", $value);
|
||||
@@ -566,6 +566,12 @@ sub translate_mysql_data_type_to_c
|
||||
elsif ($mysql_data_type =~ /int/) {
|
||||
$struct_data_type = 'uint32_t';
|
||||
}
|
||||
elsif ($mysql_data_type =~ /float|decimal/i) {
|
||||
$struct_data_type = 'float';
|
||||
}
|
||||
elsif ($mysql_data_type =~ /double/i) {
|
||||
$struct_data_type = 'double';
|
||||
}
|
||||
}
|
||||
elsif ($mysql_data_type =~ /bigint/) {
|
||||
$struct_data_type = 'int64_t';
|
||||
@@ -599,7 +605,10 @@ sub get_reserved_cpp_variable_names
|
||||
"class",
|
||||
"int",
|
||||
"key",
|
||||
"range"
|
||||
"rank",
|
||||
"range",
|
||||
"interval",
|
||||
"group"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,34 @@ void WorldserverCLI::MercsEnable(int argc, char **argv, argh::parser &cmd, std::
|
||||
LogInfo("Merc tables already exist, skipping bootstrap");
|
||||
}
|
||||
|
||||
LogInfo("Enabling mercs");
|
||||
uint32 expansions_setting = RuleManager::Instance()->GetIntRule(RuleManager::Int__ExpansionSettings);
|
||||
uint32 expansions_setting_before = expansions_setting;
|
||||
bool update_expansions = false;
|
||||
|
||||
if (expansions_setting != -1 && !(expansions_setting & EQ::expansions::ExpansionBitmask::bitSoD)) {
|
||||
expansions_setting += EQ::expansions::ExpansionBitmask::bitSoD;
|
||||
update_expansions = true;
|
||||
}
|
||||
|
||||
LogInfo("Enabling Mercenaries");
|
||||
LogInfo("Setting rule Mercs:AllowMercs to true");
|
||||
RuleManager::Instance()->SetRule("Mercs:AllowMercs", "true", &database, true, true);
|
||||
LogInfo("Mercs enabled");
|
||||
|
||||
if (update_expansions) {
|
||||
LogInfo(
|
||||
"Updating World:ExpansionSettings from [{}] to [{}] to enable Mercenary Liaison spawns",
|
||||
expansions_setting_before,
|
||||
expansions_setting
|
||||
);
|
||||
|
||||
RuleManager::Instance()->SetRule(
|
||||
"World:ExpansionSettings",
|
||||
std::to_string(expansions_setting),
|
||||
&database,
|
||||
true,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
LogInfo("Mercenaries enabled");
|
||||
}
|
||||
|
||||
+34
-37
@@ -535,67 +535,64 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app)
|
||||
return false;
|
||||
}
|
||||
|
||||
auto length = snprintf(char_name, 64, "%s", (char*)app->pBuffer);
|
||||
auto n = (NameApproval_Struct*) app->pBuffer;
|
||||
|
||||
uchar race_selection = app->pBuffer[64];
|
||||
uchar class_selection = app->pBuffer[68];
|
||||
strn0cpy(char_name, n->name, sizeof(char_name));
|
||||
|
||||
if (!IsPlayerRace(race_selection)) {
|
||||
const uint32 length = strlen(n->name);
|
||||
const uint32 race_id = n->race_id;
|
||||
const uint32 class_id = n->class_id;
|
||||
|
||||
if (!IsPlayerRace(race_id)) {
|
||||
LogInfo("Invalid Race ID.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!EQ::ValueWithin(class_selection, Class::Warrior, Class::Berserker)) {
|
||||
if (!EQ::ValueWithin(class_id, Class::Warrior, Class::Berserker)) {
|
||||
LogInfo("Invalid Class ID.");
|
||||
return false;
|
||||
}
|
||||
|
||||
LogInfo("Name approval request. Name=[{}], race_selection=[{}], class=[{}]", char_name, GetRaceIDName(race_selection), GetClassIDName(class_selection));
|
||||
|
||||
EQApplicationPacket *outapp;
|
||||
outapp = new EQApplicationPacket;
|
||||
outapp->SetOpcode(OP_ApproveName);
|
||||
outapp->pBuffer = new uchar[1];
|
||||
outapp->size = 1;
|
||||
LogInfo(
|
||||
"char_name [{}] race_id [{}] class_id [{}]",
|
||||
char_name,
|
||||
GetRaceIDName(race_id),
|
||||
GetClassIDName(class_id)
|
||||
);
|
||||
|
||||
bool valid = true;
|
||||
/* Name must be between 4 and 15 characters long, packet forged if this is true */
|
||||
if (length < 4 || length > 15) {
|
||||
valid = false;
|
||||
}
|
||||
/* Name must begin with an upper-case letter, can be sent with some tricking of the client */
|
||||
else if (islower(char_name[0])) {
|
||||
valid = false;
|
||||
}
|
||||
/* Name must not have any spaces, packet forged if this is true */
|
||||
else if (strstr(char_name, " ")) {
|
||||
valid = false;
|
||||
}
|
||||
/* I would like to do this later, since it's likely more expensive, but oh well */
|
||||
else if (!database.CheckNameFilter(char_name)) {
|
||||
valid = false;
|
||||
}
|
||||
else {
|
||||
/* Name must not not contain any uppercase letters, can be sent with some tricking of the client */
|
||||
bool is_valid = true;
|
||||
|
||||
if (!EQ::ValueWithin(length, 4, 15)) { /* Name must be between 4 and 15 characters long, packet forged if this is true */
|
||||
is_valid = false;
|
||||
} else if (islower(char_name[0])) { /* Name must begin with an upper-case letter, can be sent with some tricking of the client */
|
||||
is_valid = false;
|
||||
} else if (strstr(char_name, " ")) { /* Name must not have any spaces, packet forged if this is true */
|
||||
is_valid = false;
|
||||
} else if (!database.CheckNameFilter(char_name)) { /* I would like to do this later, since it's likely more expensive, but oh well */
|
||||
is_valid = false;
|
||||
} else { /* Name must not contain any uppercase letters, can be sent with some tricking of the client */
|
||||
for (int i = 1; i < length; ++i) {
|
||||
if (isupper(char_name[i])) {
|
||||
valid = false;
|
||||
is_valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Still not invalid, let's see if it's taken */
|
||||
if (valid) {
|
||||
valid = database.ReserveName(GetAccountID(), char_name);
|
||||
if (is_valid) { /* Still not invalid, let's see if it's taken */
|
||||
is_valid = database.ReserveName(GetAccountID(), char_name);
|
||||
}
|
||||
|
||||
outapp->pBuffer[0] = valid ? 1 : 0;
|
||||
auto outapp = new EQApplicationPacket(OP_ApproveName, 1);
|
||||
|
||||
outapp->pBuffer[0] = is_valid ? 1 : 0;
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
|
||||
if (!valid)
|
||||
if (!is_valid) {
|
||||
memset(char_name, 0, sizeof(char_name));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "../common/database_schema.h"
|
||||
#include "../common/zone_store.h"
|
||||
#include "worlddb.h"
|
||||
#include "world_config.h"
|
||||
|
||||
extern ZSList zoneserver_list;
|
||||
extern ClientList client_list;
|
||||
@@ -274,4 +275,7 @@ void EQEmuApiWorldDataService::get(Json::Value &r, const std::vector<std::string
|
||||
if (m == "reload") {
|
||||
reload(r, args);
|
||||
}
|
||||
if (m == "lock_status") {
|
||||
r["locked"] = WorldConfig::get()->Locked;
|
||||
}
|
||||
}
|
||||
|
||||
+307
-190
@@ -1818,9 +1818,8 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
||||
parse->EventNPC(EVENT_SLAY, killerMob->CastToNPC(), this, "", 0);
|
||||
}
|
||||
|
||||
const uint32 emote_id = killerMob->GetEmoteID();
|
||||
if (emote_id) {
|
||||
killerMob->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledPC, emote_id, this);
|
||||
if (emoteid) {
|
||||
killerMob->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledPC, emoteid, this);
|
||||
}
|
||||
|
||||
killerMob->TrySpellOnKill(killed_level, spell);
|
||||
@@ -2376,10 +2375,15 @@ void NPC::Damage(Mob* other, int64 damage, uint16 spell_id, EQ::skills::SkillTyp
|
||||
|
||||
bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillType attack_skill)
|
||||
{
|
||||
LogCombat("Fatal blow dealt by [{}] with [{}] damage, spell [{}], skill [{}]",
|
||||
((killer_mob) ? (killer_mob->GetName()) : ("[nullptr]")), damage, spell, attack_skill);
|
||||
LogCombat(
|
||||
"Fatal blow dealt by [{}] with [{}] damage, spell [{}], skill [{}]",
|
||||
(killer_mob ? killer_mob->GetName() : "[nullptr]"),
|
||||
damage,
|
||||
spell,
|
||||
attack_skill
|
||||
);
|
||||
|
||||
Mob *oos = killer_mob ? killer_mob->GetOwnerOrSelf() : nullptr;
|
||||
Mob* owner_or_self = killer_mob ? killer_mob->GetOwnerOrSelf() : nullptr;
|
||||
|
||||
if (IsNPC()) {
|
||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_DEATH)) {
|
||||
@@ -2391,7 +2395,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
static_cast<int>(attack_skill)
|
||||
);
|
||||
|
||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) {
|
||||
if (parse->EventNPC(EVENT_DEATH, this, owner_or_self, export_string, 0) != 0) {
|
||||
if (GetHP() < 0) {
|
||||
SetHP(0);
|
||||
}
|
||||
@@ -2408,7 +2412,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
spell,
|
||||
static_cast<int>(attack_skill)
|
||||
);
|
||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) {
|
||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), owner_or_self, export_string, 0) != 0) {
|
||||
if (GetHP() < 0) {
|
||||
SetHP(0);
|
||||
}
|
||||
@@ -2435,7 +2439,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
|
||||
if (IsEngaged()) {
|
||||
zone->DelAggroMob();
|
||||
Log(Logs::Detail, Logs::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount());
|
||||
LogAttackDetail("{} Mob{} currently aggroed.", zone->MobsAggroCount(), zone->MobsAggroCount() != 1 ? "s" : "");
|
||||
}
|
||||
|
||||
ShieldAbilityClearVariables();
|
||||
@@ -2444,7 +2448,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
SetPet(0);
|
||||
|
||||
if (GetSwarmOwner()) {
|
||||
auto* owner = entity_list.GetMobID(GetSwarmOwner());
|
||||
Mob* owner = entity_list.GetMobID(GetSwarmOwner());
|
||||
if (owner) {
|
||||
owner->SetTempPetCount(owner->GetTempPetCount() - 1);
|
||||
}
|
||||
@@ -2458,31 +2462,40 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto illusion_spell_id = spellbonuses.Illusion;
|
||||
const int illusion_spell_id = spellbonuses.Illusion;
|
||||
|
||||
HasAISpellEffects = false;
|
||||
|
||||
BuffFadeAll();
|
||||
const auto killed_level = GetLevel();
|
||||
|
||||
const uint8 killed_level = GetLevel();
|
||||
|
||||
if (GetClass() == Class::LDoNTreasure) { // open chest
|
||||
auto outapp = new EQApplicationPacket(OP_Animation, sizeof(Animation_Struct));
|
||||
Animation_Struct* anim = (Animation_Struct*)outapp->pBuffer;
|
||||
anim->spawnid = GetID();
|
||||
anim->action = 0x0F;
|
||||
anim->speed = 10;
|
||||
|
||||
auto a = (Animation_Struct*) outapp->pBuffer;
|
||||
|
||||
a->spawnid = GetID();
|
||||
a->action = 0x0F;
|
||||
a->speed = 10;
|
||||
|
||||
entity_list.QueueCloseClients(this, outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
auto app = new EQApplicationPacket(OP_Death, sizeof(Death_Struct));
|
||||
auto* d = (Death_Struct*) app->pBuffer;
|
||||
d->spawn_id = GetID();
|
||||
d->killer_id = killer_mob ? killer_mob->GetID() : 0;
|
||||
d->bindzoneid = 0;
|
||||
d->spell_id = 0xffffffff; // Sending spell was causing extra DoT land msg
|
||||
|
||||
auto d = (Death_Struct*) app->pBuffer;
|
||||
|
||||
d->spawn_id = GetID();
|
||||
d->killer_id = killer_mob ? killer_mob->GetID() : 0;
|
||||
d->bindzoneid = 0;
|
||||
d->spell_id = UINT32_MAX;
|
||||
d->attack_skill = SkillDamageTypes[attack_skill];
|
||||
d->damage = damage;
|
||||
d->damage = damage;
|
||||
|
||||
app->priority = 6;
|
||||
|
||||
entity_list.QueueClients(killer_mob, app, false);
|
||||
|
||||
safe_delete(app);
|
||||
@@ -2495,24 +2508,37 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
hate_list.AddEntToHateList(killer_mob, damage);
|
||||
}
|
||||
|
||||
Mob *give_exp = hate_list.GetDamageTopOnHateList(this);
|
||||
Mob* give_exp = hate_list.GetDamageTopOnHateList(this);
|
||||
|
||||
if (give_exp) {
|
||||
give_exp = killer;
|
||||
}
|
||||
|
||||
if (give_exp && give_exp->HasOwner()) {
|
||||
bool ownerInGroup = false;
|
||||
if ((give_exp->HasGroup() && give_exp->GetGroup()->IsGroupMember(give_exp->GetUltimateOwner()))
|
||||
|| (give_exp->IsPet() && (give_exp->GetOwner()->IsClient()
|
||||
|| (give_exp->GetOwner()->HasGroup() && give_exp->GetOwner()->GetGroup()->IsGroupMember(give_exp->GetOwner()->GetUltimateOwner()))))
|
||||
) {
|
||||
ownerInGroup = true;
|
||||
bool owner_in_group = false;
|
||||
|
||||
if (
|
||||
(
|
||||
give_exp->HasGroup() &&
|
||||
give_exp->GetGroup()->IsGroupMember(give_exp->GetUltimateOwner())
|
||||
) ||
|
||||
(
|
||||
give_exp->IsPet() &&
|
||||
(
|
||||
give_exp->GetOwner()->IsClient() ||
|
||||
(
|
||||
give_exp->GetOwner()->HasGroup() &&
|
||||
give_exp->GetOwner()->GetGroup()->IsGroupMember(give_exp->GetOwner()->GetUltimateOwner())
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
owner_in_group = true;
|
||||
}
|
||||
|
||||
give_exp = give_exp->GetUltimateOwner();
|
||||
|
||||
if (!RuleB(Bots, BotGroupXP) && !ownerInGroup) {
|
||||
if (!RuleB(Bots, BotGroupXP) && !owner_in_group) {
|
||||
give_exp = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -2526,9 +2552,9 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
}
|
||||
}
|
||||
|
||||
int PlayerCount = 0; // QueryServ Player Counting
|
||||
int player_count = 0; // QueryServ Player Counting
|
||||
|
||||
Client *give_exp_client = nullptr;
|
||||
Client* give_exp_client = nullptr;
|
||||
if (give_exp && give_exp->IsClient()) {
|
||||
give_exp_client = give_exp->CastToClient();
|
||||
}
|
||||
@@ -2538,13 +2564,13 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
hate_list.DoFactionHits(GetNPCFactionID(), GetPrimaryFaction(), GetFactionAmount());
|
||||
}
|
||||
|
||||
bool IsLdonTreasure = (GetClass() == Class::LDoNTreasure);
|
||||
const bool is_ldon_treasure = GetClass() == Class::LDoNTreasure;
|
||||
|
||||
if (give_exp_client && !IsCorpse()) {
|
||||
Group *kg = entity_list.GetGroupByClient(give_exp_client);
|
||||
Raid *kr = entity_list.GetRaidByClient(give_exp_client);
|
||||
Group* killer_group = entity_list.GetGroupByClient(give_exp_client);
|
||||
Raid* killer_raid = entity_list.GetRaidByClient(give_exp_client);
|
||||
|
||||
int64 finalxp = give_exp_client->GetExperienceForKill(this);
|
||||
int64 final_exp = give_exp_client->GetExperienceForKill(this);
|
||||
|
||||
// handle task credit on behalf of the killer
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
@@ -2556,75 +2582,98 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
task_manager->HandleUpdateTasksOnKill(give_exp_client, this);
|
||||
}
|
||||
|
||||
if (kr) {
|
||||
if (!IsLdonTreasure && MerchantType == 0) {
|
||||
kr->SplitExp((finalxp), this);
|
||||
if (killer_mob && (kr->IsRaidMember(killer_mob->GetName()) || kr->IsRaidMember(killer_mob->GetUltimateOwner()->GetName())))
|
||||
if (killer_raid) {
|
||||
if (!is_ldon_treasure && MerchantType == 0) {
|
||||
killer_raid->SplitExp(final_exp, this);
|
||||
|
||||
if (
|
||||
killer_mob &&
|
||||
(
|
||||
killer_raid->IsRaidMember(killer_mob->GetName()) ||
|
||||
killer_raid->IsRaidMember(killer_mob->GetUltimateOwner()->GetName())
|
||||
)
|
||||
) {
|
||||
killer_mob->TrySpellOnKill(killed_level, spell);
|
||||
}
|
||||
}
|
||||
|
||||
/* Send the EVENT_KILLED_MERIT event for all raid members */
|
||||
for (const auto& m : kr->members) {
|
||||
for (const auto& m : killer_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) { // If Group Member is Client
|
||||
Client *c = m.member;
|
||||
if (m.member) {
|
||||
m.member->RecordKilledNPCEvent(this);
|
||||
|
||||
c->RecordKilledNPCEvent(this);
|
||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_KILLED_MERIT)) {
|
||||
parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0);
|
||||
parse->EventNPC(EVENT_KILLED_MERIT, this, m.member, "killed", 0);
|
||||
}
|
||||
|
||||
if (RuleB(NPC, EnableMeritBasedFaction)) {
|
||||
c->SetFactionLevel(c->CharacterID(), GetNPCFactionID(), c->GetBaseClass(), c->GetBaseRace(), c->GetDeity());
|
||||
m.member->SetFactionLevel(
|
||||
m.member->CharacterID(),
|
||||
GetNPCFactionID(),
|
||||
m.member->GetBaseClass(),
|
||||
m.member->GetBaseRace(),
|
||||
m.member->GetDeity()
|
||||
);
|
||||
}
|
||||
|
||||
PlayerCount++;
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// QueryServ Logging - Raid Kills
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack =
|
||||
new ServerPacket(ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * PlayerCount));
|
||||
PlayerCount = 0;
|
||||
QSPlayerLogNPCKill_Struct* QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * player_count)
|
||||
);
|
||||
|
||||
player_count = 0;
|
||||
|
||||
auto QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 2; // Raid Fight
|
||||
for (const auto& m : kr->members) {
|
||||
QS->s1.Type = 2; // Raid Fight
|
||||
|
||||
for (const auto& m : killer_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) { // If Group Member is Client
|
||||
Client *c = m.member;
|
||||
QS->Chars[PlayerCount].char_id = c->CharacterID();
|
||||
PlayerCount++;
|
||||
if (m.member && m.member->IsClient()) {
|
||||
QS->Chars[player_count].char_id = m.member->CastToClient()->CharacterID();
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
worldserver.SendPacket(pack); // Send Packet to World
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
// End QueryServ Logging
|
||||
} else if (give_exp_client->IsGrouped() && killer_group) {
|
||||
if (!is_ldon_treasure && MerchantType == 0) {
|
||||
killer_group->SplitExp(final_exp, this);
|
||||
|
||||
}
|
||||
else if (give_exp_client->IsGrouped() && kg != nullptr) {
|
||||
if (!IsLdonTreasure && MerchantType == 0) {
|
||||
kg->SplitExp((finalxp), this);
|
||||
if (killer_mob && (kg->IsGroupMember(killer_mob->GetName()) || kg->IsGroupMember(killer_mob->GetUltimateOwner()->GetName())))
|
||||
if (
|
||||
killer_mob &&
|
||||
(
|
||||
killer_group->IsGroupMember(killer_mob->GetName()) ||
|
||||
killer_group->IsGroupMember(killer_mob->GetUltimateOwner()->GetName())
|
||||
)
|
||||
) {
|
||||
killer_mob->TrySpellOnKill(killed_level, spell);
|
||||
}
|
||||
}
|
||||
|
||||
/* Send the EVENT_KILLED_MERIT event and update kill tasks
|
||||
* for all group members */
|
||||
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (kg->members[i] != nullptr && kg->members[i]->IsClient()) { // If Group Member is Client
|
||||
Client *c = kg->members[i]->CastToClient();
|
||||
for (const auto& m : killer_group->members) {
|
||||
if (m && m->IsClient()) {
|
||||
Client* c = m->CastToClient();
|
||||
|
||||
c->RecordKilledNPCEvent(this);
|
||||
|
||||
@@ -2632,70 +2681,101 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0);
|
||||
}
|
||||
|
||||
if (RuleB(NPC, EnableMeritBasedFaction))
|
||||
c->SetFactionLevel(c->CharacterID(), GetNPCFactionID(), c->GetBaseClass(), c->GetBaseRace(), c->GetDeity());
|
||||
if (RuleB(NPC, EnableMeritBasedFaction)) {
|
||||
c->SetFactionLevel(
|
||||
c->CharacterID(),
|
||||
GetNPCFactionID(),
|
||||
c->GetBaseClass(),
|
||||
c->GetBaseRace(),
|
||||
c->GetDeity()
|
||||
);
|
||||
}
|
||||
|
||||
PlayerCount++;
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// QueryServ Logging - Group Kills
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack =
|
||||
new ServerPacket(ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * PlayerCount));
|
||||
PlayerCount = 0;
|
||||
QSPlayerLogNPCKill_Struct* QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * player_count)
|
||||
);
|
||||
|
||||
player_count = 0;
|
||||
|
||||
auto QS = (QSPlayerLogNPCKill_Struct*) pack->pBuffer;
|
||||
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 1; // Group Fight
|
||||
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
|
||||
if (kg->members[i] != nullptr && kg->members[i]->IsClient()) { // If Group Member is Client
|
||||
Client *c = kg->members[i]->CastToClient();
|
||||
QS->Chars[PlayerCount].char_id = c->CharacterID();
|
||||
PlayerCount++;
|
||||
QS->s1.Type = 1; // Group Fight
|
||||
|
||||
for (const auto& m : killer_group->members) {
|
||||
if (m && m->IsClient()) {
|
||||
QS->Chars[player_count].char_id = m->CastToClient()->CharacterID();
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
worldserver.SendPacket(pack); // Send Packet to World
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
// End QueryServ Logging
|
||||
}
|
||||
else {
|
||||
if (!IsLdonTreasure && MerchantType == 0) {
|
||||
int conlevel = give_exp->GetLevelCon(GetLevel());
|
||||
if (conlevel != CON_GRAY) {
|
||||
} else {
|
||||
if (!is_ldon_treasure && !MerchantType) {
|
||||
const uint32 con_level = give_exp->GetLevelCon(GetLevel());
|
||||
|
||||
if (con_level != CON_GRAY) {
|
||||
if (!GetOwner() || (GetOwner() && !GetOwner()->IsClient())) {
|
||||
give_exp_client->AddEXP((finalxp), conlevel);
|
||||
if (killer_mob && (killer_mob->GetID() == give_exp_client->GetID() || killer_mob->GetUltimateOwner()->GetID() == give_exp_client->GetID()))
|
||||
give_exp_client->AddEXP(final_exp, con_level);
|
||||
|
||||
if (
|
||||
killer_mob &&
|
||||
(
|
||||
killer_mob->GetID() == give_exp_client->GetID() ||
|
||||
killer_mob->GetUltimateOwner()->GetID() == give_exp_client->GetID()
|
||||
)
|
||||
) {
|
||||
killer_mob->TrySpellOnKill(killed_level, spell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Send the EVENT_KILLED_MERIT event */
|
||||
give_exp_client->RecordKilledNPCEvent(this);
|
||||
|
||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_KILLED_MERIT)) {
|
||||
parse->EventNPC(EVENT_KILLED_MERIT, this, give_exp_client, "killed", 0);
|
||||
}
|
||||
|
||||
if (RuleB(NPC, EnableMeritBasedFaction))
|
||||
give_exp_client->SetFactionLevel(give_exp_client->CharacterID(), GetNPCFactionID(), give_exp_client->GetBaseClass(),
|
||||
give_exp_client->GetBaseRace(), give_exp_client->GetDeity());
|
||||
if (RuleB(NPC, EnableMeritBasedFaction)) {
|
||||
give_exp_client->SetFactionLevel(
|
||||
give_exp_client->CharacterID(),
|
||||
GetNPCFactionID(),
|
||||
give_exp_client->GetBaseClass(),
|
||||
give_exp_client->GetBaseRace(),
|
||||
give_exp_client->GetDeity()
|
||||
);
|
||||
}
|
||||
|
||||
// QueryServ Logging - Solo
|
||||
if (RuleB(QueryServ, PlayerLogNPCKills)) {
|
||||
auto pack = new ServerPacket(ServerOP_QSPlayerLogNPCKills,
|
||||
auto pack = new ServerPacket(
|
||||
ServerOP_QSPlayerLogNPCKills,
|
||||
sizeof(QSPlayerLogNPCKill_Struct) +
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * 1));
|
||||
QSPlayerLogNPCKill_Struct* QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 0; // Solo Fight
|
||||
Client *c = give_exp_client;
|
||||
QS->Chars[0].char_id = c->CharacterID();
|
||||
PlayerCount++;
|
||||
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * 1)
|
||||
);
|
||||
|
||||
auto QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
|
||||
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 0; // Solo Fight
|
||||
QS->Chars[0].char_id = give_exp_client->CharacterID();
|
||||
|
||||
player_count++;
|
||||
|
||||
worldserver.SendPacket(pack); // Send Packet to World
|
||||
safe_delete(pack);
|
||||
}
|
||||
@@ -2703,32 +2783,68 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
}
|
||||
}
|
||||
|
||||
bool allow_merchant_corpse = RuleB(Merchant, AllowCorpse);
|
||||
bool is_merchant = (class_ == Class::Merchant || class_ == Class::AdventureMerchant || MerchantType != 0);
|
||||
const bool allow_merchant_corpse = RuleB(Merchant, AllowCorpse);
|
||||
const bool is_merchant = (class_ == Class::Merchant || class_ == Class::AdventureMerchant || MerchantType != 0);
|
||||
|
||||
Corpse* corpse = nullptr;
|
||||
|
||||
const uint16 entity_id = GetID();
|
||||
|
||||
if (!HasOwner() && !IsMerc() && !GetSwarmInfo() && (!is_merchant || allow_merchant_corpse) &&
|
||||
((killer && (killer->IsClient() || (killer->HasOwner() && killer->GetUltimateOwner()->IsClient()) ||
|
||||
(killer->IsNPC() && killer->CastToNPC()->GetSwarmInfo() && killer->CastToNPC()->GetSwarmInfo()->GetOwner() && killer->CastToNPC()->GetSwarmInfo()->GetOwner()->IsClient())))
|
||||
|| (killer_mob && IsLdonTreasure)))
|
||||
{
|
||||
if (killer != 0) {
|
||||
if (killer->GetOwner() != 0 && killer->GetOwner()->IsClient())
|
||||
if (
|
||||
!HasOwner() &&
|
||||
!IsMerc() &&
|
||||
!GetSwarmInfo() &&
|
||||
(!is_merchant || allow_merchant_corpse) &&
|
||||
(
|
||||
(
|
||||
killer &&
|
||||
(
|
||||
killer->IsClient() ||
|
||||
(
|
||||
killer->HasOwner() &&
|
||||
killer->GetUltimateOwner()->IsClient()
|
||||
) ||
|
||||
(
|
||||
killer->IsNPC() &&
|
||||
killer->CastToNPC()->GetSwarmInfo() &&
|
||||
killer->CastToNPC()->GetSwarmInfo()->GetOwner() &&
|
||||
killer->CastToNPC()->GetSwarmInfo()->GetOwner()->IsClient()
|
||||
)
|
||||
)
|
||||
) ||
|
||||
(
|
||||
killer_mob && is_ldon_treasure
|
||||
)
|
||||
)
|
||||
) {
|
||||
if (killer) {
|
||||
if (killer->GetOwner() != 0 && killer->GetOwner()->IsClient()) {
|
||||
killer = killer->GetOwner();
|
||||
}
|
||||
|
||||
if (killer->IsClient() && !killer->CastToClient()->GetGM())
|
||||
if (killer->IsClient() && !killer->CastToClient()->GetGM()) {
|
||||
CheckTrivialMinMaxLevelDrop(killer);
|
||||
}
|
||||
}
|
||||
|
||||
entity_list.RemoveFromAutoXTargets(this);
|
||||
|
||||
const uint32 emote_id = GetEmoteID();
|
||||
corpse = new Corpse(this, &itemlist, GetNPCTypeID(), &NPCTypedata,
|
||||
level > 54 ? RuleI(NPC, MajorNPCCorpseDecayTimeMS)
|
||||
: RuleI(NPC, MinorNPCCorpseDecayTimeMS));
|
||||
corpse = new Corpse(
|
||||
this,
|
||||
&itemlist,
|
||||
GetNPCTypeID(),
|
||||
&NPCTypedata,
|
||||
(
|
||||
level > 54 ?
|
||||
RuleI(NPC, MajorNPCCorpseDecayTimeMS) :
|
||||
RuleI(NPC, MinorNPCCorpseDecayTimeMS)
|
||||
)
|
||||
);
|
||||
|
||||
if (killer_mob && emoteid) {
|
||||
DoNPCEmote(EQ::constants::EmoteEventTypes::AfterDeath, emoteid, killer_mob);
|
||||
}
|
||||
|
||||
entity_list.LimitRemoveNPC(this);
|
||||
entity_list.AddCorpse(corpse, GetID());
|
||||
|
||||
@@ -2740,103 +2856,99 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
SetID(0);
|
||||
ApplyIllusionToCorpse(illusion_spell_id, corpse);
|
||||
|
||||
if (killer != 0 && emote_id)
|
||||
corpse->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::AfterDeath, emote_id, killer);
|
||||
if (killer != 0 && killer->IsClient()) {
|
||||
if (killer && killer->IsClient()) {
|
||||
corpse->AllowPlayerLoot(killer, 0);
|
||||
if (killer->IsGrouped()) {
|
||||
Group* group = entity_list.GetGroupByClient(killer->CastToClient());
|
||||
if (group != 0) {
|
||||
for (int i = 0; i<6; i++) { // Doesnt work right, needs work
|
||||
if (group->members[i] != nullptr) {
|
||||
corpse->AllowPlayerLoot(group->members[i], i);
|
||||
Group* g = entity_list.GetGroupByClient(killer->CastToClient());
|
||||
if (g) {
|
||||
uint8 slot_id = 0;
|
||||
|
||||
for (const auto &m : g->members) {
|
||||
if (m) {
|
||||
corpse->AllowPlayerLoot(m, slot_id);
|
||||
}
|
||||
|
||||
slot_id++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (killer->IsRaidGrouped()) {
|
||||
} else if (killer->IsRaidGrouped()) {
|
||||
Raid* r = entity_list.GetRaidByClient(killer->CastToClient());
|
||||
if (r) {
|
||||
int i = 0;
|
||||
for (const auto& m : r->members) {
|
||||
uint8 slot_id = 0;
|
||||
|
||||
for (const auto &m : r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (r->GetLootType()) {
|
||||
case 0:
|
||||
case 1:
|
||||
if (m.member && m.is_raid_leader) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (m.member && (m.is_raid_leader || m.is_group_leader)) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (m.member && m.is_looter) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (m.member) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case RaidLootType::LeaderOnly:
|
||||
if (m.member && m.is_raid_leader) {
|
||||
corpse->AllowPlayerLoot(m.member, slot_id);
|
||||
slot_id++;
|
||||
}
|
||||
break;
|
||||
case RaidLootType::LeaderAndGroupLeadersOnly:
|
||||
if (m.member && (m.is_raid_leader || m.is_group_leader)) {
|
||||
corpse->AllowPlayerLoot(m.member, slot_id);
|
||||
slot_id++;
|
||||
}
|
||||
break;
|
||||
case RaidLootType::LeaderSelected:
|
||||
if (m.member && m.is_looter) {
|
||||
corpse->AllowPlayerLoot(m.member, slot_id);
|
||||
slot_id++;
|
||||
}
|
||||
break;
|
||||
case RaidLootType::EntireRaid:
|
||||
default:
|
||||
if (m.member) {
|
||||
corpse->AllowPlayerLoot(m.member, slot_id);
|
||||
slot_id++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (killer_mob && IsLdonTreasure) {
|
||||
auto u_owner = killer_mob->GetUltimateOwner();
|
||||
if (u_owner->IsClient())
|
||||
corpse->AllowPlayerLoot(u_owner, 0);
|
||||
} else if (killer_mob && is_ldon_treasure) {
|
||||
Mob* ultimate_owner = killer_mob->GetUltimateOwner();
|
||||
if (ultimate_owner->IsClient()) {
|
||||
corpse->AllowPlayerLoot(ultimate_owner, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (zone && zone->adv_data) {
|
||||
ServerZoneAdventureDataReply_Struct *sr = (ServerZoneAdventureDataReply_Struct*)zone->adv_data;
|
||||
auto sr = (ServerZoneAdventureDataReply_Struct *) zone->adv_data;
|
||||
if (sr->type == Adventure_Kill) {
|
||||
zone->DoAdventureCountIncrease();
|
||||
}
|
||||
else if (sr->type == Adventure_Assassinate) {
|
||||
} else if (sr->type == Adventure_Assassinate) {
|
||||
if (sr->data_id == GetNPCTypeID()) {
|
||||
zone->DoAdventureCountIncrease();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
zone->DoAdventureAssassinationCountIncrease();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
entity_list.RemoveFromXTargets(this);
|
||||
}
|
||||
|
||||
|
||||
// Parse quests even if we're killed by an NPC
|
||||
if (oos) {
|
||||
if (IsNPC()) {
|
||||
const uint32 emote_id = GetEmoteID();
|
||||
if (emote_id) {
|
||||
DoNPCEmote(EQ::constants::EmoteEventTypes::OnDeath, emote_id, killer_mob);
|
||||
}
|
||||
if (IsNPC()) {
|
||||
if (emoteid) {
|
||||
DoNPCEmote(EQ::constants::EmoteEventTypes::OnDeath, emoteid, killer_mob);
|
||||
}
|
||||
}
|
||||
|
||||
if (oos->IsNPC()) {
|
||||
if (parse->HasQuestSub(oos->GetNPCTypeID(), EVENT_NPC_SLAY)) {
|
||||
parse->EventNPC(EVENT_NPC_SLAY, oos->CastToNPC(), this, "", 0);
|
||||
if (owner_or_self) {
|
||||
if (owner_or_self->IsNPC()) {
|
||||
if (parse->HasQuestSub(owner_or_self->GetNPCTypeID(), EVENT_NPC_SLAY)) {
|
||||
parse->EventNPC(EVENT_NPC_SLAY, owner_or_self->CastToNPC(), this, "", 0);
|
||||
}
|
||||
|
||||
const uint32 emote_id = oos->GetEmoteID();
|
||||
const uint32 emote_id = owner_or_self->GetEmoteID();
|
||||
if (emote_id) {
|
||||
oos->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledNPC, emote_id, this);
|
||||
owner_or_self->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::KilledNPC, emote_id, this);
|
||||
}
|
||||
|
||||
if (killer_mob) {
|
||||
@@ -2854,10 +2966,12 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
}
|
||||
|
||||
WipeHateList();
|
||||
|
||||
p_depop = true;
|
||||
|
||||
if (killer_mob && killer_mob->GetTarget() == this) //we can kill things without having them targeted
|
||||
killer_mob->SetTarget(nullptr); //via AE effects and such..
|
||||
if (killer_mob && killer_mob->GetTarget() == this) { // We can kill things without having them targeted
|
||||
killer_mob->SetTarget(nullptr);
|
||||
}
|
||||
|
||||
entity_list.UpdateFindableNPCState(this, true);
|
||||
|
||||
@@ -2875,7 +2989,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
|
||||
std::vector<std::any> args = { corpse };
|
||||
|
||||
parse->EventNPC(EVENT_DEATH_COMPLETE, this, oos, export_string, 0, &args);
|
||||
parse->EventNPC(EVENT_DEATH_COMPLETE, this, owner_or_self, export_string, 0, &args);
|
||||
}
|
||||
|
||||
// Zone controller process EVENT_DEATH_ZONE (Death events)
|
||||
@@ -2891,7 +3005,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
|
||||
std::vector<std::any> args = { corpse, this };
|
||||
|
||||
DispatchZoneControllerEvent(EVENT_DEATH_ZONE, oos, export_string, 0, &args);
|
||||
DispatchZoneControllerEvent(EVENT_DEATH_ZONE, owner_or_self, export_string, 0, &args);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -4435,9 +4549,12 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
||||
|
||||
// If an "innate" spell, change to spell type to
|
||||
// produce a spell message. Send to everyone.
|
||||
// This fixes issues with npc-procs like 1002 and 918 which
|
||||
// need to spit out extra spell color.
|
||||
if (IsValidSpell(spell_id) && skill_used == EQ::skills::SkillTigerClaw) {
|
||||
// This fixes issues with npc-procs like 1002 and 918 and
|
||||
// damage based disciplines which need to spit out extra spell color.
|
||||
if (IsValidSpell(spell_id) &&
|
||||
(skill_used == EQ::skills::SkillTigerClaw ||
|
||||
(IsDamageSpell(spell_id) && IsDiscipline(spell_id)))
|
||||
) {
|
||||
a->type = DamageTypeSpell;
|
||||
entity_list.QueueCloseClients(
|
||||
this, /* Sender */
|
||||
|
||||
+30
-30
@@ -107,15 +107,17 @@ Beacon::Beacon(const glm::vec4 &in_pos, int lifetime) : Mob(
|
||||
{
|
||||
remove_timer.Disable();
|
||||
spell_timer.Disable();
|
||||
remove_me = false;
|
||||
spell_id = 0xFFFF;
|
||||
resist_adjust = 0;
|
||||
spell_iterations = 0;
|
||||
caster_id = 0;
|
||||
max_targets = 4; // default
|
||||
|
||||
if(lifetime)
|
||||
remove_me = false;
|
||||
spell_id = UINT16_MAX;
|
||||
resist_adjust = 0;
|
||||
spell_iterations = 0;
|
||||
caster_id = 0;
|
||||
max_targets = 4;
|
||||
|
||||
if (lifetime) {
|
||||
remove_timer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
Beacon::~Beacon()
|
||||
@@ -125,55 +127,53 @@ Beacon::~Beacon()
|
||||
|
||||
bool Beacon::Process()
|
||||
{
|
||||
if(remove_me)
|
||||
{
|
||||
if (remove_me) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
if (
|
||||
spell_timer.Enabled() &&
|
||||
spell_timer.Check() &&
|
||||
IsValidSpell(spell_id)
|
||||
)
|
||||
{
|
||||
Mob *caster = entity_list.GetMob(caster_id);
|
||||
if(caster && spell_iterations-- && max_targets)
|
||||
{
|
||||
) {
|
||||
Mob* caster = entity_list.GetMob(caster_id);
|
||||
if (caster && spell_iterations-- && max_targets) {
|
||||
// NPCs should never be affected by an AE they cast. PB AEs shouldn't affect caster either
|
||||
// I don't think any other cases that get here matter
|
||||
bool affect_caster = (!caster->IsNPC() && !caster->IsAIControlled()) && spells[spell_id].target_type != ST_AECaster;
|
||||
const bool affect_caster = (
|
||||
!caster->IsNPC() &&
|
||||
!caster->IsAIControlled() &&
|
||||
spells[spell_id].target_type != ST_AECaster
|
||||
);
|
||||
entity_list.AESpell(caster, this, spell_id, affect_caster, resist_adjust, &max_targets);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// spell is done casting, or caster disappeared
|
||||
spell_id = 0xFFFF;
|
||||
caster_id = 0;
|
||||
spell_id = UINT16_MAX;
|
||||
spell_iterations = 0;
|
||||
|
||||
spell_timer.Disable();
|
||||
caster_id = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(remove_timer.Enabled() && remove_timer.Check())
|
||||
{
|
||||
if (remove_timer.Enabled() && remove_timer.Check()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 resist_adjust)
|
||||
void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 in_resist_adjust)
|
||||
{
|
||||
if (!IsValidSpell(cast_spell_id) || !caster) {
|
||||
return;
|
||||
}
|
||||
|
||||
caster_id = caster->GetID();
|
||||
spell_id = cast_spell_id;
|
||||
resist_adjust = resist_adjust;
|
||||
spell_iterations = spells[spell_id].aoe_duration / 2500;
|
||||
spell_iterations = spell_iterations < 1 ? 1 : spell_iterations; // at least 1
|
||||
caster_id = caster->GetID();
|
||||
spell_id = cast_spell_id;
|
||||
resist_adjust = in_resist_adjust;
|
||||
spell_iterations = ((spells[spell_id].aoe_duration / 2500) < 1) ? 1 : spell_iterations;
|
||||
|
||||
if (spells[spell_id].aoe_max_targets) {
|
||||
max_targets = spells[spell_id].aoe_max_targets;
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ public:
|
||||
bool IsBeacon() const { return true; }
|
||||
bool Process();
|
||||
virtual void Depop(bool not_used = true) { remove_me = true; }
|
||||
void AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 resist_adjust);
|
||||
void AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 in_resist_adjust);
|
||||
|
||||
protected:
|
||||
Timer remove_timer;
|
||||
|
||||
+22
-132
@@ -228,17 +228,10 @@ Bot::Bot(
|
||||
strcpy(name, GetCleanName());
|
||||
|
||||
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
|
||||
if (!database.botdb.LoadInspectMessage(GetBotID(), _botInspectMessage) && bot_owner)
|
||||
bot_owner->Message(Chat::White, "%s for '%s'", BotDatabase::fail::LoadInspectMessage(), GetCleanName());
|
||||
|
||||
std::string error_message;
|
||||
database.botdb.LoadInspectMessage(GetBotID(), _botInspectMessage);
|
||||
|
||||
EquipBot(&error_message);
|
||||
if (!error_message.empty()) {
|
||||
if (bot_owner)
|
||||
bot_owner->Message(Chat::White, error_message.c_str());
|
||||
error_message.clear();
|
||||
}
|
||||
EquipBot();
|
||||
|
||||
if (GetClass() == Class::Rogue) {
|
||||
m_evade_timer.Start();
|
||||
@@ -252,17 +245,12 @@ Bot::Bot(
|
||||
GenerateBaseStats();
|
||||
|
||||
bot_timers.clear();
|
||||
if (!database.botdb.LoadTimers(this) && bot_owner) {
|
||||
bot_owner->Message(Chat::White, "%s for '%s'", BotDatabase::fail::LoadTimers(), GetCleanName());
|
||||
}
|
||||
|
||||
database.botdb.LoadTimers(this);
|
||||
|
||||
LoadAAs();
|
||||
|
||||
if (!database.botdb.LoadBuffs(this)) {
|
||||
if (bot_owner) {
|
||||
bot_owner->Message(Chat::White, "&s for '%s'", BotDatabase::fail::LoadBuffs(), GetCleanName());
|
||||
}
|
||||
} else {
|
||||
if (database.botdb.LoadBuffs(this)) {
|
||||
//reapply some buffs
|
||||
uint32 buff_count = GetMaxBuffSlots();
|
||||
for (uint32 j1 = 0; j1 < buff_count; j1++) {
|
||||
@@ -1335,38 +1323,23 @@ bool Bot::Save()
|
||||
if (!bot_owner)
|
||||
return false;
|
||||
|
||||
std::string error_message;
|
||||
|
||||
if (!GetBotID()) { // New bot record
|
||||
uint32 bot_id = 0;
|
||||
if (!database.botdb.SaveNewBot(this, bot_id) || !bot_id) {
|
||||
bot_owner->Message(Chat::White, "%s '%s'", BotDatabase::fail::SaveNewBot(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
SetBotID(bot_id);
|
||||
}
|
||||
else { // Update existing bot record
|
||||
if (!database.botdb.SaveBot(this)) {
|
||||
bot_owner->Message(Chat::White, "%s '%s'", BotDatabase::fail::SaveBot(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// All of these continue to process if any fail
|
||||
if (!database.botdb.SaveBuffs(this))
|
||||
bot_owner->Message(Chat::White, "%s for '%s'", BotDatabase::fail::SaveBuffs(), GetCleanName());
|
||||
if (!database.botdb.SaveTimers(this))
|
||||
bot_owner->Message(Chat::White, "%s for '%s'", BotDatabase::fail::SaveTimers(), GetCleanName());
|
||||
|
||||
if (!database.botdb.SaveStance(this)) {
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Failed to save stance for '{}'.",
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
database.botdb.SaveBuffs(this);
|
||||
database.botdb.SaveTimers(this);
|
||||
database.botdb.SaveStance(this);
|
||||
|
||||
if (!SavePet())
|
||||
bot_owner->Message(Chat::White, "Failed to save pet for '%s'", GetCleanName());
|
||||
@@ -1382,7 +1355,6 @@ bool Bot::DeleteBot()
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteHealRotation(GetBotID())) {
|
||||
bot_owner->Message(Chat::White, "%s", BotDatabase::fail::DeleteHealRotation());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1413,65 +1385,23 @@ bool Bot::DeleteBot()
|
||||
RemoveBotFromRaid(this);
|
||||
}
|
||||
|
||||
std::string error_message;
|
||||
|
||||
if (!database.botdb.DeleteItems(GetBotID())) {
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} for '{}'.",
|
||||
BotDatabase::fail::DeleteItems(),
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteTimers(GetBotID())) {
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} for '{}'.",
|
||||
BotDatabase::fail::DeleteTimers(),
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteBuffs(GetBotID())) {
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} for '{}'.",
|
||||
BotDatabase::fail::DeleteBuffs(),
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteStance(GetBotID())) {
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} for '{}'.",
|
||||
BotDatabase::fail::DeleteStance(),
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteBot(GetBotID())) {
|
||||
bot_owner->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} '{}'",
|
||||
BotDatabase::fail::DeleteBot(),
|
||||
GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1511,20 +1441,16 @@ bool Bot::LoadPet()
|
||||
}
|
||||
}
|
||||
|
||||
std::string error_message;
|
||||
|
||||
uint32 pet_index = 0;
|
||||
if (!database.botdb.LoadPetIndex(GetBotID(), pet_index)) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::LoadPetIndex(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
if (!pet_index)
|
||||
return true;
|
||||
|
||||
uint32 saved_pet_spell_id = 0;
|
||||
if (!database.botdb.LoadPetSpellID(GetBotID(), saved_pet_spell_id)) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::LoadPetSpellID(), GetCleanName());
|
||||
}
|
||||
database.botdb.LoadPetSpellID(GetBotID(), saved_pet_spell_id);
|
||||
|
||||
if (!IsValidSpell(saved_pet_spell_id)) {
|
||||
bot_owner->Message(Chat::White, "Invalid spell id for %s's pet", GetCleanName());
|
||||
DeletePet();
|
||||
@@ -1537,7 +1463,6 @@ bool Bot::LoadPet()
|
||||
uint32 pet_spell_id = 0;
|
||||
|
||||
if (!database.botdb.LoadPetStats(GetBotID(), pet_name, pet_mana, pet_hp, pet_spell_id)) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::LoadPetStats(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1551,13 +1476,11 @@ bool Bot::LoadPet()
|
||||
|
||||
SpellBuff_Struct pet_buffs[PET_BUFF_COUNT];
|
||||
memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT));
|
||||
if (!database.botdb.LoadPetBuffs(GetBotID(), pet_buffs))
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::LoadPetBuffs(), GetCleanName());
|
||||
database.botdb.LoadPetBuffs(GetBotID(), pet_buffs);
|
||||
|
||||
uint32 pet_items[EQ::invslot::EQUIPMENT_COUNT];
|
||||
memset(pet_items, 0, (sizeof(uint32) * EQ::invslot::EQUIPMENT_COUNT));
|
||||
if (!database.botdb.LoadPetItems(GetBotID(), pet_items))
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::LoadPetItems(), GetCleanName());
|
||||
database.botdb.LoadPetItems(GetBotID(), pet_items);
|
||||
|
||||
pet_inst->SetPetState(pet_buffs, pet_items);
|
||||
pet_inst->CalcBonuses();
|
||||
@@ -1596,17 +1519,12 @@ bool Bot::SavePet()
|
||||
std::string pet_name_str = pet_name;
|
||||
safe_delete_array(pet_name)
|
||||
|
||||
std::string error_message;
|
||||
|
||||
if (!database.botdb.SavePetStats(GetBotID(), pet_name_str, pet_inst->GetMana(), pet_inst->GetHP(), pet_inst->GetPetSpellID())) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::SavePetStats(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!database.botdb.SavePetBuffs(GetBotID(), pet_buffs))
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::SavePetBuffs(), GetCleanName());
|
||||
if (!database.botdb.SavePetItems(GetBotID(), pet_items))
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::SavePetItems(), GetCleanName());
|
||||
database.botdb.SavePetBuffs(GetBotID(), pet_buffs);
|
||||
database.botdb.SavePetItems(GetBotID(), pet_items);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1617,18 +1535,13 @@ bool Bot::DeletePet()
|
||||
if (!bot_owner)
|
||||
return false;
|
||||
|
||||
std::string error_message;
|
||||
|
||||
if (!database.botdb.DeletePetItems(GetBotID())) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::DeletePetItems(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
if (!database.botdb.DeletePetBuffs(GetBotID())) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::DeletePetBuffs(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
if (!database.botdb.DeletePetStats(GetBotID())) {
|
||||
bot_owner->Message(Chat::White, "%s for %s's pet", BotDatabase::fail::DeletePetStats(), GetCleanName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3379,29 +3292,26 @@ bool Bot::Spawn(Client* botCharacterOwner) {
|
||||
}
|
||||
|
||||
// Deletes the inventory record for the specified item from the database for this bot.
|
||||
void Bot::RemoveBotItemBySlot(uint16 slot_id, std::string *error_message)
|
||||
void Bot::RemoveBotItemBySlot(uint16 slot_id)
|
||||
{
|
||||
if (!GetBotID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteItemBySlot(GetBotID(), slot_id)) {
|
||||
*error_message = BotDatabase::fail::DeleteItemBySlot();
|
||||
}
|
||||
database.botdb.DeleteItemBySlot(GetBotID(), slot_id);
|
||||
|
||||
m_inv.DeleteItem(slot_id);
|
||||
UpdateEquipmentLight();
|
||||
}
|
||||
|
||||
// Retrieves all the inventory records from the database for this bot.
|
||||
void Bot::GetBotItems(EQ::InventoryProfile &inv, std::string* error_message)
|
||||
void Bot::GetBotItems(EQ::InventoryProfile &inv)
|
||||
{
|
||||
if (!GetBotID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!database.botdb.LoadItems(GetBotID(), inv)) {
|
||||
*error_message = BotDatabase::fail::LoadItems();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3732,7 +3642,7 @@ void Bot::BotRemoveEquipItem(uint16 slot_id)
|
||||
}
|
||||
}
|
||||
|
||||
void Bot::BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, std::string* error_message, bool save_to_database)
|
||||
void Bot::BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, bool save_to_database)
|
||||
{
|
||||
if (!inst) {
|
||||
return;
|
||||
@@ -3740,7 +3650,6 @@ void Bot::BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, std::str
|
||||
|
||||
if (save_to_database) {
|
||||
if (!database.botdb.SaveItemBySlot(this, slot_id, inst)) {
|
||||
*error_message = BotDatabase::fail::SaveItemBySlot();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3848,21 +3757,7 @@ void Bot::RemoveBotItem(uint32 item_id) {
|
||||
|
||||
|
||||
if (inst->GetID() == item_id) {
|
||||
std::string error_message;
|
||||
RemoveBotItemBySlot(slot_id, &error_message);
|
||||
if (!error_message.empty()) {
|
||||
if (GetOwner()) {
|
||||
GetOwner()->CastToClient()->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Database Error: {}",
|
||||
error_message
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
RemoveBotItemBySlot(slot_id);
|
||||
BotRemoveEquipItem(slot_id);
|
||||
CalcBotStats(GetOwner()->CastToClient()->GetBotOption(Client::booStatsUpdate));
|
||||
return;
|
||||
@@ -5389,18 +5284,15 @@ bool Bot::IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined) {
|
||||
return Result;
|
||||
}
|
||||
|
||||
void Bot::EquipBot(std::string* error_message) {
|
||||
GetBotItems(m_inv, error_message);
|
||||
void Bot::EquipBot() {
|
||||
GetBotItems(m_inv);
|
||||
const EQ::ItemInstance* inst = nullptr;
|
||||
const EQ::ItemData* item = nullptr;
|
||||
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||
inst = GetBotItem(slot_id);
|
||||
if (inst) {
|
||||
item = inst->GetItem();
|
||||
BotTradeAddItem(inst, slot_id, error_message, false);
|
||||
if (!error_message->empty()) {
|
||||
return;
|
||||
}
|
||||
BotTradeAddItem(inst, slot_id, false);
|
||||
}
|
||||
}
|
||||
UpdateEquipmentLight();
|
||||
@@ -8131,8 +8023,6 @@ bool Bot::DyeArmor(int16 slot_id, uint32 rgb, bool all_flag, bool save_flag)
|
||||
save_slot = -2;
|
||||
|
||||
if (!database.botdb.SaveEquipmentColor(GetBotID(), save_slot, rgb)) {
|
||||
if (GetBotOwner() && GetBotOwner()->IsClient())
|
||||
GetBotOwner()->CastToClient()->Message(Chat::White, "%s", BotDatabase::fail::SaveEquipmentColor());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -386,8 +386,8 @@ public:
|
||||
bool CheckDataBucket(std::string bucket_name, const std::string& bucket_value, uint8 bucket_comparison);
|
||||
|
||||
// Bot Equipment & Inventory Class Methods
|
||||
void BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, std::string* error_message, bool save_to_database = true);
|
||||
void EquipBot(std::string* error_message);
|
||||
void BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, bool save_to_database = true);
|
||||
void EquipBot();
|
||||
bool CheckLoreConflict(const EQ::ItemData* item);
|
||||
void UpdateEquipmentLight() override
|
||||
{
|
||||
@@ -704,7 +704,8 @@ public:
|
||||
uint32 attack
|
||||
);
|
||||
void BotRemoveEquipItem(uint16 slot_id);
|
||||
void RemoveBotItemBySlot(uint16 slot_id, std::string* error_message);
|
||||
void RemoveBotItemBySlot(uint16 slot_id
|
||||
);
|
||||
void AddBotItem(
|
||||
uint16 slot_id,
|
||||
uint32 item_id,
|
||||
@@ -938,7 +939,7 @@ private:
|
||||
void SetReturningFlag(bool flag = true) { m_returning_flag = flag; }
|
||||
|
||||
// Private "Inventory" Methods
|
||||
void GetBotItems(EQ::InventoryProfile &inv, std::string* error_message);
|
||||
void GetBotItems(EQ::InventoryProfile &inv);
|
||||
void BotAddEquipItem(uint16 slot_id, uint32 item_id);
|
||||
|
||||
// Private "Pet" Methods
|
||||
|
||||
+33
-109
@@ -281,7 +281,7 @@ public:
|
||||
entry_prototype->SafeCastToInvisibility()->invis_type = BCEnum::IT_Animal;
|
||||
break;
|
||||
case SE_Mez:
|
||||
if (spells[spell_id].spell_affect_index != 12)
|
||||
if (spells[spell_id].effect_id[EFFECTIDTOINDEX(1)] != 31)
|
||||
break;
|
||||
entry_prototype = new STBaseEntry(BCEnum::SpT_Mesmerize);
|
||||
break;
|
||||
@@ -5843,7 +5843,7 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
uint32 clone_id = 0;
|
||||
if (!database.botdb.CreateCloneBot(c->CharacterID(), my_bot->GetBotID(), bot_name, clone_id) || !clone_id) {
|
||||
if (!database.botdb.CreateCloneBot(my_bot->GetBotID(), bot_name, clone_id) || !clone_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -5875,7 +5875,7 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep)
|
||||
);
|
||||
}
|
||||
|
||||
if (!database.botdb.CreateCloneBotInventory(c->CharacterID(), my_bot->GetBotID(), clone_id)) {
|
||||
if (!database.botdb.CreateCloneBotInventory(my_bot->GetBotID(), clone_id)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -6361,25 +6361,9 @@ void bot_subcommand_bot_dye_armor(Client *c, const Seperator *sep)
|
||||
|
||||
if (ab_type == ActionableBots::ABT_All) {
|
||||
if (dye_all) {
|
||||
if (!database.botdb.SaveAllArmorColors(c->CharacterID(), rgb_value)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}",
|
||||
BotDatabase::fail::SaveAllArmorColors()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
database.botdb.SaveAllArmorColors(c->CharacterID(), rgb_value);
|
||||
} else {
|
||||
if (!database.botdb.SaveAllArmorColorBySlot(c->CharacterID(), slot_id, rgb_value)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}",
|
||||
BotDatabase::fail::SaveAllArmorColorBySlot()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
database.botdb.SaveAllArmorColorBySlot(c->CharacterID(), slot_id, rgb_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6527,8 +6511,7 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep)
|
||||
continue;
|
||||
|
||||
bot_iter->SetFollowDistance(bfd);
|
||||
if (ab_type != ActionableBots::ABT_All && !database.botdb.SaveFollowDistance(c->CharacterID(), bot_iter->GetBotID(), bfd)) {
|
||||
c->Message(Chat::White, "%s for '%s'", BotDatabase::fail::SaveFollowDistance(), bot_iter->GetCleanName());
|
||||
if (ab_type != ActionableBots::ABT_All && !database.botdb.SaveFollowDistance(bot_iter->GetBotID(), bfd)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6537,7 +6520,6 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep)
|
||||
|
||||
if (ab_type == ActionableBots::ABT_All) {
|
||||
if (!database.botdb.SaveAllFollowDistances(c->CharacterID(), bfd)) {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::SaveAllFollowDistances());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6706,7 +6688,6 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep)
|
||||
memcpy(bot_message_struct, client_message_struct, sizeof(InspectMessage_Struct));
|
||||
|
||||
if (ab_type != ActionableBots::ABT_All && !database.botdb.SaveInspectMessage(bot_iter->GetBotID(), *bot_message_struct)) {
|
||||
c->Message(Chat::White, "%s for '%s'", BotDatabase::fail::SaveInspectMessage(), bot_iter->GetCleanName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6720,7 +6701,6 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep)
|
||||
memcpy(&bot_message_struct, client_message_struct, sizeof(InspectMessage_Struct));
|
||||
|
||||
if (!database.botdb.SaveAllInspectMessages(c->CharacterID(), bot_message_struct)) {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::SaveAllInspectMessages());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6800,7 +6780,6 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep)
|
||||
|
||||
std::list<BotsAvailableList> bots_list;
|
||||
if (!database.botdb.LoadBotsList(c->CharacterID(), bots_list, Account)) {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::LoadBotsList());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6814,18 +6793,18 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep)
|
||||
auto bot_number = 1;
|
||||
for (auto bots_iter : bots_list) {
|
||||
if (filter_mask) {
|
||||
if ((filter_mask & MaskClass) && filter_value[FilterClass] != bots_iter.Class) {
|
||||
if ((filter_mask & MaskClass) && filter_value[FilterClass] != bots_iter.class_) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((filter_mask & MaskRace) && filter_value[FilterRace] != bots_iter.Race) {
|
||||
if ((filter_mask & MaskRace) && filter_value[FilterRace] != bots_iter.race) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (filter_mask & MaskName) {
|
||||
std::string name_criteria = sep->arg[name_criteria_arg];
|
||||
std::transform(name_criteria.begin(), name_criteria.end(), name_criteria.begin(), ::tolower);
|
||||
std::string name_check = bots_iter.Name;
|
||||
std::string name_check = bots_iter.bot_name;
|
||||
std::transform(name_check.begin(), name_check.end(), name_check.begin(), ::tolower);
|
||||
if (name_check.find(name_criteria) == std::string::npos) {
|
||||
continue;
|
||||
@@ -6833,7 +6812,7 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep)
|
||||
}
|
||||
}
|
||||
|
||||
auto* bot = entity_list.GetBotByBotName(bots_iter.Name);
|
||||
auto* bot = entity_list.GetBotByBotName(bots_iter.bot_name);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
@@ -6841,22 +6820,22 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep)
|
||||
"Bot {} | {} is a Level {} {} {} {} owned by {}.",
|
||||
bot_number,
|
||||
(
|
||||
(c->CharacterID() == bots_iter.Owner_ID && !bot) ?
|
||||
(c->CharacterID() == bots_iter.owner_id && !bot) ?
|
||||
Saylink::Silent(
|
||||
fmt::format("^spawn {}", bots_iter.Name),
|
||||
bots_iter.Name
|
||||
fmt::format("^spawn {}", bots_iter.bot_name),
|
||||
bots_iter.bot_name
|
||||
) :
|
||||
bots_iter.Name
|
||||
bots_iter.bot_name
|
||||
),
|
||||
bots_iter.Level,
|
||||
GetGenderName(bots_iter.Gender),
|
||||
GetRaceIDName(bots_iter.Race),
|
||||
GetClassIDName(bots_iter.Class),
|
||||
bots_iter.Owner
|
||||
bots_iter.level,
|
||||
GetGenderName(bots_iter.gender),
|
||||
GetRaceIDName(bots_iter.race),
|
||||
GetClassIDName(bots_iter.class_),
|
||||
bots_iter.owner_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (c->CharacterID() == bots_iter.Owner_ID) {
|
||||
if (c->CharacterID() == bots_iter.owner_id) {
|
||||
bots_owned++;
|
||||
}
|
||||
|
||||
@@ -6975,10 +6954,7 @@ void bot_subcommand_bot_surname(Client *c, const Seperator *sep)
|
||||
std::replace(bot_surname.begin(), bot_surname.end(), '_', ' ');
|
||||
|
||||
my_bot->SetSurname(bot_surname);
|
||||
if (!database.botdb.SaveBot(my_bot)) {
|
||||
c->Message(Chat::White, BotDatabase::fail::SaveBot());
|
||||
}
|
||||
else {
|
||||
if (database.botdb.SaveBot(my_bot)) {
|
||||
c->Message(Chat::White, "Bot Surname Saved.");
|
||||
}
|
||||
}
|
||||
@@ -7003,10 +6979,7 @@ void bot_subcommand_bot_title(Client *c, const Seperator *sep)
|
||||
std::replace(bot_title.begin(), bot_title.end(), '_', ' ');
|
||||
|
||||
my_bot->SetTitle(bot_title);
|
||||
if (!database.botdb.SaveBot(my_bot)) {
|
||||
c->Message(Chat::White, BotDatabase::fail::SaveBot());
|
||||
}
|
||||
else {
|
||||
if (database.botdb.SaveBot(my_bot)) {
|
||||
c->Message(Chat::White, "Bot Title Saved.");
|
||||
}
|
||||
}
|
||||
@@ -7031,10 +7004,7 @@ void bot_subcommand_bot_suffix(Client *c, const Seperator *sep)
|
||||
std::replace(bot_suffix.begin(), bot_suffix.end(), '_', ' ');
|
||||
|
||||
my_bot->SetSuffix(bot_suffix);
|
||||
if (!database.botdb.SaveBot(my_bot)) {
|
||||
c->Message(Chat::White, BotDatabase::fail::SaveBot());
|
||||
}
|
||||
else {
|
||||
if (database.botdb.SaveBot(my_bot)) {
|
||||
c->Message(Chat::White, "Bot Suffix Saved.");
|
||||
}
|
||||
}
|
||||
@@ -7149,7 +7119,7 @@ void bot_subcommand_bot_spawn(Client *c, const Seperator *sep)
|
||||
|
||||
uint32 bot_id = 0;
|
||||
uint8 bot_class = Class::None;
|
||||
if (!database.botdb.LoadBotID(c->CharacterID(), bot_name, bot_id, bot_class)) {
|
||||
if (!database.botdb.LoadBotID(bot_name, bot_id, bot_class)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -7387,8 +7357,7 @@ void bot_subcommand_bot_stop_melee_level(Client *c, const Seperator *sep)
|
||||
// [reset] falls through with initialization value
|
||||
|
||||
my_bot->SetStopMeleeLevel(sml);
|
||||
if (!database.botdb.SaveStopMeleeLevel(c->CharacterID(), my_bot->GetBotID(), sml))
|
||||
c->Message(Chat::White, "%s for '%s'", BotDatabase::fail::SaveStopMeleeLevel(), my_bot->GetCleanName());
|
||||
database.botdb.SaveStopMeleeLevel(my_bot->GetBotID(), sml);
|
||||
|
||||
c->Message(Chat::White, "Successfully set stop melee level for %s to %u", my_bot->GetCleanName(), sml);
|
||||
}
|
||||
@@ -7587,8 +7556,7 @@ void bot_subcommand_bot_toggle_helm(Client *c, const Seperator *sep)
|
||||
bot_iter->SetShowHelm(helm_state);
|
||||
|
||||
if (ab_type != ActionableBots::ABT_All) {
|
||||
if (!database.botdb.SaveHelmAppearance(c->CharacterID(), bot_iter->GetBotID(), bot_iter->GetShowHelm())) {
|
||||
c->Message(Chat::White, "%s for '%s'", bot_iter->GetCleanName());
|
||||
if (!database.botdb.SaveHelmAppearance(bot_iter->GetBotID(), bot_iter->GetShowHelm())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7608,12 +7576,10 @@ void bot_subcommand_bot_toggle_helm(Client *c, const Seperator *sep)
|
||||
|
||||
if (ab_type == ActionableBots::ABT_All) {
|
||||
if (toggle_helm) {
|
||||
if (!database.botdb.ToggleAllHelmAppearances(c->CharacterID()))
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::ToggleAllHelmAppearances());
|
||||
database.botdb.ToggleAllHelmAppearances(c->CharacterID());
|
||||
}
|
||||
else {
|
||||
if (!database.botdb.SaveAllHelmAppearances(c->CharacterID(), helm_state))
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::SaveAllHelmAppearances());
|
||||
database.botdb.SaveAllHelmAppearances(c->CharacterID(), helm_state);
|
||||
}
|
||||
|
||||
c->Message(Chat::White, "%s all of your bot show helm flags", toggle_helm ? "Toggled" : (helm_state ? "Set" : "Cleared"));
|
||||
@@ -8357,8 +8323,7 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep)
|
||||
bool member_fail = false;
|
||||
bool target_fail = false;
|
||||
|
||||
if (!database.botdb.LoadHealRotation(creator_member, member_list, target_list, load_flag, member_fail, target_fail))
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::LoadHealRotation());
|
||||
database.botdb.LoadHealRotation(creator_member, member_list, target_list, load_flag, member_fail, target_fail);
|
||||
|
||||
if (!load_flag) {
|
||||
c->Message(Chat::White, "Successfully added %s as a current member to a new Heal Rotation", creator_member->GetCleanName());
|
||||
@@ -8387,9 +8352,6 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep)
|
||||
c->Message(Chat::White, "Could not locate member with bot id '%u'", member_iter);
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::LoadHealRotationMembers());
|
||||
}
|
||||
|
||||
if (!target_fail) {
|
||||
for (auto target_iter : target_list) {
|
||||
@@ -8406,9 +8368,6 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep)
|
||||
c->Message(Chat::White, "Failed to add target '%s'", target_mob->GetCleanName());
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::LoadHealRotationTargets());
|
||||
}
|
||||
|
||||
c->Message(Chat::White, "Successfully loaded %s's Heal Rotation", creator_member->GetCleanName());
|
||||
}
|
||||
@@ -8430,11 +8389,7 @@ void bot_subcommand_heal_rotation_delete(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (all_flag) {
|
||||
if (database.botdb.DeleteAllHealRotations(c->CharacterID()))
|
||||
c->Message(Chat::White, "Succeeded in deleting all heal rotations");
|
||||
else
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::DeleteAllHealRotations());
|
||||
|
||||
database.botdb.DeleteAllHealRotations(c->CharacterID());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8454,7 +8409,6 @@ void bot_subcommand_heal_rotation_delete(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (!database.botdb.DeleteHealRotation(current_member->GetBotID())) {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::DeleteHealRotation());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -8741,7 +8695,6 @@ void bot_subcommand_heal_rotation_save(Client *c, const Seperator *sep)
|
||||
bool member_fail = false;
|
||||
bool target_fail = false;
|
||||
if (!database.botdb.SaveHealRotation(current_member, member_fail, target_fail)) {
|
||||
c->Message(Chat::White, "%s", BotDatabase::fail::SaveHealRotation());
|
||||
return;
|
||||
}
|
||||
if (member_fail)
|
||||
@@ -8997,15 +8950,7 @@ void bot_subcommand_inventory_list(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
uint32 database_count = 0;
|
||||
if (!database.botdb.QueryInventoryCount(my_bot->GetBotID(), database_count)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}",
|
||||
BotDatabase::fail::QueryInventoryCount()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
database.botdb.QueryInventoryCount(my_bot->GetBotID(), database_count);
|
||||
|
||||
if (inventory_count != database_count) {
|
||||
c->Message(
|
||||
@@ -9114,7 +9059,6 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
std::string error_message;
|
||||
if (itm) {
|
||||
EQ::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQ::saylink::SayLinkItemInst);
|
||||
@@ -9128,18 +9072,7 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep)
|
||||
my_bot->SetBotArcherySetting(false, true);
|
||||
}
|
||||
|
||||
my_bot->RemoveBotItemBySlot(slot_id, &error_message);
|
||||
if (!error_message.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Database Error: {}",
|
||||
error_message
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
my_bot->RemoveBotItemBySlot(slot_id);
|
||||
my_bot->BotRemoveEquipItem(slot_id);
|
||||
my_bot->CalcBotStats(c->GetBotOption(Client::booStatsUpdate));
|
||||
|
||||
@@ -10671,16 +10604,7 @@ void bot_command_caster_range(Client* c, const Seperator* sep)
|
||||
my_bot->SetBotCasterRange(crange);
|
||||
++success_count;
|
||||
|
||||
if (!database.botdb.SaveBotCasterRange(c->CharacterID(), my_bot->GetBotID(), crange)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} for '{}'",
|
||||
BotDatabase::fail::SaveBotCasterRange(),
|
||||
my_bot->GetCleanName()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
database.botdb.SaveBotCasterRange(my_bot->GetBotID(), crange);
|
||||
}
|
||||
}
|
||||
if (!current_check) {
|
||||
|
||||
+1367
-1792
File diff suppressed because it is too large
Load Diff
+19
-43
@@ -50,31 +50,28 @@ public:
|
||||
/* Bot functions */
|
||||
bool QueryNameAvailablity(const std::string& bot_name, bool& available_flag);
|
||||
bool QueryBotCount(const uint32 owner_id, int class_id, uint32& bot_count, uint32& bot_class_count);
|
||||
bool LoadBotsList(const uint32 owner_id, std::list<BotsAvailableList>& bots_list, bool ByAccount = false);
|
||||
bool LoadBotsList(const uint32 owner_id, std::list<BotsAvailableList>& bots_list, bool by_account = false);
|
||||
|
||||
bool LoadOwnerID(const std::string& bot_name, uint32& owner_id);
|
||||
bool LoadOwnerID(const uint32 bot_id, uint32& owner_id);
|
||||
uint32 GetOwnerID(const uint32 bot_id);
|
||||
bool LoadBotID(const uint32 owner_id, const std::string& bot_name, uint32& bot_id);
|
||||
bool LoadBotID(const uint32 owner_id, const std::string& bot_name, uint32& bot_id, uint8& bot_class_id);
|
||||
bool LoadBotID(const std::string& bot_name, uint32& bot_id, uint8& bot_class_id);
|
||||
|
||||
bool LoadBot(const uint32 bot_id, Bot*& loaded_bot);
|
||||
bool SaveNewBot(Bot* bot_inst, uint32& bot_id);
|
||||
bool SaveBot(Bot* bot_inst);
|
||||
bool SaveNewBot(Bot* b, uint32& bot_id);
|
||||
bool SaveBot(Bot* b);
|
||||
bool DeleteBot(const uint32 bot_id);
|
||||
|
||||
bool LoadBuffs(Bot* bot_inst);
|
||||
bool SaveBuffs(Bot* bot_inst);
|
||||
bool LoadBuffs(Bot* b);
|
||||
bool SaveBuffs(Bot* b);
|
||||
bool DeleteBuffs(const uint32 bot_id);
|
||||
|
||||
bool LoadStance(const uint32 bot_id, int& bot_stance);
|
||||
bool LoadStance(Bot* bot_inst, bool& stance_flag);
|
||||
bool LoadStance(Bot* b, bool& stance_flag);
|
||||
bool SaveStance(const uint32 bot_id, const int bot_stance);
|
||||
bool SaveStance(Bot* bot_inst);
|
||||
bool SaveStance(Bot* b);
|
||||
bool DeleteStance(const uint32 bot_id);
|
||||
|
||||
bool LoadTimers(Bot* bot_inst);
|
||||
bool SaveTimers(Bot* bot_inst);
|
||||
bool LoadTimers(Bot* b);
|
||||
bool SaveTimers(Bot* b);
|
||||
bool DeleteTimers(const uint32 bot_id);
|
||||
|
||||
|
||||
@@ -82,17 +79,14 @@ public:
|
||||
bool QueryInventoryCount(const uint32 bot_id, uint32& item_count);
|
||||
|
||||
bool LoadItems(const uint32 bot_id, EQ::InventoryProfile &inventory_inst);
|
||||
bool SaveItems(Bot* bot_inst);
|
||||
bool DeleteItems(const uint32 bot_id);
|
||||
|
||||
bool LoadItemSlots(const uint32 bot_id, std::map<uint16, uint32>& m);
|
||||
bool LoadItemBySlot(Bot* bot_inst);
|
||||
bool LoadItemBySlot(const uint32 bot_id, const uint32 slot_id, uint32& item_id);
|
||||
bool SaveItemBySlot(Bot* bot_inst, const uint32 slot_id, const EQ::ItemInstance* item_inst);
|
||||
bool SaveItemBySlot(Bot* b, const uint32 slot_id, const EQ::ItemInstance* inst);
|
||||
bool DeleteItemBySlot(const uint32 bot_id, const uint32 slot_id);
|
||||
|
||||
bool LoadEquipmentColor(const uint32 bot_id, const uint8 material_slot_id, uint32& rgb);
|
||||
bool SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, const uint32 rgb);
|
||||
bool SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, const uint32 color);
|
||||
|
||||
bool SaveExpansionBitmask(const uint32 bot_id, const int expansion_bitmask);
|
||||
bool SaveEnforceSpellSetting(const uint32 bot_id, const bool enforce_spell_setting);
|
||||
@@ -126,19 +120,18 @@ public:
|
||||
bool SaveAllArmorColorBySlot(const uint32 owner_id, const int16 slot_id, const uint32 rgb_value);
|
||||
bool SaveAllArmorColors(const uint32 owner_id, const uint32 rgb_value);
|
||||
|
||||
bool SaveHelmAppearance(const uint32 owner_id, const uint32 bot_id, const bool show_flag = true);
|
||||
bool SaveHelmAppearance(const uint32 bot_id, const bool show_flag = true);
|
||||
bool SaveAllHelmAppearances(const uint32 owner_id, const bool show_flag = true);
|
||||
|
||||
bool ToggleHelmAppearance(const uint32 owner_id, const uint32 bot_id);
|
||||
bool ToggleAllHelmAppearances(const uint32 owner_id);
|
||||
|
||||
bool SaveFollowDistance(const uint32 owner_id, const uint32 bot_id, const uint32 follow_distance);
|
||||
bool SaveFollowDistance(const uint32 bot_id, const uint32 follow_distance);
|
||||
bool SaveAllFollowDistances(const uint32 owner_id, const uint32 follow_distance);
|
||||
|
||||
bool CreateCloneBot(const uint32 owner_id, const uint32 bot_id, const std::string& clone_name, uint32& clone_id);
|
||||
bool CreateCloneBotInventory(const uint32 owner_id, const uint32 bot_id, const uint32 clone_id);
|
||||
bool CreateCloneBot(const uint32 bot_id, const std::string& clone_name, uint32& clone_id);
|
||||
bool CreateCloneBotInventory(const uint32 bot_id, const uint32 clone_id);
|
||||
|
||||
bool SaveStopMeleeLevel(const uint32 owner_id, const uint32 bot_id, const uint8 sml_value);
|
||||
bool SaveStopMeleeLevel(const uint32 bot_id, const uint8 sml_value);
|
||||
|
||||
bool SaveBotArcherSetting(const uint32 bot_id, const bool bot_archer_setting);
|
||||
|
||||
@@ -146,7 +139,7 @@ public:
|
||||
bool SaveOwnerOption(const uint32 owner_id, size_t type, const bool flag);
|
||||
bool SaveOwnerOption(const uint32 owner_id, const std::pair<size_t, size_t> type, const std::pair<bool, bool> flag);
|
||||
|
||||
bool SaveBotCasterRange(const uint32 owner_id, const uint32 bot_id, const uint32 bot_caster_range_value);
|
||||
bool SaveBotCasterRange(const uint32 bot_id, const uint32 bot_caster_range_value);
|
||||
|
||||
/* Bot group functions */
|
||||
bool LoadGroupedBotsByGroupID(const uint32 owner_id, const uint32 group_id, std::list<uint32>& group_list);
|
||||
@@ -164,16 +157,12 @@ public:
|
||||
|
||||
/* Bot miscellaneous functions */
|
||||
uint8 GetSpellCastingChance(uint8 spell_type_index, uint8 class_index, uint8 stance_index, uint8 conditional_index);
|
||||
std::string GetBotNameByID(const uint32 bot_id);
|
||||
|
||||
uint16 GetRaceClassBitmask(uint16 bot_race);
|
||||
uint32 GetRaceClassBitmask(uint32 bot_race);
|
||||
|
||||
class fail {
|
||||
public:
|
||||
/* fail::Bot functions */
|
||||
static const char* LoadBotsList();
|
||||
static const char* LoadOwnerID();
|
||||
static const char* LoadBotID();
|
||||
static const char* LoadBot();
|
||||
static const char* SaveNewBot();
|
||||
static const char* SaveBot();
|
||||
@@ -189,11 +178,9 @@ public:
|
||||
/* fail::Bot inventory functions */
|
||||
static const char* QueryInventoryCount();
|
||||
static const char* LoadItems();
|
||||
static const char* SaveItems();
|
||||
static const char* DeleteItems();
|
||||
static const char* SaveItemBySlot();
|
||||
static const char* DeleteItemBySlot();
|
||||
static const char* LoadEquipmentColor();
|
||||
static const char* SaveEquipmentColor();
|
||||
|
||||
/* fail::Bot pet functions */
|
||||
@@ -212,34 +199,23 @@ public:
|
||||
/* fail::Bot command functions */
|
||||
static const char* LoadInspectMessage();
|
||||
static const char* SaveInspectMessage();
|
||||
static const char* DeleteInspectMessage();
|
||||
static const char* SaveAllInspectMessages();
|
||||
static const char* DeleteAllInspectMessages();
|
||||
static const char* SaveAllArmorColorBySlot();
|
||||
static const char* SaveAllArmorColors();
|
||||
static const char* SaveHelmAppearance();
|
||||
static const char* SaveAllHelmAppearances();
|
||||
static const char* ToggleHelmAppearance();
|
||||
static const char* ToggleAllHelmAppearances();
|
||||
static const char* SaveFollowDistance();
|
||||
static const char* SaveAllFollowDistances();
|
||||
static const char* SaveStopMeleeLevel();
|
||||
static const char* SaveBotCasterRange();
|
||||
|
||||
/* fail::Bot group functions */
|
||||
static const char* LoadGroupedBotsByGroupID();
|
||||
|
||||
/* fail::Bot heal rotation functions */
|
||||
static const char* LoadHealRotationIDByBotID();
|
||||
static const char* LoadHealRotation();
|
||||
static const char* LoadHealRotationMembers();
|
||||
static const char* LoadHealRotationTargets();
|
||||
static const char* SaveHealRotation();
|
||||
static const char* DeleteHealRotation();
|
||||
static const char* DeleteAllHealRotations();
|
||||
|
||||
/* fail::Bot miscellaneous functions */
|
||||
static const char* GetBotNameByID();
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
+4
-4
@@ -25,7 +25,7 @@
|
||||
#include "quest_parser_collection.h"
|
||||
#include "../common/data_verification.h"
|
||||
|
||||
std::vector<RaidMember> Raid::GetRaidGroupMembers(uint32 gid)
|
||||
std::vector<RaidMember> Raid::GetRaidGroupMembers(uint32 gid)
|
||||
{
|
||||
std::vector<RaidMember> raid_group_members;
|
||||
raid_group_members.clear();
|
||||
@@ -126,9 +126,9 @@ void Raid::HandleOfflineBots(uint32 owner) {
|
||||
}
|
||||
|
||||
for (const auto& b: bots_list) {
|
||||
if (IsRaidMember(b.Name)) {
|
||||
if (IsRaidMember(b.bot_name)) {
|
||||
for (const auto& m: members) {
|
||||
if (m.is_bot && strcmp(m.member_name, b.Name) == 0) {
|
||||
if (m.is_bot && strcmp(m.member_name, b.bot_name) == 0) {
|
||||
uint32 gid = GetGroup(m.member_name);
|
||||
SendRaidGroupRemove(m.member_name, gid);
|
||||
RemoveMember(m.member_name);
|
||||
@@ -313,7 +313,7 @@ void Client::SpawnRaidBotsOnConnect(Raid* raid) {
|
||||
if (strlen(m.member_name) != 0) {
|
||||
|
||||
for (const auto& b: bots_list) {
|
||||
if (strcmp(m.member_name, b.Name) == 0) {
|
||||
if (strcmp(m.member_name, b.bot_name) == 0) {
|
||||
std::string buffer = "^spawn ";
|
||||
buffer.append(m.member_name);
|
||||
bot_command_real_dispatch(this, buffer.c_str());
|
||||
|
||||
+8
-8
@@ -24,14 +24,14 @@
|
||||
#include <sstream>
|
||||
|
||||
struct BotsAvailableList {
|
||||
uint32 ID;
|
||||
char Name[64];
|
||||
uint16 Class;
|
||||
uint8 Level;
|
||||
uint16 Race;
|
||||
uint8 Gender;
|
||||
char Owner[64];
|
||||
uint32 Owner_ID;
|
||||
uint32 bot_id;
|
||||
char bot_name[64];
|
||||
uint16 class_;
|
||||
uint8 level;
|
||||
uint16 race;
|
||||
uint8 gender;
|
||||
char owner_name[64];
|
||||
uint32 owner_id;
|
||||
};
|
||||
|
||||
struct BotSpell {
|
||||
|
||||
+24
-19
@@ -8113,7 +8113,8 @@ void Client::SendColoredText(uint32 color, std::string message)
|
||||
}
|
||||
|
||||
|
||||
void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, uint32 itemid, uint32 exp, bool faction) {
|
||||
void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, uint32 itemid, uint32 exp, bool faction)
|
||||
{
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_Sound, sizeof(QuestReward_Struct));
|
||||
memset(outapp->pBuffer, 0, sizeof(QuestReward_Struct));
|
||||
@@ -8128,16 +8129,16 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
|
||||
qr->item_id[0] = itemid;
|
||||
qr->exp_reward = exp;
|
||||
|
||||
if (copper > 0 || silver > 0 || gold > 0 || platinum > 0)
|
||||
if (copper > 0 || silver > 0 || gold > 0 || platinum > 0) {
|
||||
AddMoneyToPP(copper, silver, gold, platinum);
|
||||
}
|
||||
|
||||
if (itemid > 0)
|
||||
SummonItem(itemid, -1, 0, 0, 0, 0, 0, 0, false, EQ::invslot::slotCursor);
|
||||
if (itemid > 0) {
|
||||
SummonItemIntoInventory(itemid, -1, 0, 0, 0, 0, 0, 0, false);
|
||||
}
|
||||
|
||||
if (faction)
|
||||
{
|
||||
if (target && target->IsNPC() && !target->IsCharmed())
|
||||
{
|
||||
if (faction) {
|
||||
if (target && target->IsNPC() && !target->IsCharmed()) {
|
||||
int32 nfl_id = target->CastToNPC()->GetNPCFactionID();
|
||||
SetFactionLevel(CharacterID(), nfl_id, GetBaseClass(), GetBaseRace(), GetDeity(), true);
|
||||
qr->faction = target->CastToNPC()->GetPrimaryFaction();
|
||||
@@ -8145,8 +8146,9 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
|
||||
}
|
||||
}
|
||||
|
||||
if (exp > 0)
|
||||
if (exp > 0) {
|
||||
AddEXP(exp);
|
||||
}
|
||||
|
||||
QueuePacket(outapp, true, Client::CLIENT_CONNECTED);
|
||||
safe_delete(outapp);
|
||||
@@ -8163,23 +8165,25 @@ void Client::QuestReward(Mob* target, const QuestReward_Struct &reward, bool fac
|
||||
// not set in caller because reasons
|
||||
qr->mob_id = target ? target->GetID() : 0; // Entity ID for the from mob name, tasks won't set this
|
||||
|
||||
if (reward.copper > 0 || reward.silver > 0 || reward.gold > 0 || reward.platinum > 0)
|
||||
if (reward.copper > 0 || reward.silver > 0 || reward.gold > 0 || reward.platinum > 0) {
|
||||
AddMoneyToPP(reward.copper, reward.silver, reward.gold, reward.platinum);
|
||||
}
|
||||
|
||||
for (int i = 0; i < QUESTREWARD_COUNT; ++i)
|
||||
if (reward.item_id[i] > 0)
|
||||
SummonItem(reward.item_id[i], -1, 0, 0, 0, 0, 0, 0, false, EQ::invslot::slotCursor);
|
||||
for (int i = 0; i < QUESTREWARD_COUNT; ++i) {
|
||||
if (reward.item_id[i] > 0) {
|
||||
SummonItemIntoInventory(reward.item_id[i], -1, 0, 0, 0, 0, 0, 0, false);
|
||||
}
|
||||
}
|
||||
|
||||
// only process if both are valid
|
||||
// if we don't have a target here, we want to just reward, but if there is a target, need to check charm
|
||||
if (reward.faction && reward.faction_mod && (target == nullptr || !target->IsCharmed()))
|
||||
if (reward.faction && reward.faction_mod && (target == nullptr || !target->IsCharmed())) {
|
||||
RewardFaction(reward.faction, reward.faction_mod);
|
||||
}
|
||||
|
||||
// legacy support
|
||||
if (faction)
|
||||
{
|
||||
if (target && target->IsNPC() && !target->IsCharmed())
|
||||
{
|
||||
if (faction) {
|
||||
if (target && target->IsNPC() && !target->IsCharmed()) {
|
||||
int32 nfl_id = target->CastToNPC()->GetNPCFactionID();
|
||||
SetFactionLevel(CharacterID(), nfl_id, GetBaseClass(), GetBaseRace(), GetDeity(), true);
|
||||
qr->faction = target->CastToNPC()->GetPrimaryFaction();
|
||||
@@ -8187,8 +8191,9 @@ void Client::QuestReward(Mob* target, const QuestReward_Struct &reward, bool fac
|
||||
}
|
||||
}
|
||||
|
||||
if (reward.exp_reward > 0)
|
||||
if (reward.exp_reward > 0) {
|
||||
AddEXP(reward.exp_reward);
|
||||
}
|
||||
|
||||
QueuePacket(outapp, true, Client::CLIENT_CONNECTED);
|
||||
safe_delete(outapp);
|
||||
|
||||
@@ -6256,7 +6256,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
|
||||
if (ed->dmgtype == EQ::constants::EnvironmentalDamage::Falling) {
|
||||
if (zone->HasWaterMap()) {
|
||||
auto target_position = glm::vec3(GetX(), GetY(), GetZ());
|
||||
if (!zone->watermap->InLiquid(target_position)) {
|
||||
if (zone->watermap->InLiquid(target_position)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -14905,6 +14905,11 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
if (DistanceSquared(GetPosition(), GetTarget()->GetPosition()) > (RuleI(Skills, MaximumTauntDistance) * (RuleI(Skills, MaximumTauntDistance)))) {
|
||||
MessageString(Chat::TooFarAway, TAUNT_TOO_FAR);
|
||||
return;
|
||||
}
|
||||
|
||||
Taunt(GetTarget()->CastToNPC(), false);
|
||||
return;
|
||||
}
|
||||
|
||||
+17
-26
@@ -491,42 +491,33 @@ void EntityList::MobProcess()
|
||||
old_client_count > 0 &&
|
||||
zone->GetSecondsBeforeIdle() > 0
|
||||
) {
|
||||
if (!zone->IsIdle()) {
|
||||
LogInfo(
|
||||
"Zone will go into an idle state after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
}
|
||||
|
||||
LogInfo(
|
||||
"Zone will go into an idle state after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
mob_settle_timer->Start(zone->GetSecondsBeforeIdle() * 1000);
|
||||
}
|
||||
|
||||
old_client_count = numclients;
|
||||
|
||||
if (numclients == 0 && mob_settle_timer->Check()) {
|
||||
if (!zone->IsIdle()) {
|
||||
LogInfo(
|
||||
"Zone has gone idle after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
|
||||
zone->SetIsIdle(true);
|
||||
}
|
||||
LogInfo(
|
||||
"Zone has gone idle after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
// Disable settle timer if someone zones into empty zone
|
||||
if (numclients > 0 || mob_settle_timer->Check()) {
|
||||
if (zone->IsIdle()) {
|
||||
LogInfo("Zone is no longer idle.");
|
||||
|
||||
zone->SetIsIdle(false);
|
||||
if (mob_settle_timer->Enabled()) {
|
||||
LogInfo("Zone is no longer scheduled to go idle.");
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
old_client_count = numclients;
|
||||
|
||||
Spawn2* s2 = mob->CastToNPC()->respawn2;
|
||||
|
||||
// Perform normal mob processing if any of these are true:
|
||||
@@ -534,7 +525,7 @@ void EntityList::MobProcess()
|
||||
// -- the entity's spawn2 point is marked as path_while_zone_idle
|
||||
// -- the zone is newly empty and we're allowing mobs to settle
|
||||
if (
|
||||
numclients > 0 ||
|
||||
numclients > 0 || zone->quest_idle_override ||
|
||||
(s2 && s2->PathWhenZoneIdle()) ||
|
||||
mob_settle_timer->Enabled()
|
||||
) {
|
||||
|
||||
+106
-100
@@ -31,6 +31,8 @@
|
||||
#include "water_map.h"
|
||||
#include "zonedb.h"
|
||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||
#include "../common/repositories/forage_repository.h"
|
||||
#include "../common/repositories/fishing_repository.h"
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "worldserver.h"
|
||||
|
||||
@@ -46,141 +48,145 @@ struct NPCType;
|
||||
//for a given zone.
|
||||
#define FORAGE_ITEM_LIMIT 50
|
||||
|
||||
uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) {
|
||||
uint32 ZoneDatabase::LoadForage(uint32 zone_id, uint8 skill_level)
|
||||
{
|
||||
uint32 forage_items[FORAGE_ITEM_LIMIT];
|
||||
|
||||
uint32 item[FORAGE_ITEM_LIMIT];
|
||||
uint32 chance[FORAGE_ITEM_LIMIT];
|
||||
uint32 ret;
|
||||
|
||||
for (int c=0; c < FORAGE_ITEM_LIMIT; c++) {
|
||||
item[c] = 0;
|
||||
for (uint16 slot_id = 0; slot_id < FORAGE_ITEM_LIMIT; slot_id++) {
|
||||
forage_items[slot_id] = 0;
|
||||
}
|
||||
|
||||
uint32 chancepool = 0;
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
SELECT
|
||||
itemid,
|
||||
chance
|
||||
FROM
|
||||
forage
|
||||
WHERE
|
||||
zoneid = '{}'
|
||||
and level <= '{}'
|
||||
{}
|
||||
LIMIT
|
||||
{}
|
||||
),
|
||||
ZoneID,
|
||||
skill,
|
||||
ContentFilterCriteria::apply(),
|
||||
FORAGE_ITEM_LIMIT
|
||||
const auto& l = ForageRepository::GetWhere(
|
||||
*this,
|
||||
fmt::format(
|
||||
"(`zoneid` = {} || `zoneid` = 0) AND `level` <= {} {} LIMIT {}",
|
||||
zone_id,
|
||||
skill_level,
|
||||
ContentFilterCriteria::apply(),
|
||||
FORAGE_ITEM_LIMIT
|
||||
)
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
|
||||
if (l.empty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 index = 0;
|
||||
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
|
||||
if (index >= FORAGE_ITEM_LIMIT) {
|
||||
LogInfo(
|
||||
"Loaded [{}] Forage Item{}",
|
||||
Strings::Commify(l.size()),
|
||||
l.size() != 1 ? "s" : ""
|
||||
);
|
||||
|
||||
int forage_chances[FORAGE_ITEM_LIMIT];
|
||||
|
||||
int current_chance = 0;
|
||||
uint32 item_id = 0;
|
||||
uint8 count = 0;
|
||||
|
||||
for (const auto& e : l) {
|
||||
if (count >= FORAGE_ITEM_LIMIT) {
|
||||
break;
|
||||
}
|
||||
|
||||
item[index] = Strings::ToInt(row[0]);
|
||||
chance[index] = Strings::ToInt(row[1]) + chancepool;
|
||||
chancepool = chance[index];
|
||||
forage_items[count] = e.Itemid;
|
||||
forage_chances[count] = e.chance;
|
||||
|
||||
current_chance = forage_chances[count];
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
if(chancepool == 0 || index < 1)
|
||||
if (current_chance == 0 || count < 1) {
|
||||
return 0;
|
||||
|
||||
if(index == 1) {
|
||||
return item[0];
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
if (count == 1) {
|
||||
return forage_items[0];
|
||||
}
|
||||
|
||||
uint32 rindex = zone->random.Int(1, chancepool);
|
||||
const int roll = zone->random.Int(1, current_chance);
|
||||
|
||||
for(int i = 0; i < index; i++) {
|
||||
if(rindex <= chance[i]) {
|
||||
ret = item[i];
|
||||
for (uint16 slot_id = 0; slot_id < count; slot_id++) {
|
||||
if (roll <= forage_chances[slot_id]) {
|
||||
item_id = forage_items[slot_id];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return item_id;
|
||||
}
|
||||
|
||||
uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, uint8 &npc_chance)
|
||||
uint32 ZoneDatabase::LoadFishing(uint32 zone_id, uint8 skill_level, uint32 &npc_id, uint8 &npc_chance)
|
||||
{
|
||||
uint32 item[50];
|
||||
uint32 chance[50];
|
||||
uint32 npc_ids[50];
|
||||
uint32 npc_chances[50];
|
||||
uint32 chancepool = 0;
|
||||
uint32 ret = 0;
|
||||
uint32 fishing_items[50];
|
||||
int fishing_chances[50];
|
||||
|
||||
for (int c=0; c<50; c++) {
|
||||
item[c]=0;
|
||||
chance[c]=0;
|
||||
for (uint16 slot_id = 0; slot_id < 50; slot_id++) {
|
||||
fishing_items[slot_id] = 0;
|
||||
fishing_chances[slot_id] = 0;
|
||||
}
|
||||
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
SELECT
|
||||
itemid,
|
||||
chance,
|
||||
npc_id,
|
||||
npc_chance
|
||||
FROM
|
||||
fishing
|
||||
WHERE
|
||||
(zoneid = '{}' || zoneid = 0)
|
||||
AND skill_level <= '{}'
|
||||
{}
|
||||
),
|
||||
ZoneID,
|
||||
skill,
|
||||
ContentFilterCriteria::apply()
|
||||
const auto& l = FishingRepository::GetWhere(
|
||||
*this,
|
||||
fmt::format(
|
||||
"(`zoneid` = {} || `zoneid` = 0) AND `skill_level` <= {} {}",
|
||||
zone_id,
|
||||
skill_level,
|
||||
ContentFilterCriteria::apply()
|
||||
)
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
|
||||
if (l.empty()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint8 index = 0;
|
||||
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
|
||||
if (index >= 50)
|
||||
break;
|
||||
LogInfo(
|
||||
"Loaded [{}] Fishing Item{}",
|
||||
Strings::Commify(l.size()),
|
||||
l.size() != 1 ? "s" : ""
|
||||
);
|
||||
|
||||
item[index] = Strings::ToInt(row[0]);
|
||||
chance[index] = Strings::ToInt(row[1])+chancepool;
|
||||
chancepool = chance[index];
|
||||
uint32 npc_ids[50];
|
||||
uint32 npc_chances[50];
|
||||
|
||||
npc_ids[index] = Strings::ToInt(row[2]);
|
||||
npc_chances[index] = Strings::ToInt(row[3]);
|
||||
}
|
||||
int current_chance = 0;
|
||||
uint32 item_id = 0;
|
||||
uint8 count = 0;
|
||||
|
||||
npc_id = 0;
|
||||
for (const auto &e: l) {
|
||||
if (count >= 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
fishing_items[count] = e.Itemid;
|
||||
fishing_chances[count] = e.chance + current_chance;
|
||||
npc_ids[count] = e.npc_id;
|
||||
npc_chances[count] = e.npc_chance;
|
||||
|
||||
current_chance = fishing_chances[count];
|
||||
}
|
||||
|
||||
npc_id = 0;
|
||||
npc_chance = 0;
|
||||
if (index <= 0)
|
||||
return 0;
|
||||
|
||||
uint32 random = zone->random.Int(1, chancepool);
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
if (random > chance[i])
|
||||
continue;
|
||||
if (count <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = item[i];
|
||||
npc_id = npc_ids[i];
|
||||
npc_chance = npc_chances[i];
|
||||
break;
|
||||
}
|
||||
const int roll = zone->random.Int(1, current_chance);
|
||||
|
||||
return ret;
|
||||
for (uint16 i = 0; i < count; i++) {
|
||||
if (roll > fishing_chances[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
item_id = fishing_items[i];
|
||||
npc_id = npc_ids[i];
|
||||
npc_chance = npc_chances[i];
|
||||
break;
|
||||
}
|
||||
|
||||
return item_id;
|
||||
}
|
||||
|
||||
//we need this function to immediately determine, after we receive OP_Fishing, if we can even try to fish, otherwise we have to wait a while to get the failure
|
||||
@@ -307,7 +313,7 @@ void Client::GoFish()
|
||||
if (zone->random.Int(0, 399) <= fishing_skill ) {
|
||||
uint32 npc_id = 0;
|
||||
uint8 npc_chance = 0;
|
||||
food_id = content_db.GetZoneFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance);
|
||||
food_id = content_db.LoadFishing(m_pp.zone_id, fishing_skill, npc_id, npc_chance);
|
||||
|
||||
//check for add NPC
|
||||
if (npc_chance > 0 && npc_id) {
|
||||
@@ -452,7 +458,7 @@ void Client::ForageItem(bool guarantee) {
|
||||
uint32 stringid = FORAGE_NOEAT;
|
||||
|
||||
if (zone->random.Roll(RuleI(Zone, ForageChance))) {
|
||||
foragedfood = content_db.GetZoneForage(m_pp.zone_id, skill_level);
|
||||
foragedfood = content_db.LoadForage(m_pp.zone_id, skill_level);
|
||||
}
|
||||
|
||||
//not an else in case theres no DB food
|
||||
|
||||
+106
-84
@@ -1,82 +1,138 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/repositories/grid_entries_repository.h"
|
||||
|
||||
void command_grid(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto command_type = sep->arg[1];
|
||||
auto zone_id = zone->GetZoneID();
|
||||
if (strcasecmp("max", command_type) == 0) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Highest grid ID in this zone is {}.",
|
||||
content_db.GetHighestGrid(zone_id)
|
||||
).c_str()
|
||||
);
|
||||
const uint16 arguments = sep->argnum;
|
||||
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #grid add [Grid ID] [Wander Type] [Pause Type] - Add a grid with the specified wander and pause type");
|
||||
c->Message(Chat::White, "Usage: #grid delete [Grid ID] - Delete a grid");
|
||||
c->Message(Chat::White, "Usage: #grid hide - Hides waypoint nodes from targeted NPC's grid");
|
||||
c->Message(Chat::White, "Usage: #grid max - Displays the highest grid ID used in this zone (for add)");
|
||||
c->Message(Chat::White, "Usage: #grid show - Displays waypoint nodes for targeted NPC's grid");
|
||||
return;
|
||||
}
|
||||
else if (strcasecmp("add", command_type) == 0) {
|
||||
auto grid_id = Strings::ToInt(sep->arg[2]);
|
||||
auto wander_type = Strings::ToInt(sep->arg[3]);
|
||||
auto pause_type = Strings::ToInt(sep->arg[4]);
|
||||
if (!content_db.GridExistsInZone(zone_id, grid_id)) {
|
||||
content_db.ModifyGrid(c, false, grid_id, wander_type, pause_type, zone_id);
|
||||
|
||||
const bool is_add = !strcasecmp(sep->arg[1], "add");
|
||||
const bool is_delete = !strcasecmp(sep->arg[1], "delete");
|
||||
const bool is_hide = !strcasecmp(sep->arg[1], "hide");
|
||||
const bool is_max = !strcasecmp(sep->arg[1], "max");
|
||||
const bool is_show = !strcasecmp(sep->arg[1], "show");
|
||||
|
||||
if (!is_add && !is_delete && !is_hide && !is_max && !is_show) {
|
||||
c->Message(Chat::White, "Usage: #grid add [Grid ID] [Wander Type] [Pause Type] - Add a grid with the specified wander and pause type");
|
||||
c->Message(Chat::White, "Usage: #grid delete [Grid ID] - Delete a grid");
|
||||
c->Message(Chat::White, "Usage: #grid hide - Hides waypoint nodes from targeted NPC's grid");
|
||||
c->Message(Chat::White, "Usage: #grid max - Displays the highest grid ID used in this zone (for add)");
|
||||
c->Message(Chat::White, "Usage: #grid show - Displays waypoint nodes for targeted NPC's grid");
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_add) {
|
||||
const uint32 grid_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
const uint8 wander_type = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[3]));
|
||||
const uint8 pause_type = static_cast<uint8>(Strings::ToUnsignedInt(sep->arg[4]));
|
||||
|
||||
if (!grid_id) {
|
||||
c->Message(Chat::White, "You must specify a valid grid ID.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!content_db.GridExistsInZone(zone->GetZoneID(), grid_id)) {
|
||||
content_db.ModifyGrid(c, false, grid_id, wander_type, pause_type, zone->GetZoneID());
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Grid {} added to zone ID {} with wander type {} and pause type {}.",
|
||||
grid_id,
|
||||
zone_id,
|
||||
zone->GetZoneID(),
|
||||
wander_type,
|
||||
pause_type
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Grid {} already exists in zone ID {}.",
|
||||
grid_id,
|
||||
zone_id
|
||||
zone->GetZoneID()
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (strcasecmp("show", command_type) == 0) {
|
||||
Mob *target = c->GetTarget();
|
||||
if (!target || !target->IsNPC()) {
|
||||
c->Message(Chat::White, "You need to target an NPC!");
|
||||
} else if (is_delete) {
|
||||
const uint32 grid_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
content_db.ModifyGrid(c, true, grid_id, 0, 0, zone->GetZoneID());
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Grid {} deleted from zone ID {}.",
|
||||
grid_id,
|
||||
zone->GetZoneID()
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_hide) {
|
||||
Mob* t = c->GetTarget();
|
||||
if (!t || !t->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto grid_id = target->CastToNPC()->GetGrid();
|
||||
std::string query = fmt::format(
|
||||
"SELECT `x`, `y`, `z`, `heading`, `number` "
|
||||
"FROM `grid_entries` "
|
||||
"WHERE `zoneid` = {} AND `gridid` = {} "
|
||||
"ORDER BY `number`",
|
||||
zone_id,
|
||||
grid_id
|
||||
const uint32 grid_id = t->CastToNPC()->GetGrid();
|
||||
|
||||
entity_list.DespawnGridNodes(grid_id);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Depawning nodes for grid {}.",
|
||||
grid_id
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_max) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Highest grid ID in this zone is {}.",
|
||||
content_db.GetHighestGrid(zone->GetZoneID())
|
||||
).c_str()
|
||||
);
|
||||
} else if (is_show) {
|
||||
Mob* t = c->GetTarget();
|
||||
if (!t || !t->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const uint32 grid_id = t->CastToNPC()->GetGrid();
|
||||
|
||||
const auto& l = GridEntriesRepository::GetWhere(
|
||||
content_db,
|
||||
fmt::format(
|
||||
"`zoneid` = {} AND `gridid` = {} ORDER BY `number`",
|
||||
zone->GetZoneID(),
|
||||
grid_id
|
||||
)
|
||||
);
|
||||
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
c->Message(Chat::White, "Error querying database.");
|
||||
c->Message(Chat::White, query.c_str());
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
if (l.empty()) {
|
||||
c->Message(Chat::White, "No grid found.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Depop any node npc's already spawned
|
||||
// Depop any grid nodes already spawned
|
||||
entity_list.DespawnGridNodes(grid_id);
|
||||
|
||||
// Spawn grid nodes
|
||||
std::map<std::vector<float>, int32> zoffset;
|
||||
for (auto row : results) {
|
||||
glm::vec4 node_position = glm::vec4(Strings::ToFloat(row[0]), Strings::ToFloat(row[1]), Strings::ToFloat(row[2]), Strings::ToFloat(row[3]));
|
||||
|
||||
for (const auto& e : l) {
|
||||
glm::vec4 node_position = glm::vec4(e.x, e.y, e.z, e.heading);
|
||||
|
||||
std::vector<float> node_loc{
|
||||
node_position.x,
|
||||
node_position.y,
|
||||
@@ -84,19 +140,20 @@ void command_grid(Client *c, const Seperator *sep)
|
||||
};
|
||||
|
||||
// If we already have a node at this location, set the z offset
|
||||
// higher from the existing one so we can see it. Adjust so if
|
||||
// higher from the existing one, so we can see it. Adjust so if
|
||||
// there is another at the same spot we adjust again.
|
||||
auto search = zoffset.find(node_loc);
|
||||
if (search != zoffset.end()) {
|
||||
search->second = search->second + 3;
|
||||
}
|
||||
else {
|
||||
search->second += 3;
|
||||
} else {
|
||||
zoffset[node_loc] = 0.0;
|
||||
}
|
||||
|
||||
node_position.z += zoffset[node_loc];
|
||||
NPC::SpawnGridNodeNPC(node_position, grid_id, Strings::ToInt(row[4]), zoffset[node_loc]);
|
||||
|
||||
NPC::SpawnGridNodeNPC(node_position, grid_id, e.number, zoffset[node_loc]);
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -105,39 +162,4 @@ void command_grid(Client *c, const Seperator *sep)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else if (strcasecmp("hide", command_type) == 0) {
|
||||
Mob *target = c->GetTarget();
|
||||
if (!target || !target->IsNPC()) {
|
||||
c->Message(Chat::White, "You need to target an NPC!");
|
||||
return;
|
||||
}
|
||||
|
||||
auto grid_id = target->CastToNPC()->GetGrid();
|
||||
entity_list.DespawnGridNodes(grid_id);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Depawning nodes for grid {}.",
|
||||
grid_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else if (strcasecmp("delete", command_type) == 0) {
|
||||
auto grid_id = Strings::ToInt(sep->arg[2]);
|
||||
content_db.ModifyGrid(c, true, grid_id, 0, 0, zone_id);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Grid {} deleted from zone ID {}.",
|
||||
grid_id,
|
||||
zone_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Usage: #grid [add|delete] [grid_id] [wander_type] [pause_type]");
|
||||
c->Message(Chat::White, "Usage: #grid [max] - displays the highest grid ID used in this zone (for add)");
|
||||
c->Message(Chat::White, "Usage: #grid [show] - displays wp nodes as boxes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1645,6 +1645,31 @@ void command_npcedit(Client *c, const Seperator *sep)
|
||||
);
|
||||
return;
|
||||
}
|
||||
} else if (!strcasecmp(sep->arg[1], "set_grid")) {
|
||||
if (sep->IsNumber(2)) {
|
||||
const uint32 grid_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
if (grid_id) {
|
||||
d = fmt::format(
|
||||
"{} now has a Grid ID of {} on Spawn Group ID {}.",
|
||||
npc_id_string,
|
||||
grid_id,
|
||||
Strings::Commify(std::to_string(t->GetSpawnGroupId()))
|
||||
);
|
||||
auto query = fmt::format(
|
||||
"UPDATE spawn2 SET pathgrid = {} WHERE spawngroupID = {} AND version = {}",
|
||||
grid_id,
|
||||
t->GetSpawnGroupId(),
|
||||
zone->GetInstanceVersion()
|
||||
);
|
||||
content_db.QueryDatabase(query);
|
||||
} else {
|
||||
c->Message(Chat::White, "Grid ID must be greater than 0.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
SendNPCEditSubCommands(c);
|
||||
return;
|
||||
@@ -1768,4 +1793,5 @@ void SendNPCEditSubCommands(Client *c)
|
||||
c->Message(Chat::White, "Usage: #npcedit keeps_sold_items [Flag] - Sets an NPC's Keeps Sold Items Flag [0 = False, 1 = True]");
|
||||
c->Message(Chat::White, "Usage: #npcedit setanimation [Animation ID] - Sets an NPC's Animation on Spawn (Stored in spawn2 table)");
|
||||
c->Message(Chat::White, "Usage: #npcedit respawntime [Respawn Time] - Sets an NPC's Respawn Timer in Seconds (Stored in spawn2 table)");
|
||||
c->Message(Chat::White, "Usage: #npcedit set_grid [Grid ID] - Sets an NPC's Grid ID");
|
||||
}
|
||||
|
||||
@@ -2,24 +2,65 @@
|
||||
|
||||
void command_petitems(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetPet()) {
|
||||
c->Message(Chat::White, "You must have a pet to use this command.");
|
||||
NPC* t = nullptr;
|
||||
|
||||
if (c->GetPet()) {
|
||||
t = c->GetPet()->CastToNPC();
|
||||
}
|
||||
|
||||
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
|
||||
t = c->GetTarget()->CastToNPC();
|
||||
}
|
||||
|
||||
if (!t || !t->IsPet()) {
|
||||
c->Message(Chat::White, "You must have a pet or target a bot's pet to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mob* o = t->GetOwner();
|
||||
if (!o) {
|
||||
c->Message(Chat::White, "Invalid owner for pet.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto pet = c->GetPet()->CastToNPC();
|
||||
auto loot_list = pet->GetLootList();
|
||||
if (!loot_list.empty()) {
|
||||
pet->QueryLoot(c, true);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Your pet has {} item{}.",
|
||||
loot_list.size(),
|
||||
loot_list.size() != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(Chat::White, "Your pet has no items.");
|
||||
|
||||
if (
|
||||
o->IsBot() &&
|
||||
o->CastToBot()->GetBotOwnerCharacterID() != c->CharacterID()
|
||||
) {
|
||||
c->Message(Chat::White, "You do not own the targeted pet.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
o->IsClient() &&
|
||||
o->GetID() != c->GetID()
|
||||
) {
|
||||
c->Message(Chat::White, "You do not own the targeted pet.");
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string& pet_owner = (
|
||||
o->IsClient() ?
|
||||
"Your" :
|
||||
fmt::format(
|
||||
"Your bot {}{}",
|
||||
o->GetCleanName(),
|
||||
Strings::EndsWith(o->GetCleanName(), "s") ? "'" : "'s"
|
||||
)
|
||||
);
|
||||
|
||||
const auto& l = t->GetLootList();
|
||||
if (!l.empty()) {
|
||||
t->QueryLoot(c, true);
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} pet has {} item{}.",
|
||||
pet_owner,
|
||||
l.size(),
|
||||
l.size() != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ void command_wp(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
if (strcasecmp("-h", sep->arg[5]) == 0) {
|
||||
content_db.AddWP(c, grid_id, waypoint, c->GetPosition(), pause, zone_id);
|
||||
content_db.AddWaypoint(c, grid_id, waypoint, c->GetPosition(), pause, zone_id);
|
||||
}
|
||||
else {
|
||||
auto position = c->GetPosition();
|
||||
position.w = -1;
|
||||
content_db.AddWP(c, grid_id, waypoint, position, pause, zone_id);
|
||||
content_db.AddWaypoint(c, grid_id, waypoint, position, pause, zone_id);
|
||||
}
|
||||
c->Message(
|
||||
Chat::White,
|
||||
|
||||
@@ -29,7 +29,7 @@ void command_wpadd(Client *c, const Seperator *sep)
|
||||
}
|
||||
|
||||
auto zone_id = zone->GetZoneID();
|
||||
uint32 tmp_grid = content_db.AddWPForSpawn(c, s2info->GetID(), position, pause, type1, type2, zone_id);
|
||||
uint32 tmp_grid = content_db.AddWaypointForSpawn(c, s2info->GetID(), position, pause, type1, type2, zone_id);
|
||||
if (tmp_grid) {
|
||||
target->CastToNPC()->SetGrid(tmp_grid);
|
||||
}
|
||||
|
||||
+10
-7
@@ -80,15 +80,18 @@ bool HateList::IsEntOnHateList(Mob *mob)
|
||||
return false;
|
||||
}
|
||||
|
||||
struct_HateList *HateList::Find(Mob *in_entity)
|
||||
struct_HateList* HateList::Find(Mob* m)
|
||||
{
|
||||
auto iterator = list.begin();
|
||||
while (iterator != list.end())
|
||||
{
|
||||
if ((*iterator)->entity_on_hatelist == in_entity)
|
||||
return (*iterator);
|
||||
++iterator;
|
||||
if (!m) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto* e : list) {
|
||||
if (e->entity_on_hatelist && e->entity_on_hatelist == m) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
struct_HateList *Find(Mob *ent);
|
||||
struct_HateList* Find(Mob* m);
|
||||
private:
|
||||
std::list<struct_HateList *> list;
|
||||
Mob *hate_owner;
|
||||
|
||||
+27
-30
@@ -5575,20 +5575,17 @@ Merc* Client::GetMerc() {
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
uint8 Client::GetNumberOfMercenaries() {
|
||||
uint8 Client::GetNumberOfMercenaries()
|
||||
{
|
||||
uint8 count = 0;
|
||||
|
||||
uint8 numMercs = 0;
|
||||
|
||||
for(int i=0; i<MAXMERCS; i++)
|
||||
{
|
||||
if(m_mercinfo[i].mercid != 0)
|
||||
{
|
||||
numMercs++;
|
||||
for (int slot_id = 0; slot_id < MAXMERCS; slot_id++) {
|
||||
if (m_mercinfo[slot_id].mercid != 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
Log(Logs::General, Logs::Mercenaries, "GetNumberOfMercenaries Number: %i for %s.", numMercs, GetName());
|
||||
|
||||
return numMercs;
|
||||
return count;
|
||||
}
|
||||
|
||||
void Merc::SetMercData( uint32 template_id ) {
|
||||
@@ -5738,17 +5735,17 @@ void NPC::LoadMercenaryTypes()
|
||||
);
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
MercType t;
|
||||
|
||||
t.Type = Strings::ToInt(row[0]);
|
||||
t.ClientVersion = Strings::ToInt(row[1]);
|
||||
|
||||
mercTypeList.push_back(t);
|
||||
for (auto row : results) {
|
||||
mercTypeList.push_back(
|
||||
MercType{
|
||||
.Type = Strings::ToUnsignedInt(row[0]),
|
||||
.ClientVersion = Strings::ToUnsignedInt(row[1])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5772,21 +5769,21 @@ void NPC::LoadMercenaries()
|
||||
);
|
||||
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
MercData t;
|
||||
|
||||
t.MercTemplateID = Strings::ToInt(row[0]);
|
||||
t.MercType = Strings::ToInt(row[1]);
|
||||
t.MercSubType = Strings::ToInt(row[2]);
|
||||
t.CostFormula = Strings::ToInt(row[3]);
|
||||
t.ClientVersion = Strings::ToInt(row[4]);
|
||||
t.NPCID = Strings::ToInt(row[5]);
|
||||
|
||||
mercDataList.push_back(t);
|
||||
for (auto row : results) {
|
||||
mercDataList.push_back(
|
||||
MercData{
|
||||
.MercTemplateID = Strings::ToUnsignedInt(row[0]),
|
||||
.MercType = Strings::ToUnsignedInt(row[1]),
|
||||
.MercSubType = Strings::ToUnsignedInt(row[2]),
|
||||
.CostFormula = Strings::ToUnsignedInt(row[3]),
|
||||
.ClientVersion = Strings::ToUnsignedInt(row[4]),
|
||||
.NPCID = Strings::ToUnsignedInt(row[5])
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -1800,9 +1800,8 @@ void Mob::AI_Event_Engaged(Mob *attacker, bool yell_for_help)
|
||||
parse->EventNPC(EVENT_COMBAT, CastToNPC(), attacker, "1", 0);
|
||||
}
|
||||
|
||||
const uint32 emote_id = GetEmoteID();
|
||||
if (emote_id) {
|
||||
CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::EnterCombat, emote_id, attacker);
|
||||
if (emoteid) {
|
||||
CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::EnterCombat, emoteid, attacker);
|
||||
}
|
||||
|
||||
std::string mob_name = GetCleanName();
|
||||
|
||||
+6
-9
@@ -438,7 +438,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
|
||||
qGlobals = nullptr;
|
||||
|
||||
SetEmoteID(static_cast<uint32>(npc_type_data->emoteid));
|
||||
SetEmoteID(npc_type_data->emoteid);
|
||||
InitializeBuffSlots();
|
||||
CalcBonuses();
|
||||
|
||||
@@ -1113,9 +1113,8 @@ void NPC::UpdateEquipmentLight()
|
||||
}
|
||||
|
||||
void NPC::Depop(bool start_spawn_timer) {
|
||||
const uint32 emote_id = GetEmoteID();
|
||||
if (emote_id) {
|
||||
DoNPCEmote(EQ::constants::EmoteEventTypes::OnDespawn, emote_id);
|
||||
if (emoteid) {
|
||||
DoNPCEmote(EQ::constants::EmoteEventTypes::OnDespawn, emoteid);
|
||||
}
|
||||
|
||||
if (IsNPC()) {
|
||||
@@ -3073,10 +3072,8 @@ void NPC::SendPayload(int payload_id, std::string payload_value)
|
||||
NPC_Emote_Struct* NPC::GetNPCEmote(uint32 emote_id, uint8 event_) {
|
||||
std::vector<NPC_Emote_Struct*> emotes;
|
||||
|
||||
for (const auto &e : zone->npc_emote_list) {
|
||||
auto nes = e;
|
||||
|
||||
if (nes->emoteid == emote_id && nes->event_ == event_) {
|
||||
for (auto& e : zone->npc_emote_list) {
|
||||
if (e->emoteid == emote_id && e->event_ == event_) {
|
||||
emotes.emplace_back(e);
|
||||
}
|
||||
}
|
||||
@@ -3098,7 +3095,7 @@ void NPC::DoNPCEmote(uint8 event_, uint32 emote_id, Mob* t)
|
||||
return;
|
||||
}
|
||||
|
||||
auto e = GetNPCEmote(emote_id, event_);
|
||||
const auto& e = GetNPCEmote(emote_id, event_);
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
|
||||
+26
-29
@@ -21,6 +21,7 @@
|
||||
#include "../common/strings.h"
|
||||
|
||||
#include "../common/repositories/pets_repository.h"
|
||||
#include "../common/repositories/pets_beastlord_data_repository.h"
|
||||
|
||||
#include "entity.h"
|
||||
#include "client.h"
|
||||
@@ -196,15 +197,18 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
|
||||
}
|
||||
|
||||
// Beastlord Pets
|
||||
if(record.petnaming == 2) {
|
||||
if (record.petnaming == 2) {
|
||||
uint16 race_id = GetBaseRace();
|
||||
auto beastlord_pet_data = content_db.GetBeastlordPetData(race_id);
|
||||
npc_type->race = beastlord_pet_data.race_id;
|
||||
npc_type->texture = beastlord_pet_data.texture;
|
||||
npc_type->helmtexture = beastlord_pet_data.helm_texture;
|
||||
npc_type->gender = beastlord_pet_data.gender;
|
||||
npc_type->size *= beastlord_pet_data.size_modifier;
|
||||
npc_type->luclinface = beastlord_pet_data.face;
|
||||
|
||||
auto d = content_db.GetBeastlordPetData(race_id);
|
||||
|
||||
npc_type->race = d.race_id;
|
||||
npc_type->texture = d.texture;
|
||||
npc_type->helmtexture = d.helm_texture;
|
||||
npc_type->gender = d.gender;
|
||||
npc_type->luclinface = d.face;
|
||||
|
||||
npc_type->size *= d.size_modifier;
|
||||
}
|
||||
|
||||
// handle monster summoning pet appearance
|
||||
@@ -655,27 +659,20 @@ bool Pet::CheckSpellLevelRestriction(Mob *caster, uint16 spell_id)
|
||||
}
|
||||
|
||||
BeastlordPetData::PetStruct ZoneDatabase::GetBeastlordPetData(uint16 race_id) {
|
||||
BeastlordPetData::PetStruct beastlord_pet_data;
|
||||
std::string query = fmt::format(
|
||||
SQL(
|
||||
SELECT
|
||||
`pet_race`, `texture`, `helm_texture`, `gender`, `size_modifier`, `face`
|
||||
FROM `pets_beastlord_data`
|
||||
WHERE `player_race` = {}
|
||||
),
|
||||
race_id
|
||||
);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success() || results.RowCount() != 1) {
|
||||
return beastlord_pet_data;
|
||||
BeastlordPetData::PetStruct d;
|
||||
|
||||
const auto& e = PetsBeastlordDataRepository::FindOne(*this, race_id);
|
||||
|
||||
if (!e.player_race) {
|
||||
return d;
|
||||
}
|
||||
|
||||
auto row = results.begin();
|
||||
beastlord_pet_data.race_id = Strings::ToInt(row[0]);
|
||||
beastlord_pet_data.texture = Strings::ToInt(row[1]);
|
||||
beastlord_pet_data.helm_texture = Strings::ToInt(row[2]);
|
||||
beastlord_pet_data.gender = Strings::ToInt(row[3]);
|
||||
beastlord_pet_data.size_modifier = Strings::ToFloat(row[4]);
|
||||
beastlord_pet_data.face = Strings::ToInt(row[5]);
|
||||
return beastlord_pet_data;
|
||||
d.race_id = e.pet_race;
|
||||
d.texture = e.texture;
|
||||
d.helm_texture = e.helm_texture;
|
||||
d.gender = e.gender;
|
||||
d.size_modifier = e.size_modifier;
|
||||
d.face = e.face;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
+61
-27
@@ -3,19 +3,38 @@
|
||||
#include <string>
|
||||
#include <cmath>
|
||||
#include "../common/strings.h"
|
||||
#include "../common/data_verification.h"
|
||||
|
||||
static const float position_eps = 0.0001f;
|
||||
constexpr float position_eps = 0.0001f;
|
||||
|
||||
std::string to_string(const glm::vec4 &position) {
|
||||
return StringFormat("(%.3f, %.3f, %.3f, %.3f)", position.x,position.y,position.z,position.w);
|
||||
std::string to_string(const glm::vec4 &position)
|
||||
{
|
||||
return fmt::format(
|
||||
"({:.3f}, {:.3f}, {:.3f}, {:.3f})",
|
||||
position.x,
|
||||
position.y,
|
||||
position.z,
|
||||
position.w
|
||||
);
|
||||
}
|
||||
|
||||
std::string to_string(const glm::vec3 &position){
|
||||
return StringFormat("(%.3f, %.3f, %.3f)", position.x,position.y,position.z);
|
||||
std::string to_string(const glm::vec3 &position)
|
||||
{
|
||||
return fmt::format(
|
||||
"({:.3f}, {:.3f}, {:.3f})",
|
||||
position.x,
|
||||
position.y,
|
||||
position.z
|
||||
);
|
||||
}
|
||||
|
||||
std::string to_string(const glm::vec2 &position){
|
||||
return StringFormat("(%.3f, %.3f)", position.x,position.y);
|
||||
std::string to_string(const glm::vec2 &position)
|
||||
{
|
||||
return fmt::format(
|
||||
"({:.3f}, {:.3f})",
|
||||
position.x,
|
||||
position.y
|
||||
);
|
||||
}
|
||||
|
||||
bool IsOrigin(const glm::vec3 &position) {
|
||||
@@ -103,14 +122,23 @@ float DistanceSquaredNoZ(const glm::vec4& point1, const glm::vec4& point2) {
|
||||
* box (3 dimensional) formed from the points minimum and maximum.
|
||||
*/
|
||||
bool IsWithinAxisAlignedBox(const glm::vec3 &position, const glm::vec3 &minimum, const glm::vec3 &maximum) {
|
||||
auto actualMinimum = glm::vec3(std::min(minimum.x, maximum.x), std::min(minimum.y, maximum.y),std::min(minimum.z, maximum.z));
|
||||
auto actualMaximum = glm::vec3(std::max(minimum.x, maximum.x), std::max(minimum.y, maximum.y),std::max(minimum.z, maximum.z));
|
||||
auto min = glm::vec3(
|
||||
std::min(minimum.x, maximum.x),
|
||||
std::min(minimum.y, maximum.y),
|
||||
std::min(minimum.z, maximum.z)
|
||||
);
|
||||
|
||||
bool xcheck = position.x >= actualMinimum.x && position.x <= actualMaximum.x;
|
||||
bool ycheck = position.y >= actualMinimum.y && position.y <= actualMaximum.y;
|
||||
bool zcheck = position.z >= actualMinimum.z && position.z <= actualMaximum.z;
|
||||
auto max = glm::vec3(
|
||||
std::max(minimum.x, maximum.x),
|
||||
std::max(minimum.y, maximum.y),
|
||||
std::max(minimum.z, maximum.z)
|
||||
);
|
||||
|
||||
return xcheck && ycheck && zcheck;
|
||||
const bool x_check = EQ::ValueWithin(position.x, min.x, max.x);
|
||||
const bool y_check = EQ::ValueWithin(position.y, min.y, max.y);
|
||||
const bool z_check = EQ::ValueWithin(position.z, min.z, max.z);
|
||||
|
||||
return x_check && y_check && z_check;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,13 +146,13 @@ bool IsWithinAxisAlignedBox(const glm::vec3 &position, const glm::vec3 &minimum,
|
||||
* box (2 dimensional) formed from the points minimum and maximum.
|
||||
*/
|
||||
bool IsWithinAxisAlignedBox(const glm::vec2 &position, const glm::vec2 &minimum, const glm::vec2 &maximum) {
|
||||
auto actualMinimum = glm::vec2(std::min(minimum.x, maximum.x), std::min(minimum.y, maximum.y));
|
||||
auto actualMaximum = glm::vec2(std::max(minimum.x, maximum.x), std::max(minimum.y, maximum.y));
|
||||
auto min = glm::vec2(std::min(minimum.x, maximum.x), std::min(minimum.y, maximum.y));
|
||||
auto max = glm::vec2(std::max(minimum.x, maximum.x), std::max(minimum.y, maximum.y));
|
||||
|
||||
bool xcheck = position.x >= actualMinimum.x && position.x <= actualMaximum.x;
|
||||
bool ycheck = position.y >= actualMinimum.y && position.y <= actualMaximum.y;
|
||||
const bool x_check = EQ::ValueWithin(position.x, min.x, max.x);
|
||||
const bool y_check = EQ::ValueWithin(position.y, min.y, max.y);
|
||||
|
||||
return xcheck && ycheck;
|
||||
return x_check && y_check;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,10 +172,10 @@ float GetReciprocalHeading(const glm::vec4& point1) {
|
||||
*/
|
||||
float GetReciprocalHeading(const float heading)
|
||||
{
|
||||
float result = 0;
|
||||
float result;
|
||||
|
||||
// Convert to radians
|
||||
float h = (heading / 512.0f) * 6.283184f;
|
||||
const float h = (heading / 512.0f) * 6.283184f;
|
||||
|
||||
// Calculate the reciprocal heading in radians
|
||||
result = h + 3.141592f;
|
||||
@@ -228,23 +256,29 @@ bool IsPositionWithinSimpleCylinder(const glm::vec4 &p1, const glm::vec4 &cylind
|
||||
|
||||
float CalculateHeadingAngleBetweenPositions(float x1, float y1, float x2, float y2)
|
||||
{
|
||||
float y_diff = std::abs(y1 - y2);
|
||||
float x_diff = std::abs(x1 - x2);
|
||||
if (y_diff < 0.0000009999999974752427)
|
||||
float y_diff = std::abs(y1 - y2);
|
||||
if (y_diff < 0.0000009999999974752427) {
|
||||
y_diff = 0.0000009999999974752427;
|
||||
}
|
||||
|
||||
float angle = atan2(x_diff, y_diff) * 180.0f * 0.3183099014828645f; // angle, nice "pi"
|
||||
const float angle = atan2(x_diff, y_diff) * 180.0f * 0.3183099014828645f; // angle, nice "pi"
|
||||
|
||||
// return the right thing based on relative quadrant
|
||||
// I'm sure this could be improved for readability, but whatever
|
||||
if (y1 >= y2) {
|
||||
if (x2 >= x1)
|
||||
if (x2 >= x1) {
|
||||
return (90.0f - angle + 90.0f) * 511.5f * 0.0027777778f;
|
||||
if (x2 <= x1)
|
||||
}
|
||||
|
||||
if (x2 <= x1) {
|
||||
return (angle + 180.0f) * 511.5f * 0.0027777778f;
|
||||
}
|
||||
}
|
||||
if (y1 > y2 || x2 > x1)
|
||||
|
||||
if (y1 > y2 || x2 > x1) {
|
||||
return angle * 511.5f * 0.0027777778f;
|
||||
else
|
||||
} else {
|
||||
return (90.0f - angle + 270.0f) * 511.5f * 0.0027777778f;
|
||||
}
|
||||
}
|
||||
|
||||
+115
-96
@@ -40,6 +40,8 @@
|
||||
#include "dialogue_window.h"
|
||||
|
||||
#include "../common/repositories/tradeskill_recipe_repository.h"
|
||||
#include "../common/repositories/instance_list_repository.h"
|
||||
#include "../common/repositories/grid_entries_repository.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <limits.h>
|
||||
@@ -933,9 +935,9 @@ void QuestManager::repopzone() {
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::processmobswhilezoneempty(bool turn_on) {
|
||||
void QuestManager::processmobswhilezoneempty(bool on) {
|
||||
if (zone) {
|
||||
zone->SetIdleWhenEmpty(!turn_on);
|
||||
zone->quest_idle_override = on;
|
||||
} else {
|
||||
LogQuests(
|
||||
"QuestManager::processmobswhilezoneempty called with nullptr zone. Probably syntax error in quest file"
|
||||
@@ -1987,38 +1989,48 @@ void QuestManager::setanim(int npc_type, int animnum) {
|
||||
}
|
||||
|
||||
//displays an in game path based on a waypoint grid
|
||||
void QuestManager::showgrid(int grid) {
|
||||
void QuestManager::showgrid(int grid_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(initiator == nullptr)
|
||||
|
||||
if (!initiator) {
|
||||
return;
|
||||
}
|
||||
|
||||
FindPerson_Point pt;
|
||||
std::vector<FindPerson_Point> pts;
|
||||
std::vector<FindPerson_Point> v;
|
||||
|
||||
pt.x = initiator->GetX();
|
||||
pt.y = initiator->GetY();
|
||||
pt.z = initiator->GetZ();
|
||||
pts.push_back(pt);
|
||||
v.push_back(
|
||||
FindPerson_Point{
|
||||
.y = initiator->GetY(),
|
||||
.x = initiator->GetX(),
|
||||
.z = initiator->GetZ()
|
||||
}
|
||||
);
|
||||
|
||||
// Retrieve all waypoints for this grid
|
||||
std::string query = StringFormat("SELECT `x`,`y`,`z` FROM grid_entries "
|
||||
"WHERE `gridid` = %i AND `zoneid` = %i "
|
||||
"ORDER BY `number`", grid, zone->GetZoneID());
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogQuests("Error loading grid [{}] for showgrid(): [{}]", grid, results.ErrorMessage().c_str());
|
||||
const auto& l = GridEntriesRepository::GetWhere(
|
||||
content_db,
|
||||
fmt::format(
|
||||
"`gridid` = {} AND `zoneid` = {} ORDER BY `number`",
|
||||
grid_id,
|
||||
zone->GetZoneID()
|
||||
)
|
||||
);
|
||||
|
||||
if (l.empty()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
pt.x = Strings::ToFloat(row[0]);
|
||||
pt.y = Strings::ToFloat(row[1]);
|
||||
pt.z = Strings::ToFloat(row[2]);
|
||||
for (const auto& e : l) {
|
||||
v.push_back(
|
||||
FindPerson_Point{
|
||||
.y = e.y,
|
||||
.x = e.x,
|
||||
.z = e.z
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
pts.push_back(pt);
|
||||
}
|
||||
|
||||
initiator->SendPathPacket(pts);
|
||||
initiator->SendPathPacket(v);
|
||||
|
||||
}
|
||||
|
||||
@@ -3239,7 +3251,7 @@ std::string QuestManager::getcleannpcnamebyid(uint32 npc_id) {
|
||||
return res;
|
||||
}
|
||||
|
||||
uint16 QuestManager::CreateInstance(const char *zone_short_name, int16 instance_version, uint32 duration)
|
||||
uint16 QuestManager::CreateInstance(const std::string& zone_short_name, int16 instance_version, uint32 duration)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
@@ -3275,57 +3287,56 @@ void QuestManager::DestroyInstance(uint16 instance_id)
|
||||
|
||||
void QuestManager::UpdateInstanceTimer(uint16 instance_id, uint32 new_duration)
|
||||
{
|
||||
std::string query = StringFormat("UPDATE instance_list SET duration = %lu, start_time = UNIX_TIMESTAMP() WHERE id = %lu",
|
||||
(unsigned long)new_duration, (unsigned long)instance_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
auto e = InstanceListRepository::FindOne(database, instance_id);
|
||||
|
||||
if (results.Success()) {
|
||||
if (!e.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.duration = new_duration;
|
||||
e.start_time = std::time(nullptr);
|
||||
|
||||
const int updated = InstanceListRepository::UpdateOne(database, e);
|
||||
|
||||
if (updated) {
|
||||
auto pack = new ServerPacket(ServerOP_InstanceUpdateTime, sizeof(ServerInstanceUpdateTime_Struct));
|
||||
ServerInstanceUpdateTime_Struct *ut = (ServerInstanceUpdateTime_Struct*) pack->pBuffer;
|
||||
ut->instance_id = instance_id;
|
||||
|
||||
auto ut = (ServerInstanceUpdateTime_Struct*) pack->pBuffer;
|
||||
|
||||
ut->instance_id = instance_id;
|
||||
ut->new_duration = new_duration;
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
uint32 QuestManager::GetInstanceTimer() {
|
||||
if (zone && zone->GetInstanceID() > 0 && zone->GetInstanceTimer()) {
|
||||
uint32 ttime = zone->GetInstanceTimer()->GetRemainingTime();
|
||||
return ttime;
|
||||
uint32 QuestManager::GetInstanceTimer()
|
||||
{
|
||||
if (zone && zone->GetInstanceID() && zone->GetInstanceTimer()) {
|
||||
return zone->GetInstanceTimer()->GetRemainingTime();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 QuestManager::GetInstanceTimerByID(uint16 instance_id) {
|
||||
if (instance_id == 0)
|
||||
return 0;
|
||||
|
||||
std::string query = StringFormat("SELECT ((start_time + duration) - UNIX_TIMESTAMP()) AS `remaining` FROM `instance_list` WHERE `id` = %lu", (unsigned long)instance_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
|
||||
if (results.Success()) {
|
||||
auto row = results.begin();
|
||||
uint32 timer = Strings::ToInt(row[0]);
|
||||
return timer;
|
||||
}
|
||||
return 0;
|
||||
uint32 QuestManager::GetInstanceTimerByID(uint16 instance_id)
|
||||
{
|
||||
return instance_id ? InstanceListRepository::GetRemainingTimeByInstanceID(database, instance_id) : 0;
|
||||
}
|
||||
|
||||
uint16 QuestManager::GetInstanceID(const char *zone, int16 version)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator)
|
||||
{
|
||||
return database.GetInstanceID(ZoneID(zone), initiator->CharacterID(), version);
|
||||
}
|
||||
return 0;
|
||||
|
||||
return initiator ? database.GetInstanceID(ZoneID(zone), initiator->CharacterID(), version) : 0;
|
||||
}
|
||||
|
||||
std::vector<uint16> QuestManager::GetInstanceIDs(std::string zone_name, uint32 character_id)
|
||||
{
|
||||
if (!character_id) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
|
||||
if (initiator) {
|
||||
return database.GetInstanceIDs(ZoneID(zone_name), initiator->CharacterID());
|
||||
}
|
||||
@@ -3336,33 +3347,37 @@ std::vector<uint16> QuestManager::GetInstanceIDs(std::string zone_name, uint32 c
|
||||
return database.GetInstanceIDs(ZoneID(zone_name), character_id);
|
||||
}
|
||||
|
||||
uint16 QuestManager::GetInstanceIDByCharID(const char *zone, int16 version, uint32 char_id) {
|
||||
return database.GetInstanceID(ZoneID(zone), char_id, version);
|
||||
uint16 QuestManager::GetInstanceIDByCharID(
|
||||
const std::string &zone_short_name,
|
||||
int16 instance_version,
|
||||
uint32 character_id
|
||||
)
|
||||
{
|
||||
return database.GetInstanceID(ZoneID(zone_short_name), character_id, instance_version);
|
||||
}
|
||||
|
||||
void QuestManager::AssignToInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator)
|
||||
{
|
||||
|
||||
if (initiator) {
|
||||
database.AddClientToInstance(instance_id, initiator->CharacterID());
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::AssignToInstanceByCharID(uint16 instance_id, uint32 char_id) {
|
||||
database.AddClientToInstance(instance_id, char_id);
|
||||
void QuestManager::AssignToInstanceByCharID(uint16 instance_id, uint32 character_id)
|
||||
{
|
||||
database.AddClientToInstance(instance_id, character_id);
|
||||
}
|
||||
|
||||
void QuestManager::AssignGroupToInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator)
|
||||
{
|
||||
Group *g = initiator->GetGroup();
|
||||
if (g)
|
||||
{
|
||||
uint32 gid = g->GetID();
|
||||
database.AssignGroupToInstance(gid, instance_id);
|
||||
|
||||
if (initiator) {
|
||||
Group* g = initiator->GetGroup();
|
||||
if (g) {
|
||||
database.AssignGroupToInstance(g->GetID(), instance_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3370,13 +3385,11 @@ void QuestManager::AssignGroupToInstance(uint16 instance_id)
|
||||
void QuestManager::AssignRaidToInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator)
|
||||
{
|
||||
Raid *r = initiator->GetRaid();
|
||||
if(r)
|
||||
{
|
||||
uint32 rid = r->GetID();
|
||||
database.AssignRaidToInstance(rid, instance_id);
|
||||
|
||||
if (initiator) {
|
||||
Raid* r = initiator->GetRaid();
|
||||
if (r) {
|
||||
database.AssignRaidToInstance(r->GetID(), instance_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3384,12 +3397,13 @@ void QuestManager::AssignRaidToInstance(uint16 instance_id)
|
||||
void QuestManager::RemoveFromInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator)
|
||||
{
|
||||
if (database.RemoveClientFromInstance(instance_id, initiator->CharacterID()))
|
||||
|
||||
if (initiator) {
|
||||
if (database.RemoveClientFromInstance(instance_id, initiator->CharacterID())) {
|
||||
initiator->Message(Chat::Say, "Removed client from instance.");
|
||||
else
|
||||
} else {
|
||||
initiator->Message(Chat::Say, "Failed to remove client from instance.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3404,16 +3418,22 @@ bool QuestManager::CheckInstanceByCharID(uint16 instance_id, uint32 char_id) {
|
||||
void QuestManager::RemoveAllFromInstance(uint16 instance_id)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator)
|
||||
{
|
||||
|
||||
if (initiator) {
|
||||
std::list<uint32> character_ids;
|
||||
|
||||
if (database.RemoveClientsFromInstance(instance_id))
|
||||
if (database.RemoveClientsFromInstance(instance_id)) {
|
||||
initiator->Message(Chat::Say, "Removed all players from instance.");
|
||||
else
|
||||
{
|
||||
} else {
|
||||
database.GetCharactersInInstance(instance_id, character_ids);
|
||||
initiator->Message(Chat::Say, "Failed to remove %i player(s) from instance.", character_ids.size()); // once the expedition system is in, this message it not relevant
|
||||
initiator->Message(
|
||||
Chat::Say,
|
||||
fmt::format(
|
||||
"Failed to remove {} player{} from instance.",
|
||||
character_ids.size(),
|
||||
character_ids.size() != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3421,8 +3441,8 @@ void QuestManager::RemoveAllFromInstance(uint16 instance_id)
|
||||
void QuestManager::MovePCInstance(int zone_id, int instance_id, const glm::vec4& position)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(initiator)
|
||||
{
|
||||
|
||||
if (initiator) {
|
||||
initiator->MovePC(zone_id, instance_id, position.x, position.y, position.z, position.w);
|
||||
}
|
||||
}
|
||||
@@ -3430,10 +3450,10 @@ void QuestManager::MovePCInstance(int zone_id, int instance_id, const glm::vec4&
|
||||
void QuestManager::FlagInstanceByGroupLeader(uint32 zone, int16 version)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(initiator)
|
||||
{
|
||||
Group *g = initiator->GetGroup();
|
||||
if(g){
|
||||
|
||||
if (initiator) {
|
||||
Group* g = initiator->GetGroup();
|
||||
if (g) {
|
||||
database.FlagInstanceByGroupLeader(zone, version, initiator->CharacterID(), g->GetID());
|
||||
}
|
||||
}
|
||||
@@ -3442,11 +3462,10 @@ void QuestManager::FlagInstanceByGroupLeader(uint32 zone, int16 version)
|
||||
void QuestManager::FlagInstanceByRaidLeader(uint32 zone, int16 version)
|
||||
{
|
||||
QuestManagerCurrentQuestVars();
|
||||
if(initiator)
|
||||
{
|
||||
Raid *r = initiator->GetRaid();
|
||||
if(r)
|
||||
{
|
||||
|
||||
if (initiator) {
|
||||
Raid* r = initiator->GetRaid();
|
||||
if (r) {
|
||||
database.FlagInstanceByRaidLeader(zone, version, initiator->CharacterID(), r->GetID());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -106,7 +106,7 @@ public:
|
||||
void depopall(int npc_type = 0);
|
||||
void depopzone(bool StartSpawnTimer = true);
|
||||
void repopzone();
|
||||
void processmobswhilezoneempty(bool idle_when_empty);
|
||||
void processmobswhilezoneempty(bool quest_override_on);
|
||||
void settarget(const char *type, int target_id);
|
||||
void follow(int entity_id, int distance);
|
||||
void sfollow();
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
void enable_proximity_say();
|
||||
void disable_proximity_say();
|
||||
void setanim(int npc_type, int animnum);
|
||||
void showgrid(int gridid);
|
||||
void showgrid(int grid_id);
|
||||
void spawn_condition(const char *zone_short, uint32 instance_id, uint16 condition_id, short new_value);
|
||||
short get_spawn_condition(const char *zone_short, uint32 instance_id, uint16 condition_id);
|
||||
void toggle_spawn_event(int event_id, bool enable, bool strict, bool reset_base);
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
void UpdateSpawnTimer(uint32 id, uint32 newTime);
|
||||
void MerchantSetItem(uint32 NPCid, uint32 itemid, uint32 quantity = 0);
|
||||
uint32 MerchantCountItem(uint32 NPCid, uint32 itemid);
|
||||
uint16 CreateInstance(const char *zone_short_name, int16 instance_version, uint32 duration);
|
||||
uint16 CreateInstance(const std::string& zone_short_name, int16 instance_version, uint32 duration);
|
||||
void UpdateInstanceTimer(uint16 instance_id, uint32 new_duration);
|
||||
void UpdateZoneHeader(std::string type, std::string value);
|
||||
uint32 GetInstanceTimer();
|
||||
@@ -270,7 +270,7 @@ public:
|
||||
void DestroyInstance(uint16 instance_id);
|
||||
uint16 GetInstanceID(const char *zone, int16 version);
|
||||
std::vector<uint16> GetInstanceIDs(std::string zone_name, uint32 character_id = 0);
|
||||
uint16 GetInstanceIDByCharID(const char *zone, int16 version, uint32 char_id);
|
||||
uint16 GetInstanceIDByCharID(const std::string& zone_short_name, int16 instance_version, uint32 character_id);
|
||||
void AssignToInstance(uint16 instance_id);
|
||||
void AssignToInstanceByCharID(uint16 instance_id, uint32 char_id);
|
||||
void AssignGroupToInstance(uint16 instance_id);
|
||||
|
||||
+225
-195
@@ -27,6 +27,9 @@
|
||||
#include "zone.h"
|
||||
#include "zonedb.h"
|
||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||
#include "../common/repositories/spawn_conditions_repository.h"
|
||||
#include "../common/repositories/spawn_condition_values_repository.h"
|
||||
#include "../common/repositories/spawn_events_repository.h"
|
||||
#include "../common/repositories/spawn2_repository.h"
|
||||
#include "../common/repositories/spawn2_disabled_repository.h"
|
||||
#include "../common/repositories/respawn_times_repository.h"
|
||||
@@ -253,7 +256,7 @@ bool Spawn2::Process() {
|
||||
if (spawn_group->wp_spawns && grid_ > 0)
|
||||
{
|
||||
glm::vec4 wploc;
|
||||
starting_wp = content_db.GetRandomWaypointLocFromGrid(wploc, zone->GetZoneID(), grid_);
|
||||
starting_wp = content_db.GetRandomWaypointFromGrid(wploc, zone->GetZoneID(), grid_);
|
||||
if (wploc.x != 0.0f || wploc.y != 0.0f || wploc.z != 0.0f)
|
||||
{
|
||||
loc = wploc;
|
||||
@@ -539,23 +542,31 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spa
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* zone, const glm::vec4& position, uint32 respawn, uint32 variance, uint16 condition, int16 cond_value)
|
||||
bool ZoneDatabase::CreateSpawn2(
|
||||
Client* c,
|
||||
uint32 spawngroup_id,
|
||||
const std::string& zone_short_name,
|
||||
const glm::vec4& position,
|
||||
uint32 respawn,
|
||||
uint32 variance,
|
||||
uint16 condition,
|
||||
int16 condition_value
|
||||
)
|
||||
{
|
||||
auto e = Spawn2Repository::NewEntity();
|
||||
|
||||
std::string query = StringFormat("INSERT INTO spawn2 (spawngroupID, zone, x, y, z, heading, "
|
||||
"respawntime, variance, _condition, cond_value) "
|
||||
"VALUES (%i, '%s', %f, %f, %f, %f, %i, %i, %u, %i)",
|
||||
spawngroup, zone, position.x, position.y, position.z, position.w,
|
||||
respawn, variance, condition, cond_value);
|
||||
auto results = QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
e.spawngroupID = spawngroup_id;
|
||||
e.zone = zone_short_name;
|
||||
e.x = position.x;
|
||||
e.y = position.y;
|
||||
e.z = position.z;
|
||||
e.heading = position.w;
|
||||
e.respawntime = respawn;
|
||||
e.variance = variance;
|
||||
e._condition = condition;
|
||||
e.cond_value = condition_value;
|
||||
|
||||
if (results.RowsAffected() != 1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return Spawn2Repository::InsertOne(*this, e).id;
|
||||
}
|
||||
|
||||
uint32 Zone::CountSpawn2() {
|
||||
@@ -718,7 +729,7 @@ void SpawnConditionManager::Process() {
|
||||
EQTime::ToString(&cevent.next, t);
|
||||
LogSpawns("Event [{}]: Will trigger again in [{}] EQ minutes at [{}]", cevent.id, cevent.period, t.c_str());
|
||||
//save the next event time in the DB
|
||||
UpdateDBEvent(cevent);
|
||||
UpdateSpawnEvent(cevent);
|
||||
//find the next closest event timer.
|
||||
FindNearestEvent();
|
||||
//minor optimization, if theres no more possible events,
|
||||
@@ -786,152 +797,167 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) {
|
||||
cond.value = new_value;
|
||||
}
|
||||
|
||||
void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) {
|
||||
void SpawnConditionManager::UpdateSpawnEvent(SpawnEvent &event)
|
||||
{
|
||||
auto e = SpawnEventsRepository::FindOne(database, event.id);
|
||||
|
||||
std::string query = StringFormat("UPDATE spawn_events SET "
|
||||
"next_minute = %d, next_hour = %d, "
|
||||
"next_day = %d, next_month = %d, "
|
||||
"next_year = %d, enabled = %d, "
|
||||
"strict = %d WHERE id = %d",
|
||||
event.next.minute, event.next.hour,
|
||||
event.next.day, event.next.month,
|
||||
event.next.year, event.enabled? 1: 0,
|
||||
event.strict? 1: 0, event.id);
|
||||
database.QueryDatabase(query);
|
||||
e.next_minute = event.next.minute;
|
||||
e.next_hour = event.next.hour;
|
||||
e.next_day = event.next.day;
|
||||
e.next_month = event.next.month;
|
||||
e.next_year = event.next.year;
|
||||
e.enabled = event.enabled ? 1 : 0;
|
||||
e.next_minute = event.strict;
|
||||
|
||||
SpawnEventsRepository::UpdateOne(database, e);
|
||||
}
|
||||
|
||||
void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 instance_id, uint16 cond_id, int16 value) {
|
||||
|
||||
std::string query = StringFormat("REPLACE INTO spawn_condition_values "
|
||||
"(id, value, zone, instance_id) "
|
||||
"VALUES( %u, %u, '%s', %u)",
|
||||
cond_id, value, zone_name, instance_id);
|
||||
database.QueryDatabase(query);
|
||||
void SpawnConditionManager::UpdateSpawnCondition(
|
||||
const std::string& zone_short_name,
|
||||
uint32 instance_id,
|
||||
uint16 condition,
|
||||
int16 condition_value
|
||||
)
|
||||
{
|
||||
SpawnConditionValuesRepository::ReplaceOne(
|
||||
database,
|
||||
SpawnConditionValuesRepository::SpawnConditionValues{
|
||||
.id = condition,
|
||||
.value = static_cast<uint8_t>(condition_value),
|
||||
.zone = zone_short_name,
|
||||
.instance_id = instance_id
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std::string &zone_name) {
|
||||
bool SpawnConditionManager::LoadSpawnEvent(
|
||||
uint32 event_id,
|
||||
SpawnEvent& event,
|
||||
std::string& zone_short_name
|
||||
)
|
||||
{
|
||||
const auto& e = SpawnEventsRepository::FindOne(database, event_id);
|
||||
|
||||
std::string query = StringFormat("SELECT id, cond_id, period, "
|
||||
"next_minute, next_hour, next_day, "
|
||||
"next_month, next_year, enabled, "
|
||||
"action, argument, strict, zone "
|
||||
"FROM spawn_events WHERE id = %d", event_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
if (!e.id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0)
|
||||
return false;
|
||||
event.id = e.id;
|
||||
event.condition_id = e.cond_id;
|
||||
event.period = e.period;
|
||||
event.next.minute = e.next_minute;
|
||||
event.next.hour = e.next_hour;
|
||||
event.next.day = e.next_day;
|
||||
event.next.month = e.next_month;
|
||||
event.next.year = e.next_year;
|
||||
event.enabled = e.enabled;
|
||||
event.action = static_cast<SpawnEvent::Action>(e.action);
|
||||
event.argument = e.argument;
|
||||
event.strict = e.strict;
|
||||
|
||||
auto row = results.begin();
|
||||
zone_short_name = e.zone;
|
||||
|
||||
event.id = Strings::ToInt(row[0]);
|
||||
event.condition_id = Strings::ToInt(row[1]);
|
||||
event.period = Strings::ToInt(row[2]);
|
||||
std::string time_string;
|
||||
EQTime::ToString(&event.next, time_string);
|
||||
|
||||
event.next.minute = Strings::ToInt(row[3]);
|
||||
event.next.hour = Strings::ToInt(row[4]);
|
||||
event.next.day = Strings::ToInt(row[5]);
|
||||
event.next.month = Strings::ToInt(row[6]);
|
||||
event.next.year = Strings::ToInt(row[7]);
|
||||
|
||||
event.enabled = Strings::ToInt(row[8]) != 0;
|
||||
event.action = (SpawnEvent::Action) Strings::ToInt(row[9]);
|
||||
event.argument = Strings::ToInt(row[10]);
|
||||
event.strict = Strings::ToInt(row[11]) != 0;
|
||||
zone_name = row[12];
|
||||
|
||||
std::string timeAsString;
|
||||
EQTime::ToString(&event.next, timeAsString);
|
||||
|
||||
LogSpawns("(LoadDBEvent) Loaded [{}] spawn event [{}] on condition [{}] with period [{}], action [{}], argument [{}], strict [{}]. Will trigger at [{}]", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str());
|
||||
LogSpawns(
|
||||
"Loaded [{}] event_id [{}] condition [{}] period [{}] action [{}] argument [{}] strict [{}] time [{}]",
|
||||
event.enabled ? "enabled" : "disabled",
|
||||
event.id,
|
||||
event.condition_id,
|
||||
event.period,
|
||||
event.action,
|
||||
event.argument,
|
||||
event.strict,
|
||||
time_string
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 instance_id)
|
||||
bool SpawnConditionManager::LoadSpawnConditions(const std::string& zone_short_name, uint32 instance_id)
|
||||
{
|
||||
//clear out old stuff..
|
||||
spawn_conditions.clear();
|
||||
|
||||
std::string query = StringFormat("SELECT id, onchange, value "
|
||||
"FROM spawn_conditions "
|
||||
"WHERE zone = '%s'", zone_name);
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
const auto& conditions = SpawnConditionsRepository::GetWhere(
|
||||
content_db,
|
||||
fmt::format(
|
||||
"`zone` = '{}'",
|
||||
Strings::Escape(zone_short_name)
|
||||
)
|
||||
);
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
//load spawn conditions
|
||||
SpawnCondition cond;
|
||||
for (const auto& e : conditions) {
|
||||
SpawnCondition c;
|
||||
|
||||
cond.condition_id = Strings::ToInt(row[0]);
|
||||
cond.value = Strings::ToInt(row[2]);
|
||||
cond.on_change = (SpawnCondition::OnChange) Strings::ToInt(row[1]);
|
||||
spawn_conditions[cond.condition_id] = cond;
|
||||
c.condition_id = e.id;
|
||||
c.value = e.value;
|
||||
c.on_change = static_cast<SpawnCondition::OnChange>(e.onchange);
|
||||
|
||||
LogSpawns("Loaded spawn condition [{}] with value [{}] and on_change [{}]", cond.condition_id, cond.value, cond.on_change);
|
||||
}
|
||||
spawn_conditions[c.condition_id] = c;
|
||||
|
||||
LogInfo("Loaded [{}] spawn_conditions", Strings::Commify(std::to_string(results.RowCount())));
|
||||
LogSpawns(
|
||||
"Loaded spawn condition [{}] with value [{}] and on_change [{}]",
|
||||
c.condition_id,
|
||||
c.value,
|
||||
c.on_change
|
||||
);
|
||||
}
|
||||
|
||||
//load values
|
||||
query = StringFormat("SELECT id, value FROM spawn_condition_values "
|
||||
"WHERE zone = '%s' AND instance_id = %u",
|
||||
zone_name, instance_id);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
spawn_conditions.clear();
|
||||
return false;
|
||||
}
|
||||
LogInfo("Loaded [{}] spawn_conditions", Strings::Commify(std::to_string(conditions.size())));
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
auto iter = spawn_conditions.find(Strings::ToInt(row[0]));
|
||||
const auto& condition_values = SpawnConditionValuesRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`zone` = '{}' AND `instance_id` = {}",
|
||||
Strings::Escape(zone_short_name),
|
||||
instance_id
|
||||
)
|
||||
);
|
||||
|
||||
if(iter != spawn_conditions.end())
|
||||
iter->second.value = Strings::ToInt(row[1]);
|
||||
}
|
||||
for (const auto& e : condition_values) {
|
||||
auto i = spawn_conditions.find(e.id);
|
||||
if (i != spawn_conditions.end()) {
|
||||
i->second.value = e.value;
|
||||
}
|
||||
}
|
||||
|
||||
//load spawn events
|
||||
query = StringFormat("SELECT id, cond_id, period, next_minute, next_hour, "
|
||||
"next_day, next_month, next_year, enabled, action, argument, strict "
|
||||
"FROM spawn_events WHERE zone = '%s'", zone_name);
|
||||
results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
}
|
||||
const auto& events = SpawnEventsRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`zone` = '{}'",
|
||||
Strings::Escape(zone_short_name)
|
||||
)
|
||||
);
|
||||
|
||||
LogInfo("Loaded [{}] spawn_events", Strings::Commify(std::to_string(results.RowCount())));
|
||||
LogInfo("Loaded [{}] spawn_events", Strings::Commify(std::to_string(events.size())));
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
for (const auto& e : events) {
|
||||
SpawnEvent event;
|
||||
|
||||
event.id = Strings::ToInt(row[0]);
|
||||
event.condition_id = Strings::ToInt(row[1]);
|
||||
event.period = Strings::ToInt(row[2]);
|
||||
event.id = e.id;
|
||||
event.condition_id = e.cond_id;
|
||||
event.period = e.period;
|
||||
|
||||
if (event.period == 0) {
|
||||
if (!event.period) {
|
||||
LogError("Refusing to load spawn event #[{}] because it has a period of 0\n", event.id);
|
||||
continue;
|
||||
}
|
||||
|
||||
event.next.minute = Strings::ToInt(row[3]);
|
||||
event.next.hour = Strings::ToInt(row[4]);
|
||||
event.next.day = Strings::ToInt(row[5]);
|
||||
event.next.month = Strings::ToInt(row[6]);
|
||||
event.next.year = Strings::ToInt(row[7]);
|
||||
|
||||
event.enabled = Strings::ToInt(row[8]) == 0 ? false : true;
|
||||
event.action = (SpawnEvent::Action) Strings::ToInt(row[9]);
|
||||
event.argument = Strings::ToInt(row[10]);
|
||||
event.strict = Strings::ToInt(row[11]) == 0 ? false : true;
|
||||
event.next.minute = e.next_minute;
|
||||
event.next.hour = e.next_hour;
|
||||
event.next.day = e.next_day;
|
||||
event.next.month = e.next_month;
|
||||
event.next.year = e.next_year;
|
||||
event.enabled = e.enabled;
|
||||
event.action = static_cast<SpawnEvent::Action>(e.action);
|
||||
event.argument = e.argument;
|
||||
event.strict = e.strict;
|
||||
|
||||
spawn_events.push_back(event);
|
||||
|
||||
LogSpawns(
|
||||
"(LoadSpawnConditions) Loaded [{}] spawn event [{}] on condition [{}] with period [{}], action [{}], argument [{}], strict [{}]",
|
||||
"(LoadSpawnConditions) Loaded [{}] spawn event [{}] on condition [{}] with period [{}] action [{}] argument [{}] strict [{}]",
|
||||
event.enabled ? "enabled" : "disabled",
|
||||
event.id,
|
||||
event.condition_id,
|
||||
@@ -945,62 +971,70 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in
|
||||
//now we need to catch up on events that happened while we were away
|
||||
//and use them to alter just the condition variables.
|
||||
|
||||
//each spawn2 will then use its correct condition value when
|
||||
//it decides what to do. This essentially forces a 'depop' action
|
||||
//on spawn points which are turned off, and a 'repop' action on
|
||||
//spawn points which get turned on. Im too lazy to figure out a
|
||||
//better solution, and I just dont care thats much.
|
||||
//get our current time
|
||||
TimeOfDay_Struct tod{};
|
||||
zone->zone_time.GetCurrentEQTimeOfDay(&tod);
|
||||
|
||||
for(auto cur = spawn_events.begin(); cur != spawn_events.end(); ++cur) {
|
||||
SpawnEvent &cevent = *cur;
|
||||
for (auto& e : spawn_events) {
|
||||
bool is_strict = false;
|
||||
|
||||
bool StrictCheck = false;
|
||||
if(cevent.strict &&
|
||||
cevent.next.hour == tod.hour &&
|
||||
cevent.next.day == tod.day &&
|
||||
cevent.next.month == tod.month &&
|
||||
cevent.next.year == tod.year)
|
||||
StrictCheck = true;
|
||||
if (
|
||||
e.strict &&
|
||||
e.next.hour == tod.hour &&
|
||||
e.next.day == tod.day &&
|
||||
e.next.month == tod.month &&
|
||||
e.next.year == tod.year
|
||||
) {
|
||||
is_strict = true;
|
||||
}
|
||||
|
||||
//If event is disabled, or we failed the strict check, set initial spawn_condition to 0.
|
||||
if(!cevent.enabled || !StrictCheck)
|
||||
SetCondition(zone->GetShortName(), zone->GetInstanceID(),cevent.condition_id,0);
|
||||
//If event is disabled, or we failed the strict check, set initial spawn_condition to default startup value from spawn_conditions.
|
||||
if (!e.enabled || !is_strict) {
|
||||
SetCondition(
|
||||
zone->GetShortName(),
|
||||
zone->GetInstanceID(),
|
||||
e.condition_id,
|
||||
spawn_conditions[e.condition_id].value
|
||||
);
|
||||
}
|
||||
|
||||
if(!cevent.enabled)
|
||||
continue;
|
||||
if (!e.enabled) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//watch for special case of all 0s, which means to reset next to now
|
||||
if (cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 &&
|
||||
cevent.next.minute == 0) {
|
||||
LogSpawns("Initial next trigger time set for spawn event [{}]", cevent.id);
|
||||
memcpy(&cevent.next, &tod, sizeof(cevent.next));
|
||||
//add one period
|
||||
EQTime::AddMinutes(cevent.period, &cevent.next);
|
||||
//save it in the db.
|
||||
UpdateDBEvent(cevent);
|
||||
continue; //were done with this event.
|
||||
if (
|
||||
e.next.year == 0 &&
|
||||
e.next.month == 0 &&
|
||||
e.next.day == 0 &&
|
||||
e.next.hour == 0 &&
|
||||
e.next.minute == 0
|
||||
) {
|
||||
LogSpawns("Initial next trigger time set for spawn event [{}]", e.id);
|
||||
memcpy(&e.next, &tod, sizeof(e.next));
|
||||
EQTime::AddMinutes(e.period, &e.next);
|
||||
UpdateSpawnEvent(e);
|
||||
continue;
|
||||
}
|
||||
|
||||
bool ran = false;
|
||||
while (EQTime::IsTimeBefore(&tod, &cevent.next)) {
|
||||
LogSpawns("Catch up triggering on event [{}]", cevent.id);
|
||||
while (EQTime::IsTimeBefore(&tod, &e.next)) {
|
||||
LogSpawns("Catch up triggering on event [{}]", e.id);
|
||||
//this event has been triggered.
|
||||
//execute the event
|
||||
if (!cevent.strict || StrictCheck) {
|
||||
ExecEvent(cevent, false);
|
||||
if (!e.strict || is_strict) {
|
||||
ExecEvent(e, false);
|
||||
}
|
||||
|
||||
//add the period of the event to the trigger time
|
||||
EQTime::AddMinutes(cevent.period, &cevent.next);
|
||||
EQTime::AddMinutes(e.period, &e.next);
|
||||
ran = true;
|
||||
}
|
||||
|
||||
//only write it out if the event actually ran
|
||||
if(ran)
|
||||
UpdateDBEvent(cevent); //save the event in the DB
|
||||
if (ran) {
|
||||
UpdateSpawnEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
//now our event timers are all up to date, find our closest event.
|
||||
@@ -1053,7 +1087,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance
|
||||
SpawnCondition &cond = condi->second;
|
||||
|
||||
if(cond.value == new_value) {
|
||||
LogSpawns("Condition update received from world for [{}] with value [{}], which is what we already have", condition_id, new_value);
|
||||
LogSpawns("Condition update received from world for [{}] with value [{}] which is what we already have", condition_id, new_value);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1080,7 +1114,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance
|
||||
SpawnCondition &cond = condi->second;
|
||||
|
||||
if(cond.value == new_value) {
|
||||
LogSpawns("Local Condition update requested for [{}] with value [{}], which is what we already have", condition_id, new_value);
|
||||
LogSpawns("Local Condition update requested for [{}] with value [{}] which is what we already have", condition_id, new_value);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1089,7 +1123,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance
|
||||
//set our local value
|
||||
cond.value = new_value;
|
||||
//save it in the DB too
|
||||
UpdateDBCondition(zone_short, instance_id, condition_id, new_value);
|
||||
UpdateSpawnCondition(zone_short, instance_id, condition_id, new_value);
|
||||
|
||||
LogSpawns("Local Condition update requested for [{}] with value [{}]", condition_id, new_value);
|
||||
|
||||
@@ -1103,7 +1137,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance
|
||||
|
||||
LogSpawns("Remote spawn condition [{}] set to [{}]. Updating DB and notifying world", condition_id, new_value);
|
||||
|
||||
UpdateDBCondition(zone_short, instance_id, condition_id, new_value);
|
||||
UpdateSpawnCondition(zone_short, instance_id, condition_id, new_value);
|
||||
|
||||
auto pack = new ServerPacket(ServerOP_SpawnCondition, sizeof(ServerSpawnCondition_Struct));
|
||||
ServerSpawnCondition_Struct* ssc = (ServerSpawnCondition_Struct*)pack->pBuffer;
|
||||
@@ -1132,7 +1166,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) {
|
||||
|
||||
if(cevent.id == event_id) {
|
||||
//load the event into the old event slot
|
||||
if(!LoadDBEvent(event_id, cevent, zone_short_name)) {
|
||||
if(!LoadSpawnEvent(event_id, cevent, zone_short_name)) {
|
||||
//unable to find the event in the database...
|
||||
LogSpawns("Failed to reload event [{}] from the database", event_id);
|
||||
return;
|
||||
@@ -1145,7 +1179,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) {
|
||||
|
||||
//if we get here, it is a new event...
|
||||
SpawnEvent e;
|
||||
if(!LoadDBEvent(event_id, e, zone_short_name)) {
|
||||
if(!LoadSpawnEvent(event_id, e, zone_short_name)) {
|
||||
//unable to find the event in the database...
|
||||
LogSpawns("Failed to reload event [{}] from the database", event_id);
|
||||
return;
|
||||
@@ -1189,7 +1223,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri
|
||||
}
|
||||
|
||||
//save the event in the DB
|
||||
UpdateDBEvent(cevent);
|
||||
UpdateSpawnEvent(cevent);
|
||||
|
||||
//sync up our nearest event
|
||||
FindNearestEvent();
|
||||
@@ -1212,7 +1246,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri
|
||||
//update its in-memory event list
|
||||
SpawnEvent e;
|
||||
std::string zone_short_name;
|
||||
if(!LoadDBEvent(event_id, e, zone_short_name)) {
|
||||
if(!LoadSpawnEvent(event_id, e, zone_short_name)) {
|
||||
LogSpawns("Unable to find spawn event [{}] in the database", event_id);
|
||||
//unable to find the event in the database...
|
||||
return;
|
||||
@@ -1233,7 +1267,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri
|
||||
LogSpawns("Spawn event [{}] is in zone [{}]. State changed. Notifying world", event_id, zone_short_name.c_str(), e.period);
|
||||
}
|
||||
//save the event in the DB
|
||||
UpdateDBEvent(e);
|
||||
UpdateSpawnEvent(e);
|
||||
|
||||
|
||||
//now notify the zone
|
||||
@@ -1247,43 +1281,39 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id) {
|
||||
if(!strcasecmp(zone_short, zone->GetShortName()) && instance_id == zone->GetInstanceID())
|
||||
{
|
||||
//this is a local spawn condition
|
||||
std::map<uint16, SpawnCondition>::iterator condi;
|
||||
condi = spawn_conditions.find(condition_id);
|
||||
if(condi == spawn_conditions.end())
|
||||
{
|
||||
LogSpawns("Unable to find local condition [{}] in Get request", condition_id);
|
||||
return(0); //unable to find the spawn condition
|
||||
int16 SpawnConditionManager::GetCondition(const std::string& zone_short_name, uint32 instance_id, uint16 condition)
|
||||
{
|
||||
if (
|
||||
Strings::EqualFold(zone_short_name, zone->GetShortName()) &&
|
||||
instance_id == zone->GetInstanceID()
|
||||
) {
|
||||
auto i = spawn_conditions.find(condition);
|
||||
if (i == spawn_conditions.end()) {
|
||||
LogSpawns("Unable to find local condition [{}] in Get request", condition);
|
||||
return (0); //unable to find the spawn condition
|
||||
}
|
||||
|
||||
SpawnCondition &cond = condi->second;
|
||||
return cond.value;
|
||||
return i->second.value;
|
||||
}
|
||||
|
||||
//this is a remote spawn condition, grab it from the DB
|
||||
//load spawn conditions
|
||||
std::string query = StringFormat(
|
||||
"SELECT value FROM spawn_condition_values "
|
||||
"WHERE zone = '%s' AND instance_id = %u AND id = %d",
|
||||
zone_short, instance_id, condition_id
|
||||
const auto& l = SpawnConditionValuesRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"`zone` = '{}' AND `instance_id` = {} AND `id` = {}",
|
||||
Strings::Escape(zone_short_name),
|
||||
instance_id,
|
||||
condition
|
||||
)
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
LogSpawns("Unable to query remote condition [{}] from zone [{}] in Get request", condition_id, zone_short);
|
||||
return 0; //dunno a better thing to do...
|
||||
|
||||
if (l.empty()) {
|
||||
LogSpawns("Unable to query remote condition [{}] from zone [{}] in Get request", condition, zone_short_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
LogSpawns("Unable to load remote condition [{}] from zone [{}] in Get request", condition_id, zone_short);
|
||||
return 0; //dunno a better thing to do...
|
||||
}
|
||||
const auto& e = l.front();
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
return Strings::ToInt(row[0]);
|
||||
return e.value;
|
||||
}
|
||||
|
||||
bool SpawnConditionManager::Check(uint16 condition, int16 min_value) {
|
||||
|
||||
+5
-5
@@ -147,9 +147,9 @@ public:
|
||||
SpawnConditionManager();
|
||||
|
||||
void Process();
|
||||
bool LoadSpawnConditions(const char* zone_name, uint32 instance_id);
|
||||
bool LoadSpawnConditions(const std::string& zone_short_name, uint32 instance_id);
|
||||
|
||||
int16 GetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id);
|
||||
int16 GetCondition(const std::string& zone_short_name, uint32 instance_id, uint16 condition);
|
||||
void SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update = false);
|
||||
void ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base);
|
||||
bool Check(uint16 condition, int16 min_value);
|
||||
@@ -160,9 +160,9 @@ protected:
|
||||
std::vector<SpawnEvent> spawn_events;
|
||||
|
||||
void ExecEvent(SpawnEvent &e, bool send_update);
|
||||
void UpdateDBEvent(SpawnEvent &e);
|
||||
bool LoadDBEvent(uint32 event_id, SpawnEvent &e, std::string &zone_name);
|
||||
void UpdateDBCondition(const char* zone_name, uint32 instance_id, uint16 cond_id, int16 value);
|
||||
void UpdateSpawnEvent(SpawnEvent &e);
|
||||
bool LoadSpawnEvent(uint32 event_id, SpawnEvent& event, std::string& zone_short_name);
|
||||
void UpdateSpawnCondition(const std::string& zone_short_name, uint32 instance_id, uint16 condition, int16 condition_value);
|
||||
void FindNearestEvent();
|
||||
|
||||
Timer minute_timer;
|
||||
|
||||
@@ -1819,14 +1819,16 @@ void NPC::DoClassAttacks(Mob *target) {
|
||||
target->GetBodyType() != BT_Undead &&
|
||||
taunt_time &&
|
||||
type_of_pet &&
|
||||
type_of_pet != petTargetLock
|
||||
type_of_pet != petTargetLock &&
|
||||
DistanceSquared(GetPosition(), target->GetPosition()) <= (RuleI(Pets, PetTauntRange) * RuleI(Pets, PetTauntRange))
|
||||
) {
|
||||
GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING);
|
||||
Taunt(target->CastToNPC(), false);
|
||||
}
|
||||
|
||||
if(!ca_time)
|
||||
if(!ca_time) {
|
||||
return;
|
||||
}
|
||||
|
||||
float HasteModifier = GetHaste() * 0.01f;
|
||||
|
||||
|
||||
@@ -3805,10 +3805,6 @@ bool Mob::SpellOnTarget(
|
||||
|
||||
LogSpells("Casting spell [{}] on [{}] with effective caster level [{}]", spell_id, spelltar->GetName(), caster_level);
|
||||
|
||||
if (IsOfClientBotMerc() && (IsDiscipline(spell_id) || spells[spell_id].is_discipline)) {
|
||||
entity_list.MessageClose(this, false, 200, 0, fmt::format("{}{}", GetCleanName(), spells[spell_id].cast_on_other).c_str());
|
||||
}
|
||||
|
||||
// Actual cast action - this causes the caster animation and the particles
|
||||
// around the target
|
||||
// we do this first, that way we get the particles even if the spell
|
||||
|
||||
+2
-1
@@ -125,7 +125,8 @@
|
||||
#define FAIL_DISARM_DETECTED_TRAP 370 //You fail to disarm the detected trap.
|
||||
#define LOOT_LORE_ERROR 371 //You cannot loot this Lore Item. You already have one.
|
||||
#define PICK_LORE 379 //You cannot pick up a lore item you already possess.
|
||||
#define POISON_TOO_HIGH 382 // This poison is too high level for you to apply.
|
||||
#define POISON_TOO_HIGH 382 //This poison is too high level for you to apply.
|
||||
#define TAUNT_TOO_FAR 386 //You are too far away from your target to taunt.
|
||||
#define CORPSE_TOO_FAR 389 //The corpse is too far away to summon.
|
||||
#define CONSENT_DENIED 390 //You do not have consent to summon that corpse.
|
||||
#define DISCIPLINE_RDY 393 //You are ready to use a new discipline now.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user