This removes the separate Expedition class and moves lockout code and
/dz command handlers into DynamicZone classes. It also refactors some
code to reduce bloat and some database usage.
This completes the effort of moving everything to DynamicZone that
started when implementing shared tasks. It also makes sense to do this
since expeditions are just dynamic zones internally despite dzs being
used for other types. Expedition specific things are just handled with
dz type checks.
Functionally nothing should change. This is mainly internal refactoring
and moving code around along with some bug fixes and reduced database
usage.
Main changes:
- The `expeditions` database table has been removed
- Expeditions no longer use a separate id, the expedition id is just the dz id
- Expedition lock state and replay timer option were moved to the
`dynamic_zones` table
- Expeditions no longer have a separate cache from dynamic zones
- Expedition creation no longer has every zone query the database to cache it
- Expedition internal lockouts are now stored on DynamicZone
- The `expedition_lockouts` table has been renamed to `dynamic_zone_lockouts`
- Fixed a small bug with the UpdateLockoutDuration api where the
internal lockout would get the time added twice in memory in the
initiating zone (this api is likely rarely used)
- Fixed an issue where use of the group/raid DoesAnyMemberHaveExpeditionLockout
api would query once for every out of zone character.
- This api now checks all members in the current zone first and only
performs a single bulk query for out of zone members if that check
is exhausted
- Deprecated the max_check_count param of DoesAnyMemberHaveExpeditionLockout,
the quest api still exists to avoid api break but a passed arg has no effect
* First pass of player_event_loot_items
* Second pass of player_event_loot_items
* Third pass of player_event_loot_items
* Example without RecordDetailEvent template
* Cleanup the removal of the template
* Fourth Pass
Add retention for etl tables
Rename tables/fields to etl nomenclature
Combine database work to one atomic load
* Reposition to reduce db tasks
* Refactor etl processing for easier additions
* Add merchant purchase event
testing passed though appears that the event itself has a few bugs. Will fix them in another commit
* Fix PlayerEventMerchantPurchase in client_packet.cpp
* WIP - Handin
* Handin Event added
* Cleanup
* All a rentention period of 0 days which deletes all current records.
* Updates
Cleanup and refactor a few items.
* Cleanup and Formatting
Cleanup and Formatting
* Add etl for
Playerevent::Trade
PlayerEvent::Speech (new event to mirror functionality of qs_speech
* Add etl for
Playerevent::KilledNPC, KilledNamedNPC and KilledRaidNPC
* Add etl for Playerevent::AA_purchase
Add etl for Playerevent::AA_purchase
* Cleanup before PR
* Review comment updates.
* Add world cli etl:settings to output a json on all player event details.
* Add reserve for all etl_queues
Correct a failed test case for improper next id for etl tables when table is first created.
* Potential solution for a dedicated database connection for player events.
* Simple thread for player_events. Likely there is a better way to do this.
* Add zone to qs communications for recordplayerevents
First pass of enabling zone to qs direct transport to allow for PlayerEvents to bypass world.
* Cleanup a linux compile issue
* Add augments to LOOT ITEM and DESTROY ITEM
* Add augments to ITEMCREATION, FORAGESUCCESS, FISHSUCCESS, DESTROYITEM, LOOTITEM, DROPPEDITEM, TRADERPURCHASE, TRADERSELL, GUILDTRIBUTEDONATE and cleaned up the naming convention of augments
* Formatting fixes
* Swap out GetNextTableId
* Statically load counter
* Add counter.clear() since the counter is static
* Upload optional QS conversion scripts
* Remove all qs_tables and code referencing them
* Update database.cpp
* Simplify ProcessBatchQueue
* Simplify PorcessBatchQueue
* Simplify event truncation
* Build event truncation to bulk query by retention groups
* Post rebase
* Update player_events.h
* Fix build
* Update npc.cpp
* First pass of direct zone to qs sending for player events
* Remove keepalive logic
* Fix event ordering
* Cleanup
* Update player_event_logs.cpp
* Wipe event data after ETL processed
* Split up database connections, hot reload logs for QS
* Load rules from database vs qs_database
* Update player_event_logs.cpp
* Hot toggle queryserv connect
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* 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>
* Add Parcel Feature
Add the parcel system for RoF2 client
* Fixed a duplicate define
* Reformat
reformating and review changes
* Further Formatting
* Memory Mgmt Updates
Refactored to using unique_ptr/make_unique/etc to avoid manual memory mgmt.
Other format changes
* Refactor db structure
Refactor for db structure of parcels to character_parcels
Removal of parcel_merchants
Addition of npc_types.is_parcel_merchant
Cleanup as a result
* Refactor to use item id 99990 for money transfers. Removed the money string function as a result, though simplified the messaging related to money. Other updates based on feedback.
* Move prune routine out of scheduler and into a world process.
Removed RuleI from #define
* Update
* Update database.cpp
* Update database_update_manifest.cpp
* Update main.cpp
* Update client_process.cpp
* Update parcels.cpp
* Remove parcel merchant content to optional sql instead of manifest.
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [Feature] Add additional Guild Features
This adds the following guild features and design pattern
- the existing guild system was used
- guild features are based on RoF2 within source with translaters used to converted between client differences
- backward compatible with Ti and UF, and allows for mixed client servers
- Guild Back for Ti and UF is based on RoF2 Permissions for banking if Guild Leader does not use Ti/UF
- Guild Ranks and Permissions are enabled.
- Guild Tributes are enabled.
- Event logging via rules for donating tribute items and plat
- Rules to limit Guild Tributes based on max level of server
- Rewrote guild communications to client using specific opcodes
-- Server no longer sends a guild member list on each zone
-- Guild window is updated when a member levels, rank changes, zone changes, banker/alt status using individual opcodes
-- When a member is removed or added to a guild, a single opcode is sent to each guild member
-- This reduces network traffic considerably
Known issues:
- Visual bug only. Guild Tributes window will display a 0 for level if tribute is above max level rule setting.
- Visual bug only. Guild Mgmt Window will not display an online member if the player has 'show offline' unchecked and a guild member zones within the Notes/Tribute tab. This is resolved by selecting and de-selecting the 'Show Offline' checkbox.
* Updated RoF2 Guild Comms
Updated RoF2 Guild Comms
Update RoF2 Opcodes
Rewrote RoF2 Guild Communications using specific opcodes.
Added database changes - they are irreversible
* Formatting
* Update base_guild_members_repository.h
* Format GuildInfo
* Format GuildAction enum
* Formatting in clientlist
* quantity vs quantity
* desc vs description
* Format structs
* Inline struct values
* Formatting
* Formatting
* Formatting fixes
* Formatting items
* Formatting
* Formatting
* struct formatting updates
* Updated formatting
* Updated
- std:string items
- naming conventions
- magic numbers
* Repo refactors
Other formatting updates
* Remove test guild commands
* Updated #guild info command
* Add new repo methods for Neckolla ReplaceOne and ReplaceMany
* Fix guild_tributes repo
* Update database_update_manifest.cpp
* Phase 1 of final testing with RoF2 -> RoF2.
Next phase will be inter compatibility review
* Remove #guild testing commands
* Fix uf translator error
Rewrite LoadGuilds
* Use extended repository
* FIx guild window on member add
* LoadGuild Changes
* Update guild_base.cpp
* Few small fixes for display issue with UF
* Update guild_base.cpp
* Update guild_members_repository.h
* Update zoneserver.cpp
* Update guild.cpp
* Update entity.h
* Switch formatting
* Formatting
* Update worldserver.cpp
* Switch formatting
* Formatting switch statement
* Update guild.cpp
* Formatting in guild_base
* We don't need to validate m_db everywhere
* More formatting / spacing issues
* Switch format
* Update guild_base.cpp
* Fix an UF issue displaying incorrect guildtag as <>
* Updated several constants, fixed a few issues with Ti/UF and guild tributes not being removed or sent when a member is removed/disbands from a guild.
* Formatting and logging updates
* Fix for Loadguilds and permissions after repo updates.
* Cleanup unnecessary m_db checks
* Updated logging to use player_event_logs
* Updated to use the single opcodes for guild traffic for Ti/UF/RoF2. Several enhancements for guild functionality for more reusable code and readability.
* Update to fix Demote Self and guild invites declining when option set to not accept guild invites
* Potential fix for guild notes/tribute display issues when client has 'Show Offline' unchecked.
* Updates to fox recent master changes
Updates to fix recent master changes
* Updates in response to comments
* Further Updates in response to comments
* Comment updates and refactor for SendAppearance functions
* Comment updates
* Update client spawn process for show guild name
Add show guild tag to default spawn process
* Update to use zone spawn packets for RoF2
Removed several unused functions as a result
Updated MemberRankUpdate to properly update guild_show on rank change.
Updated OP_GuildURLAndChannel opcode for UF/RoF2
* Cleanup of world changes
Created function for repetitive zonelist sendpackets to only booted zones
Re-Inserted accidental delete of scanclosemobs
* Fixes
* Further world cleanup
* Fix a few test guild bank cases for backward compat
Removed a duplicate db call
Fixed a fallthrough issue
* Update guild_mgr.cpp
* Cleanup
---------
Co-authored-by: Akkadius <akkadius1@gmail.com>
* [BUG] Fixed the discrepacy with time using command #time and in quests. https://github.com/EQEmu/Server/issues/3700
* removed comments and paratheses from previous commit.
* fixed typos.
* made some adjustment so #time, /time, scripting, and log all match.
* Update lua_general.cpp
* 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>
* MYSQL objects cannot be copied in a well defined way, this removes the copy and replaces it with another connection
* Change to share underlying pointers.
* Push up mutex changes
* Post rebase
* Formatting
---------
Co-authored-by: KimLS <KimLS@peqtgc.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
* Plumbing
* Batch processing in world
* Cleanup
* Cleanup
* Update player_event_logs.cpp
* Add player zoning event
* Use generics
* Comments
* Add events
* Add more events
* AA_GAIN, AA_PURCHASE, FORAGE_SUCCESS, FORAGE_FAILURE
* FISH_SUCCESS, FISH_FAILURE, ITEM_DESTROY
* Add charges to ITEM_DESTROY
* WENT_ONLINE, WENT_OFFLINE
* LEVEL_GAIN, LEVEL_LOSS
* LOOT_ITEM
* MERCHANT_PURCHASE
* MERCHANT_SELL
* SKILL_UP
* Add events
* Add more events
* TASK_ACCEPT, TASK_COMPLETE, and TASK_UPDATE
* GROUNDSPAWN_PICKUP
* SAY
* REZ_ACCEPTED
* COMBINE_FAILURE and COMBINE_SUCCESS
* DROPPED_ITEM
* DEATH
* SPLIT_MONEY
* TRADER_PURCHASE and TRADER_SELL
* DISCOVER_ITEM
* Convert GM_COMMAND to use new macro
* Convert ZONING event to use macro
* Revert some code changes
* Revert "Revert some code changes"
This reverts commit d53682f997e89a053a660761085913245db91e9d.
* Add cereal generation support to repositories
* TRADE
* Formatting
* Cleanup
* Relocate discord_manager to discord folder
* Discord sending plumbing
* Rename UCS's Database class to UCSDatabase to be more specific and not collide with base Database class for repository usage
* More discord sending plumbing
* More discord message formatting work
* More discord formatting work
* Discord formatting of events
* Format WENT_ONLINE, WENT_OFFLINE
* Add merchant purchase event
* Handle Discord MERCHANT_SELL formatter
* Update player_event_discord_formatter.cpp
* Tweaks
* Implement retention truncation
* Put mutex locking on batch queue, put processor on its own thread
* Process on initial bootup
* Implement optional QS processing, implement keepalive from world to QS
* Reload player event settings when logs are reloaded in game
* Set settings defaults
* Update player_event_logs.cpp
* Update player_event_logs.cpp
* Set retention days on boot
* Update player_event_logs.cpp
* Player Handin Event Testing.
Testing player handin stuff.
* Cleanup.
* Finish NPC Handin.
* set a reference to the client inside of the trade object as well for plugins to process
* Fix for windows _inline
* Bump to cpp20 default, ignore excessive warnings on windows
* Bump FMT to 6.1.2 for cpp20 compat and swap fmt::join for Strings::Join
* Windows compile fixes
* Update CMakeLists.txt
* Update CMakeLists.txt
* Update CMakeLists.txt
* Create 2022_12_19_player_events_tables.sql
* [Formatters] Work on Discord Formatters
* Handin money.
* Format header
* [Formatters] Work on Discord Formatters
* Format
* Format
* [Formatters] More Formatter work, need to test further.
* [Formatters] More Work on Formatters.
* Add missing #endif
* [Formatters] Work on Formatters, fix Bot formatting in ^create help
* NPC Handin Discord Formatter
* Update player_event_logs.cpp
* Discover Item Discord Formatter
* Dropped Item Discord Formatter
* Split Money Discord Formatter
* Trader Discord Formatters
* Cleanup.
* Trade Event Discord Formatter Groundwork
* SAY don't record GM commands
* GM_Command don't record #help
* Update player_event_logs.cpp
* Fill in more event data
* Post rebase fixes
* Post rebase fix
* Discord formatting adjustments
* Add event deprecation or unimplemented tag support
* Trade events
* Add return money and sanity checks.
* Update schema
* Update ucs.cpp
* Update client.cpp
* Update 2022_12_19_player_events_tables.sql
* Implement archive single line
* Replace hackers table and functions with PossibleHack player event
* Replace very old eventlog table since the same events are covered by player event logs
* Update bot_command.cpp
* Record NPC kill events ALL / Named / Raid
* Add BatchEventProcessIntervalSeconds rule
* Naming
* Update CMakeLists.txt
* Update database_schema.h
* Remove logging function and methods
* DB version
* Cleanup SendPlayerHandinEvent
---------
Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
Co-authored-by: Aeadoin <109764533+Aeadoin@users.noreply.github.com>
* [Code Cleanup] Zone data loading refactor
* Update client_packet.cpp
* strcpy adjustments
* Ensure safe points get reloaded properly
* Simplify GetPEQZone and getZoneShutDownDelay
* Bring in zone_store where needed
* Update client.cpp
* Signature
* Signature
* Convert helpers to using pointers
* PR comment
* Update worlddb.cpp
* Fix loading for instances
* Fix zoning with fallback as well
* Another place for instance fallback
* [Bug Fix] Fix IP Exemptions.
- IP Exemptions were broken due to GetAccountID() returning 0 in logic somehow, resolved this by setting a variable to GetAccountID() at the beginning of the method.
- Fixed weird IP messages where the long form of IP was displayed instead of the string form.
- Fixes edge case where IP rule may be set to -1 and this will make anyone get instantly kicked if IP Exemptions were enabled as their IP Count would always be greater than -1.
* Update client.cpp
* Update client.cpp
* Update clientlist.cpp
* Update clientlist.cpp
* Change default expansion values for ALL to -1 from 0
* Adjust content_filter_criteria
* Refactor content filtering logic
* Allow flag strings to also just be empty instead of null
* Formatting
* Editor oops
* [Cleanup] Make use of AccountStatus constants wherever status is checked or used.
- Cleanup all instances of SendEmoteMessage.
- Cleanup all instances of SendEmoteMessageRaw.
- Cleanup all instances of MessageStatus.
- Convert Quest API method defaults to use constants.
* Cleanup constant names.
* 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>
Add common expedition base class
Use repository for zone and world expedition caching
World now stores members and leader as Member objects instead of ids
This improves readability of the caching methods and lets world cache
expedition dzs and members like zone. World also now caches expeditions
as unique_ptr which will be necessary for future dz callback lambdas
that capture 'this' so addresses don't change on cache vector resizes.
* Convert common/eq_limits.cpp to use make_unique
* Convert common/net/console_server.cpp to use make_unique
* Convert common/net/servertalk_client_connection.cpp to use make_unique
* Convert common/net/servertalk_legacy_client_connection.cpp to use make_unique
* Convert common/net/servertalk_server.cpp to use make_unique
* Convert common/net/websocket_server.cpp to use make_unique
* Convert common/net/websocket_server_connection.cpp to use make_unique
* Convert common/shareddb.cpp to use make_unique
* Convert eqlaunch/worldserver.cpp to use make_unique
* Convert loginserver/server_manager.cpp to use make_unique
* Convert loginserver/world_server.cpp to use make_unique
* Convert queryserv/worldserver.cpp to use make_unique
* Convert ucs/worldserver.cpp to use make_unique
* Convert world/clientlist.cpp to use make_unique
* Convert world/expedition.cpp to use make_unique
* Convert world/launcher_link.cpp to use make_unique
* Convert world/login_server.cpp to use make_unique
* Convert world/main.cpp to use make_unique
* Convert world/ucs.cpp to use make_unique
* Convert world/web_interface.cpp to use make_unique
* Convert world/zonelist.cpp to use make_unique
* Convert world/zoneserver.cpp to use make_unique
* Convert zone/client.cpp to use make_unique
* Convert zone/corpse.cpp to use make_unique
* Convert zone/dynamiczone.cpp to use make_unique
* Convert zone/expedition.cpp to use make_unique
* Convert zone/main.cpp to use make_unique
* Convert zone/mob_ai.cpp to use make_unique
* Convert zone/mob_movement_manager.cpp to use make_unique
* Convert zone/pathfinder_nav_mesh.cpp to use make_unique
* Convert zone/worldserver.cpp to use make_unique
This is an experimental change which allows members to log in at the
safe return if they were offline when the expedition was deleted.
Prior to this they would log in at bind instead
Partially reverts commit 32c69d235d7fc8b816fa598b499be47d451ddba5
Removed expedition members are no longer hard deleted from db
Zones are no longer able to delete expeditions. World now tracks empty
expeditions in cache and only deletes them when it detects an
expedition's dynamic zone instance has no more clients inside.
This fixes an exploit where lockouts couldn't be applied to expeditions
after all members were removed because zones were deleting the expedition
immediately. Clients still inside the dz were able to complete events
before being kicked from the instance while not having an expedition.
Expeditions are no longer purged from database in the world purge
instance timer to avoid a possible race with this new system
This implements a small cache in world to track expedition states.
This fixes expired expeditions being left in zone caches unless the
expedition's dz instance was running to detect it (or unless an
expedition was deleted via a client using /kickplayers). This was also
leaving clients in a ghost expedition that no longer actually existed
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