Compare commits

..

53 Commits

Author SHA1 Message Date
Alex King 7c982df0e3 [Release] 22.43.3 (#4034)
### 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
2024-01-30 19:26:50 -05:00
Paul Coene fa783c3c6b [Bug Fix] spawn_conditions map was being emptied by mistake (#4033) 2024-01-30 18:48:28 -05:00
Paul Coene 5377bb3f49 [Bug Fix] Patch for recent change to DEATH (#4032) 2024-01-30 17:10:45 -05:00
JJ f98c79fdba [Bots] Missing boolean returns on DeletePetStats and SaveInspectMessage (#4031) 2024-01-30 12:07:02 -05:00
Alex King ae79022e06 [Zone] Convert Fishing/Foraging to Repositories (#4008)
* [Zone] Convert Fishing/Foraging to Repositories

# Notes
- Convert `LoadFishing()` and `LoadForage()` to repositories.

* Update forage.cpp

* Cleanup
2024-01-30 05:55:09 -05:00
Chris Miles bc59882a65 [Hotfix] Fix database loading routines (#4030) 2024-01-29 00:14:33 -06:00
Alex King 2e0ed82986 [Grids] Convert Grid/Grid Entries to Repositories (#4011)
* [Grids] Convert Grid/Grid Entries to Repositories

- Convert `AddWaypoint()`, `AddWaypointForSpawn()`, `DeleteWaypoint()`, `GetHighestWaypoint()`, `GetRandomWaypointFromGrid()`, `GridExistsInZone()`, and `ModifyGrid()` to repositories.

* Update grid.cpp

* Update questmgr.cpp

* Update waypoints.cpp

* Update waypoints.cpp
2024-01-28 23:37:34 -06:00
Alex King 8e3218aaf7 [Cleanup] Cleanup cross-zone/world-wide OPCode handling (#4003)
* [Cleanup] Cleanup cross-zone/world-wide OPCode handling

# Notes
- Cleans up the logic greatly for cross-zone/world-wide methods since we were doing extraneous status checks and needlessly allocating memory for variables.

* Update worldserver.cpp
2024-01-28 23:07:27 -06:00
Alex King 9276966418 [Rules] Add rules for cross-zone/world-wide casts to affect Bots/Mercenaries/Pets (#4002)
* [Rules] Add rules for cross-zone/world-wide casts to affect bots/mercenaries/pets

# Notes
- These rules allow operators to have cross-zone/world-wide casts/removals of spells affect bots, mercenaries, and/or pets.
- Adds `World:AllowWorldWideSpellsOnBots`.
- Adds `World:AllowWorldWideSpellsOnMercs`.
- Adds `World:AllowWorldWideSpellsOnPets`.
- Adds `Zone:AllowCrossZoneSpellsOnBots`.
- Adds `Zone:AllowCrossZoneSpellsOnMercs`.
- Adds `Zone:AllowCrossZoneSpellsOnPets`.

* Consolidate to 3 rules
2024-01-28 23:06:21 -06:00
Alex King b89772ca91 [Pets] Convert Load of Pets Beastlord Data to Repositories (#3995)
* [Pets] Convert Load of Pets Beastlord Data to Repositories

# Notes
- Convert `GetBeastlordPetData()` to repositories.
- Add support for `unsigned` versions of `float`, `double`, and `decimal`, without this we defaulted to `std::string`, such as with `pets_beastlord_data`.

* Update repository-generator.pl

---------

Co-authored-by: Chris Miles <akkadius1@gmail.com>
2024-01-28 23:05:43 -06:00
Alex King a1f2a21c99 [Bug Fix] Fix NPC After Death Emotes (#4021)
* [Bug Fix] Fix NPC After Death Emotes

- `DoNPCEmote` was being called on the corpse, not the NPC, so it wasn't working for some reason despite it working for years.
- Cleaned up some other logic and variable names in `NPC::Death` while I was in there.

* Update attack.cpp

* Update npc.cpp

* Update attack.cpp

* Update attack.cpp
2024-01-29 00:03:34 -05:00
Alex King 1cb72642ac [Traps] Convert Load/Set of Traps to Repositories (#3994)
# Notes
- Convert `LoadTraps()` and `SetTrapData()` to repositories.
2024-01-28 22:38:21 -06:00
Alex King a38fd8f986 [Alternate Currency] Convert Load of Alternate Currencies to Repositories (#3993)
# Notes
- Convert `LoadAlternateCurrencies()` to repositories.
2024-01-28 22:36:26 -06:00
Alex King 337b6f38e0 [Mercenaries] Add expansion settings update to Mercs:Enable (#4001)
# Notes
- Adds an expansion settings update to the `Mercs:Enable` command, only updates if the expansion setting isn't already `-1` or doesn't already contain the bitmask for Seeds of Destruction (16384).
- This will enable Mercenary Liaisons spawning properly in Plane of Knowledge for the hiring of mercenaries.
2024-01-28 21:58:58 -06:00
Alex King b4414d3052 [Merchants] Convert Merchant Load to Repositories (#4007)
* [Merchants] Convert Merchant Load to Repositories

# Notes
- Convert `GetMerchantDataForZoneLoad()` to repositories.

# Images
## Load

* Change to LoadMerchants()
2024-01-28 21:55:59 -06:00
Alex King bfeeb0ce05 [Commands] Cleanup #petitems Command (#4005)
- Adds support to `#petitems` to allow you to target bot's pets to view their items, defaults to your pet if you have one.
- If you have no pet or no bot pet targeted it won't function.
2024-01-28 21:55:35 -06:00
Alex King e640e3cad3 [Cleanup] Add Raid Loot Type Constants (#4022)
* [Cleanup] Add Raid Loot Type Constants

# Notes
- Add constants for Raid loot types.

* [Cleanup] Add Raid Loot Type Constants

# Notes
- Add constants for Raid loot types.
2024-01-28 21:45:32 -06:00
Alex King c09a3a5bba [Spawn2] Convert Spawn2 Methods to Repositories (#4014)
* [Spawn2] Convert Spawn2 Methods to Repositories

# Notes
- Convert `CreateSpawn2()`, `GetCondition()`, `LoadSpawnConditions()`, `LoadSpawnEvent()`, `UpdateSpawnCondition()`, and `UpdateSpawnEvent()` to repositories.

# Images

* Update spawn2.cpp
2024-01-28 20:24:33 -06:00
Alex King ce907c9519 [Bots] Convert Bot Database Methods to Repositories (#4023)
* [Bots] Convert Bot Database Methods to Repositories

* Final push.

* Cleanup.

* Cleanup.

* Update bot_database.cpp

* Update bot_database.cpp

* Update bot_database.cpp

* Update bot_database.cpp

* Update bot_database.cpp
2024-01-28 20:23:31 -06:00
Alex King 7a770e0e08 [Beacon] Cleanup Beacons Code (#4024)
# Notes
- Use constants where possible.
- Change `resist_adjust` parameter in `Beacon::AELocationSpell` from `resist_adjust` to `in_resist_adjust` so we're not possibly causing parameter shadowing.
2024-01-28 20:20:09 -06:00
Chris Miles 97c3205657 [API] Add lock_status method to world API (#4028) 2024-01-28 20:18:32 -06:00
Alex King ff2e56abc7 [Bug Fix] Fix issue in character_corpses Repository Query (#4029)
* [Bug Fix] Fix issue in character_corpses Repository Query

# Notes
- Query had an extra ` inside of it, causing it to fail.

* Update character_corpses_repository.h
2024-01-28 20:18:24 -06:00
Alex King 9ee16f8bf7 [Crash Fix] Fix Possible Crash in HateList::Find (#4027)
# Notes
- We were not doing any pointer validation, so we were causing crashes in some cases.
- Example: http://spire.akkadius.com/dev/release/22.43.2?id=19163
2024-01-28 02:44:04 -06:00
Paul Coene 5b43bf4a5e [Quests] Use separate variable for quest idle override. (#4026)
* [Quests] Use separate variable for quest idle override.

* Fix missing zone->
2024-01-27 14:09:00 -05:00
Fryguy 4c769c46b3 [Bug Fix] Limit Player Taunt Distance (#4019)
* [Bug Fix] Player Taunt Distance

Previously this was not regulated on the server side and allowed players to exploit situations where the client did not enforce Z distance checks.

Rule Name: MaximumTauntDistance
Rule Default: 150

Calculation is Rule Squared

* remove `this`
2024-01-26 15:44:05 -05:00
Fryguy 8a87e00b66 [Bug Fix] Limit Pet Taunt Distance (#4018)
* [Bug Fix] Limit pet taunt distance

Previously this was not regulated and allowed players to exploit unlimited taunt distance.

Rule Name: PetTauntRange
Rule Default: 150

Calculation is Rule Squared.

* Remove `this`
2024-01-26 15:43:20 -05:00
Alex King 0ebc7f9bb6 [Release] 22.43.2 (#4017)
### 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
2024-01-25 16:30:50 -06:00
Alex King 9ac25338bb [Crash Fix] Fix crash when creating Frogloks/Drakkin (#4016)
* [Crash Fix] Fix crash when creating Frogloks/Drakkin

# Notes
- https://github.com/EQEmu/Server/pull/3920 introduced an issue where we were using `uchar` for `race_selection` and `class_selection` which was not functioning properly within `IsPlayerRace()`.

* Update client.cpp
2024-01-25 06:19:59 -05:00
Alex King e9285fd2ca [Instances] Convert Instance Quest Methods to Repositories (#4012)
* [Instances] Convert Instance Quest Methods to Repositories

# Notes
- Convert `UpdateInstanceTimer()` and `GetInstanceTimerByID()` to repositories.
- Cleanup other instance methods.

* Update questmgr.cpp
2024-01-25 05:50:10 -05:00
Alex King 5b85f89c21 [Cleanup] Cleanup position methods (#4015)
# Notes
- Cleanup logic.
2024-01-24 22:47:24 -06:00
Paul Coene 7fed8fc8c8 [Bug Fix] Fixes to zone idle while empty changes. (#4006) 2024-01-22 19:33:00 -05:00
Alex King 26769f40d9 [Commands] Add #npcedit set_grid [Grid ID] to #npcedit (#4004)
* [Commands] Add #npcedit grid_id to #npcedit

# Notes
- Adds `#npcedit grid_id [Grid ID]` to `#npcedit`.

* set_grid
2024-01-22 17:49:18 -05:00
regneq f6148b9b8d [Quest] QuestReward should now summon item to the inventory instead of the cursor. (#3996)
* [forage rule feature] add a rule to disabled using common_food_ids from the list in forage.cpp.  currently set to enabled.

* [Quest] change QuestReward summonitem to SummonItemToInventory.

* add closing brackets in QuestReward functions.
2024-01-22 17:35:15 -05:00
Chris Miles ca1299bf1d [Database] Increase max spawngroup name from 50 to 200 (#3991) 2024-01-22 17:34:54 -05:00
Chris Miles 3fb24dc0a3 [Logging] Force Info category to be always on in file/console logs (#3990) 2024-01-22 17:34:48 -05:00
Chris Miles dcd7bffa54 [Zoning] Additional logs for zoning under instance checks (#3989) 2024-01-22 17:34:41 -05:00
Alex King 5298abe6bc [Bug Fix] Fix Mercenaries Buffs/Zoning Issues (#4000)
# Notes
- Mercenaries were disappearing on zoning because they were saving to slot `1` and being loaded from slot `0`.
- Mercenaries were not displaying properly in group window because of this as well.
- Mercenary buffs were saving even when they did not have any buffs.
2024-01-22 17:34:28 -05:00
dariusuknuis fbc2b7c152 [Bot] ^mez command spell list fix (#3998)
This change will allow necros to cast mez spells when ^mez command is used.
2024-01-19 16:39:14 -05:00
Paul Coene 86705000b0 Push discpline messages under melee->disciplines (#3987)
* Push discpline messages under melee->disciplines

* Added safe_delete()

* Remove fryguy's new message code and fix existing instead
2024-01-19 08:55:26 -05:00
Fryguy 748e37dbdf [Crash Fix] Reverting PR #3877 (#3997)
Reports of #3877 causing crashes on windows. No reports on Linux, but reverting for safety.
2024-01-17 18:22:11 -05:00
Paul Coene 27256215b8 [Messages] Fix disciple message added by previous patch. (#3986) 2024-01-15 14:01:24 -05:00
Chris Miles 59cbe1a152 [Database] Drop item_tick if exists tweak in manifest (#3985) 2024-01-14 23:14:15 -05:00
Chris Miles 3e50427bb7 [Repositories] Add rank to reserved words (#3982)
* [Repositories] Add `rank` to reserved words

* Update zonedb.cpp

* Guild Ranks

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2024-01-14 20:58:03 -05:00
Paul Coene 883b3b5826 [Spawn2] Spawn condition value should default spawn_conditions value (#3980)
* [Spawn2] Spawn condition value should default to value in spawn_conditions table

* Formatting changes and {}
2024-01-14 13:50:05 -05:00
Fryguy 135ee6b2b7 [Bug Fix] Reversed logic on InLiquid (#3979)
Thank you @noudness for catching this. Reversed logic on InLiquid check for falling damage.
2024-01-14 11:22:48 -05:00
Akkadius 906879ce2e [Repositories] Revert #3976 - fix character corpses 2024-01-14 03:30:00 -06:00
Chris Miles 8b7aba2769 [Release] 22.43.0 (#3978) 2024-01-14 00:12:26 -06:00
Chris Miles 9303255caa [Database] Drop deprecated item_tick table (#3977) 2024-01-14 00:10:21 -06:00
Chris Miles 14509fcc4e [Repositories] Fix datetime zero-value save behavior (#3976) 2024-01-14 00:10:13 -06:00
JJ e40267b9b8 [Merchants] Change database structure for merchant slots (#3974)
* [Merchants] Change database structure for merchant slots
The `slot` field should be unsigned int. The temp slot is currently limited to 127. The client will limit the visible slots.

* Update version.h
2024-01-13 20:58:46 -05:00
Alex King f3073b463f [Release] 22.42.1 (#3973)
### Fixes

* Fix zone database update manifest ([#3972](https://github.com/EQEmu/Server/pull/3972)) @Kinglykrab 2024-01-13
* quest::processmobswhilezoneempty() fix. ([#3971](https://github.com/EQEmu/Server/pull/3971)) @noudess 2024-01-13
2024-01-13 20:09:01 -05:00
Alex King 5ad4129312 [Bug Fix] Fix zone database update manifest (#3972)
* [Bug Fix] Fix zone database update manifest

# Notes
- Missing comma.

* Update database_update_manifest.cpp
2024-01-13 18:15:01 -05:00
Paul Coene 4b5b29b165 [Bug Fix] quest::processmobswhilezoneempty() fix. (#3971) 2024-01-13 09:37:22 -05:00
214 changed files with 9910 additions and 8280 deletions
+174
View File
@@ -1,3 +1,177 @@
## [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
* Drop deprecated item_tick table ([#3977](https://github.com/EQEmu/Server/pull/3977)) @Akkadius 2024-01-14
### Merchants
* Change database structure for merchant slots ([#3974](https://github.com/EQEmu/Server/pull/3974)) @joligario 2024-01-14
### Repositories
* Fix datetime zero-value save behavior ([#3976](https://github.com/EQEmu/Server/pull/3976)) @Akkadius 2024-01-14
### Zones
* Convert IDLE_WHEN_EMPTY to a Zone Column ([#3891](https://github.com/EQEmu/Server/pull/3891)) @Kinglykrab 2024-01-13
## [22.42.1] - 1/13/2024
### Fixes
* Fix zone database update manifest ([#3972](https://github.com/EQEmu/Server/pull/3972)) @Kinglykrab 2024-01-13
* quest::processmobswhilezoneempty() fix. ([#3971](https://github.com/EQEmu/Server/pull/3971)) @noudess 2024-01-13
## [22.42.0] - 1/13/2024
### AAs
+46 -2
View File
@@ -5194,10 +5194,54 @@ ALTER TABLE `instance_list`
.match = "",
.sql = R"(
ALTER TABLE `zone`
ADD COLUMN `idle_when_empty` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `min_lava_damage`
ADD COLUMN `seconds_before_idle` int(11) UNSIGNED NOT NULL DEFAULT 60 AFTER `idle_when_empty`
ADD COLUMN `idle_when_empty` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `min_lava_damage`,
ADD COLUMN `seconds_before_idle` int(11) UNSIGNED NOT NULL DEFAULT 60 AFTER `idle_when_empty`;
)",
.content_schema_update = true
},
ManifestEntry{
.version = 9253,
.description = "2024_01_13_merchantlist_slot.sql",
.check = "SHOW COLUMNS FROM `merchantlist` LIKE 'slot'",
.condition = "missing",
.match = "unsigned",
.sql = R"(
ALTER TABLE `merchantlist`
MODIFY COLUMN `slot` int(11) UNSIGNED NOT NULL DEFAULT 0
)",
.content_schema_update = true
},
ManifestEntry{
.version = 9254,
.description = "2024_01_13_merchantlist_temp_slot.sql",
.check = "SHOW COLUMNS FROM `merchantlist_temp` LIKE 'slot'",
.condition = "contains",
.match = "tinyint",
.sql = R"(
ALTER TABLE `merchantlist_temp`
MODIFY COLUMN `slot` int(11) UNSIGNED NOT NULL DEFAULT 0
)"
},
ManifestEntry{
.version = 9255,
.description = "2024_01_13_drop_item_tick_deprecated.sql",
.check = "show tables like 'item_tick'",
.condition = "not_empty",
.match = "",
.sql = R"(
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
// ManifestEntry{
@@ -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
+7
View File
@@ -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*/
+6
View File
@@ -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
+2
View File
@@ -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;
}
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseAaAbilityRepository {
public:
struct AaAbility {
@@ -174,19 +173,19 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.name = row[1] ? row[1] : "";
e.category = static_cast<int32_t>(atoi(row[2]));
e.classes = static_cast<int32_t>(atoi(row[3]));
e.races = static_cast<int32_t>(atoi(row[4]));
e.drakkin_heritage = static_cast<int32_t>(atoi(row[5]));
e.deities = static_cast<int32_t>(atoi(row[6]));
e.status = static_cast<int32_t>(atoi(row[7]));
e.type = static_cast<int32_t>(atoi(row[8]));
e.charges = static_cast<int32_t>(atoi(row[9]));
e.grant_only = static_cast<int8_t>(atoi(row[10]));
e.first_rank_id = static_cast<int32_t>(atoi(row[11]));
e.category = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.classes = row[3] ? static_cast<int32_t>(atoi(row[3])) : 131070;
e.races = row[4] ? static_cast<int32_t>(atoi(row[4])) : 65535;
e.drakkin_heritage = row[5] ? static_cast<int32_t>(atoi(row[5])) : 127;
e.deities = row[6] ? static_cast<int32_t>(atoi(row[6])) : 131071;
e.status = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.type = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.charges = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.grant_only = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.first_rank_id = row[11] ? static_cast<int32_t>(atoi(row[11])) : -1;
e.enabled = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 1;
e.reset_on_death = static_cast<int8_t>(atoi(row[13]));
e.auto_grant_enabled = static_cast<int8_t>(atoi(row[14]));
e.reset_on_death = row[13] ? static_cast<int8_t>(atoi(row[13])) : 0;
e.auto_grant_enabled = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
return e;
}
@@ -350,19 +349,19 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.name = row[1] ? row[1] : "";
e.category = static_cast<int32_t>(atoi(row[2]));
e.classes = static_cast<int32_t>(atoi(row[3]));
e.races = static_cast<int32_t>(atoi(row[4]));
e.drakkin_heritage = static_cast<int32_t>(atoi(row[5]));
e.deities = static_cast<int32_t>(atoi(row[6]));
e.status = static_cast<int32_t>(atoi(row[7]));
e.type = static_cast<int32_t>(atoi(row[8]));
e.charges = static_cast<int32_t>(atoi(row[9]));
e.grant_only = static_cast<int8_t>(atoi(row[10]));
e.first_rank_id = static_cast<int32_t>(atoi(row[11]));
e.category = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.classes = row[3] ? static_cast<int32_t>(atoi(row[3])) : 131070;
e.races = row[4] ? static_cast<int32_t>(atoi(row[4])) : 65535;
e.drakkin_heritage = row[5] ? static_cast<int32_t>(atoi(row[5])) : 127;
e.deities = row[6] ? static_cast<int32_t>(atoi(row[6])) : 131071;
e.status = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.type = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.charges = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.grant_only = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.first_rank_id = row[11] ? static_cast<int32_t>(atoi(row[11])) : -1;
e.enabled = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 1;
e.reset_on_death = static_cast<int8_t>(atoi(row[13]));
e.auto_grant_enabled = static_cast<int8_t>(atoi(row[14]));
e.reset_on_death = row[13] ? static_cast<int8_t>(atoi(row[13])) : 0;
e.auto_grant_enabled = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
all_entries.push_back(e);
}
@@ -389,19 +388,19 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.name = row[1] ? row[1] : "";
e.category = static_cast<int32_t>(atoi(row[2]));
e.classes = static_cast<int32_t>(atoi(row[3]));
e.races = static_cast<int32_t>(atoi(row[4]));
e.drakkin_heritage = static_cast<int32_t>(atoi(row[5]));
e.deities = static_cast<int32_t>(atoi(row[6]));
e.status = static_cast<int32_t>(atoi(row[7]));
e.type = static_cast<int32_t>(atoi(row[8]));
e.charges = static_cast<int32_t>(atoi(row[9]));
e.grant_only = static_cast<int8_t>(atoi(row[10]));
e.first_rank_id = static_cast<int32_t>(atoi(row[11]));
e.category = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.classes = row[3] ? static_cast<int32_t>(atoi(row[3])) : 131070;
e.races = row[4] ? static_cast<int32_t>(atoi(row[4])) : 65535;
e.drakkin_heritage = row[5] ? static_cast<int32_t>(atoi(row[5])) : 127;
e.deities = row[6] ? static_cast<int32_t>(atoi(row[6])) : 131071;
e.status = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.type = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.charges = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.grant_only = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.first_rank_id = row[11] ? static_cast<int32_t>(atoi(row[11])) : -1;
e.enabled = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 1;
e.reset_on_death = static_cast<int8_t>(atoi(row[13]));
e.auto_grant_enabled = static_cast<int8_t>(atoi(row[14]));
e.reset_on_death = row[13] ? static_cast<int8_t>(atoi(row[13])) : 0;
e.auto_grant_enabled = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
all_entries.push_back(e);
}
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseAaRankEffectsRepository {
public:
struct AaRankEffects {
@@ -134,9 +133,9 @@ public:
e.rank_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 1;
e.effect_id = static_cast<int32_t>(atoi(row[2]));
e.base1 = static_cast<int32_t>(atoi(row[3]));
e.base2 = static_cast<int32_t>(atoi(row[4]));
e.effect_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.base1 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.base2 = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
return e;
}
@@ -270,9 +269,9 @@ public:
e.rank_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 1;
e.effect_id = static_cast<int32_t>(atoi(row[2]));
e.base1 = static_cast<int32_t>(atoi(row[3]));
e.base2 = static_cast<int32_t>(atoi(row[4]));
e.effect_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.base1 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.base2 = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
all_entries.push_back(e);
}
@@ -299,9 +298,9 @@ public:
e.rank_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 1;
e.effect_id = static_cast<int32_t>(atoi(row[2]));
e.base1 = static_cast<int32_t>(atoi(row[3]));
e.base2 = static_cast<int32_t>(atoi(row[4]));
e.effect_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.base1 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.base2 = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
all_entries.push_back(e);
}
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseAaRankPrereqsRepository {
public:
struct AaRankPrereqs {
@@ -125,8 +124,8 @@ public:
AaRankPrereqs e{};
e.rank_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.aa_id = static_cast<int32_t>(atoi(row[1]));
e.points = static_cast<int32_t>(atoi(row[2]));
e.aa_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.points = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
return e;
}
@@ -253,8 +252,8 @@ public:
AaRankPrereqs e{};
e.rank_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.aa_id = static_cast<int32_t>(atoi(row[1]));
e.points = static_cast<int32_t>(atoi(row[2]));
e.aa_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.points = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -280,8 +279,8 @@ public:
AaRankPrereqs e{};
e.rank_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.aa_id = static_cast<int32_t>(atoi(row[1]));
e.points = static_cast<int32_t>(atoi(row[2]));
e.aa_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.points = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseAaRanksRepository {
public:
struct AaRanks {
@@ -165,18 +164,18 @@ public:
AaRanks e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.upper_hotkey_sid = static_cast<int32_t>(atoi(row[1]));
e.lower_hotkey_sid = static_cast<int32_t>(atoi(row[2]));
e.title_sid = static_cast<int32_t>(atoi(row[3]));
e.desc_sid = static_cast<int32_t>(atoi(row[4]));
e.cost = static_cast<int32_t>(atoi(row[5]));
e.level_req = static_cast<int32_t>(atoi(row[6]));
e.spell = static_cast<int32_t>(atoi(row[7]));
e.spell_type = static_cast<int32_t>(atoi(row[8]));
e.recast_time = static_cast<int32_t>(atoi(row[9]));
e.expansion = static_cast<int32_t>(atoi(row[10]));
e.prev_id = static_cast<int32_t>(atoi(row[11]));
e.next_id = static_cast<int32_t>(atoi(row[12]));
e.upper_hotkey_sid = row[1] ? static_cast<int32_t>(atoi(row[1])) : -1;
e.lower_hotkey_sid = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.title_sid = row[3] ? static_cast<int32_t>(atoi(row[3])) : -1;
e.desc_sid = row[4] ? static_cast<int32_t>(atoi(row[4])) : -1;
e.cost = row[5] ? static_cast<int32_t>(atoi(row[5])) : 1;
e.level_req = row[6] ? static_cast<int32_t>(atoi(row[6])) : 51;
e.spell = row[7] ? static_cast<int32_t>(atoi(row[7])) : -1;
e.spell_type = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.recast_time = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.expansion = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.prev_id = row[11] ? static_cast<int32_t>(atoi(row[11])) : -1;
e.next_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : -1;
return e;
}
@@ -333,18 +332,18 @@ public:
AaRanks e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.upper_hotkey_sid = static_cast<int32_t>(atoi(row[1]));
e.lower_hotkey_sid = static_cast<int32_t>(atoi(row[2]));
e.title_sid = static_cast<int32_t>(atoi(row[3]));
e.desc_sid = static_cast<int32_t>(atoi(row[4]));
e.cost = static_cast<int32_t>(atoi(row[5]));
e.level_req = static_cast<int32_t>(atoi(row[6]));
e.spell = static_cast<int32_t>(atoi(row[7]));
e.spell_type = static_cast<int32_t>(atoi(row[8]));
e.recast_time = static_cast<int32_t>(atoi(row[9]));
e.expansion = static_cast<int32_t>(atoi(row[10]));
e.prev_id = static_cast<int32_t>(atoi(row[11]));
e.next_id = static_cast<int32_t>(atoi(row[12]));
e.upper_hotkey_sid = row[1] ? static_cast<int32_t>(atoi(row[1])) : -1;
e.lower_hotkey_sid = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.title_sid = row[3] ? static_cast<int32_t>(atoi(row[3])) : -1;
e.desc_sid = row[4] ? static_cast<int32_t>(atoi(row[4])) : -1;
e.cost = row[5] ? static_cast<int32_t>(atoi(row[5])) : 1;
e.level_req = row[6] ? static_cast<int32_t>(atoi(row[6])) : 51;
e.spell = row[7] ? static_cast<int32_t>(atoi(row[7])) : -1;
e.spell_type = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.recast_time = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.expansion = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.prev_id = row[11] ? static_cast<int32_t>(atoi(row[11])) : -1;
e.next_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : -1;
all_entries.push_back(e);
}
@@ -370,18 +369,18 @@ public:
AaRanks e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.upper_hotkey_sid = static_cast<int32_t>(atoi(row[1]));
e.lower_hotkey_sid = static_cast<int32_t>(atoi(row[2]));
e.title_sid = static_cast<int32_t>(atoi(row[3]));
e.desc_sid = static_cast<int32_t>(atoi(row[4]));
e.cost = static_cast<int32_t>(atoi(row[5]));
e.level_req = static_cast<int32_t>(atoi(row[6]));
e.spell = static_cast<int32_t>(atoi(row[7]));
e.spell_type = static_cast<int32_t>(atoi(row[8]));
e.recast_time = static_cast<int32_t>(atoi(row[9]));
e.expansion = static_cast<int32_t>(atoi(row[10]));
e.prev_id = static_cast<int32_t>(atoi(row[11]));
e.next_id = static_cast<int32_t>(atoi(row[12]));
e.upper_hotkey_sid = row[1] ? static_cast<int32_t>(atoi(row[1])) : -1;
e.lower_hotkey_sid = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.title_sid = row[3] ? static_cast<int32_t>(atoi(row[3])) : -1;
e.desc_sid = row[4] ? static_cast<int32_t>(atoi(row[4])) : -1;
e.cost = row[5] ? static_cast<int32_t>(atoi(row[5])) : 1;
e.level_req = row[6] ? static_cast<int32_t>(atoi(row[6])) : 51;
e.spell = row[7] ? static_cast<int32_t>(atoi(row[7])) : -1;
e.spell_type = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.recast_time = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.expansion = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.prev_id = row[11] ? static_cast<int32_t>(atoi(row[11])) : -1;
e.next_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : -1;
all_entries.push_back(e);
}
@@ -127,10 +127,10 @@ public:
if (results.RowCount() == 1) {
AccountIp e{};
e.accid = static_cast<int32_t>(atoi(row[0]));
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.ip = row[1] ? row[1] : "";
e.count = static_cast<int32_t>(atoi(row[2]));
e.lastused = row[3] ? row[3] : "";
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
e.lastused = row[3] ? row[3] : std::time(nullptr);
return e;
}
@@ -259,10 +259,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
AccountIp e{};
e.accid = static_cast<int32_t>(atoi(row[0]));
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.ip = row[1] ? row[1] : "";
e.count = static_cast<int32_t>(atoi(row[2]));
e.lastused = row[3] ? row[3] : "";
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
e.lastused = row[3] ? row[3] : std::time(nullptr);
all_entries.push_back(e);
}
@@ -287,10 +287,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
AccountIp e{};
e.accid = static_cast<int32_t>(atoi(row[0]));
e.accid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.ip = row[1] ? row[1] : "";
e.count = static_cast<int32_t>(atoi(row[2]));
e.lastused = row[3] ? row[3] : "";
e.count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 1;
e.lastused = row[3] ? row[3] : std::time(nullptr);
all_entries.push_back(e);
}
@@ -207,22 +207,22 @@ public:
if (results.RowCount() == 1) {
Account e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.password = row[4] ? row[4] : "";
e.status = static_cast<int32_t>(atoi(row[5]));
e.ls_id = row[6] ? row[6] : "";
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.ls_id = row[6] ? row[6] : "eqemu";
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.invulnerable = static_cast<int8_t>(atoi(row[9]));
e.flymode = static_cast<int8_t>(atoi(row[10]));
e.ignore_tells = static_cast<int8_t>(atoi(row[11]));
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.minilogin_ip = row[14] ? row[14] : "";
e.hideme = static_cast<int8_t>(atoi(row[15]));
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
@@ -418,22 +418,22 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Account e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.password = row[4] ? row[4] : "";
e.status = static_cast<int32_t>(atoi(row[5]));
e.ls_id = row[6] ? row[6] : "";
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.ls_id = row[6] ? row[6] : "eqemu";
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.invulnerable = static_cast<int8_t>(atoi(row[9]));
e.flymode = static_cast<int8_t>(atoi(row[10]));
e.ignore_tells = static_cast<int8_t>(atoi(row[11]));
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.minilogin_ip = row[14] ? row[14] : "";
e.hideme = static_cast<int8_t>(atoi(row[15]));
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
@@ -466,22 +466,22 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Account e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.password = row[4] ? row[4] : "";
e.status = static_cast<int32_t>(atoi(row[5]));
e.ls_id = row[6] ? row[6] : "";
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.ls_id = row[6] ? row[6] : "eqemu";
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.invulnerable = static_cast<int8_t>(atoi(row[9]));
e.flymode = static_cast<int8_t>(atoi(row[10]));
e.ignore_tells = static_cast<int8_t>(atoi(row[11]));
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.minilogin_ip = row[14] ? row[14] : "";
e.hideme = static_cast<int8_t>(atoi(row[15]));
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
@@ -149,7 +149,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.adventure_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.instance_id = static_cast<int32_t>(atoi(row[2]));
e.instance_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.count = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.assassinate_count = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
e.status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
@@ -300,7 +300,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.adventure_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.instance_id = static_cast<int32_t>(atoi(row[2]));
e.instance_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.count = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.assassinate_count = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
e.status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
@@ -333,7 +333,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.adventure_id = row[1] ? static_cast<uint16_t>(strtoul(row[1], nullptr, 10)) : 0;
e.instance_id = static_cast<int32_t>(atoi(row[2]));
e.instance_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.count = row[3] ? static_cast<uint16_t>(strtoul(row[3], nullptr, 10)) : 0;
e.assassinate_count = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
e.status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
@@ -266,7 +266,7 @@ public:
e.zone_in_zone_id = row[20] ? static_cast<uint16_t>(strtoul(row[20], nullptr, 10)) : 0;
e.zone_in_x = row[21] ? strtof(row[21], nullptr) : 0;
e.zone_in_y = row[22] ? strtof(row[22], nullptr) : 0;
e.zone_in_object_id = static_cast<int16_t>(atoi(row[23]));
e.zone_in_object_id = row[23] ? static_cast<int16_t>(atoi(row[23])) : 0;
e.dest_x = row[24] ? strtof(row[24], nullptr) : 0;
e.dest_y = row[25] ? strtof(row[25], nullptr) : 0;
e.dest_z = row[26] ? strtof(row[26], nullptr) : 0;
@@ -513,7 +513,7 @@ public:
e.zone_in_zone_id = row[20] ? static_cast<uint16_t>(strtoul(row[20], nullptr, 10)) : 0;
e.zone_in_x = row[21] ? strtof(row[21], nullptr) : 0;
e.zone_in_y = row[22] ? strtof(row[22], nullptr) : 0;
e.zone_in_object_id = static_cast<int16_t>(atoi(row[23]));
e.zone_in_object_id = row[23] ? static_cast<int16_t>(atoi(row[23])) : 0;
e.dest_x = row[24] ? strtof(row[24], nullptr) : 0;
e.dest_y = row[25] ? strtof(row[25], nullptr) : 0;
e.dest_z = row[26] ? strtof(row[26], nullptr) : 0;
@@ -569,7 +569,7 @@ public:
e.zone_in_zone_id = row[20] ? static_cast<uint16_t>(strtoul(row[20], nullptr, 10)) : 0;
e.zone_in_x = row[21] ? strtof(row[21], nullptr) : 0;
e.zone_in_y = row[22] ? strtof(row[22], nullptr) : 0;
e.zone_in_object_id = static_cast<int16_t>(atoi(row[23]));
e.zone_in_object_id = row[23] ? static_cast<int16_t>(atoi(row[23])) : 0;
e.dest_x = row[24] ? strtof(row[24], nullptr) : 0;
e.dest_y = row[25] ? strtof(row[25], nullptr) : 0;
e.dest_z = row[26] ? strtof(row[26], nullptr) : 0;
@@ -119,8 +119,8 @@ public:
if (results.RowCount() == 1) {
AlternateCurrency e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.item_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
return e;
}
@@ -243,8 +243,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
AlternateCurrency e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.item_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
all_entries.push_back(e);
}
@@ -269,8 +269,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
AlternateCurrency e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.item_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
all_entries.push_back(e);
}
@@ -155,17 +155,17 @@ public:
if (results.RowCount() == 1) {
Auras e{};
e.type = static_cast<int32_t>(atoi(row[0]));
e.npc_type = static_cast<int32_t>(atoi(row[1]));
e.type = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.npc_type = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.spell_id = static_cast<int32_t>(atoi(row[3]));
e.distance = static_cast<int32_t>(atoi(row[4]));
e.aura_type = static_cast<int32_t>(atoi(row[5]));
e.spawn_type = static_cast<int32_t>(atoi(row[6]));
e.movement = static_cast<int32_t>(atoi(row[7]));
e.duration = static_cast<int32_t>(atoi(row[8]));
e.icon = static_cast<int32_t>(atoi(row[9]));
e.cast_time = static_cast<int32_t>(atoi(row[10]));
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.distance = row[4] ? static_cast<int32_t>(atoi(row[4])) : 60;
e.aura_type = row[5] ? static_cast<int32_t>(atoi(row[5])) : 1;
e.spawn_type = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.movement = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.duration = row[8] ? static_cast<int32_t>(atoi(row[8])) : 5400;
e.icon = row[9] ? static_cast<int32_t>(atoi(row[9])) : -1;
e.cast_time = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
return e;
}
@@ -315,17 +315,17 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Auras e{};
e.type = static_cast<int32_t>(atoi(row[0]));
e.npc_type = static_cast<int32_t>(atoi(row[1]));
e.type = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.npc_type = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.spell_id = static_cast<int32_t>(atoi(row[3]));
e.distance = static_cast<int32_t>(atoi(row[4]));
e.aura_type = static_cast<int32_t>(atoi(row[5]));
e.spawn_type = static_cast<int32_t>(atoi(row[6]));
e.movement = static_cast<int32_t>(atoi(row[7]));
e.duration = static_cast<int32_t>(atoi(row[8]));
e.icon = static_cast<int32_t>(atoi(row[9]));
e.cast_time = static_cast<int32_t>(atoi(row[10]));
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.distance = row[4] ? static_cast<int32_t>(atoi(row[4])) : 60;
e.aura_type = row[5] ? static_cast<int32_t>(atoi(row[5])) : 1;
e.spawn_type = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.movement = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.duration = row[8] ? static_cast<int32_t>(atoi(row[8])) : 5400;
e.icon = row[9] ? static_cast<int32_t>(atoi(row[9])) : -1;
e.cast_time = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
all_entries.push_back(e);
}
@@ -350,17 +350,17 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Auras e{};
e.type = static_cast<int32_t>(atoi(row[0]));
e.npc_type = static_cast<int32_t>(atoi(row[1]));
e.type = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.npc_type = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.spell_id = static_cast<int32_t>(atoi(row[3]));
e.distance = static_cast<int32_t>(atoi(row[4]));
e.aura_type = static_cast<int32_t>(atoi(row[5]));
e.spawn_type = static_cast<int32_t>(atoi(row[6]));
e.movement = static_cast<int32_t>(atoi(row[7]));
e.duration = static_cast<int32_t>(atoi(row[8]));
e.icon = static_cast<int32_t>(atoi(row[9]));
e.cast_time = static_cast<int32_t>(atoi(row[10]));
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.distance = row[4] ? static_cast<int32_t>(atoi(row[4])) : 60;
e.aura_type = row[5] ? static_cast<int32_t>(atoi(row[5])) : 1;
e.spawn_type = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.movement = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.duration = row[8] ? static_cast<int32_t>(atoi(row[8])) : 5400;
e.icon = row[9] ? static_cast<int32_t>(atoi(row[9])) : -1;
e.cast_time = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
all_entries.push_back(e);
}
@@ -175,10 +175,10 @@ public:
if (results.RowCount() == 1) {
BlockedSpells e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[2]));
e.zoneid = static_cast<int32_t>(atoi(row[3]));
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
e.y = row[5] ? strtof(row[5], nullptr) : 0;
e.z = row[6] ? strtof(row[6], nullptr) : 0;
@@ -187,8 +187,8 @@ public:
e.z_diff = row[9] ? strtof(row[9], nullptr) : 0;
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
@@ -354,10 +354,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
BlockedSpells e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[2]));
e.zoneid = static_cast<int32_t>(atoi(row[3]));
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
e.y = row[5] ? strtof(row[5], nullptr) : 0;
e.z = row[6] ? strtof(row[6], nullptr) : 0;
@@ -366,8 +366,8 @@ public:
e.z_diff = row[9] ? strtof(row[9], nullptr) : 0;
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
@@ -394,10 +394,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
BlockedSpells e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[2]));
e.zoneid = static_cast<int32_t>(atoi(row[3]));
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
e.y = row[5] ? strtof(row[5], nullptr) : 0;
e.z = row[6] ? strtof(row[6], nullptr) : 0;
@@ -406,8 +406,8 @@ public:
e.z_diff = row[9] ? strtof(row[9], nullptr) : 0;
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
@@ -127,10 +127,10 @@ public:
if (results.RowCount() == 1) {
Books e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.txtfile = row[2] ? row[2] : "";
e.language = static_cast<int32_t>(atoi(row[3]));
e.language = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
return e;
}
@@ -258,10 +258,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Books e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.txtfile = row[2] ? row[2] : "";
e.language = static_cast<int32_t>(atoi(row[3]));
e.language = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -286,10 +286,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Books e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.txtfile = row[2] ? row[2] : "";
e.language = static_cast<int32_t>(atoi(row[3]));
e.language = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -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
@@ -240,36 +240,36 @@ public:
BugReports e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zone = row[1] ? row[1] : "";
e.zone = row[1] ? row[1] : "Unknown";
e.client_version_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.client_version_name = row[3] ? row[3] : "";
e.client_version_name = row[3] ? row[3] : "Unknown";
e.account_id = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.character_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.character_name = row[6] ? row[6] : "";
e.reporter_spoof = static_cast<int8_t>(atoi(row[7]));
e.character_name = row[6] ? row[6] : "Unknown";
e.reporter_spoof = row[7] ? static_cast<int8_t>(atoi(row[7])) : 1;
e.category_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.category_name = row[9] ? row[9] : "";
e.reporter_name = row[10] ? row[10] : "";
e.ui_path = row[11] ? row[11] : "";
e.category_name = row[9] ? row[9] : "Other";
e.reporter_name = row[10] ? row[10] : "Unknown";
e.ui_path = row[11] ? row[11] : "Unknown";
e.pos_x = row[12] ? strtof(row[12], nullptr) : 0;
e.pos_y = row[13] ? strtof(row[13], nullptr) : 0;
e.pos_z = row[14] ? strtof(row[14], nullptr) : 0;
e.heading = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.time_played = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
e.target_id = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 0;
e.target_name = row[18] ? row[18] : "";
e.target_name = row[18] ? row[18] : "Unknown";
e.optional_info_mask = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e._can_duplicate = static_cast<int8_t>(atoi(row[20]));
e._crash_bug = static_cast<int8_t>(atoi(row[21]));
e._target_info = static_cast<int8_t>(atoi(row[22]));
e._character_flags = static_cast<int8_t>(atoi(row[23]));
e._unknown_value = static_cast<int8_t>(atoi(row[24]));
e._can_duplicate = row[20] ? static_cast<int8_t>(atoi(row[20])) : 0;
e._crash_bug = row[21] ? static_cast<int8_t>(atoi(row[21])) : 0;
e._target_info = row[22] ? static_cast<int8_t>(atoi(row[22])) : 0;
e._character_flags = row[23] ? static_cast<int8_t>(atoi(row[23])) : 0;
e._unknown_value = row[24] ? static_cast<int8_t>(atoi(row[24])) : 0;
e.bug_report = row[25] ? row[25] : "";
e.system_info = row[26] ? row[26] : "";
e.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
e.bug_status = row[28] ? static_cast<uint8_t>(strtoul(row[28], nullptr, 10)) : 0;
e.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
e.last_reviewer = row[30] ? row[30] : "";
e.last_reviewer = row[30] ? row[30] : "None";
e.reviewer_notes = row[31] ? row[31] : "";
return e;
@@ -483,36 +483,36 @@ public:
BugReports e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zone = row[1] ? row[1] : "";
e.zone = row[1] ? row[1] : "Unknown";
e.client_version_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.client_version_name = row[3] ? row[3] : "";
e.client_version_name = row[3] ? row[3] : "Unknown";
e.account_id = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.character_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.character_name = row[6] ? row[6] : "";
e.reporter_spoof = static_cast<int8_t>(atoi(row[7]));
e.character_name = row[6] ? row[6] : "Unknown";
e.reporter_spoof = row[7] ? static_cast<int8_t>(atoi(row[7])) : 1;
e.category_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.category_name = row[9] ? row[9] : "";
e.reporter_name = row[10] ? row[10] : "";
e.ui_path = row[11] ? row[11] : "";
e.category_name = row[9] ? row[9] : "Other";
e.reporter_name = row[10] ? row[10] : "Unknown";
e.ui_path = row[11] ? row[11] : "Unknown";
e.pos_x = row[12] ? strtof(row[12], nullptr) : 0;
e.pos_y = row[13] ? strtof(row[13], nullptr) : 0;
e.pos_z = row[14] ? strtof(row[14], nullptr) : 0;
e.heading = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.time_played = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
e.target_id = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 0;
e.target_name = row[18] ? row[18] : "";
e.target_name = row[18] ? row[18] : "Unknown";
e.optional_info_mask = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e._can_duplicate = static_cast<int8_t>(atoi(row[20]));
e._crash_bug = static_cast<int8_t>(atoi(row[21]));
e._target_info = static_cast<int8_t>(atoi(row[22]));
e._character_flags = static_cast<int8_t>(atoi(row[23]));
e._unknown_value = static_cast<int8_t>(atoi(row[24]));
e._can_duplicate = row[20] ? static_cast<int8_t>(atoi(row[20])) : 0;
e._crash_bug = row[21] ? static_cast<int8_t>(atoi(row[21])) : 0;
e._target_info = row[22] ? static_cast<int8_t>(atoi(row[22])) : 0;
e._character_flags = row[23] ? static_cast<int8_t>(atoi(row[23])) : 0;
e._unknown_value = row[24] ? static_cast<int8_t>(atoi(row[24])) : 0;
e.bug_report = row[25] ? row[25] : "";
e.system_info = row[26] ? row[26] : "";
e.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
e.bug_status = row[28] ? static_cast<uint8_t>(strtoul(row[28], nullptr, 10)) : 0;
e.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
e.last_reviewer = row[30] ? row[30] : "";
e.last_reviewer = row[30] ? row[30] : "None";
e.reviewer_notes = row[31] ? row[31] : "";
all_entries.push_back(e);
@@ -539,36 +539,36 @@ public:
BugReports e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zone = row[1] ? row[1] : "";
e.zone = row[1] ? row[1] : "Unknown";
e.client_version_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.client_version_name = row[3] ? row[3] : "";
e.client_version_name = row[3] ? row[3] : "Unknown";
e.account_id = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.character_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.character_name = row[6] ? row[6] : "";
e.reporter_spoof = static_cast<int8_t>(atoi(row[7]));
e.character_name = row[6] ? row[6] : "Unknown";
e.reporter_spoof = row[7] ? static_cast<int8_t>(atoi(row[7])) : 1;
e.category_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.category_name = row[9] ? row[9] : "";
e.reporter_name = row[10] ? row[10] : "";
e.ui_path = row[11] ? row[11] : "";
e.category_name = row[9] ? row[9] : "Other";
e.reporter_name = row[10] ? row[10] : "Unknown";
e.ui_path = row[11] ? row[11] : "Unknown";
e.pos_x = row[12] ? strtof(row[12], nullptr) : 0;
e.pos_y = row[13] ? strtof(row[13], nullptr) : 0;
e.pos_z = row[14] ? strtof(row[14], nullptr) : 0;
e.heading = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.time_played = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
e.target_id = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 0;
e.target_name = row[18] ? row[18] : "";
e.target_name = row[18] ? row[18] : "Unknown";
e.optional_info_mask = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e._can_duplicate = static_cast<int8_t>(atoi(row[20]));
e._crash_bug = static_cast<int8_t>(atoi(row[21]));
e._target_info = static_cast<int8_t>(atoi(row[22]));
e._character_flags = static_cast<int8_t>(atoi(row[23]));
e._unknown_value = static_cast<int8_t>(atoi(row[24]));
e._can_duplicate = row[20] ? static_cast<int8_t>(atoi(row[20])) : 0;
e._crash_bug = row[21] ? static_cast<int8_t>(atoi(row[21])) : 0;
e._target_info = row[22] ? static_cast<int8_t>(atoi(row[22])) : 0;
e._character_flags = row[23] ? static_cast<int8_t>(atoi(row[23])) : 0;
e._unknown_value = row[24] ? static_cast<int8_t>(atoi(row[24])) : 0;
e.bug_report = row[25] ? row[25] : "";
e.system_info = row[26] ? row[26] : "";
e.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
e.bug_status = row[28] ? static_cast<uint8_t>(strtoul(row[28], nullptr, 10)) : 0;
e.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
e.last_reviewer = row[30] ? row[30] : "";
e.last_reviewer = row[30] ? row[30] : "None";
e.reviewer_notes = row[31] ? row[31] : "";
all_entries.push_back(e);
@@ -174,7 +174,7 @@ public:
e.flag = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.target = row[9] ? row[9] : "";
e.bug = row[10] ? row[10] : "";
e.date = row[11] ? row[11] : "";
e.date = row[11] ? row[11] : 0;
e.status = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
return e;
@@ -341,7 +341,7 @@ public:
e.flag = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.target = row[9] ? row[9] : "";
e.bug = row[10] ? row[10] : "";
e.date = row[11] ? row[11] : "";
e.date = row[11] ? row[11] : 0;
e.status = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
all_entries.push_back(e);
@@ -378,7 +378,7 @@ public:
e.flag = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.target = row[9] ? row[9] : "";
e.bug = row[10] ? row[10] : "";
e.date = row[11] ? row[11] : "";
e.date = row[11] ? row[11] : 0;
e.status = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
all_entries.push_back(e);
@@ -135,12 +135,12 @@ public:
if (results.RowCount() == 1) {
Buyer e{};
e.charid = static_cast<int32_t>(atoi(row[0]));
e.buyslot = static_cast<int32_t>(atoi(row[1]));
e.itemid = static_cast<int32_t>(atoi(row[2]));
e.charid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.buyslot = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.itemname = row[3] ? row[3] : "";
e.quantity = static_cast<int32_t>(atoi(row[4]));
e.price = static_cast<int32_t>(atoi(row[5]));
e.quantity = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.price = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
return e;
}
@@ -275,12 +275,12 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Buyer e{};
e.charid = static_cast<int32_t>(atoi(row[0]));
e.buyslot = static_cast<int32_t>(atoi(row[1]));
e.itemid = static_cast<int32_t>(atoi(row[2]));
e.charid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.buyslot = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.itemname = row[3] ? row[3] : "";
e.quantity = static_cast<int32_t>(atoi(row[4]));
e.price = static_cast<int32_t>(atoi(row[5]));
e.quantity = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.price = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -305,12 +305,12 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Buyer e{};
e.charid = static_cast<int32_t>(atoi(row[0]));
e.buyslot = static_cast<int32_t>(atoi(row[1]));
e.itemid = static_cast<int32_t>(atoi(row[2]));
e.charid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.buyslot = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.itemname = row[3] ? row[3] : "";
e.quantity = static_cast<int32_t>(atoi(row[4]));
e.price = static_cast<int32_t>(atoi(row[5]));
e.quantity = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.price = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -123,9 +123,9 @@ public:
if (results.RowCount() == 1) {
CharRecipeList e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.recipe_id = static_cast<int32_t>(atoi(row[1]));
e.madecount = static_cast<int32_t>(atoi(row[2]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.recipe_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.madecount = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
return e;
}
@@ -251,9 +251,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharRecipeList e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.recipe_id = static_cast<int32_t>(atoi(row[1]));
e.madecount = static_cast<int32_t>(atoi(row[2]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.recipe_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.madecount = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -278,9 +278,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharRecipeList e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.recipe_id = static_cast<int32_t>(atoi(row[1]));
e.madecount = static_cast<int32_t>(atoi(row[2]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.recipe_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.madecount = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -135,7 +135,7 @@ public:
e.taskid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.activityid = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.donecount = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.completed = static_cast<int8_t>(atoi(row[4]));
e.completed = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
return e;
}
@@ -271,7 +271,7 @@ public:
e.taskid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.activityid = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.donecount = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.completed = static_cast<int8_t>(atoi(row[4]));
e.completed = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
all_entries.push_back(e);
}
@@ -300,7 +300,7 @@ public:
e.taskid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.activityid = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.donecount = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.completed = static_cast<int8_t>(atoi(row[4]));
e.completed = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
all_entries.push_back(e);
}
@@ -123,9 +123,9 @@ public:
if (results.RowCount() == 1) {
CharacterAuras e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.slot = static_cast<int8_t>(atoi(row[1]));
e.spell_id = static_cast<int32_t>(atoi(row[2]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.slot = row[1] ? static_cast<int8_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
return e;
}
@@ -251,9 +251,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterAuras e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.slot = static_cast<int8_t>(atoi(row[1]));
e.spell_id = static_cast<int32_t>(atoi(row[2]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.slot = row[1] ? static_cast<int8_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -278,9 +278,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterAuras e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.slot = static_cast<int8_t>(atoi(row[1]));
e.spell_id = static_cast<int32_t>(atoi(row[2]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.slot = row[1] ? static_cast<int8_t>(atoi(row[1])) : 0;
e.spell_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -140,7 +140,7 @@ public:
e.bandolier_slot = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.icon = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.bandolier_name = row[5] ? row[5] : "";
e.bandolier_name = row[5] ? row[5] : "0";
return e;
}
@@ -280,7 +280,7 @@ public:
e.bandolier_slot = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.icon = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.bandolier_name = row[5] ? row[5] : "";
e.bandolier_name = row[5] ? row[5] : "0";
all_entries.push_back(e);
}
@@ -310,7 +310,7 @@ public:
e.bandolier_slot = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.icon = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.bandolier_name = row[5] ? row[5] : "";
e.bandolier_name = row[5] ? row[5] : "0";
all_entries.push_back(e);
}
@@ -144,7 +144,7 @@ public:
CharacterBind e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot = static_cast<int32_t>(atoi(row[1]));
e.slot = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.zone_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
e.instance_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
@@ -291,7 +291,7 @@ public:
CharacterBind e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot = static_cast<int32_t>(atoi(row[1]));
e.slot = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.zone_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
e.instance_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
@@ -323,7 +323,7 @@ public:
CharacterBind e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.slot = static_cast<int32_t>(atoi(row[1]));
e.slot = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.zone_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
e.instance_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
@@ -184,18 +184,18 @@ public:
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.caster_name = row[4] ? row[4] : "";
e.ticsremaining = static_cast<int32_t>(atoi(row[5]));
e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.numhits = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.melee_rune = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.magic_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.persistent = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = static_cast<int32_t>(atoi(row[11]));
e.caston_x = static_cast<int32_t>(atoi(row[12]));
e.caston_y = static_cast<int32_t>(atoi(row[13]));
e.caston_z = static_cast<int32_t>(atoi(row[14]));
e.ExtraDIChance = static_cast<int32_t>(atoi(row[15]));
e.instrument_mod = static_cast<int32_t>(atoi(row[16]));
e.dot_rune = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.caston_x = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.caston_y = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_z = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.ExtraDIChance = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.instrument_mod = row[16] ? static_cast<int32_t>(atoi(row[16])) : 10;
return e;
}
@@ -368,18 +368,18 @@ public:
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.caster_name = row[4] ? row[4] : "";
e.ticsremaining = static_cast<int32_t>(atoi(row[5]));
e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.numhits = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.melee_rune = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.magic_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.persistent = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = static_cast<int32_t>(atoi(row[11]));
e.caston_x = static_cast<int32_t>(atoi(row[12]));
e.caston_y = static_cast<int32_t>(atoi(row[13]));
e.caston_z = static_cast<int32_t>(atoi(row[14]));
e.ExtraDIChance = static_cast<int32_t>(atoi(row[15]));
e.instrument_mod = static_cast<int32_t>(atoi(row[16]));
e.dot_rune = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.caston_x = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.caston_y = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_z = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.ExtraDIChance = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.instrument_mod = row[16] ? static_cast<int32_t>(atoi(row[16])) : 10;
all_entries.push_back(e);
}
@@ -409,18 +409,18 @@ public:
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
e.caster_level = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.caster_name = row[4] ? row[4] : "";
e.ticsremaining = static_cast<int32_t>(atoi(row[5]));
e.ticsremaining = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.counters = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.numhits = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.melee_rune = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.magic_rune = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.persistent = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 0;
e.dot_rune = static_cast<int32_t>(atoi(row[11]));
e.caston_x = static_cast<int32_t>(atoi(row[12]));
e.caston_y = static_cast<int32_t>(atoi(row[13]));
e.caston_z = static_cast<int32_t>(atoi(row[14]));
e.ExtraDIChance = static_cast<int32_t>(atoi(row[15]));
e.instrument_mod = static_cast<int32_t>(atoi(row[16]));
e.dot_rune = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.caston_x = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.caston_y = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.caston_z = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.ExtraDIChance = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.instrument_mod = row[16] ? static_cast<int32_t>(atoi(row[16])) : 10;
all_entries.push_back(e);
}
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseCharacterCorpseItemsRepository {
public:
struct CharacterCorpseItems {
@@ -181,8 +180,8 @@ public:
e.aug_3 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.aug_4 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.aug_5 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.aug_6 = static_cast<int32_t>(atoi(row[9]));
e.attuned = static_cast<int16_t>(atoi(row[10]));
e.aug_6 = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.attuned = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.custom_data = row[11] ? row[11] : "";
e.ornamenticon = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.ornamentidfile = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
@@ -357,8 +356,8 @@ public:
e.aug_3 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.aug_4 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.aug_5 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.aug_6 = static_cast<int32_t>(atoi(row[9]));
e.attuned = static_cast<int16_t>(atoi(row[10]));
e.aug_6 = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.attuned = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.custom_data = row[11] ? row[11] : "";
e.ornamenticon = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.ornamentidfile = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
@@ -396,8 +395,8 @@ public:
e.aug_3 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.aug_4 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.aug_5 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.aug_6 = static_cast<int32_t>(atoi(row[9]));
e.attuned = static_cast<int16_t>(atoi(row[10]));
e.aug_6 = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.attuned = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.custom_data = row[11] ? row[11] : "";
e.ornamenticon = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
e.ornamentidfile = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseCharacterCorpsesRepository {
public:
struct CharacterCorpses {
@@ -303,7 +302,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.charid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.charname = row[2] ? row[2] : "";
e.zone_id = static_cast<int16_t>(atoi(row[3]));
e.zone_id = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.instance_id = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
e.x = row[5] ? strtof(row[5], nullptr) : 0;
e.y = row[6] ? strtof(row[6], nullptr) : 0;
@@ -312,9 +311,9 @@ public:
e.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
e.guild_consent_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.is_rezzed = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.is_buried = static_cast<int8_t>(atoi(row[12]));
e.was_at_graveyard = static_cast<int8_t>(atoi(row[13]));
e.is_locked = static_cast<int8_t>(atoi(row[14]));
e.is_buried = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
e.was_at_graveyard = row[13] ? static_cast<int8_t>(atoi(row[13])) : 0;
e.is_locked = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
e.exp = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.size = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
e.level = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 0;
@@ -606,7 +605,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.charid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.charname = row[2] ? row[2] : "";
e.zone_id = static_cast<int16_t>(atoi(row[3]));
e.zone_id = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.instance_id = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
e.x = row[5] ? strtof(row[5], nullptr) : 0;
e.y = row[6] ? strtof(row[6], nullptr) : 0;
@@ -615,9 +614,9 @@ public:
e.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
e.guild_consent_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.is_rezzed = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.is_buried = static_cast<int8_t>(atoi(row[12]));
e.was_at_graveyard = static_cast<int8_t>(atoi(row[13]));
e.is_locked = static_cast<int8_t>(atoi(row[14]));
e.is_buried = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
e.was_at_graveyard = row[13] ? static_cast<int8_t>(atoi(row[13])) : 0;
e.is_locked = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
e.exp = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.size = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
e.level = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 0;
@@ -677,7 +676,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.charid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.charname = row[2] ? row[2] : "";
e.zone_id = static_cast<int16_t>(atoi(row[3]));
e.zone_id = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.instance_id = row[4] ? static_cast<uint16_t>(strtoul(row[4], nullptr, 10)) : 0;
e.x = row[5] ? strtof(row[5], nullptr) : 0;
e.y = row[6] ? strtof(row[6], nullptr) : 0;
@@ -686,9 +685,9 @@ public:
e.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
e.guild_consent_id = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.is_rezzed = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.is_buried = static_cast<int8_t>(atoi(row[12]));
e.was_at_graveyard = static_cast<int8_t>(atoi(row[13]));
e.is_locked = static_cast<int8_t>(atoi(row[14]));
e.is_buried = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
e.was_at_graveyard = row[13] ? static_cast<int8_t>(atoi(row[13])) : 0;
e.is_locked = row[14] ? static_cast<int8_t>(atoi(row[14])) : 0;
e.exp = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.size = row[16] ? static_cast<uint32_t>(strtoul(row[16], nullptr, 10)) : 0;
e.level = row[17] ? static_cast<uint32_t>(strtoul(row[17], nullptr, 10)) : 0;
@@ -524,7 +524,7 @@ public:
CharacterData e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.account_id = static_cast<int32_t>(atoi(row[1]));
e.account_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.last_name = row[3] ? row[3] : "";
e.title = row[4] ? row[4] : "";
@@ -618,7 +618,7 @@ public:
e.lfg = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
e.mailkey = row[93] ? row[93] : "";
e.xtargets = row[94] ? static_cast<uint8_t>(strtoul(row[94], nullptr, 10)) : 5;
e.firstlogon = static_cast<int8_t>(atoi(row[95]));
e.firstlogon = row[95] ? static_cast<int8_t>(atoi(row[95])) : 0;
e.e_aa_effects = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
e.e_percent_to_aa = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
e.e_expended_aa_spent = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
@@ -1051,7 +1051,7 @@ public:
CharacterData e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.account_id = static_cast<int32_t>(atoi(row[1]));
e.account_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.last_name = row[3] ? row[3] : "";
e.title = row[4] ? row[4] : "";
@@ -1145,7 +1145,7 @@ public:
e.lfg = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
e.mailkey = row[93] ? row[93] : "";
e.xtargets = row[94] ? static_cast<uint8_t>(strtoul(row[94], nullptr, 10)) : 5;
e.firstlogon = static_cast<int8_t>(atoi(row[95]));
e.firstlogon = row[95] ? static_cast<int8_t>(atoi(row[95])) : 0;
e.e_aa_effects = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
e.e_percent_to_aa = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
e.e_expended_aa_spent = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
@@ -1178,7 +1178,7 @@ public:
CharacterData e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.account_id = static_cast<int32_t>(atoi(row[1]));
e.account_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.last_name = row[3] ? row[3] : "";
e.title = row[4] ? row[4] : "";
@@ -1272,7 +1272,7 @@ public:
e.lfg = row[92] ? static_cast<uint8_t>(strtoul(row[92], nullptr, 10)) : 0;
e.mailkey = row[93] ? row[93] : "";
e.xtargets = row[94] ? static_cast<uint8_t>(strtoul(row[94], nullptr, 10)) : 5;
e.firstlogon = static_cast<int8_t>(atoi(row[95]));
e.firstlogon = row[95] ? static_cast<int8_t>(atoi(row[95])) : 0;
e.e_aa_effects = row[96] ? static_cast<uint32_t>(strtoul(row[96], nullptr, 10)) : 0;
e.e_percent_to_aa = row[97] ? static_cast<uint32_t>(strtoul(row[97], nullptr, 10)) : 0;
e.e_expended_aa_spent = row[98] ? static_cast<uint32_t>(strtoul(row[98], nullptr, 10)) : 0;
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseCharacterExpModifiersRepository {
public:
struct CharacterExpModifiers {
@@ -132,9 +131,9 @@ public:
if (results.RowCount() == 1) {
CharacterExpModifiers e{};
e.character_id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.instance_version = static_cast<int32_t>(atoi(row[2]));
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 0;
e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 0;
@@ -268,9 +267,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterExpModifiers e{};
e.character_id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.instance_version = static_cast<int32_t>(atoi(row[2]));
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 0;
e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 0;
@@ -297,9 +296,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterExpModifiers e{};
e.character_id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.instance_version = static_cast<int32_t>(atoi(row[2]));
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.instance_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : -1;
e.aa_modifier = row[3] ? strtof(row[3], nullptr) : 0;
e.exp_modifier = row[4] ? strtof(row[4], nullptr) : 0;
@@ -149,9 +149,9 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.instance_zone_id = static_cast<int32_t>(atoi(row[2]));
e.instance_id = static_cast<int32_t>(atoi(row[3]));
e.safe_zone_id = static_cast<int32_t>(atoi(row[4]));
e.instance_zone_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.instance_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.safe_zone_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.safe_x = row[5] ? strtof(row[5], nullptr) : 0;
e.safe_y = row[6] ? strtof(row[6], nullptr) : 0;
e.safe_z = row[7] ? strtof(row[7], nullptr) : 0;
@@ -300,9 +300,9 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.instance_zone_id = static_cast<int32_t>(atoi(row[2]));
e.instance_id = static_cast<int32_t>(atoi(row[3]));
e.safe_zone_id = static_cast<int32_t>(atoi(row[4]));
e.instance_zone_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.instance_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.safe_zone_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.safe_x = row[5] ? strtof(row[5], nullptr) : 0;
e.safe_y = row[6] ? strtof(row[6], nullptr) : 0;
e.safe_z = row[7] ? strtof(row[7], nullptr) : 0;
@@ -333,9 +333,9 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.instance_zone_id = static_cast<int32_t>(atoi(row[2]));
e.instance_id = static_cast<int32_t>(atoi(row[3]));
e.safe_zone_id = static_cast<int32_t>(atoi(row[4]));
e.instance_zone_id = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.instance_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.safe_zone_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.safe_x = row[5] ? strtof(row[5], nullptr) : 0;
e.safe_y = row[6] ? strtof(row[6], nullptr) : 0;
e.safe_z = row[7] ? strtof(row[7], nullptr) : 0;
@@ -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) + ")");
}
@@ -119,8 +119,8 @@ public:
if (results.RowCount() == 1) {
CharacterPeqzoneFlags e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
return e;
}
@@ -243,8 +243,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPeqzoneFlags e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
all_entries.push_back(e);
}
@@ -269,8 +269,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPeqzoneFlags e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
all_entries.push_back(e);
}
@@ -155,16 +155,16 @@ public:
if (results.RowCount() == 1) {
CharacterPetBuffs e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.slot = static_cast<int32_t>(atoi(row[2]));
e.spell_id = static_cast<int32_t>(atoi(row[3]));
e.caster_level = static_cast<int8_t>(atoi(row[4]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.caster_level = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
e.castername = row[5] ? row[5] : "";
e.ticsremaining = static_cast<int32_t>(atoi(row[6]));
e.counters = static_cast<int32_t>(atoi(row[7]));
e.numhits = static_cast<int32_t>(atoi(row[8]));
e.rune = static_cast<int32_t>(atoi(row[9]));
e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.numhits = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.rune = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.instrument_mod = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 10;
return e;
@@ -315,16 +315,16 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetBuffs e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.slot = static_cast<int32_t>(atoi(row[2]));
e.spell_id = static_cast<int32_t>(atoi(row[3]));
e.caster_level = static_cast<int8_t>(atoi(row[4]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.caster_level = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
e.castername = row[5] ? row[5] : "";
e.ticsremaining = static_cast<int32_t>(atoi(row[6]));
e.counters = static_cast<int32_t>(atoi(row[7]));
e.numhits = static_cast<int32_t>(atoi(row[8]));
e.rune = static_cast<int32_t>(atoi(row[9]));
e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.numhits = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.rune = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.instrument_mod = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 10;
all_entries.push_back(e);
@@ -350,16 +350,16 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetBuffs e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.slot = static_cast<int32_t>(atoi(row[2]));
e.spell_id = static_cast<int32_t>(atoi(row[3]));
e.caster_level = static_cast<int8_t>(atoi(row[4]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.spell_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.caster_level = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
e.castername = row[5] ? row[5] : "";
e.ticsremaining = static_cast<int32_t>(atoi(row[6]));
e.counters = static_cast<int32_t>(atoi(row[7]));
e.numhits = static_cast<int32_t>(atoi(row[8]));
e.rune = static_cast<int32_t>(atoi(row[9]));
e.ticsremaining = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.counters = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.numhits = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.rune = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.instrument_mod = row[10] ? static_cast<uint8_t>(strtoul(row[10], nullptr, 10)) : 10;
all_entries.push_back(e);
@@ -147,15 +147,15 @@ public:
if (results.RowCount() == 1) {
CharacterPetInfo e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.petname = row[2] ? row[2] : "";
e.petpower = static_cast<int32_t>(atoi(row[3]));
e.spell_id = static_cast<int32_t>(atoi(row[4]));
e.hp = static_cast<int32_t>(atoi(row[5]));
e.mana = static_cast<int32_t>(atoi(row[6]));
e.petpower = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.spell_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.hp = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.mana = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.size = row[7] ? strtof(row[7], nullptr) : 0;
e.taunting = static_cast<int8_t>(atoi(row[8]));
e.taunting = row[8] ? static_cast<int8_t>(atoi(row[8])) : 1;
return e;
}
@@ -299,15 +299,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetInfo e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.petname = row[2] ? row[2] : "";
e.petpower = static_cast<int32_t>(atoi(row[3]));
e.spell_id = static_cast<int32_t>(atoi(row[4]));
e.hp = static_cast<int32_t>(atoi(row[5]));
e.mana = static_cast<int32_t>(atoi(row[6]));
e.petpower = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.spell_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.hp = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.mana = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.size = row[7] ? strtof(row[7], nullptr) : 0;
e.taunting = static_cast<int8_t>(atoi(row[8]));
e.taunting = row[8] ? static_cast<int8_t>(atoi(row[8])) : 1;
all_entries.push_back(e);
}
@@ -332,15 +332,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetInfo e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.petname = row[2] ? row[2] : "";
e.petpower = static_cast<int32_t>(atoi(row[3]));
e.spell_id = static_cast<int32_t>(atoi(row[4]));
e.hp = static_cast<int32_t>(atoi(row[5]));
e.mana = static_cast<int32_t>(atoi(row[6]));
e.petpower = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.spell_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.hp = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.mana = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.size = row[7] ? strtof(row[7], nullptr) : 0;
e.taunting = static_cast<int8_t>(atoi(row[8]));
e.taunting = row[8] ? static_cast<int8_t>(atoi(row[8])) : 1;
all_entries.push_back(e);
}
@@ -127,10 +127,10 @@ public:
if (results.RowCount() == 1) {
CharacterPetInventory e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.slot = static_cast<int32_t>(atoi(row[2]));
e.item_id = static_cast<int32_t>(atoi(row[3]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.item_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
return e;
}
@@ -259,10 +259,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetInventory e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.slot = static_cast<int32_t>(atoi(row[2]));
e.item_id = static_cast<int32_t>(atoi(row[3]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.item_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -287,10 +287,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterPetInventory e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.pet = static_cast<int32_t>(atoi(row[1]));
e.slot = static_cast<int32_t>(atoi(row[2]));
e.item_id = static_cast<int32_t>(atoi(row[3]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.pet = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.slot = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.item_id = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -407,78 +407,78 @@ public:
if (results.RowCount() == 1) {
CharacterStatsRecord e{};
e.character_id = static_cast<int32_t>(atoi(row[0]));
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.status = static_cast<int32_t>(atoi(row[2]));
e.level = static_cast<int32_t>(atoi(row[3]));
e.class_ = static_cast<int32_t>(atoi(row[4]));
e.race = static_cast<int32_t>(atoi(row[5]));
e.aa_points = static_cast<int32_t>(atoi(row[6]));
e.status = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.level = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.class_ = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.race = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.aa_points = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.hp = row[7] ? strtoll(row[7], nullptr, 10) : 0;
e.mana = row[8] ? strtoll(row[8], nullptr, 10) : 0;
e.endurance = row[9] ? strtoll(row[9], nullptr, 10) : 0;
e.ac = static_cast<int32_t>(atoi(row[10]));
e.strength = static_cast<int32_t>(atoi(row[11]));
e.stamina = static_cast<int32_t>(atoi(row[12]));
e.dexterity = static_cast<int32_t>(atoi(row[13]));
e.agility = static_cast<int32_t>(atoi(row[14]));
e.intelligence = static_cast<int32_t>(atoi(row[15]));
e.wisdom = static_cast<int32_t>(atoi(row[16]));
e.charisma = static_cast<int32_t>(atoi(row[17]));
e.magic_resist = static_cast<int32_t>(atoi(row[18]));
e.fire_resist = static_cast<int32_t>(atoi(row[19]));
e.cold_resist = static_cast<int32_t>(atoi(row[20]));
e.poison_resist = static_cast<int32_t>(atoi(row[21]));
e.disease_resist = static_cast<int32_t>(atoi(row[22]));
e.corruption_resist = static_cast<int32_t>(atoi(row[23]));
e.heroic_strength = static_cast<int32_t>(atoi(row[24]));
e.heroic_stamina = static_cast<int32_t>(atoi(row[25]));
e.heroic_dexterity = static_cast<int32_t>(atoi(row[26]));
e.heroic_agility = static_cast<int32_t>(atoi(row[27]));
e.heroic_intelligence = static_cast<int32_t>(atoi(row[28]));
e.heroic_wisdom = static_cast<int32_t>(atoi(row[29]));
e.heroic_charisma = static_cast<int32_t>(atoi(row[30]));
e.heroic_magic_resist = static_cast<int32_t>(atoi(row[31]));
e.heroic_fire_resist = static_cast<int32_t>(atoi(row[32]));
e.heroic_cold_resist = static_cast<int32_t>(atoi(row[33]));
e.heroic_poison_resist = static_cast<int32_t>(atoi(row[34]));
e.heroic_disease_resist = static_cast<int32_t>(atoi(row[35]));
e.heroic_corruption_resist = static_cast<int32_t>(atoi(row[36]));
e.haste = static_cast<int32_t>(atoi(row[37]));
e.accuracy = static_cast<int32_t>(atoi(row[38]));
e.attack = static_cast<int32_t>(atoi(row[39]));
e.avoidance = static_cast<int32_t>(atoi(row[40]));
e.clairvoyance = static_cast<int32_t>(atoi(row[41]));
e.combat_effects = static_cast<int32_t>(atoi(row[42]));
e.damage_shield_mitigation = static_cast<int32_t>(atoi(row[43]));
e.damage_shield = static_cast<int32_t>(atoi(row[44]));
e.dot_shielding = static_cast<int32_t>(atoi(row[45]));
e.hp_regen = static_cast<int32_t>(atoi(row[46]));
e.mana_regen = static_cast<int32_t>(atoi(row[47]));
e.endurance_regen = static_cast<int32_t>(atoi(row[48]));
e.shielding = static_cast<int32_t>(atoi(row[49]));
e.spell_damage = static_cast<int32_t>(atoi(row[50]));
e.spell_shielding = static_cast<int32_t>(atoi(row[51]));
e.strikethrough = static_cast<int32_t>(atoi(row[52]));
e.stun_resist = static_cast<int32_t>(atoi(row[53]));
e.backstab = static_cast<int32_t>(atoi(row[54]));
e.wind = static_cast<int32_t>(atoi(row[55]));
e.brass = static_cast<int32_t>(atoi(row[56]));
e.string = static_cast<int32_t>(atoi(row[57]));
e.percussion = static_cast<int32_t>(atoi(row[58]));
e.singing = static_cast<int32_t>(atoi(row[59]));
e.baking = static_cast<int32_t>(atoi(row[60]));
e.alchemy = static_cast<int32_t>(atoi(row[61]));
e.tailoring = static_cast<int32_t>(atoi(row[62]));
e.blacksmithing = static_cast<int32_t>(atoi(row[63]));
e.fletching = static_cast<int32_t>(atoi(row[64]));
e.brewing = static_cast<int32_t>(atoi(row[65]));
e.jewelry = static_cast<int32_t>(atoi(row[66]));
e.pottery = static_cast<int32_t>(atoi(row[67]));
e.research = static_cast<int32_t>(atoi(row[68]));
e.alcohol = static_cast<int32_t>(atoi(row[69]));
e.fishing = static_cast<int32_t>(atoi(row[70]));
e.tinkering = static_cast<int32_t>(atoi(row[71]));
e.ac = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.strength = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.stamina = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.dexterity = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.agility = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.intelligence = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.wisdom = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.charisma = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.magic_resist = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.fire_resist = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.cold_resist = row[20] ? static_cast<int32_t>(atoi(row[20])) : 0;
e.poison_resist = row[21] ? static_cast<int32_t>(atoi(row[21])) : 0;
e.disease_resist = row[22] ? static_cast<int32_t>(atoi(row[22])) : 0;
e.corruption_resist = row[23] ? static_cast<int32_t>(atoi(row[23])) : 0;
e.heroic_strength = row[24] ? static_cast<int32_t>(atoi(row[24])) : 0;
e.heroic_stamina = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.heroic_dexterity = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.heroic_agility = row[27] ? static_cast<int32_t>(atoi(row[27])) : 0;
e.heroic_intelligence = row[28] ? static_cast<int32_t>(atoi(row[28])) : 0;
e.heroic_wisdom = row[29] ? static_cast<int32_t>(atoi(row[29])) : 0;
e.heroic_charisma = row[30] ? static_cast<int32_t>(atoi(row[30])) : 0;
e.heroic_magic_resist = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.heroic_fire_resist = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
e.heroic_cold_resist = row[33] ? static_cast<int32_t>(atoi(row[33])) : 0;
e.heroic_poison_resist = row[34] ? static_cast<int32_t>(atoi(row[34])) : 0;
e.heroic_disease_resist = row[35] ? static_cast<int32_t>(atoi(row[35])) : 0;
e.heroic_corruption_resist = row[36] ? static_cast<int32_t>(atoi(row[36])) : 0;
e.haste = row[37] ? static_cast<int32_t>(atoi(row[37])) : 0;
e.accuracy = row[38] ? static_cast<int32_t>(atoi(row[38])) : 0;
e.attack = row[39] ? static_cast<int32_t>(atoi(row[39])) : 0;
e.avoidance = row[40] ? static_cast<int32_t>(atoi(row[40])) : 0;
e.clairvoyance = row[41] ? static_cast<int32_t>(atoi(row[41])) : 0;
e.combat_effects = row[42] ? static_cast<int32_t>(atoi(row[42])) : 0;
e.damage_shield_mitigation = row[43] ? static_cast<int32_t>(atoi(row[43])) : 0;
e.damage_shield = row[44] ? static_cast<int32_t>(atoi(row[44])) : 0;
e.dot_shielding = row[45] ? static_cast<int32_t>(atoi(row[45])) : 0;
e.hp_regen = row[46] ? static_cast<int32_t>(atoi(row[46])) : 0;
e.mana_regen = row[47] ? static_cast<int32_t>(atoi(row[47])) : 0;
e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0;
e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0;
e.spell_shielding = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0;
e.strikethrough = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0;
e.stun_resist = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0;
e.backstab = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0;
e.wind = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0;
e.brass = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0;
e.string = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0;
e.percussion = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
e.singing = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0;
e.baking = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0;
e.alchemy = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0;
e.tailoring = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0;
e.blacksmithing = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0;
e.fletching = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0;
e.brewing = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0;
e.jewelry = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0;
e.pottery = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0;
e.research = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0;
e.alcohol = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0;
e.fishing = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0;
e.tinkering = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0;
e.created_at = strtoll(row[72] ? row[72] : "-1", nullptr, 10);
e.updated_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10);
@@ -819,78 +819,78 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterStatsRecord e{};
e.character_id = static_cast<int32_t>(atoi(row[0]));
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.status = static_cast<int32_t>(atoi(row[2]));
e.level = static_cast<int32_t>(atoi(row[3]));
e.class_ = static_cast<int32_t>(atoi(row[4]));
e.race = static_cast<int32_t>(atoi(row[5]));
e.aa_points = static_cast<int32_t>(atoi(row[6]));
e.status = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.level = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.class_ = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.race = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.aa_points = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.hp = row[7] ? strtoll(row[7], nullptr, 10) : 0;
e.mana = row[8] ? strtoll(row[8], nullptr, 10) : 0;
e.endurance = row[9] ? strtoll(row[9], nullptr, 10) : 0;
e.ac = static_cast<int32_t>(atoi(row[10]));
e.strength = static_cast<int32_t>(atoi(row[11]));
e.stamina = static_cast<int32_t>(atoi(row[12]));
e.dexterity = static_cast<int32_t>(atoi(row[13]));
e.agility = static_cast<int32_t>(atoi(row[14]));
e.intelligence = static_cast<int32_t>(atoi(row[15]));
e.wisdom = static_cast<int32_t>(atoi(row[16]));
e.charisma = static_cast<int32_t>(atoi(row[17]));
e.magic_resist = static_cast<int32_t>(atoi(row[18]));
e.fire_resist = static_cast<int32_t>(atoi(row[19]));
e.cold_resist = static_cast<int32_t>(atoi(row[20]));
e.poison_resist = static_cast<int32_t>(atoi(row[21]));
e.disease_resist = static_cast<int32_t>(atoi(row[22]));
e.corruption_resist = static_cast<int32_t>(atoi(row[23]));
e.heroic_strength = static_cast<int32_t>(atoi(row[24]));
e.heroic_stamina = static_cast<int32_t>(atoi(row[25]));
e.heroic_dexterity = static_cast<int32_t>(atoi(row[26]));
e.heroic_agility = static_cast<int32_t>(atoi(row[27]));
e.heroic_intelligence = static_cast<int32_t>(atoi(row[28]));
e.heroic_wisdom = static_cast<int32_t>(atoi(row[29]));
e.heroic_charisma = static_cast<int32_t>(atoi(row[30]));
e.heroic_magic_resist = static_cast<int32_t>(atoi(row[31]));
e.heroic_fire_resist = static_cast<int32_t>(atoi(row[32]));
e.heroic_cold_resist = static_cast<int32_t>(atoi(row[33]));
e.heroic_poison_resist = static_cast<int32_t>(atoi(row[34]));
e.heroic_disease_resist = static_cast<int32_t>(atoi(row[35]));
e.heroic_corruption_resist = static_cast<int32_t>(atoi(row[36]));
e.haste = static_cast<int32_t>(atoi(row[37]));
e.accuracy = static_cast<int32_t>(atoi(row[38]));
e.attack = static_cast<int32_t>(atoi(row[39]));
e.avoidance = static_cast<int32_t>(atoi(row[40]));
e.clairvoyance = static_cast<int32_t>(atoi(row[41]));
e.combat_effects = static_cast<int32_t>(atoi(row[42]));
e.damage_shield_mitigation = static_cast<int32_t>(atoi(row[43]));
e.damage_shield = static_cast<int32_t>(atoi(row[44]));
e.dot_shielding = static_cast<int32_t>(atoi(row[45]));
e.hp_regen = static_cast<int32_t>(atoi(row[46]));
e.mana_regen = static_cast<int32_t>(atoi(row[47]));
e.endurance_regen = static_cast<int32_t>(atoi(row[48]));
e.shielding = static_cast<int32_t>(atoi(row[49]));
e.spell_damage = static_cast<int32_t>(atoi(row[50]));
e.spell_shielding = static_cast<int32_t>(atoi(row[51]));
e.strikethrough = static_cast<int32_t>(atoi(row[52]));
e.stun_resist = static_cast<int32_t>(atoi(row[53]));
e.backstab = static_cast<int32_t>(atoi(row[54]));
e.wind = static_cast<int32_t>(atoi(row[55]));
e.brass = static_cast<int32_t>(atoi(row[56]));
e.string = static_cast<int32_t>(atoi(row[57]));
e.percussion = static_cast<int32_t>(atoi(row[58]));
e.singing = static_cast<int32_t>(atoi(row[59]));
e.baking = static_cast<int32_t>(atoi(row[60]));
e.alchemy = static_cast<int32_t>(atoi(row[61]));
e.tailoring = static_cast<int32_t>(atoi(row[62]));
e.blacksmithing = static_cast<int32_t>(atoi(row[63]));
e.fletching = static_cast<int32_t>(atoi(row[64]));
e.brewing = static_cast<int32_t>(atoi(row[65]));
e.jewelry = static_cast<int32_t>(atoi(row[66]));
e.pottery = static_cast<int32_t>(atoi(row[67]));
e.research = static_cast<int32_t>(atoi(row[68]));
e.alcohol = static_cast<int32_t>(atoi(row[69]));
e.fishing = static_cast<int32_t>(atoi(row[70]));
e.tinkering = static_cast<int32_t>(atoi(row[71]));
e.ac = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.strength = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.stamina = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.dexterity = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.agility = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.intelligence = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.wisdom = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.charisma = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.magic_resist = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.fire_resist = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.cold_resist = row[20] ? static_cast<int32_t>(atoi(row[20])) : 0;
e.poison_resist = row[21] ? static_cast<int32_t>(atoi(row[21])) : 0;
e.disease_resist = row[22] ? static_cast<int32_t>(atoi(row[22])) : 0;
e.corruption_resist = row[23] ? static_cast<int32_t>(atoi(row[23])) : 0;
e.heroic_strength = row[24] ? static_cast<int32_t>(atoi(row[24])) : 0;
e.heroic_stamina = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.heroic_dexterity = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.heroic_agility = row[27] ? static_cast<int32_t>(atoi(row[27])) : 0;
e.heroic_intelligence = row[28] ? static_cast<int32_t>(atoi(row[28])) : 0;
e.heroic_wisdom = row[29] ? static_cast<int32_t>(atoi(row[29])) : 0;
e.heroic_charisma = row[30] ? static_cast<int32_t>(atoi(row[30])) : 0;
e.heroic_magic_resist = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.heroic_fire_resist = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
e.heroic_cold_resist = row[33] ? static_cast<int32_t>(atoi(row[33])) : 0;
e.heroic_poison_resist = row[34] ? static_cast<int32_t>(atoi(row[34])) : 0;
e.heroic_disease_resist = row[35] ? static_cast<int32_t>(atoi(row[35])) : 0;
e.heroic_corruption_resist = row[36] ? static_cast<int32_t>(atoi(row[36])) : 0;
e.haste = row[37] ? static_cast<int32_t>(atoi(row[37])) : 0;
e.accuracy = row[38] ? static_cast<int32_t>(atoi(row[38])) : 0;
e.attack = row[39] ? static_cast<int32_t>(atoi(row[39])) : 0;
e.avoidance = row[40] ? static_cast<int32_t>(atoi(row[40])) : 0;
e.clairvoyance = row[41] ? static_cast<int32_t>(atoi(row[41])) : 0;
e.combat_effects = row[42] ? static_cast<int32_t>(atoi(row[42])) : 0;
e.damage_shield_mitigation = row[43] ? static_cast<int32_t>(atoi(row[43])) : 0;
e.damage_shield = row[44] ? static_cast<int32_t>(atoi(row[44])) : 0;
e.dot_shielding = row[45] ? static_cast<int32_t>(atoi(row[45])) : 0;
e.hp_regen = row[46] ? static_cast<int32_t>(atoi(row[46])) : 0;
e.mana_regen = row[47] ? static_cast<int32_t>(atoi(row[47])) : 0;
e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0;
e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0;
e.spell_shielding = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0;
e.strikethrough = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0;
e.stun_resist = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0;
e.backstab = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0;
e.wind = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0;
e.brass = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0;
e.string = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0;
e.percussion = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
e.singing = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0;
e.baking = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0;
e.alchemy = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0;
e.tailoring = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0;
e.blacksmithing = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0;
e.fletching = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0;
e.brewing = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0;
e.jewelry = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0;
e.pottery = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0;
e.research = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0;
e.alcohol = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0;
e.fishing = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0;
e.tinkering = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0;
e.created_at = strtoll(row[72] ? row[72] : "-1", nullptr, 10);
e.updated_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10);
@@ -917,78 +917,78 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterStatsRecord e{};
e.character_id = static_cast<int32_t>(atoi(row[0]));
e.character_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.status = static_cast<int32_t>(atoi(row[2]));
e.level = static_cast<int32_t>(atoi(row[3]));
e.class_ = static_cast<int32_t>(atoi(row[4]));
e.race = static_cast<int32_t>(atoi(row[5]));
e.aa_points = static_cast<int32_t>(atoi(row[6]));
e.status = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.level = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.class_ = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.race = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.aa_points = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.hp = row[7] ? strtoll(row[7], nullptr, 10) : 0;
e.mana = row[8] ? strtoll(row[8], nullptr, 10) : 0;
e.endurance = row[9] ? strtoll(row[9], nullptr, 10) : 0;
e.ac = static_cast<int32_t>(atoi(row[10]));
e.strength = static_cast<int32_t>(atoi(row[11]));
e.stamina = static_cast<int32_t>(atoi(row[12]));
e.dexterity = static_cast<int32_t>(atoi(row[13]));
e.agility = static_cast<int32_t>(atoi(row[14]));
e.intelligence = static_cast<int32_t>(atoi(row[15]));
e.wisdom = static_cast<int32_t>(atoi(row[16]));
e.charisma = static_cast<int32_t>(atoi(row[17]));
e.magic_resist = static_cast<int32_t>(atoi(row[18]));
e.fire_resist = static_cast<int32_t>(atoi(row[19]));
e.cold_resist = static_cast<int32_t>(atoi(row[20]));
e.poison_resist = static_cast<int32_t>(atoi(row[21]));
e.disease_resist = static_cast<int32_t>(atoi(row[22]));
e.corruption_resist = static_cast<int32_t>(atoi(row[23]));
e.heroic_strength = static_cast<int32_t>(atoi(row[24]));
e.heroic_stamina = static_cast<int32_t>(atoi(row[25]));
e.heroic_dexterity = static_cast<int32_t>(atoi(row[26]));
e.heroic_agility = static_cast<int32_t>(atoi(row[27]));
e.heroic_intelligence = static_cast<int32_t>(atoi(row[28]));
e.heroic_wisdom = static_cast<int32_t>(atoi(row[29]));
e.heroic_charisma = static_cast<int32_t>(atoi(row[30]));
e.heroic_magic_resist = static_cast<int32_t>(atoi(row[31]));
e.heroic_fire_resist = static_cast<int32_t>(atoi(row[32]));
e.heroic_cold_resist = static_cast<int32_t>(atoi(row[33]));
e.heroic_poison_resist = static_cast<int32_t>(atoi(row[34]));
e.heroic_disease_resist = static_cast<int32_t>(atoi(row[35]));
e.heroic_corruption_resist = static_cast<int32_t>(atoi(row[36]));
e.haste = static_cast<int32_t>(atoi(row[37]));
e.accuracy = static_cast<int32_t>(atoi(row[38]));
e.attack = static_cast<int32_t>(atoi(row[39]));
e.avoidance = static_cast<int32_t>(atoi(row[40]));
e.clairvoyance = static_cast<int32_t>(atoi(row[41]));
e.combat_effects = static_cast<int32_t>(atoi(row[42]));
e.damage_shield_mitigation = static_cast<int32_t>(atoi(row[43]));
e.damage_shield = static_cast<int32_t>(atoi(row[44]));
e.dot_shielding = static_cast<int32_t>(atoi(row[45]));
e.hp_regen = static_cast<int32_t>(atoi(row[46]));
e.mana_regen = static_cast<int32_t>(atoi(row[47]));
e.endurance_regen = static_cast<int32_t>(atoi(row[48]));
e.shielding = static_cast<int32_t>(atoi(row[49]));
e.spell_damage = static_cast<int32_t>(atoi(row[50]));
e.spell_shielding = static_cast<int32_t>(atoi(row[51]));
e.strikethrough = static_cast<int32_t>(atoi(row[52]));
e.stun_resist = static_cast<int32_t>(atoi(row[53]));
e.backstab = static_cast<int32_t>(atoi(row[54]));
e.wind = static_cast<int32_t>(atoi(row[55]));
e.brass = static_cast<int32_t>(atoi(row[56]));
e.string = static_cast<int32_t>(atoi(row[57]));
e.percussion = static_cast<int32_t>(atoi(row[58]));
e.singing = static_cast<int32_t>(atoi(row[59]));
e.baking = static_cast<int32_t>(atoi(row[60]));
e.alchemy = static_cast<int32_t>(atoi(row[61]));
e.tailoring = static_cast<int32_t>(atoi(row[62]));
e.blacksmithing = static_cast<int32_t>(atoi(row[63]));
e.fletching = static_cast<int32_t>(atoi(row[64]));
e.brewing = static_cast<int32_t>(atoi(row[65]));
e.jewelry = static_cast<int32_t>(atoi(row[66]));
e.pottery = static_cast<int32_t>(atoi(row[67]));
e.research = static_cast<int32_t>(atoi(row[68]));
e.alcohol = static_cast<int32_t>(atoi(row[69]));
e.fishing = static_cast<int32_t>(atoi(row[70]));
e.tinkering = static_cast<int32_t>(atoi(row[71]));
e.ac = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.strength = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.stamina = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.dexterity = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.agility = row[14] ? static_cast<int32_t>(atoi(row[14])) : 0;
e.intelligence = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.wisdom = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
e.charisma = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.magic_resist = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.fire_resist = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.cold_resist = row[20] ? static_cast<int32_t>(atoi(row[20])) : 0;
e.poison_resist = row[21] ? static_cast<int32_t>(atoi(row[21])) : 0;
e.disease_resist = row[22] ? static_cast<int32_t>(atoi(row[22])) : 0;
e.corruption_resist = row[23] ? static_cast<int32_t>(atoi(row[23])) : 0;
e.heroic_strength = row[24] ? static_cast<int32_t>(atoi(row[24])) : 0;
e.heroic_stamina = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.heroic_dexterity = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.heroic_agility = row[27] ? static_cast<int32_t>(atoi(row[27])) : 0;
e.heroic_intelligence = row[28] ? static_cast<int32_t>(atoi(row[28])) : 0;
e.heroic_wisdom = row[29] ? static_cast<int32_t>(atoi(row[29])) : 0;
e.heroic_charisma = row[30] ? static_cast<int32_t>(atoi(row[30])) : 0;
e.heroic_magic_resist = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.heroic_fire_resist = row[32] ? static_cast<int32_t>(atoi(row[32])) : 0;
e.heroic_cold_resist = row[33] ? static_cast<int32_t>(atoi(row[33])) : 0;
e.heroic_poison_resist = row[34] ? static_cast<int32_t>(atoi(row[34])) : 0;
e.heroic_disease_resist = row[35] ? static_cast<int32_t>(atoi(row[35])) : 0;
e.heroic_corruption_resist = row[36] ? static_cast<int32_t>(atoi(row[36])) : 0;
e.haste = row[37] ? static_cast<int32_t>(atoi(row[37])) : 0;
e.accuracy = row[38] ? static_cast<int32_t>(atoi(row[38])) : 0;
e.attack = row[39] ? static_cast<int32_t>(atoi(row[39])) : 0;
e.avoidance = row[40] ? static_cast<int32_t>(atoi(row[40])) : 0;
e.clairvoyance = row[41] ? static_cast<int32_t>(atoi(row[41])) : 0;
e.combat_effects = row[42] ? static_cast<int32_t>(atoi(row[42])) : 0;
e.damage_shield_mitigation = row[43] ? static_cast<int32_t>(atoi(row[43])) : 0;
e.damage_shield = row[44] ? static_cast<int32_t>(atoi(row[44])) : 0;
e.dot_shielding = row[45] ? static_cast<int32_t>(atoi(row[45])) : 0;
e.hp_regen = row[46] ? static_cast<int32_t>(atoi(row[46])) : 0;
e.mana_regen = row[47] ? static_cast<int32_t>(atoi(row[47])) : 0;
e.endurance_regen = row[48] ? static_cast<int32_t>(atoi(row[48])) : 0;
e.shielding = row[49] ? static_cast<int32_t>(atoi(row[49])) : 0;
e.spell_damage = row[50] ? static_cast<int32_t>(atoi(row[50])) : 0;
e.spell_shielding = row[51] ? static_cast<int32_t>(atoi(row[51])) : 0;
e.strikethrough = row[52] ? static_cast<int32_t>(atoi(row[52])) : 0;
e.stun_resist = row[53] ? static_cast<int32_t>(atoi(row[53])) : 0;
e.backstab = row[54] ? static_cast<int32_t>(atoi(row[54])) : 0;
e.wind = row[55] ? static_cast<int32_t>(atoi(row[55])) : 0;
e.brass = row[56] ? static_cast<int32_t>(atoi(row[56])) : 0;
e.string = row[57] ? static_cast<int32_t>(atoi(row[57])) : 0;
e.percussion = row[58] ? static_cast<int32_t>(atoi(row[58])) : 0;
e.singing = row[59] ? static_cast<int32_t>(atoi(row[59])) : 0;
e.baking = row[60] ? static_cast<int32_t>(atoi(row[60])) : 0;
e.alchemy = row[61] ? static_cast<int32_t>(atoi(row[61])) : 0;
e.tailoring = row[62] ? static_cast<int32_t>(atoi(row[62])) : 0;
e.blacksmithing = row[63] ? static_cast<int32_t>(atoi(row[63])) : 0;
e.fletching = row[64] ? static_cast<int32_t>(atoi(row[64])) : 0;
e.brewing = row[65] ? static_cast<int32_t>(atoi(row[65])) : 0;
e.jewelry = row[66] ? static_cast<int32_t>(atoi(row[66])) : 0;
e.pottery = row[67] ? static_cast<int32_t>(atoi(row[67])) : 0;
e.research = row[68] ? static_cast<int32_t>(atoi(row[68])) : 0;
e.alcohol = row[69] ? static_cast<int32_t>(atoi(row[69])) : 0;
e.fishing = row[70] ? static_cast<int32_t>(atoi(row[70])) : 0;
e.tinkering = row[71] ? static_cast<int32_t>(atoi(row[71])) : 0;
e.created_at = strtoll(row[72] ? row[72] : "-1", nullptr, 10);
e.updated_at = strtoll(row[73] ? row[73] : "-1", nullptr, 10);
@@ -138,8 +138,8 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.task_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.timer_type = static_cast<int32_t>(atoi(row[3]));
e.timer_group = static_cast<int32_t>(atoi(row[4]));
e.timer_type = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.timer_group = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.expire_time = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
return e;
@@ -277,8 +277,8 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.task_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.timer_type = static_cast<int32_t>(atoi(row[3]));
e.timer_group = static_cast<int32_t>(atoi(row[4]));
e.timer_type = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.timer_group = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.expire_time = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
all_entries.push_back(e);
@@ -307,8 +307,8 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.task_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.timer_type = static_cast<int32_t>(atoi(row[3]));
e.timer_group = static_cast<int32_t>(atoi(row[4]));
e.timer_type = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.timer_group = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.expire_time = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
all_entries.push_back(e);
@@ -138,9 +138,9 @@ public:
e.charid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.taskid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.slot = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[3]));
e.type = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
e.acceptedtime = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.was_rewarded = static_cast<int8_t>(atoi(row[5]));
e.was_rewarded = row[5] ? static_cast<int8_t>(atoi(row[5])) : 0;
return e;
}
@@ -278,9 +278,9 @@ public:
e.charid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.taskid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.slot = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[3]));
e.type = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
e.acceptedtime = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.was_rewarded = static_cast<int8_t>(atoi(row[5]));
e.was_rewarded = row[5] ? static_cast<int8_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -308,9 +308,9 @@ public:
e.charid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.taskid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.slot = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[3]));
e.type = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
e.acceptedtime = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.was_rewarded = static_cast<int8_t>(atoi(row[5]));
e.was_rewarded = row[5] ? static_cast<int8_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -127,7 +127,7 @@ public:
if (results.RowCount() == 1) {
CharacterTribute e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.tier = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.tribute = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -258,7 +258,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterTribute e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.tier = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.tribute = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -286,7 +286,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
CharacterTribute e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.character_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.tier = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.tribute = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -119,7 +119,7 @@ public:
if (results.RowCount() == 1) {
ChatchannelReservedNames e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
return e;
@@ -242,7 +242,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
ChatchannelReservedNames e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
all_entries.push_back(e);
@@ -268,7 +268,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
ChatchannelReservedNames e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
all_entries.push_back(e);
@@ -131,11 +131,11 @@ public:
if (results.RowCount() == 1) {
Chatchannels e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.owner = row[2] ? row[2] : "";
e.password = row[3] ? row[3] : "";
e.minstatus = static_cast<int32_t>(atoi(row[4]));
e.minstatus = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
return e;
}
@@ -266,11 +266,11 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Chatchannels e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.owner = row[2] ? row[2] : "";
e.password = row[3] ? row[3] : "";
e.minstatus = static_cast<int32_t>(atoi(row[4]));
e.minstatus = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
all_entries.push_back(e);
}
@@ -295,11 +295,11 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Chatchannels e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.owner = row[2] ? row[2] : "";
e.password = row[3] ? row[3] : "";
e.minstatus = static_cast<int32_t>(atoi(row[4]));
e.minstatus = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
all_entries.push_back(e);
}
@@ -132,8 +132,8 @@ public:
CompletedSharedTaskActivityState e{};
e.shared_task_id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.activity_id = static_cast<int32_t>(atoi(row[1]));
e.done_count = static_cast<int32_t>(atoi(row[2]));
e.activity_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.done_count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
@@ -268,8 +268,8 @@ public:
CompletedSharedTaskActivityState e{};
e.shared_task_id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.activity_id = static_cast<int32_t>(atoi(row[1]));
e.done_count = static_cast<int32_t>(atoi(row[2]));
e.activity_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.done_count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
@@ -297,8 +297,8 @@ public:
CompletedSharedTaskActivityState e{};
e.shared_task_id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.activity_id = static_cast<int32_t>(atoi(row[1]));
e.done_count = static_cast<int32_t>(atoi(row[2]));
e.activity_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.done_count = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.updated_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
e.completed_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
@@ -125,7 +125,7 @@ public:
e.shared_task_id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.character_id = row[1] ? strtoll(row[1], nullptr, 10) : 0;
e.is_leader = static_cast<int8_t>(atoi(row[2]));
e.is_leader = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
return e;
}
@@ -253,7 +253,7 @@ public:
e.shared_task_id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.character_id = row[1] ? strtoll(row[1], nullptr, 10) : 0;
e.is_leader = static_cast<int8_t>(atoi(row[2]));
e.is_leader = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -280,7 +280,7 @@ public:
e.shared_task_id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.character_id = row[1] ? strtoll(row[1], nullptr, 10) : 0;
e.is_leader = static_cast<int8_t>(atoi(row[2]));
e.is_leader = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -136,11 +136,11 @@ public:
CompletedSharedTasks e{};
e.id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.task_id = static_cast<int32_t>(atoi(row[1]));
e.task_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10);
e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
e.is_locked = static_cast<int8_t>(atoi(row[5]));
e.is_locked = row[5] ? static_cast<int8_t>(atoi(row[5])) : 0;
return e;
}
@@ -276,11 +276,11 @@ public:
CompletedSharedTasks e{};
e.id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.task_id = static_cast<int32_t>(atoi(row[1]));
e.task_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10);
e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
e.is_locked = static_cast<int8_t>(atoi(row[5]));
e.is_locked = row[5] ? static_cast<int8_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -306,11 +306,11 @@ public:
CompletedSharedTasks e{};
e.id = row[0] ? strtoll(row[0], nullptr, 10) : 0;
e.task_id = static_cast<int32_t>(atoi(row[1]));
e.task_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.accepted_time = strtoll(row[2] ? row[2] : "-1", nullptr, 10);
e.expire_time = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
e.completion_time = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
e.is_locked = static_cast<int8_t>(atoi(row[5]));
e.is_locked = row[5] ? static_cast<int8_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -130,7 +130,7 @@ public:
e.charid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.completedtime = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.taskid = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.activityid = static_cast<int32_t>(atoi(row[3]));
e.activityid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
return e;
}
@@ -262,7 +262,7 @@ public:
e.charid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.completedtime = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.taskid = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.activityid = static_cast<int32_t>(atoi(row[3]));
e.activityid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -290,7 +290,7 @@ public:
e.charid = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.completedtime = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.taskid = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.activityid = static_cast<int32_t>(atoi(row[3]));
e.activityid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -127,9 +127,9 @@ public:
if (results.RowCount() == 1) {
ContentFlags e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.flag_name = row[1] ? row[1] : "";
e.enabled = static_cast<int8_t>(atoi(row[2]));
e.enabled = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.notes = row[3] ? row[3] : "";
return e;
@@ -258,9 +258,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
ContentFlags e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.flag_name = row[1] ? row[1] : "";
e.enabled = static_cast<int8_t>(atoi(row[2]));
e.enabled = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.notes = row[3] ? row[3] : "";
all_entries.push_back(e);
@@ -286,9 +286,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
ContentFlags e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.flag_name = row[1] ? row[1] : "";
e.enabled = static_cast<int8_t>(atoi(row[2]));
e.enabled = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.notes = row[3] ? row[3] : "";
all_entries.push_back(e);
@@ -123,8 +123,8 @@ public:
if (results.RowCount() == 1) {
DbStr e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.type = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.type = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.value = row[2] ? row[2] : "";
return e;
@@ -251,8 +251,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
DbStr e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.type = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.type = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.value = row[2] ? row[2] : "";
all_entries.push_back(e);
@@ -278,8 +278,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
DbStr e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.type = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.type = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.value = row[2] ? row[2] : "";
all_entries.push_back(e);
@@ -131,7 +131,7 @@ public:
if (results.RowCount() == 1) {
DiscordWebhooks e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.webhook_name = row[1] ? row[1] : "";
e.webhook_url = row[2] ? row[2] : "";
e.created_at = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
@@ -266,7 +266,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
DiscordWebhooks e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.webhook_name = row[1] ? row[1] : "";
e.webhook_url = row[2] ? row[2] : "";
e.created_at = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
@@ -295,7 +295,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
DiscordWebhooks e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.webhook_name = row[1] ? row[1] : "";
e.webhook_url = row[2] ? row[2] : "";
e.created_at = strtoll(row[3] ? row[3] : "-1", nullptr, 10);
@@ -130,7 +130,7 @@ public:
e.item_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.char_name = row[1] ? row[1] : "";
e.discovered_date = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.account_status = static_cast<int32_t>(atoi(row[3]));
e.account_status = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
return e;
}
@@ -262,7 +262,7 @@ public:
e.item_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.char_name = row[1] ? row[1] : "";
e.discovered_date = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.account_status = static_cast<int32_t>(atoi(row[3]));
e.account_status = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -290,7 +290,7 @@ public:
e.item_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.char_name = row[1] ? row[1] : "";
e.discovered_date = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
e.account_status = static_cast<int32_t>(atoi(row[3]));
e.account_status = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -255,40 +255,40 @@ public:
if (results.RowCount() == 1) {
Doors e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.doorid = static_cast<int16_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.doorid = row[1] ? static_cast<int16_t>(atoi(row[1])) : 0;
e.zone = row[2] ? row[2] : "";
e.version = static_cast<int16_t>(atoi(row[3]));
e.version = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.name = row[4] ? row[4] : "";
e.pos_y = row[5] ? strtof(row[5], nullptr) : 0;
e.pos_x = row[6] ? strtof(row[6], nullptr) : 0;
e.pos_z = row[7] ? strtof(row[7], nullptr) : 0;
e.heading = row[8] ? strtof(row[8], nullptr) : 0;
e.opentype = static_cast<int16_t>(atoi(row[9]));
e.guild = static_cast<int16_t>(atoi(row[10]));
e.lockpick = static_cast<int16_t>(atoi(row[11]));
e.keyitem = static_cast<int32_t>(atoi(row[12]));
e.opentype = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
e.guild = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.lockpick = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
e.keyitem = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.nokeyring = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.triggerdoor = static_cast<int16_t>(atoi(row[14]));
e.triggertype = static_cast<int16_t>(atoi(row[15]));
e.disable_timer = static_cast<int8_t>(atoi(row[16]));
e.doorisopen = static_cast<int16_t>(atoi(row[17]));
e.door_param = static_cast<int32_t>(atoi(row[18]));
e.dest_zone = row[19] ? row[19] : "";
e.triggerdoor = row[14] ? static_cast<int16_t>(atoi(row[14])) : 0;
e.triggertype = row[15] ? static_cast<int16_t>(atoi(row[15])) : 0;
e.disable_timer = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.doorisopen = row[17] ? static_cast<int16_t>(atoi(row[17])) : 0;
e.door_param = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.dest_zone = row[19] ? row[19] : "NONE";
e.dest_instance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.dest_x = row[21] ? strtof(row[21], nullptr) : 0;
e.dest_y = row[22] ? strtof(row[22], nullptr) : 0;
e.dest_z = row[23] ? strtof(row[23], nullptr) : 0;
e.dest_heading = row[24] ? strtof(row[24], nullptr) : 0;
e.invert_state = static_cast<int32_t>(atoi(row[25]));
e.incline = static_cast<int32_t>(atoi(row[26]));
e.invert_state = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.incline = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.size = row[27] ? static_cast<uint16_t>(strtoul(row[27], nullptr, 10)) : 100;
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = static_cast<int16_t>(atoi(row[30]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[31]));
e.min_expansion = static_cast<int8_t>(atoi(row[32]));
e.max_expansion = static_cast<int8_t>(atoi(row[33]));
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.content_flags = row[34] ? row[34] : "";
e.content_flags_disabled = row[35] ? row[35] : "";
@@ -514,40 +514,40 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Doors e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.doorid = static_cast<int16_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.doorid = row[1] ? static_cast<int16_t>(atoi(row[1])) : 0;
e.zone = row[2] ? row[2] : "";
e.version = static_cast<int16_t>(atoi(row[3]));
e.version = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.name = row[4] ? row[4] : "";
e.pos_y = row[5] ? strtof(row[5], nullptr) : 0;
e.pos_x = row[6] ? strtof(row[6], nullptr) : 0;
e.pos_z = row[7] ? strtof(row[7], nullptr) : 0;
e.heading = row[8] ? strtof(row[8], nullptr) : 0;
e.opentype = static_cast<int16_t>(atoi(row[9]));
e.guild = static_cast<int16_t>(atoi(row[10]));
e.lockpick = static_cast<int16_t>(atoi(row[11]));
e.keyitem = static_cast<int32_t>(atoi(row[12]));
e.opentype = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
e.guild = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.lockpick = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
e.keyitem = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.nokeyring = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.triggerdoor = static_cast<int16_t>(atoi(row[14]));
e.triggertype = static_cast<int16_t>(atoi(row[15]));
e.disable_timer = static_cast<int8_t>(atoi(row[16]));
e.doorisopen = static_cast<int16_t>(atoi(row[17]));
e.door_param = static_cast<int32_t>(atoi(row[18]));
e.dest_zone = row[19] ? row[19] : "";
e.triggerdoor = row[14] ? static_cast<int16_t>(atoi(row[14])) : 0;
e.triggertype = row[15] ? static_cast<int16_t>(atoi(row[15])) : 0;
e.disable_timer = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.doorisopen = row[17] ? static_cast<int16_t>(atoi(row[17])) : 0;
e.door_param = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.dest_zone = row[19] ? row[19] : "NONE";
e.dest_instance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.dest_x = row[21] ? strtof(row[21], nullptr) : 0;
e.dest_y = row[22] ? strtof(row[22], nullptr) : 0;
e.dest_z = row[23] ? strtof(row[23], nullptr) : 0;
e.dest_heading = row[24] ? strtof(row[24], nullptr) : 0;
e.invert_state = static_cast<int32_t>(atoi(row[25]));
e.incline = static_cast<int32_t>(atoi(row[26]));
e.invert_state = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.incline = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.size = row[27] ? static_cast<uint16_t>(strtoul(row[27], nullptr, 10)) : 100;
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = static_cast<int16_t>(atoi(row[30]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[31]));
e.min_expansion = static_cast<int8_t>(atoi(row[32]));
e.max_expansion = static_cast<int8_t>(atoi(row[33]));
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.content_flags = row[34] ? row[34] : "";
e.content_flags_disabled = row[35] ? row[35] : "";
@@ -574,40 +574,40 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Doors e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.doorid = static_cast<int16_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.doorid = row[1] ? static_cast<int16_t>(atoi(row[1])) : 0;
e.zone = row[2] ? row[2] : "";
e.version = static_cast<int16_t>(atoi(row[3]));
e.version = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.name = row[4] ? row[4] : "";
e.pos_y = row[5] ? strtof(row[5], nullptr) : 0;
e.pos_x = row[6] ? strtof(row[6], nullptr) : 0;
e.pos_z = row[7] ? strtof(row[7], nullptr) : 0;
e.heading = row[8] ? strtof(row[8], nullptr) : 0;
e.opentype = static_cast<int16_t>(atoi(row[9]));
e.guild = static_cast<int16_t>(atoi(row[10]));
e.lockpick = static_cast<int16_t>(atoi(row[11]));
e.keyitem = static_cast<int32_t>(atoi(row[12]));
e.opentype = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
e.guild = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.lockpick = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
e.keyitem = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.nokeyring = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.triggerdoor = static_cast<int16_t>(atoi(row[14]));
e.triggertype = static_cast<int16_t>(atoi(row[15]));
e.disable_timer = static_cast<int8_t>(atoi(row[16]));
e.doorisopen = static_cast<int16_t>(atoi(row[17]));
e.door_param = static_cast<int32_t>(atoi(row[18]));
e.dest_zone = row[19] ? row[19] : "";
e.triggerdoor = row[14] ? static_cast<int16_t>(atoi(row[14])) : 0;
e.triggertype = row[15] ? static_cast<int16_t>(atoi(row[15])) : 0;
e.disable_timer = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.doorisopen = row[17] ? static_cast<int16_t>(atoi(row[17])) : 0;
e.door_param = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.dest_zone = row[19] ? row[19] : "NONE";
e.dest_instance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.dest_x = row[21] ? strtof(row[21], nullptr) : 0;
e.dest_y = row[22] ? strtof(row[22], nullptr) : 0;
e.dest_z = row[23] ? strtof(row[23], nullptr) : 0;
e.dest_heading = row[24] ? strtof(row[24], nullptr) : 0;
e.invert_state = static_cast<int32_t>(atoi(row[25]));
e.incline = static_cast<int32_t>(atoi(row[26]));
e.invert_state = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.incline = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.size = row[27] ? static_cast<uint16_t>(strtoul(row[27], nullptr, 10)) : 100;
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = static_cast<int16_t>(atoi(row[30]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[31]));
e.min_expansion = static_cast<int8_t>(atoi(row[32]));
e.max_expansion = static_cast<int8_t>(atoi(row[33]));
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.content_flags = row[34] ? row[34] : "";
e.content_flags_disabled = row[35] ? row[35] : "";
@@ -200,23 +200,23 @@ public:
DynamicZoneTemplates e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.zone_version = static_cast<int32_t>(atoi(row[2]));
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.zone_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.name = row[3] ? row[3] : "";
e.min_players = static_cast<int32_t>(atoi(row[4]));
e.max_players = static_cast<int32_t>(atoi(row[5]));
e.duration_seconds = static_cast<int32_t>(atoi(row[6]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[7]));
e.compass_zone_id = static_cast<int32_t>(atoi(row[8]));
e.min_players = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.max_players = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.duration_seconds = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.dz_switch_id = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.compass_zone_id = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.compass_x = row[9] ? strtof(row[9], nullptr) : 0;
e.compass_y = row[10] ? strtof(row[10], nullptr) : 0;
e.compass_z = row[11] ? strtof(row[11], nullptr) : 0;
e.return_zone_id = static_cast<int32_t>(atoi(row[12]));
e.return_zone_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.return_x = row[13] ? strtof(row[13], nullptr) : 0;
e.return_y = row[14] ? strtof(row[14], nullptr) : 0;
e.return_z = row[15] ? strtof(row[15], nullptr) : 0;
e.return_h = row[16] ? strtof(row[16], nullptr) : 0;
e.override_zone_in = static_cast<int8_t>(atoi(row[17]));
e.override_zone_in = row[17] ? static_cast<int8_t>(atoi(row[17])) : 0;
e.zone_in_x = row[18] ? strtof(row[18], nullptr) : 0;
e.zone_in_y = row[19] ? strtof(row[19], nullptr) : 0;
e.zone_in_z = row[20] ? strtof(row[20], nullptr) : 0;
@@ -403,23 +403,23 @@ public:
DynamicZoneTemplates e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.zone_version = static_cast<int32_t>(atoi(row[2]));
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.zone_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.name = row[3] ? row[3] : "";
e.min_players = static_cast<int32_t>(atoi(row[4]));
e.max_players = static_cast<int32_t>(atoi(row[5]));
e.duration_seconds = static_cast<int32_t>(atoi(row[6]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[7]));
e.compass_zone_id = static_cast<int32_t>(atoi(row[8]));
e.min_players = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.max_players = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.duration_seconds = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.dz_switch_id = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.compass_zone_id = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.compass_x = row[9] ? strtof(row[9], nullptr) : 0;
e.compass_y = row[10] ? strtof(row[10], nullptr) : 0;
e.compass_z = row[11] ? strtof(row[11], nullptr) : 0;
e.return_zone_id = static_cast<int32_t>(atoi(row[12]));
e.return_zone_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.return_x = row[13] ? strtof(row[13], nullptr) : 0;
e.return_y = row[14] ? strtof(row[14], nullptr) : 0;
e.return_z = row[15] ? strtof(row[15], nullptr) : 0;
e.return_h = row[16] ? strtof(row[16], nullptr) : 0;
e.override_zone_in = static_cast<int8_t>(atoi(row[17]));
e.override_zone_in = row[17] ? static_cast<int8_t>(atoi(row[17])) : 0;
e.zone_in_x = row[18] ? strtof(row[18], nullptr) : 0;
e.zone_in_y = row[19] ? strtof(row[19], nullptr) : 0;
e.zone_in_z = row[20] ? strtof(row[20], nullptr) : 0;
@@ -449,23 +449,23 @@ public:
DynamicZoneTemplates e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.zone_version = static_cast<int32_t>(atoi(row[2]));
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.zone_version = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.name = row[3] ? row[3] : "";
e.min_players = static_cast<int32_t>(atoi(row[4]));
e.max_players = static_cast<int32_t>(atoi(row[5]));
e.duration_seconds = static_cast<int32_t>(atoi(row[6]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[7]));
e.compass_zone_id = static_cast<int32_t>(atoi(row[8]));
e.min_players = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.max_players = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.duration_seconds = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.dz_switch_id = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.compass_zone_id = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.compass_x = row[9] ? strtof(row[9], nullptr) : 0;
e.compass_y = row[10] ? strtof(row[10], nullptr) : 0;
e.compass_z = row[11] ? strtof(row[11], nullptr) : 0;
e.return_zone_id = static_cast<int32_t>(atoi(row[12]));
e.return_zone_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.return_x = row[13] ? strtof(row[13], nullptr) : 0;
e.return_y = row[14] ? strtof(row[14], nullptr) : 0;
e.return_z = row[15] ? strtof(row[15], nullptr) : 0;
e.return_h = row[16] ? strtof(row[16], nullptr) : 0;
e.override_zone_in = static_cast<int8_t>(atoi(row[17]));
e.override_zone_in = row[17] ? static_cast<int8_t>(atoi(row[17])) : 0;
e.zone_in_x = row[18] ? strtof(row[18], nullptr) : 0;
e.zone_in_y = row[19] ? strtof(row[19], nullptr) : 0;
e.zone_in_z = row[20] ? strtof(row[20], nullptr) : 0;
@@ -204,14 +204,14 @@ public:
DynamicZones e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.instance_id = static_cast<int32_t>(atoi(row[1]));
e.instance_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.uuid = row[3] ? row[3] : "";
e.name = row[4] ? row[4] : "";
e.leader_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.min_players = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.max_players = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.dz_switch_id = static_cast<int32_t>(atoi(row[8]));
e.dz_switch_id = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.compass_zone_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.compass_x = row[10] ? strtof(row[10], nullptr) : 0;
e.compass_y = row[11] ? strtof(row[11], nullptr) : 0;
@@ -411,14 +411,14 @@ public:
DynamicZones e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.instance_id = static_cast<int32_t>(atoi(row[1]));
e.instance_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.uuid = row[3] ? row[3] : "";
e.name = row[4] ? row[4] : "";
e.leader_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.min_players = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.max_players = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.dz_switch_id = static_cast<int32_t>(atoi(row[8]));
e.dz_switch_id = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.compass_zone_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.compass_x = row[10] ? strtof(row[10], nullptr) : 0;
e.compass_y = row[11] ? strtof(row[11], nullptr) : 0;
@@ -458,14 +458,14 @@ public:
DynamicZones e{};
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.instance_id = static_cast<int32_t>(atoi(row[1]));
e.instance_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.uuid = row[3] ? row[3] : "";
e.name = row[4] ? row[4] : "";
e.leader_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.min_players = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
e.max_players = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.dz_switch_id = static_cast<int32_t>(atoi(row[8]));
e.dz_switch_id = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.compass_zone_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.compass_x = row[10] ? strtof(row[10], nullptr) : 0;
e.compass_y = row[11] ? strtof(row[11], nullptr) : 0;
@@ -195,26 +195,26 @@ public:
if (results.RowCount() == 1) {
FactionAssociation e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id_1 = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.id_1 = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.mod_1 = row[2] ? strtof(row[2], nullptr) : 0;
e.id_2 = static_cast<int32_t>(atoi(row[3]));
e.id_2 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.mod_2 = row[4] ? strtof(row[4], nullptr) : 0;
e.id_3 = static_cast<int32_t>(atoi(row[5]));
e.id_3 = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.mod_3 = row[6] ? strtof(row[6], nullptr) : 0;
e.id_4 = static_cast<int32_t>(atoi(row[7]));
e.id_4 = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.mod_4 = row[8] ? strtof(row[8], nullptr) : 0;
e.id_5 = static_cast<int32_t>(atoi(row[9]));
e.id_5 = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.mod_5 = row[10] ? strtof(row[10], nullptr) : 0;
e.id_6 = static_cast<int32_t>(atoi(row[11]));
e.id_6 = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.mod_6 = row[12] ? strtof(row[12], nullptr) : 0;
e.id_7 = static_cast<int32_t>(atoi(row[13]));
e.id_7 = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.mod_7 = row[14] ? strtof(row[14], nullptr) : 0;
e.id_8 = static_cast<int32_t>(atoi(row[15]));
e.id_8 = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.mod_8 = row[16] ? strtof(row[16], nullptr) : 0;
e.id_9 = static_cast<int32_t>(atoi(row[17]));
e.id_9 = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.mod_9 = row[18] ? strtof(row[18], nullptr) : 0;
e.id_10 = static_cast<int32_t>(atoi(row[19]));
e.id_10 = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.mod_10 = row[20] ? strtof(row[20], nullptr) : 0;
return e;
@@ -395,26 +395,26 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionAssociation e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id_1 = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.id_1 = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.mod_1 = row[2] ? strtof(row[2], nullptr) : 0;
e.id_2 = static_cast<int32_t>(atoi(row[3]));
e.id_2 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.mod_2 = row[4] ? strtof(row[4], nullptr) : 0;
e.id_3 = static_cast<int32_t>(atoi(row[5]));
e.id_3 = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.mod_3 = row[6] ? strtof(row[6], nullptr) : 0;
e.id_4 = static_cast<int32_t>(atoi(row[7]));
e.id_4 = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.mod_4 = row[8] ? strtof(row[8], nullptr) : 0;
e.id_5 = static_cast<int32_t>(atoi(row[9]));
e.id_5 = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.mod_5 = row[10] ? strtof(row[10], nullptr) : 0;
e.id_6 = static_cast<int32_t>(atoi(row[11]));
e.id_6 = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.mod_6 = row[12] ? strtof(row[12], nullptr) : 0;
e.id_7 = static_cast<int32_t>(atoi(row[13]));
e.id_7 = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.mod_7 = row[14] ? strtof(row[14], nullptr) : 0;
e.id_8 = static_cast<int32_t>(atoi(row[15]));
e.id_8 = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.mod_8 = row[16] ? strtof(row[16], nullptr) : 0;
e.id_9 = static_cast<int32_t>(atoi(row[17]));
e.id_9 = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.mod_9 = row[18] ? strtof(row[18], nullptr) : 0;
e.id_10 = static_cast<int32_t>(atoi(row[19]));
e.id_10 = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.mod_10 = row[20] ? strtof(row[20], nullptr) : 0;
all_entries.push_back(e);
@@ -440,26 +440,26 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionAssociation e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id_1 = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.id_1 = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.mod_1 = row[2] ? strtof(row[2], nullptr) : 0;
e.id_2 = static_cast<int32_t>(atoi(row[3]));
e.id_2 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.mod_2 = row[4] ? strtof(row[4], nullptr) : 0;
e.id_3 = static_cast<int32_t>(atoi(row[5]));
e.id_3 = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.mod_3 = row[6] ? strtof(row[6], nullptr) : 0;
e.id_4 = static_cast<int32_t>(atoi(row[7]));
e.id_4 = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.mod_4 = row[8] ? strtof(row[8], nullptr) : 0;
e.id_5 = static_cast<int32_t>(atoi(row[9]));
e.id_5 = row[9] ? static_cast<int32_t>(atoi(row[9])) : 0;
e.mod_5 = row[10] ? strtof(row[10], nullptr) : 0;
e.id_6 = static_cast<int32_t>(atoi(row[11]));
e.id_6 = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.mod_6 = row[12] ? strtof(row[12], nullptr) : 0;
e.id_7 = static_cast<int32_t>(atoi(row[13]));
e.id_7 = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
e.mod_7 = row[14] ? strtof(row[14], nullptr) : 0;
e.id_8 = static_cast<int32_t>(atoi(row[15]));
e.id_8 = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
e.mod_8 = row[16] ? strtof(row[16], nullptr) : 0;
e.id_9 = static_cast<int32_t>(atoi(row[17]));
e.id_9 = row[17] ? static_cast<int32_t>(atoi(row[17])) : 0;
e.mod_9 = row[18] ? strtof(row[18], nullptr) : 0;
e.id_10 = static_cast<int32_t>(atoi(row[19]));
e.id_10 = row[19] ? static_cast<int32_t>(atoi(row[19])) : 0;
e.mod_10 = row[20] ? strtof(row[20], nullptr) : 0;
all_entries.push_back(e);
@@ -135,12 +135,12 @@ public:
if (results.RowCount() == 1) {
FactionBaseData e{};
e.client_faction_id = static_cast<int16_t>(atoi(row[0]));
e.min = static_cast<int16_t>(atoi(row[1]));
e.max = static_cast<int16_t>(atoi(row[2]));
e.unk_hero1 = static_cast<int16_t>(atoi(row[3]));
e.unk_hero2 = static_cast<int16_t>(atoi(row[4]));
e.unk_hero3 = static_cast<int16_t>(atoi(row[5]));
e.client_faction_id = row[0] ? static_cast<int16_t>(atoi(row[0])) : 0;
e.min = row[1] ? static_cast<int16_t>(atoi(row[1])) : -2000;
e.max = row[2] ? static_cast<int16_t>(atoi(row[2])) : 2000;
e.unk_hero1 = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.unk_hero2 = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.unk_hero3 = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
return e;
}
@@ -275,12 +275,12 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionBaseData e{};
e.client_faction_id = static_cast<int16_t>(atoi(row[0]));
e.min = static_cast<int16_t>(atoi(row[1]));
e.max = static_cast<int16_t>(atoi(row[2]));
e.unk_hero1 = static_cast<int16_t>(atoi(row[3]));
e.unk_hero2 = static_cast<int16_t>(atoi(row[4]));
e.unk_hero3 = static_cast<int16_t>(atoi(row[5]));
e.client_faction_id = row[0] ? static_cast<int16_t>(atoi(row[0])) : 0;
e.min = row[1] ? static_cast<int16_t>(atoi(row[1])) : -2000;
e.max = row[2] ? static_cast<int16_t>(atoi(row[2])) : 2000;
e.unk_hero1 = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.unk_hero2 = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.unk_hero3 = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -305,12 +305,12 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionBaseData e{};
e.client_faction_id = static_cast<int16_t>(atoi(row[0]));
e.min = static_cast<int16_t>(atoi(row[1]));
e.max = static_cast<int16_t>(atoi(row[2]));
e.unk_hero1 = static_cast<int16_t>(atoi(row[3]));
e.unk_hero2 = static_cast<int16_t>(atoi(row[4]));
e.unk_hero3 = static_cast<int16_t>(atoi(row[5]));
e.client_faction_id = row[0] ? static_cast<int16_t>(atoi(row[0])) : 0;
e.min = row[1] ? static_cast<int16_t>(atoi(row[1])) : -2000;
e.max = row[2] ? static_cast<int16_t>(atoi(row[2])) : 2000;
e.unk_hero1 = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.unk_hero2 = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.unk_hero3 = row[5] ? static_cast<int16_t>(atoi(row[5])) : 0;
all_entries.push_back(e);
}
@@ -129,7 +129,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.faction_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.mod = static_cast<int16_t>(atoi(row[2]));
e.mod = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.mod_name = row[3] ? row[3] : "";
return e;
@@ -260,7 +260,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.faction_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.mod = static_cast<int16_t>(atoi(row[2]));
e.mod = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.mod_name = row[3] ? row[3] : "";
all_entries.push_back(e);
@@ -288,7 +288,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.faction_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.mod = static_cast<int16_t>(atoi(row[2]));
e.mod = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.mod_name = row[3] ? row[3] : "";
all_entries.push_back(e);
@@ -123,9 +123,9 @@ public:
if (results.RowCount() == 1) {
FactionList e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.base = static_cast<int16_t>(atoi(row[2]));
e.base = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
return e;
}
@@ -251,9 +251,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionList e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.base = static_cast<int16_t>(atoi(row[2]));
e.base = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -278,9 +278,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionList e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.base = static_cast<int16_t>(atoi(row[2]));
e.base = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -127,10 +127,10 @@ public:
if (results.RowCount() == 1) {
FactionValues e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.faction_id = static_cast<int32_t>(atoi(row[1]));
e.current_value = static_cast<int16_t>(atoi(row[2]));
e.temp = static_cast<int8_t>(atoi(row[3]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.faction_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.current_value = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.temp = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
return e;
}
@@ -259,10 +259,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionValues e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.faction_id = static_cast<int32_t>(atoi(row[1]));
e.current_value = static_cast<int16_t>(atoi(row[2]));
e.temp = static_cast<int8_t>(atoi(row[3]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.faction_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.current_value = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.temp = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -287,10 +287,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
FactionValues e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
e.faction_id = static_cast<int32_t>(atoi(row[1]));
e.current_value = static_cast<int16_t>(atoi(row[2]));
e.temp = static_cast<int8_t>(atoi(row[3]));
e.char_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.faction_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.current_value = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.temp = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -155,15 +155,15 @@ public:
if (results.RowCount() == 1) {
Fishing e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.Itemid = static_cast<int32_t>(atoi(row[2]));
e.skill_level = static_cast<int16_t>(atoi(row[3]));
e.chance = static_cast<int16_t>(atoi(row[4]));
e.npc_id = static_cast<int32_t>(atoi(row[5]));
e.npc_chance = static_cast<int32_t>(atoi(row[6]));
e.min_expansion = static_cast<int8_t>(atoi(row[7]));
e.max_expansion = static_cast<int8_t>(atoi(row[8]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.Itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.skill_level = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.chance = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.npc_id = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.npc_chance = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
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] : "";
@@ -314,15 +314,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Fishing e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.Itemid = static_cast<int32_t>(atoi(row[2]));
e.skill_level = static_cast<int16_t>(atoi(row[3]));
e.chance = static_cast<int16_t>(atoi(row[4]));
e.npc_id = static_cast<int32_t>(atoi(row[5]));
e.npc_chance = static_cast<int32_t>(atoi(row[6]));
e.min_expansion = static_cast<int8_t>(atoi(row[7]));
e.max_expansion = static_cast<int8_t>(atoi(row[8]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.Itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.skill_level = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.chance = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.npc_id = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.npc_chance = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
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] : "";
@@ -349,15 +349,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Fishing e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.Itemid = static_cast<int32_t>(atoi(row[2]));
e.skill_level = static_cast<int16_t>(atoi(row[3]));
e.chance = static_cast<int16_t>(atoi(row[4]));
e.npc_id = static_cast<int32_t>(atoi(row[5]));
e.npc_chance = static_cast<int32_t>(atoi(row[6]));
e.min_expansion = static_cast<int8_t>(atoi(row[7]));
e.max_expansion = static_cast<int8_t>(atoi(row[8]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.Itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.skill_level = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.chance = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.npc_id = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.npc_chance = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
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] : "";
@@ -147,13 +147,13 @@ public:
if (results.RowCount() == 1) {
Forage e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.Itemid = static_cast<int32_t>(atoi(row[2]));
e.level = static_cast<int16_t>(atoi(row[3]));
e.chance = static_cast<int16_t>(atoi(row[4]));
e.min_expansion = static_cast<int8_t>(atoi(row[5]));
e.max_expansion = static_cast<int8_t>(atoi(row[6]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.Itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.level = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.chance = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.min_expansion = row[5] ? static_cast<int8_t>(atoi(row[5])) : -1;
e.max_expansion = row[6] ? static_cast<int8_t>(atoi(row[6])) : -1;
e.content_flags = row[7] ? row[7] : "";
e.content_flags_disabled = row[8] ? row[8] : "";
@@ -298,13 +298,13 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Forage e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.Itemid = static_cast<int32_t>(atoi(row[2]));
e.level = static_cast<int16_t>(atoi(row[3]));
e.chance = static_cast<int16_t>(atoi(row[4]));
e.min_expansion = static_cast<int8_t>(atoi(row[5]));
e.max_expansion = static_cast<int8_t>(atoi(row[6]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.Itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.level = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.chance = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.min_expansion = row[5] ? static_cast<int8_t>(atoi(row[5])) : -1;
e.max_expansion = row[6] ? static_cast<int8_t>(atoi(row[6])) : -1;
e.content_flags = row[7] ? row[7] : "";
e.content_flags_disabled = row[8] ? row[8] : "";
@@ -331,13 +331,13 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Forage e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.Itemid = static_cast<int32_t>(atoi(row[2]));
e.level = static_cast<int16_t>(atoi(row[3]));
e.chance = static_cast<int16_t>(atoi(row[4]));
e.min_expansion = static_cast<int8_t>(atoi(row[5]));
e.max_expansion = static_cast<int8_t>(atoi(row[6]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.Itemid = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.level = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.chance = row[4] ? static_cast<int16_t>(atoi(row[4])) : 0;
e.min_expansion = row[5] ? static_cast<int8_t>(atoi(row[5])) : -1;
e.max_expansion = row[6] ? static_cast<int8_t>(atoi(row[6])) : -1;
e.content_flags = row[7] ? row[7] : "";
e.content_flags_disabled = row[8] ? row[8] : "";
@@ -16,7 +16,6 @@
#include "../../strings.h"
#include <ctime>
class BaseGlobalLootRepository {
public:
struct GlobalLoot {
@@ -124,7 +124,7 @@ public:
GmIps e{};
e.name = row[0] ? row[0] : "";
e.account_id = static_cast<int32_t>(atoi(row[1]));
e.account_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.ip_address = row[2] ? row[2] : "";
return e;
@@ -252,7 +252,7 @@ public:
GmIps e{};
e.name = row[0] ? row[0] : "";
e.account_id = static_cast<int32_t>(atoi(row[1]));
e.account_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.ip_address = row[2] ? row[2] : "";
all_entries.push_back(e);
@@ -279,7 +279,7 @@ public:
GmIps e{};
e.name = row[0] ? row[0] : "";
e.account_id = static_cast<int32_t>(atoi(row[1]));
e.account_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.ip_address = row[2] ? row[2] : "";
all_entries.push_back(e);
@@ -135,8 +135,8 @@ public:
if (results.RowCount() == 1) {
Graveyard e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.x = row[2] ? strtof(row[2], nullptr) : 0;
e.y = row[3] ? strtof(row[3], nullptr) : 0;
e.z = row[4] ? strtof(row[4], nullptr) : 0;
@@ -274,8 +274,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Graveyard e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.x = row[2] ? strtof(row[2], nullptr) : 0;
e.y = row[3] ? strtof(row[3], nullptr) : 0;
e.z = row[4] ? strtof(row[4], nullptr) : 0;
@@ -304,8 +304,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Graveyard e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.x = row[2] ? strtof(row[2], nullptr) : 0;
e.y = row[3] ? strtof(row[3], nullptr) : 0;
e.z = row[4] ? strtof(row[4], nullptr) : 0;
@@ -147,15 +147,15 @@ public:
if (results.RowCount() == 1) {
GridEntries e{};
e.gridid = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.number = static_cast<int32_t>(atoi(row[2]));
e.gridid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.number = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.x = row[3] ? strtof(row[3], nullptr) : 0;
e.y = row[4] ? strtof(row[4], nullptr) : 0;
e.z = row[5] ? strtof(row[5], nullptr) : 0;
e.heading = row[6] ? strtof(row[6], nullptr) : 0;
e.pause = static_cast<int32_t>(atoi(row[7]));
e.centerpoint = static_cast<int8_t>(atoi(row[8]));
e.pause = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.centerpoint = row[8] ? static_cast<int8_t>(atoi(row[8])) : 0;
return e;
}
@@ -299,15 +299,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GridEntries e{};
e.gridid = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.number = static_cast<int32_t>(atoi(row[2]));
e.gridid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.number = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.x = row[3] ? strtof(row[3], nullptr) : 0;
e.y = row[4] ? strtof(row[4], nullptr) : 0;
e.z = row[5] ? strtof(row[5], nullptr) : 0;
e.heading = row[6] ? strtof(row[6], nullptr) : 0;
e.pause = static_cast<int32_t>(atoi(row[7]));
e.centerpoint = static_cast<int8_t>(atoi(row[8]));
e.pause = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.centerpoint = row[8] ? static_cast<int8_t>(atoi(row[8])) : 0;
all_entries.push_back(e);
}
@@ -332,15 +332,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GridEntries e{};
e.gridid = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.number = static_cast<int32_t>(atoi(row[2]));
e.gridid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.number = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.x = row[3] ? strtof(row[3], nullptr) : 0;
e.y = row[4] ? strtof(row[4], nullptr) : 0;
e.z = row[5] ? strtof(row[5], nullptr) : 0;
e.heading = row[6] ? strtof(row[6], nullptr) : 0;
e.pause = static_cast<int32_t>(atoi(row[7]));
e.centerpoint = static_cast<int8_t>(atoi(row[8]));
e.pause = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.centerpoint = row[8] ? static_cast<int8_t>(atoi(row[8])) : 0;
all_entries.push_back(e);
}
+12 -12
View File
@@ -127,10 +127,10 @@ public:
if (results.RowCount() == 1) {
Grid e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.type = static_cast<int32_t>(atoi(row[2]));
e.type2 = static_cast<int32_t>(atoi(row[3]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type2 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
return e;
}
@@ -259,10 +259,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Grid e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.type = static_cast<int32_t>(atoi(row[2]));
e.type2 = static_cast<int32_t>(atoi(row[3]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type2 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -287,10 +287,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Grid e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zoneid = static_cast<int32_t>(atoi(row[1]));
e.type = static_cast<int32_t>(atoi(row[2]));
e.type2 = static_cast<int32_t>(atoi(row[3]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zoneid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.type = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.type2 = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -185,7 +185,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zoneid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.version = static_cast<int16_t>(atoi(row[2]));
e.version = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.max_x = row[3] ? strtof(row[3], nullptr) : 2000;
e.max_y = row[4] ? strtof(row[4], nullptr) : 2000;
e.max_z = row[5] ? strtof(row[5], nullptr) : 10000;
@@ -197,8 +197,8 @@ public:
e.max_allowed = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 1;
e.comment = row[12] ? row[12] : "";
e.respawn_timer = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 300;
e.min_expansion = static_cast<int8_t>(atoi(row[14]));
e.max_expansion = static_cast<int8_t>(atoi(row[15]));
e.min_expansion = row[14] ? static_cast<int8_t>(atoi(row[14])) : -1;
e.max_expansion = row[15] ? static_cast<int8_t>(atoi(row[15])) : -1;
e.content_flags = row[16] ? row[16] : "";
e.content_flags_disabled = row[17] ? row[17] : "";
@@ -372,7 +372,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zoneid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.version = static_cast<int16_t>(atoi(row[2]));
e.version = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.max_x = row[3] ? strtof(row[3], nullptr) : 2000;
e.max_y = row[4] ? strtof(row[4], nullptr) : 2000;
e.max_z = row[5] ? strtof(row[5], nullptr) : 10000;
@@ -384,8 +384,8 @@ public:
e.max_allowed = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 1;
e.comment = row[12] ? row[12] : "";
e.respawn_timer = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 300;
e.min_expansion = static_cast<int8_t>(atoi(row[14]));
e.max_expansion = static_cast<int8_t>(atoi(row[15]));
e.min_expansion = row[14] ? static_cast<int8_t>(atoi(row[14])) : -1;
e.max_expansion = row[15] ? static_cast<int8_t>(atoi(row[15])) : -1;
e.content_flags = row[16] ? row[16] : "";
e.content_flags_disabled = row[17] ? row[17] : "";
@@ -414,7 +414,7 @@ public:
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.zoneid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.version = static_cast<int16_t>(atoi(row[2]));
e.version = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
e.max_x = row[3] ? strtof(row[3], nullptr) : 2000;
e.max_y = row[4] ? strtof(row[4], nullptr) : 2000;
e.max_z = row[5] ? strtof(row[5], nullptr) : 10000;
@@ -426,8 +426,8 @@ public:
e.max_allowed = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 1;
e.comment = row[12] ? row[12] : "";
e.respawn_timer = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 300;
e.min_expansion = static_cast<int8_t>(atoi(row[14]));
e.max_expansion = static_cast<int8_t>(atoi(row[15]));
e.min_expansion = row[14] ? static_cast<int8_t>(atoi(row[14])) : -1;
e.max_expansion = row[15] ? static_cast<int8_t>(atoi(row[15])) : -1;
e.content_flags = row[16] ? row[16] : "";
e.content_flags_disabled = row[17] ? row[17] : "";
@@ -127,10 +127,10 @@ public:
if (results.RowCount() == 1) {
GroupId e{};
e.groupid = static_cast<int32_t>(atoi(row[0]));
e.charid = static_cast<int32_t>(atoi(row[1]));
e.groupid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.charid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.ismerc = static_cast<int8_t>(atoi(row[3]));
e.ismerc = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
return e;
}
@@ -259,10 +259,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GroupId e{};
e.groupid = static_cast<int32_t>(atoi(row[0]));
e.charid = static_cast<int32_t>(atoi(row[1]));
e.groupid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.charid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.ismerc = static_cast<int8_t>(atoi(row[3]));
e.ismerc = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -287,10 +287,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GroupId e{};
e.groupid = static_cast<int32_t>(atoi(row[0]));
e.charid = static_cast<int32_t>(atoi(row[1]));
e.groupid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.charid = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.name = row[2] ? row[2] : "";
e.ismerc = static_cast<int8_t>(atoi(row[3]));
e.ismerc = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
all_entries.push_back(e);
}
@@ -147,15 +147,15 @@ public:
if (results.RowCount() == 1) {
GroupLeaders e{};
e.gid = static_cast<int32_t>(atoi(row[0]));
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.leadername = row[1] ? row[1] : "";
e.marknpc = row[2] ? row[2] : "";
e.leadershipaa = row[3] ? row[3] : "";
e.leadershipaa = row[3] ? row[3] : 0;
e.maintank = row[4] ? row[4] : "";
e.assist = row[5] ? row[5] : "";
e.puller = row[6] ? row[6] : "";
e.mentoree = row[7] ? row[7] : "";
e.mentor_percent = static_cast<int32_t>(atoi(row[8]));
e.mentor_percent = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
return e;
}
@@ -299,15 +299,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GroupLeaders e{};
e.gid = static_cast<int32_t>(atoi(row[0]));
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.leadername = row[1] ? row[1] : "";
e.marknpc = row[2] ? row[2] : "";
e.leadershipaa = row[3] ? row[3] : "";
e.leadershipaa = row[3] ? row[3] : 0;
e.maintank = row[4] ? row[4] : "";
e.assist = row[5] ? row[5] : "";
e.puller = row[6] ? row[6] : "";
e.mentoree = row[7] ? row[7] : "";
e.mentor_percent = static_cast<int32_t>(atoi(row[8]));
e.mentor_percent = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
all_entries.push_back(e);
}
@@ -332,15 +332,15 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GroupLeaders e{};
e.gid = static_cast<int32_t>(atoi(row[0]));
e.gid = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.leadername = row[1] ? row[1] : "";
e.marknpc = row[2] ? row[2] : "";
e.leadershipaa = row[3] ? row[3] : "";
e.leadershipaa = row[3] ? row[3] : 0;
e.maintank = row[4] ? row[4] : "";
e.assist = row[5] ? row[5] : "";
e.puller = row[6] ? row[6] : "";
e.mentoree = row[7] ? row[7] : "";
e.mentor_percent = static_cast<int32_t>(atoi(row[8]));
e.mentor_percent = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
all_entries.push_back(e);
}
@@ -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;
@@ -151,9 +151,9 @@ public:
if (results.RowCount() == 1) {
GuildMembers e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
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));
@@ -307,9 +307,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GuildMembers e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
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;
@@ -341,9 +341,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
GuildMembers e{};
e.char_id = static_cast<int32_t>(atoi(row[0]));
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) + ")");
@@ -125,7 +125,7 @@ public:
e.guild1 = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.guild2 = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.relation = static_cast<int8_t>(atoi(row[2]));
e.relation = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
return e;
}
@@ -253,7 +253,7 @@ public:
e.guild1 = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.guild2 = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.relation = static_cast<int8_t>(atoi(row[2]));
e.relation = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -280,7 +280,7 @@ public:
e.guild1 = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.guild2 = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.relation = static_cast<int8_t>(atoi(row[2]));
e.relation = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -151,10 +151,10 @@ public:
if (results.RowCount() == 1) {
Guilds e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.leader = static_cast<int32_t>(atoi(row[2]));
e.minstatus = static_cast<int16_t>(atoi(row[3]));
e.leader = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.minstatus = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.motd = row[4] ? row[4] : "";
e.tribute = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.motd_setter = row[6] ? row[6] : "";
@@ -306,10 +306,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Guilds e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.leader = static_cast<int32_t>(atoi(row[2]));
e.minstatus = static_cast<int16_t>(atoi(row[3]));
e.leader = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.minstatus = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.motd = row[4] ? row[4] : "";
e.tribute = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.motd_setter = row[6] ? row[6] : "";
@@ -340,10 +340,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Guilds e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.leader = static_cast<int32_t>(atoi(row[2]));
e.minstatus = static_cast<int16_t>(atoi(row[3]));
e.leader = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.minstatus = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.motd = row[4] ? row[4] : "";
e.tribute = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
e.motd_setter = row[6] ? row[6] : "";
@@ -139,13 +139,13 @@ public:
if (results.RowCount() == 1) {
Horses e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.filename = row[1] ? row[1] : "";
e.race = static_cast<int16_t>(atoi(row[2]));
e.gender = static_cast<int8_t>(atoi(row[3]));
e.texture = static_cast<int8_t>(atoi(row[4]));
e.race = row[2] ? static_cast<int16_t>(atoi(row[2])) : 216;
e.gender = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
e.texture = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
e.mountspeed = row[5] ? strtof(row[5], nullptr) : 0.75;
e.notes = row[6] ? row[6] : "";
e.notes = row[6] ? row[6] : "Notes";
return e;
}
@@ -282,13 +282,13 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Horses e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.filename = row[1] ? row[1] : "";
e.race = static_cast<int16_t>(atoi(row[2]));
e.gender = static_cast<int8_t>(atoi(row[3]));
e.texture = static_cast<int8_t>(atoi(row[4]));
e.race = row[2] ? static_cast<int16_t>(atoi(row[2])) : 216;
e.gender = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
e.texture = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
e.mountspeed = row[5] ? strtof(row[5], nullptr) : 0.75;
e.notes = row[6] ? row[6] : "";
e.notes = row[6] ? row[6] : "Notes";
all_entries.push_back(e);
}
@@ -313,13 +313,13 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Horses e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.filename = row[1] ? row[1] : "";
e.race = static_cast<int16_t>(atoi(row[2]));
e.gender = static_cast<int8_t>(atoi(row[3]));
e.texture = static_cast<int8_t>(atoi(row[4]));
e.race = row[2] ? static_cast<int16_t>(atoi(row[2])) : 216;
e.gender = row[3] ? static_cast<int8_t>(atoi(row[3])) : 0;
e.texture = row[4] ? static_cast<int8_t>(atoi(row[4])) : 0;
e.mountspeed = row[5] ? strtof(row[5], nullptr) : 0.75;
e.notes = row[6] ? row[6] : "";
e.notes = row[6] ? row[6] : "Notes";
all_entries.push_back(e);
}
@@ -143,7 +143,7 @@ public:
if (results.RowCount() == 1) {
InstanceList e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.version = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.is_global = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -290,7 +290,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
InstanceList e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.version = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.is_global = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -322,7 +322,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
InstanceList e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.version = row[2] ? static_cast<uint8_t>(strtoul(row[2], nullptr, 10)) : 0;
e.is_global = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
@@ -185,12 +185,12 @@ public:
e.augslot3 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.augslot4 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.augslot5 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.augslot6 = static_cast<int32_t>(atoi(row[10]));
e.augslot6 = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.instnodrop = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.custom_data = row[12] ? row[12] : "";
e.ornamenticon = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.ornamentidfile = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.ornament_hero_model = static_cast<int32_t>(atoi(row[15]));
e.ornament_hero_model = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
return e;
}
@@ -365,12 +365,12 @@ public:
e.augslot3 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.augslot4 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.augslot5 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.augslot6 = static_cast<int32_t>(atoi(row[10]));
e.augslot6 = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.instnodrop = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.custom_data = row[12] ? row[12] : "";
e.ornamenticon = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.ornamentidfile = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.ornament_hero_model = static_cast<int32_t>(atoi(row[15]));
e.ornament_hero_model = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
all_entries.push_back(e);
}
@@ -405,12 +405,12 @@ public:
e.augslot3 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.augslot4 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.augslot5 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.augslot6 = static_cast<int32_t>(atoi(row[10]));
e.augslot6 = row[10] ? static_cast<int32_t>(atoi(row[10])) : 0;
e.instnodrop = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
e.custom_data = row[12] ? row[12] : "";
e.ornamenticon = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.ornamentidfile = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.ornament_hero_model = static_cast<int32_t>(atoi(row[15]));
e.ornament_hero_model = row[15] ? static_cast<int32_t>(atoi(row[15])) : 0;
all_entries.push_back(e);
}
@@ -190,12 +190,12 @@ public:
e.augslot3 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.augslot4 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.augslot5 = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.augslot6 = static_cast<int32_t>(atoi(row[11]));
e.augslot6 = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.instnodrop = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.custom_data = row[13] ? row[13] : "";
e.ornamenticon = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.ornamentidfile = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.ornament_hero_model = static_cast<int32_t>(atoi(row[16]));
e.ornament_hero_model = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
return e;
}
@@ -374,12 +374,12 @@ public:
e.augslot3 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.augslot4 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.augslot5 = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.augslot6 = static_cast<int32_t>(atoi(row[11]));
e.augslot6 = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.instnodrop = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.custom_data = row[13] ? row[13] : "";
e.ornamenticon = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.ornamentidfile = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.ornament_hero_model = static_cast<int32_t>(atoi(row[16]));
e.ornament_hero_model = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
all_entries.push_back(e);
}
@@ -415,12 +415,12 @@ public:
e.augslot3 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.augslot4 = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
e.augslot5 = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
e.augslot6 = static_cast<int32_t>(atoi(row[11]));
e.augslot6 = row[11] ? static_cast<int32_t>(atoi(row[11])) : 0;
e.instnodrop = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.custom_data = row[13] ? row[13] : "";
e.ornamenticon = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.ornamentidfile = row[15] ? static_cast<uint32_t>(strtoul(row[15], nullptr, 10)) : 0;
e.ornament_hero_model = static_cast<int32_t>(atoi(row[16]));
e.ornament_hero_model = row[16] ? static_cast<int32_t>(atoi(row[16])) : 0;
all_entries.push_back(e);
}
@@ -123,9 +123,9 @@ public:
if (results.RowCount() == 1) {
IpExemptions e{};
e.exemption_id = static_cast<int32_t>(atoi(row[0]));
e.exemption_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.exemption_ip = row[1] ? row[1] : "";
e.exemption_amount = static_cast<int32_t>(atoi(row[2]));
e.exemption_amount = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
return e;
}
@@ -250,9 +250,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
IpExemptions e{};
e.exemption_id = static_cast<int32_t>(atoi(row[0]));
e.exemption_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.exemption_ip = row[1] ? row[1] : "";
e.exemption_amount = static_cast<int32_t>(atoi(row[2]));
e.exemption_amount = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
@@ -277,9 +277,9 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
IpExemptions e{};
e.exemption_id = static_cast<int32_t>(atoi(row[0]));
e.exemption_id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.exemption_ip = row[1] ? row[1] : "";
e.exemption_amount = static_cast<int32_t>(atoi(row[2]));
e.exemption_amount = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
all_entries.push_back(e);
}
File diff suppressed because it is too large Load Diff
@@ -123,7 +123,7 @@ public:
if (results.RowCount() == 1) {
LevelExpMods e{};
e.level = static_cast<int32_t>(atoi(row[0]));
e.level = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.exp_mod = row[1] ? strtof(row[1], nullptr) : 0;
e.aa_exp_mod = row[2] ? strtof(row[2], nullptr) : 0;
@@ -251,7 +251,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
LevelExpMods e{};
e.level = static_cast<int32_t>(atoi(row[0]));
e.level = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.exp_mod = row[1] ? strtof(row[1], nullptr) : 0;
e.aa_exp_mod = row[2] ? strtof(row[2], nullptr) : 0;
@@ -278,7 +278,7 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
LevelExpMods e{};
e.level = static_cast<int32_t>(atoi(row[0]));
e.level = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.exp_mod = row[1] ? strtof(row[1], nullptr) : 0;
e.aa_exp_mod = row[2] ? strtof(row[2], nullptr) : 0;
@@ -135,10 +135,10 @@ public:
if (results.RowCount() == 1) {
LoginApiTokens e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.token = row[1] ? row[1] : "";
e.can_write = static_cast<int32_t>(atoi(row[2]));
e.can_read = static_cast<int32_t>(atoi(row[3]));
e.can_write = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.can_read = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.created_at = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
e.updated_at = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
@@ -274,10 +274,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
LoginApiTokens e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.token = row[1] ? row[1] : "";
e.can_write = static_cast<int32_t>(atoi(row[2]));
e.can_read = static_cast<int32_t>(atoi(row[3]));
e.can_write = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.can_read = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.created_at = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
e.updated_at = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
@@ -304,10 +304,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
LoginApiTokens e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.token = row[1] ? row[1] : "";
e.can_write = static_cast<int32_t>(atoi(row[2]));
e.can_read = static_cast<int32_t>(atoi(row[3]));
e.can_write = row[2] ? static_cast<int32_t>(atoi(row[2])) : 0;
e.can_read = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.created_at = strtoll(row[4] ? row[4] : "-1", nullptr, 10);
e.updated_at = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
@@ -155,11 +155,11 @@ public:
e.long_name = row[1] ? row[1] : "";
e.short_name = row[2] ? row[2] : "";
e.tag_description = row[3] ? row[3] : "";
e.login_server_list_type_id = static_cast<int32_t>(atoi(row[4]));
e.login_server_list_type_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.last_login_date = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
e.last_ip_address = row[6] ? row[6] : "";
e.login_server_admin_id = static_cast<int32_t>(atoi(row[7]));
e.is_server_trusted = static_cast<int32_t>(atoi(row[8]));
e.login_server_admin_id = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.is_server_trusted = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.note = row[9] ? row[9] : "";
return e;
@@ -310,11 +310,11 @@ public:
e.long_name = row[1] ? row[1] : "";
e.short_name = row[2] ? row[2] : "";
e.tag_description = row[3] ? row[3] : "";
e.login_server_list_type_id = static_cast<int32_t>(atoi(row[4]));
e.login_server_list_type_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.last_login_date = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
e.last_ip_address = row[6] ? row[6] : "";
e.login_server_admin_id = static_cast<int32_t>(atoi(row[7]));
e.is_server_trusted = static_cast<int32_t>(atoi(row[8]));
e.login_server_admin_id = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.is_server_trusted = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.note = row[9] ? row[9] : "";
all_entries.push_back(e);
@@ -344,11 +344,11 @@ public:
e.long_name = row[1] ? row[1] : "";
e.short_name = row[2] ? row[2] : "";
e.tag_description = row[3] ? row[3] : "";
e.login_server_list_type_id = static_cast<int32_t>(atoi(row[4]));
e.login_server_list_type_id = row[4] ? static_cast<int32_t>(atoi(row[4])) : 0;
e.last_login_date = strtoll(row[5] ? row[5] : "-1", nullptr, 10);
e.last_ip_address = row[6] ? row[6] : "";
e.login_server_admin_id = static_cast<int32_t>(atoi(row[7]));
e.is_server_trusted = static_cast<int32_t>(atoi(row[8]));
e.login_server_admin_id = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
e.is_server_trusted = row[8] ? static_cast<int32_t>(atoi(row[8])) : 0;
e.note = row[9] ? row[9] : "";
all_entries.push_back(e);

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