Move ExpeditionLockoutTimer to common
This simplifies expedition request conflict checks and uses repository
for the queries instead of processing the query result directly.
This more accurately matches live for the new behavior introduced
in the September 16, 2020 patch. All members of a raid/group are
still checked for conflicts and the truncation is only allowed if
there are none.
It might make sense to add a rule for this since ignoring members
that would exceed the expedition max from the start makes it more
convenient to create expeditions. Members that wouldn't be added
anyway don't really need their conflicts checked.
This implements the new behavior from live's September 16, 2020
(test server's September 8, 2020) patch
Expeditions can be created even when the client's group or raid
exceeds the expedition's max player requirement. Members are added
until the max player count is reached and the rest are ignored.
Raid members are added ordered by their raid group number with
ungrouped members having the lowest priority
Rename expedition request method ValidateMembers to CanMembersJoin
Change some expedition messages to System color (live changes)
Remove extra cross zone message server opcode and struct. Existing
function already exists for normal messages
Group CZClientMessageString struct with other CZ structs
Breaking change to the current API
has_replay_timer column removed from expedition_details table
This argument is unnecessary and just creates confusion. Expedition
replay timers use a hardcoded name precisely for this purpose and
those lockouts are already being checked on creation requests.
Small cleanup of logic and unused variables
Rename LoadValidationData to LoadMembersForCreateRequest
Remove unnecessary early string building for members query
Remove unnecessary lockout expired check for leader messages
Make quest compass a vec3 to remove include dependency
Quest compass location doesn't require a zone id since it can only be
set in the zone that it's drawn in. Drop the DynamicZoneLocation member
and forward declare to remove the dependency on header.
Move ExpeditionInvite struct to zone common header
Including expedition.h in client.h just to use the ExpeditionInvite struct
is an unnecessary header dependency that increases incremental build time.
This allows expedition classes to be forward declared in client header.
Get group leader name from Client if possible and ask database otherwise
Group::GetLeaderName() is unreliable and broken for groups formed across
zones. The correct leader name is needed here to avoid any possible
exploits with an invalid leader bypassing lockout checks.
Add optional argument to CreateExpedition to disable conflict messages
Some live expeditions like anguish use a timeout to prevent excessive
leader conflict messages while still performing a creation request
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