* Save spawns
* Update base_zone_state_spawns_repository.h
* Zone state save work
* Code cleanup
* More cleanup
* Database migration
* Update database_update_manifest.cpp
* Revert decay at storage model
* Code cleanup
* More cleanup
* More cleanup
* More cleanup
* Entity variables
* Add entity variables to the schema
* Post rebase
* Checkpoint
* Serialize / deserialize buffs
* Current hp / mana / end save / load
* Save / load current_waypoint
* Add zone spawn protection
* Finishing touches
* Cleanup
* Update zone_save_state.cpp
* Cleanup
* Update zone_save_state.cpp
* Update npc.cpp
* Update npc.cpp
* More
* Update perl_npc.cpp
* Update zone_loot.cpp
* Implement spell AI pulling, fix throw stone
* more pull tweaks
* holding check at start of ai process
* fully implement ^pull logic to always return, can still be overidden by ^attack
* Rewrite ^pull logic and handling. **MORE**
Add ^setassistee command to set who your bots will assist. Bots will always assist you first before anyone else.
If the rule Bots, AllowCrossGroupRaidAssist is enabled bots will assist the group or raid main assists.
Rewrites logic in handling of pull and returning to ensure bots make it back to their location.
* Move HateLine to a better ID
* cleanup ST_Self logic in CastChecks
* Removed unused BotSpellTypeRequiresLoS
* Move fizzle message to define
* add timer checks to Idle/Engaged/Pursue CastCheck to early terminate
* Add back !IsBotNonSpellFighter() check to the different CastCheck
* Correct IsValidSpellRange
* Implement AAs and harmtouch/layonhands to ^cast --- fix IsValidSpellRange
* Add PetDamageShields and PetResistBuffs to IsPetBotSpellType()
* Add priorities to HateLine inserts for db update
* Remove SpellTypeRequiresCastChecks
* Add bot check to DetermineSpellTargets for IsIllusionSpell
* merge with previous
* Correct bot checks for ST_GroupClientAndPet
* Remove misc target_type checks
* Add lull/aelull to ^cast
* Add more checks for CommandedSubTypes::AETarget
* remove unneeded checks on IsValidSpellTypeBySpellID
* add to aelull
* rewrite GetCorrectSpellType
* Add IsBlockedBuff to CastChecks
* Add spellid option to ^cast to allow casting of a specific spell by ID
* ^cast adjustments for spellid casts
* Add missing alert round for ranged attacks
* More castcheck improvements
* CanUseBotSpell for ^cast
* remove ht/loh from attack ai
* remove SetCombatRoundForAlerts that triggered every engagement
* Add RangedAttackImmunity checks before trying to ranged attack
* move bot backstab to mob
* fix MinStatusToBypassCreateLimit
* more backstab to mob cleanup
* add bot checks to tryheadshot / tryassassinate
* adjust version number for bots
* add back m_mob_check_moving_timer, necessary?
* add sanity checks for classattacks
* Get rid of Bots:BotGroupXP and change logic to support Bots:SameRaidGroupForXP
Bots won't do anything if not in the same group so this should more accurately control only when in the same raid group.
* add "confirm" check to ^delete
* Update bot.cpp
* Remove `id` from bot_settings, correct types
* Implement blocked_buffs and blocked_pet_buffs
* more blocked buff tweaks
* add beneficial check to ^blockedbuffs
* command grammar
* missing )
* Move getnames for categories and settings to mob, rename hptomed/manatomed
* add GetBotSpellCategoryIDByShortName and CopyBotBlockedPetBuffs, update ^defaultsettings command
* cls cleanup
* Allow bots to clear HasProjectIllusion flag
* Add PercentChanceToCastGroupCure
* Implmenet PetCures, add some missing types for defaults/chance to cast
* Change GetRaidByBotName to GetRaidByBot
* Typo on PetBuffs implement
* Change GetSpellListSpellType to GetParentSpellType
* missing from GetChanceToCastBySpellType
* Fix performance in IsValidSpellRange by flipping HasProjectIllusion
* merge with prev
* merge with cls cleanup
* Reorder IsTargetAlreadyReceivingSpell/CheckSpellLevelRestriction/IsBlockedBuff
* Combine GatherGroupSpellTargets and GatherSpellTargets
* Cleanup IsTargetAlreadyReceivingSpell
* Fix ^petsettype to account for usable levels of spells and remove hardcoded level limits.
* Remove Bot_AICheckCloseBeneficialSpells and use AttemptCloseBeneficialSpells for better performance
* remove default hold for resist buffa
* move IsValidSpellRange further down castchecks
* raid optimizations
* correct name checking to match players
* more name checks and add proper soft deletes to bots
* organize some checks in IsImmuneToBotSpell
* Fix GetRaidByBotName and GetRaidByBot checks to not loop unnecessarily
* Move GatherSpellTargets to mob
* Change GetPrioritizedBotSpellsBySpellType to vector
Some slipped through in "organize some checks in IsImmuneToBotSpell"
* Move GatherSpellTargets and Raid to stored variables.
Missing some in "organize some checks in IsImmuneToBotSpell"
* comment out precheck, delays, thresholds, etc logging
missed some in "organize some checks in IsImmuneToBotSpell"
* Missing IsInGroupOrRaid cleanup
* Implement AIBot_spells_by_type to reduce looping when searching for spells
* Add _tempSpellType as placeholder for any future passthru
* todo
* Move bot_list from std::list to std::unordered_map like other entities
* Fix missing raid assignment for GetStoredRaid in IsInGroupOrRaid
* TempPet owned by bots that get the kill will now give exp like a client would
* Remove unnecessary checks in bot process (closescanmoving timer, verify raid, send hp/mana/end packet
* Fix client spell commands from saving the wrong setting
* Cleanup ^copysettings command and add new commands
* Add pet option to ^taunt
No longer has toggle, required on/off option and an optional "pet" option to control pets' taunting state
* Allow pet types to ^cast, prevent failure spam, add cure check
* more raid optimizations, should be final.
10 clients, 710 bots, 10 raids, ~250 pets sits around 3.5% CPU idle
* Move spell range check to proper location
* Implement ^discipline
* remove ^aggressive/^defensive
* remove this for a separate PR
* cleanup
* Add BotGroupSay method
* todo list
* Add missing bot_blocked_buffs to schema
* Remove plural on ^spelltypeidsand ^spelltypenames
* Move spelltype names, spell subtypes, category names and setting names to maps.
* move los checks to mob.cpp
* Bot CampAll fix
* Bots special_attacks.cpp fix
* Add zero check for bot spawn limits
If the spawn limit rule is set to 0 and spawn limit is set by bucket, if no class buckets are set, it defaults to the rule of 0 and renders the player unable to spawn bots.
This adds a check where if the rule and class bucket are 0, it will check for the spawn limit bucket
* Add HasSkill checks to bot special abilities (kick/bash/etc)
* code cleanup 1
* code cleanup 2
* code cleanup 3
* code cleanup 4
* fix ^cast wirh commanded types
* Remove bcspells, fix helper_send_usage_required_bots
* linux build fix
* remove completed todo
* Allow inventory give to specific ID slots
* Update TODO
* Correct slot ranges for inventorygive
* Add zone specific spawn limits and zone specific forced spawn limits
* remove bd. from update queries where it doesn't exist
* Rename _spellSettings to m_bot_spell_settings
* Add IsPetOwnerOfClientBot(), add Lua and Perl methods
* Make botOwnerCharacterID snakecase
* Throw bot_camp_timer behind Bots:Enabled rule
* Move various Bot<>Checks logging to BotSpellChecks
* Remove from LogCategoryName
* Consolidate IsInGroupOrRaid
* Consolidate GatherSpellTargets
* Add missing Bot Spell Type Checks to log
* Add GetParentSpellType when checking spelltypes for idle, engaged, pursue CastChecks.
* Consolidate AttemptForcedCastSpell
* Consolidate SetBotBlockedBuff/SetBotBlockedPetBuff
* Add list option to ^spellpriority commands.
* Move client functions to client_bot
* Move mob functions to mob_bot
* Move bot spdat functions to spdat_bot
* Move SendCommandHelpWindow to SendBotCommandHelpWindow and simplify
* Change char_id to character_id for bot_settings
* update todo
* Fix typo on merge conflict
* Cleanup command format changes, remove hardcoded class IDs in examples.
* Set #illusionblock for players to guide access
* Move client commands for bot spells from gm commands to existing bot commands
* Fix alignment issues
* More alignment fixes
* More cleanup 1
* More cleanup 2
* Fix BotMeditate to med at proper percentages
* Correct GetStopMeleeLevel checks for some buff checks
* Add back hpmanaend update to bot raid, force timer update to prevent spamming
* Remove log
* Cleanup ranged and ammo calculations - Adds throwing check for match
* Add check in distance calculations to stay at range if set even if no ammo or ranged
* Move melee distance calculations to better function
* Add GetBuffTargets helper
* Missing p_item, s_item in CombatRangeInput
* Linux test?
* Reduce GetCorrectBotSpellType branching slightly
This is still an ugly ass function but my brain is melted
* Line fixes
* Make bot pets only do half damage in pvp
* Add bot pet pvp damage to tune
* Add bot pet check for AIYellForHelp
* Add bots to UseSpellImpliedTargeting
* Move toggleranged, togglehelm and illusionblock to new help window. Add actionable support
* Add bot and bot pet checks to various spells, auras and targeting checks that were missing.
* update todo
* New lines
* Correct DoLosChecks
* Remove Log TestDebug
* Remove _Struct from struct declarations
* Add bot check to IsAttackAllowed for GetUltimateOwner to skip entity list where possible
* Wrap SaveBotSettings in Bots Enabled check
* Remove comment
* Wrap bot setting loading for clients in bots enabled rule
* Cleanup BlockedBuffs logic in SpellOnTarget
* Rename BotSpells_Struct/BotSpells_Struct_wIndex
* Rename spawn/create status bypass rules, fix return for spawn limit
* Remove unnecessary return in CanBuffStack, cleanup
* Enable recastdelay support for clients
* Remove unused variables
* Rename _assistee to bot_assistee
* hardcode BotCommandHelpWindow colors
* todo
* Fix ^cast summoncorpse
* todo
* Reimplement secondary colors to BotSendCommandHelpWindow
* Give ^copysettings/^defaultsettings more options, cleanup.
* Cleanup some commands
* Add comment to CheckLosCheat/CheckLosCheatExempt
* Make struct BotSpellSettings snake case
* Allow duplicate casts of same spell on target for heals and cures
* Add default delay to cures
* Remove unused methods
* Implement missing ^spellresistlimits/^resistlimits command
* Move functions out of mob.h and cleanup
* Return for GetRawBotList
This checks offline bots too
* Rename BotGroupSay to RaidGroupSay
* Prevent bots from forming their own group if a bot that is a group leader is removed from the raid
* Linux fix?
* IsPetOwner fixes
* Add remove option to list for ^blockedbuffs / ^blockedpetbuffs
* Implement ^spellannouncecasts to toggle announcing casts of spell types
* Remove rule Bots:BardsAnnounceCasts
* Update bot.h
* Remove unused no_pets option from GatherSpellTargets
* Move ^attack response back to normal chat window (other)
* Set lower limit of spell delays to 100 rather than 1
* Correct pet checks on GetUltimateSpell functions
* Add rules (Bots, AICastSpellTypeDelay, Bots, AICastSpellTypeHeldDelay) to prevent spamming of failed spell type AI casts
* Correct pet buff type logic to catch DS/Resists with other spell effects in them
* Fix defaults for clients
* Add more logic for necros/shaman for default heal thresholds due to lich and canni
* Rename SpellHold, SpellDelay, SpellMinThreshold, SpellMaxThreshold, SpellRecastDelay to fit SpellType style naming
* Use GetTempSpellType() for announce check in RaidGroupSay
* Make all spell shortnames plural where applicable
* Update bot.cpp
* Bots:BotsUseLiveBlockedMessage filter to spell failure
* Move GetSpellTargetList to only get called when necessary to reduce overhead
* formatting
* Formatting
* Simplify case SE_Illusion and SE_IllusionCopy for GetIllusionBlock
* Clean up InterruptSpell
* Cleanup IsBot() checks for DetermineSpellTargets->ST_GroupClientAndPet
* Cleanup range/aoe_range check in SpellFinished
* Cleanup DetermineSpellTargets->ST_GroupNoPets
* Cleanup DetermineSpellTargets->ST_Self for bot summon corpse
* Cleanup DetermineSpellTargets->ST_Pet
* Cleanup bot logic in TryBackstab
* Cleanup IsAttackAllowed checks for bots and their pets
* Cleanup StopMoving for bots
* Cleanup CanThisClassTripleAttack
* Fix casting for GetIllusionBlock checks
* Formatting
* Fix DetermineSpellTargets for group spells (this also wasn't properly checking the rule Character:EnableTGB in master)
* Cleanup spelltarget grabbing logic, consolidate group heals in to GetNumberNeedingHealedInGroup
* Throw added client los pet checks behind LoS cheat rule for bots
* CLeanup give_exp on npc death logic and ensure client pets always pass.
* Undo unintended rename from previous refactor
* Remove pointless Bots, SameRaidGroupForXP rule
* Revision to 0690783a9d1e99005d6bee0824597ea920e26df9
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Zone optimizations
* More changes
* More
* Update entity.cpp
* Beautiful
* Amazing
* Feature flag all logic
* Broadcast to group
* Update mob.cpp
* Updates
* Update client.cpp
* Update client.cpp
* Add rule Zone:EnableEntityClipping
* Little bit of cleanup
* Don't send update to self while in group
* Remove visibility work and feature flags
* Cleanup
* Logging
* Improve CheckSendBulkNpcPositions
* No need to cast
* Field cleanup
* Build initial list on zone-in
* basic evolving items framework created
* Implement evolving tab in the inventory window
* Implement experience and number of kills
* Move zone evolving map to a evolvingitemsmanager class
* rework gm commands
* rework GetInventory
* wip
* wip loot testing
* Fix Duplicate Message
* reworked evolving item looting, swapping, etc
* reworked const functions for evolving methods
* Functioning Player Trade of evolving items test item_id is 89550
* First pass of Final Result link working
* First pass of item upgrading when reaching 100%
* Add strings and logic for displaying the evolving item xp transfer window in Corathus
* Prototype of xp transfer window sending items
* WIP for evolve xp transfer
* WIP for evolve xp transfer. First tests passed
* XP Transfer Cleanup
* XP Transfer Cleanup
* Add Rule for evolving items equip timer/ default is 30 secs
* Add logging and player events
Add logging and player events
* Formatting
* Database updates
* Updates for linux build
* Perl/Cleanup
* Command cleanup
* Lua
* Added a crash condition check if final item id is blank or not found.
* Review Changes
Updates to resolve review comments and a rebase.
* migrate to content_db for items_evolving_details
migrate to content_db for items_evolving_details
* Simplify, don't hit database unless evolving
* Update 2025_01_19_items_evolving_details.sql
* Update client.cpp
* Update manifest with items_evolving_details
* character_id vs char_id
* Remove _Struct from structs
* Remove license header in evolving.cpp
* Move evolving constants from eq_constants.h to evolving.h since it is more specific
* Update database_schema.h
* General cleanup
* Be more specific with `evolving_items` vs `evolving`
---------
Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
# Corpse Overhaul
Changelog:
- Player corpses now have two timers, one specific to the rezability of the corpse and the other to cover the overall rot timer of the player corpse.
- The rezability timer is based on the online presence of the player/account and is not affected by being offline.
- The rot timer is not affected by offline/online status and will count to the rot status of the corpse.
- Corpses can be rezzed multiple times, however only the first rez that yeilds returned xp will be counted. Not other rez will return any xp. This allows for a "Poor mans COTH" as was used many times in the early eras.
- All Corpse class private/protected member variables are all now prefixed with m_
- Added Corpses logging category along with many debug logs
- Removed LoadCharacterCorpseData
- Removed LoadCharacterCorpseEntity
- Added LoadCharacterCorpse(const CharacterCorpsesRepository::CharacterCorpses, const glm::vec4 &position) which simplifies areas of consumption and reduces double queries from removing LoadCharacterCorpseData and replacing LoadCharacterCorpseEntity
- All parameters that were prefixed with in_ have been dropped
- Removed two queries from CheckIsOwnerOnline and have it query the world's CLE by account_id since that is how live works
- Regenerated repository character_corpses
- Cleaned up many list iterators to use range based for loops
- Rate limit Corpse::Process m_is_rezzable with a 1 second check timer
- General code cleanup
- Added a Server Up check to bury all corpses in instances to prevent lost corpses if an instance is released during server down. This facilitates player recovery via shadowrest or priests of luclin.
This PR also now fixes a long standing issue with HasItem performance in our script plugins. It is significantly faster, we will need to coordinate quest changes and comms with operators.
```lua
if ($client->HasItemOnCorpse($item_id)) {
return 1;
}
```
```lua
--corpse
if self:HasItemOnCorpse(itemid) then
return true
end
```
Testing Completed:
- Create a Corpse
- Standard rezzing
- Ghetto Coth (No Extra XP)
- Rezzing after graveyard move
- Divine Rez works as intended
- No XP Rez (Corpse Call) does not give XP
- Corpse Burying
- Cross Instance Graveyard Corpse movement/Rezzing
- DZ End/Quit Corpse Movement/Rezzing
- Server Shutdown/Reinit DZ Corpse Movement/Rezzing
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Added mintime and maxtime to spawnentry. This will prevent a NPC from spawning outside of the times specified. NPCs spawned in this way will then behave like normal NPCs. They will not despawn on their own, unlike spawn_events/spawn_conditions. NPCs using this that are alone in their spawngroup will attempt to spawn after their respawn timer has expired if the time of day is outside their range. Otherwise, another NPC in the spawngroup will be chosen to spawn. The normal rules (chance, spawn_limit) still apply to these NPCs, this is just another rule added to the system.
mintime and maxtime both represent the in-game EQ Hour. Valid values are 1-24. If either or both of the values are 0, then the NPC will not have any time restriction.
Added a new rule World:BootHour. This allows server admins to specify the EQ hour the server will boot to. Valid options are 1-24. Setting this rule to 0 (default) disables it and world will use whatever time is specified in the DB.
* generated base_spawnentry_repository.h from script
* removed the rule insert from database_update_manifest.cpp.
* Add logging, initializers, minor cleanup
* Remove if/else branch
* Update eqtime.cpp
* Initializers, logging
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Data Buckets] Zone-Based Data Bucket Caching
# Notes
- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.
* Cleanup and unify GetData access patterns
* Cache work
* Push
* Add to cache when we fetch and do a db hit
* Handle bucket misses in cache
* Formatting
* Logging
* [Data Buckets] Zone-Based Data Bucket Caching
- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.
* Cleanup and unify GetData access patterns
* Cache work
* Push
* Add to cache when we fetch and do a db hit
* Handle bucket misses in cache
* Formatting
* Remove redundant fetches from cache since GetData does the same thing
* Push progress
* Distributed cache work
* Logging
* Fix issue with scoping where same named keys could return overlapping results
* Misses cache tweak, logging, comments
* Add bot, client, and NPC bucket methods to Lua.
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Commands] Add #bugs Command.
- Adds a #bugs command for viewing bug reports.
- Remove unused bug related rules in favor of hard-coding the new system.
* Cleanup.
* Typo.
* Push.
* Lower status so it fits with message.
* Add faction logging category
Probably should use this for more things
* Add FactionAssociation struct
This is simply just a struct that contains an array of faction ids and
multiplier. This can hold a maximum of 10 entries (Seru hit is 8, so 2
extra) this can be raised if need be.
* Add database changes and other data point changes
This is all the database changes and loading changes
Included is an optional SQL that will be used as a starting point, there
is likely errors or typos, but we will fix those as they are discovered.
* Add Client::RewardFaction function
This just takes the faction ID and the magnitude of the primary faction
hit and calculates the rest.
The minimum change will be either 1 or -1. We stop processing after we
see an ID of 0 and assume there will be no later entries.
The primary faction ID will always receive a hit even if there is no
faction association entries
* Add users of RewardFaction to NPC death, tasks, and QuestRewards
This will only use the new system if the magnitude is set, otherwise we
will just use the old system still
* Add quest system calls and lua QuestReward support
* Add #factionassociation command
This just calls RewardFaction, mostly useful for debugging
* Start of discord integration work
* more testing
* Discord client work
* More discord work
* Cleanup
* Handle retry timer response and max retries
* Update base retry timer
* Move Discord queue handler to UCS, add queuer to own thread
* Post merge
* Send up Zone::SendDiscordMessage
* Start of discord integration work
* more testing
* Discord client work
* More discord work
* Cleanup
* Move Discord queue handler to UCS, add queuer to own thread
* Post merge
* Push up tables
* Quest API stuff.
* Update 2022_05_07_discord_webhooks.sql
* Post merge fixes
* Push up manifest
* Flip logging signs in logic from copy / paste of inverse logic before
* Make sure we add new line to quest api sourced messages
Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
* [Feature] Client Checksum Verification (Resubmit old 1678)
* Updated db version
* Add new updatechecksum to CmakeLists.txt
* Removed magic number and used constant
* Fix new command to have access to worldserver
* spacing, more venbose desc and remove unneeded check
* Cleanup, refactoring
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Initial commit
* Push latest
* Update door_manipulation.cpp
* More door work
* More doors work
* Upload notes
* Finalize changes
* Remove comment
* Add missing chat line
* Swapped URI parser with something not using deprecated C++ functions
* Shared tasks WIP; lots of logging; shared tasks and tasks work internally the same for now; lots to cleanup yet
* Update task_manager.cpp
* Add tables
* World message handler
* Zone message handler
* More messaging
* More rearranging
* Task creation work (wip)
* Tweaks
* Decoupled things, added a shared task manager, moved logic to the manager, created the shared task object, now creating a sense of state on creation and members, zero validation, happy path
* Cleanup unnecessary getter
* More work on shared task persistence and state loading
* Add int64 support into repositories
* More state handling, creation loads all tables
* Wrap up shared task state creation and removal
* Move more lookup operations to preloading (memory). Restore shared task state during world bootup
* Implement shared task updates
* Add members other than just leader in task confirmations
* Update shared_task_manager.cpp
* Hook task cancellation for shared task removal (middleware)
* Remove dynamic_zone_id from SharedTasks model in repositories (for now) since we will likely be one to many with DZ objects
* Get members to show up in the window on creation
* Add opcodes, cleanup
* Add opcode handlers
* Split some methods out, self removal of shared task and updating members
* Implement offline shared task sync
* Style changes
* Send memberlist on initial login; implement remove player from shared task window
* Refactorings, cleanup
* Implement make leader in shared tasks window
* Implement add player, sync shared task state after add
* Add opcodes for remaining clients
* Shared task invite dialogue window implementation and response handling (including validation)
* Logging
* Remove comment
* Some cleanup
* Pass NPC context through shared task request logic
* Remove extra SharedTaskMember fields
* Add message constants
* Remove static
* Only use dz for expedition request
This passes expedition creation parameters through DynamicZone instead
of injecting ExpeditionRequest since it can hold creation data now
* Store expedition leader on dz
This shifts to using the leader object that exists in the core dynamic
zone object. It will be moved to the dynamic zone table later with other
columns that should just be on the dz to make loading easier.
Expeditions are probably the only dz type that will use this for window
updates and command auth. Other systems on live do fill the window but
don't keep it updated
* Store expedition name on dz
This uses the name stored on dz (for window packets) instead of
duplicating it. This will be moved completely to dz table later
* Store uuid on dynamic zone
This lets dynamic zones generate the uuid instead of expeditions. Other
dz type systems may want to make use of this. Lockouts should also be
moved to dynamic zones at some point in the future so this will be
necessary for that
* Move expedition db columns to dz
These columns should just belong to the core dynamic zone. This will
simplify loading from the database and in the future a separate
expedition table may no longer be necessary.
* Move window packet methods to dz
It makes more sense for these methods to be in the core
This will also allow support for other systems to use the window, though
live behavior that updates the window for shared task missions when not
in an expedition is likely unintended since it's not updated on changes.
* Store dynamic zone ids on clients
These will now be used for client dynamic zone lookups to remove
dependency on any dz type system caches
* Move member management to dz
This moves server messaging for adding and removing members to internal
dynamic zone methods
Set default dz member status to Unknown
* Move member status caching to dz
This moves world member status caching into internal dz methods
Zone member updates for created expeditions are now async and sent after
world replies with member statuses. Prior to this two memberlist packets
were sent to members in other zones on creation to update statuses.
This also fixes a bug with member statuses being wrong for offline raid
members in the zone that created an expedition. Note that live kicks
offline players out of raids so this is only to support emu behavior.
* Move member status updates to dz
* Set dz member status on all client dzs
This also renames the zone entry dz update method and moves window
update to a dynamic zone method. Eventually expedition components
should just be merged with dz and handled as another dz type
* Save instance safe return on characters
Add character_instance_safereturns table and repository
Previously dz safe return only worked for online characters via the dz
kicktimer or offline characters with a workaround that moved them when
an expedition was deleted. There were various edge cases that would
cause characters to be moved to bind instead (succoring after removal,
camping before kick timer, removed while offline, bulk kickplayers
removal with some offline)
This updates a character's instance safereturn every time they enter a
zone. If a character enters world in an instance that expired or are no
longer part of they'll be moved to their instance safereturn (if the
safereturn data is for the same zone-instance). Bind is still a fallback
This may also be used for non-dz instancing so it's named generically
This removes the expedition MoveMembersToSafeReturn workaround which
deprecates the is_current_member column of dynamic_zone_members and
will be removed in a followup patch.
* Remove is_current_member from dz members
This was only being used in the workaround to move past members to
dz safereturns if they were still inside the dz but not online
* Let dz check leader in world
This moves expedition leader processing in world to the dynamic zone.
This is a step in phasing out the separate expedition class for things
that can run off the dynamic zone core with simple dz type checks
This greatly simplifies checking leader on member and status changes
without needing callbacks. Other dz types that may use the dz leader
object can just handle it directly on the dz the same as expeditions
* Let dz handle member expire warnings
This moves expire warning checks to dz. This will make it easier for
other dz types to issue expire warnings if needed
* Use separate dynamic zone cache
Dynamic zones are no longer member objects of expeditions and have been
placed into their own cache. This was done so other dz types can be
cached without relying on their systems. Client and zone dz Lookups are
now independent of any system
This continues the process of phasing out a separate expedition cache.
Eventually expeditions can just be run directly as dynamic zones
internally with a few dz type checks.
Add dz serialization methods (cereal) for passing server dz creation
Modify #dz list to show cache and database separately. Also adds #dz
cache reload. This command will reload expeditions too since they
currently hold references to the dz in their own zone cache.
Add a dynamic zone processing class to world to process all types and
move expedition processing to it
* Move expedition makeleader processing to dz
* Let dz handle expedition deletions
This removes the need for separate expedition cache in world
This will greatly simplify world dynamic zone caching and processing.
Dynamic zones that are expeditions can just handle this directly. Once
lockouts and other components are completely moved to dynamic zones the
separate expedition cache in zone will also no longer be necessary
* Remove ExpeditionBase class
Since world no longer caches expeditions this will not be necessary
* Fix windows compile
* Implement task dz creation
Prototype dz creation for shared tasks
* Add and remove shared task members from dz
Also keep leader updated (used in choose zone window)
* Fix client crash on failed shared task
* Fix linux compile and warning
* Check client nullptr for dz message
This was accidently removed when expedition makeleader was moved
* Disable dz creation for solo tasks
* Add shared task repository headers to CMakeLists
* Add shared task dynamic zones table
* Add shared task dz database persistence
* Get members from db on shared task dz creation
This fixes a case where removing a member from a shared task dz would
fail if the member's name was empty. This could happen if the shared
task dz was created while a member was offline.
This also changes the dz member removal method to only check id. It
might be possible to change all dz member validations to only check
ids since names are primarily for window updates, but shared task dz
member names need to be non-empty anyway to support possible live-like
dz window usage in the future.
* Add character message methods to world
Add simple and eqstr message methods to ClientList
Add shared task manager methods to message all members or leader
* Add SyncClientSharedTaskState and nested sync strategies to cover M3 work
* Fix whitespace
* Implement task request cooldown timer
This implements the task request cooldown (15 seconds) that live uses
when a task is accepted. This will also need to be set when shared
tasks are offered (likely due to additional group/raid validations)
* Implement shared task selector validation
This implements the validation and filtering that occurs before the task
selection window is sent to a client for shared tasks
To keep things live-like, task selectors that contain a shared task will
be run through shared task validation and drop non-shared tasks. Live
doesn't mix types in task selections and this makes validation simpler.
Also note that live sends shared task selectors via a different opcode
than solo tasks but that has not been implemented yet
* Add separate shared task select opcodes
Live uses separate opcodes for solo and shared task selection windows
* Convert ActivityType to enum class
* Refactor task selector serialization
This adds serializer methods to task and task objective structs for the
task selection windows. This combines the duplicate task selector
methods to reduce code duplication and simplify serialization
* Add shared task selector
This sends shared task selection window using the shared task specific
opcode and adds an opcode handler for shared task accepts which are sent
by client in response to setting selection window to shared task type.
* Refactor task objective serialization
This adds a serialization method to the task objective struct for
serializing objectives in the window list and combines the separate
client-based methods to reduce duplicated code.
* Add task level spread and player count columns
* Implement shared task accept validation
This adds a common method for shared task character request queries
* Add task replay and request timer columns
* Add character task timers table
* Use shared task accept time on clients
This overrides client task accept time with shared task's creation time.
This is needed for accurate window task timers and lockout messages
especially for characters added to shared tasks post creation
* Implement task timer lockouts
This implements replay and request task timers for solo and shared tasks
* Add solo and shared task timer validation
* Remove logging of padding array
This gets interpreted as a c string which may not be null terminated
* Implement /kickplayers task
This also fixes current CancelTask behavior for leader which was
performing kickplayers functionality through the remove task button
* Implement /taskquit command
* Implement shared task invite validation
Remove active invitation before invite accept validation
* Remove local client db persistence during SyncClientSharedTaskRemoveLocalIfNotExists
* Add missing accept time arg to assign task
* Only validate non-zero task invite requirements
* Fix task error log crash
* Separate task cooldown timer messaging
* Use method to check for client shared task
* Avoid unneeded task invite validation query
Only need to query character data for levels for non-zero level spread
* Implement /tasktimers command
May want to add some type of throttled caching mechanism for this in
the future
* Add /tasktimers rate limiter
* Intercept shared task completion; more work to come
* Change SharedTaskActivityState and SharedTasks time objects to datetime
* Add updated_time updates to SharedTaskActivities
* Mark shared tasks as complete when all activities are completed
* Save a database query on shared task completion and use the active record in memory
* Don't record shared task completions to the quest log
* Implement RecordSharedTaskCompletion, add tables, repositories
* Update shared_task_manager.cpp
* Update shared_task_manager.cpp
* Add shared task replay timers
This is still not feature complete. On live any past members that ever
joined the shared task will receive a replay timer when it's completed
* Create FindCharactersInSharedTasks that searches through memory
* Remove namespace shorthand and formatting
* More minor cleanup
* Implement PurgeAllSharedTasks via #task command
* Add #task purgetimers
* Decrease m_keepalive time between processes
* Remove type ordering in /tasktimer query
* Add comment for task packet reward multiplier
This is likely a reward multiplier that changes text color based on
value to represent any scaled bonus or penalty
* Add replay timers to past members
This implements the live behavior that adds replay timers to any
previous member of a shared task. This likely exists to avoid possible
exploits.
Shared task member history is stored in memory and is used to assign
replay timers. This history will be lost on world crashes or restarts
but is simpler than saving past member state in database.
This also makes world send shared task replay timer messages since
past members need to be messaged now
* Move PurgeTaskTimers client method to tasks.cpp
* Remove dz members when purging shared tasks
Server dz states need to be updated before shared tasks are deleted
* Use exact name in shared task invites
This removes the wildcards from shared task invite character queries
which was sometimes selecting the wrong character
Taskadd validation is called even for invalid characters to allow for
proper messages to occur
* Clear declined active shared task invitations
This also notifies leader for declined shared task invites
* Store shared task member names
This adds back the character name field to SharedTaskMember. This should
make serialization easier in the future and reduce database lookups when
names are needed for /task commands
* Implement /taskplayerlist command
* Replace queries with member name lookups
Now that shared task members store names these queries are unnecessary
This also adds not-a-member messages for /taskremove and /taskmakeleader
* Implement shared task member change packet
This avoids sending the full member list to members when a single member
is added or removed and lets the client generate chat messages for it.
* Serialize shared task member list from world
This uses cereal to serialize the full member list from world and
removes the zone query workarounds
* Initialize client task state array
This was causing sql query errors on client state reloads
The client task information array was uninitialized resulting in being
filled with 0xcdcdcdcd values in msvc debug builds. Under release builds
this may have resulted in indeterminate values
A better fix would be to refactor some of this legacy code
* Add shared task command messages
Add messages for non-leader task commands
This adds taskadd, taskremove, taskmakeleader, and taskquit messages
The leader receives double messages for taskremove like live due to the
client generated message as well as the explicit one. It also receives
double server messages if the leader /taskremoves self.
* Replace some task messages with eqstrs
This also updates to use live colors
* Avoid shared task invite leader lookup query
Since member names are stored now this query is also unnecessary
* Avoid reloading client state on shared task accept
This was unnecessarily reloading client task state when added to a
shared task.
This also resulted in all active tasks being resent to shared task
members on creation. The shared task itself is the only task that
needs to be sent which is handled by AcceptNewTask.
* Remove active shared task invite on zone
Live doesn't re-send shared task invites after zoning like it does for
expeditions so there's no need to keep these around. This fixes active
invitations never getting reset on characters that zone or go offline.
* Choose new shared task leader if leader removed
* Add separate shared task kickplayers method
* Enable EVENT_CAST_ON for clients
This will be required for a shared task objective (The Creator) in DoN
* Revert "Avoid reloading client state on shared task accept"
This reverts commit 3af14fee2de8b109ffb6c2b2fc67731e1531a665.
Without this clients added to a task after some objectives have been
completed don't get updated state. Will need to investigate this later
* Disallow looting inside a dz by non-members
Non-members of a dynamic zone should not be allowed to loot npcs inside
it. This should have been disabled for expeditions already but was still
allowed due to an oversight (or live behavior changed). This is less
critical for shared tasks since members can be added and removed at will
without leaving a dz but still an important feature.
* Change load where criteria
* Increase task completion emote column size
* Use eqstr for task item reward message
* Implement radiant and ebon crystal rewards
This adds reward columns for radiant and ebon crystals to the tasks
table and updates task description serialization
* Send task completion emote before rewards
This matches live and makes it a little easier to see item rewards when
tasks have a long completion emote. This also changes it to send via the
same normal message opcode that live uses.
* Do not send a shared task in completed task history
* Allow EVENT_TASK_STAGE_COMPLETE for quest goals
This invokes event_task_stage_complete for task elements flagged with a
quest controlled goal method. It should be expected behavior that a
completed task stage always fires this event even if a quest controls it
* Add SyncSharedTaskZoneClientDoneCountState
* Swap return for continue in this case
* Formatting
* Simplify
* Formatting
* Formatting
* Formatting
* Remove errant check
* Formatting, add setter for shared tasks
* Remove debugging
* Comments in PR
* More PR follow up
* Formatting
* Cleanup
* Update packet comments
* Comments
* More cleanup
* Send command error message if not in shared task
/taskadd is the only command with this feedback on live. Newer live
clients also generate this instead of the server sending the message
* Implement expire_time on SharedTask object and add a purge on world bootup
* Comment
* Add SyncClientSharedTaskStateToLocal where clients fall out of sync and no longer have a task locally
* Clamp shared task activity updates to max done count and discard updates out of bounds
* Fix packet send
* Revert packet send
* Adjust clamping OOO for completed time check. Add completed tables to purge truncation
* Refactor kill update logic so that shared task kill updates only update one client instead of all clients
* Cleanup how we're checking for active tasks
* Forward task sets that contain shared tasks
This forwards task sets that contain a shared task to shared task
selector validation like normal task selectors
* Change eqstr for empty solo task offers
This is the message live appears to use if all task offers are filtered
out by solo task validation
* Fix max active tasks client message
This message starts at the third argument. It was maybe intended to be
an npc say message but live just sends it as a normal eqstr with the
first two arguments nulled.
* Load client task state after zoning complete
This fixes a possible race where a character removed from a shared task
while zoning would be stuck with an incorrect character activities state
after zoning was completed.
This was caused by the character loading task state to early on zone
entry but never receiving the remove player message from world since
they are missing from the world cle until zoning is completed.
Loading client state after zone connection is completed makes sure the
client has the latest state and available to the world cle
* Send message to clients removed while zoning
This message should usually only be sent to characters that were
removed from a shared task while zoning but will occur for any sync
state removals where a message wouldn't have already occured.
* Post rebase fix
* HG comment for checking active task
* Addressing HG comments around zeroing out a shared task id
* Remove errant comment
* Post rebase database manifest updates
* Update eqemu_logsys_log_aliases.h
* More rebase catches
* Bump database version for last commit
Co-authored-by: hg <4683435+hgtw@users.noreply.github.com>
* [Cheat Detection] Anti-Cheat reimplementation
* minor patch fixes
* ceiling to server side runspeed
Warp(LT) was picking up a bunch of expected 6.2 but it was reported back as 6.5, this should help reduce the amount of false positives we get
* use ceil instead of std::ceilf for linux
* boat false positive fix
* stopping the double detection
* fixes and cleanup
* auto merge tricked me...
* dummy divide by 0 checks
this should prevent anyone from setting Zone:MQWarpDetectionDistanceFactor to 0 and causing a crash.
* Formatting
* encapsulation to its own class and clean up
* more detections
* typo
* OP_UnderWorld implmentation
* Update client_packet.h
* Syntax changes, formatting, cleanup
* preventing crashes due to invalid packet size
* typos and clearer logic
* seperated the catagory for cheats
* Updated MQGhost for more detail
Co-authored-by: Akkadius <akkadius1@gmail.com>
Added public/private class for oldleadername so we can save the previous leader name when the entity is destroyed then allow us to transfer leadership.
Adjusted DelmemberOOZ and in zone functions to include removal of the old leader when disbanding.
Add DynamicZone sql table schema
Add DynamicZones logging category
Modify CreateExpedition to take DynamicZone and ExpeditionRequest objects
Implement DynamicZone compass, safereturn, and zone-in coordinates.
Implement live-like DynamicZone instance kick timer for removed members
Implement updating multiple client compasses (supports existing quest compass)
fix: Send client compass update after entering zones to clear existing compass
Implement Client::MovePCDynamicZone to invoke DynamicZoneSwitchListWnd
when entering a zone where client has multiple dynamic zones assigned
Implement OP_DzChooseZoneReply handling
Add Lua api methods for expedition's associated dynamic zone
Add #dz list gm command to list current DynamicZone instances from database
Add Expeditions logging category
Add handlers for all Dynamic Zone/Expedition related opcodes
Add FormatName string_util function to format character names
Add Zone::IsZone helper method
Add cross zone MessageString support with variable parameters
Add static Client method helpers for cross zone messaging
Add #dz gm command to debug expedition cache for current zone