8633 Commits

Author SHA1 Message Date
hg
c0b8bfde03 Fix invalid return in perl expedition api
This was returning an invalid (garbage) hash reference for
empty results when filtering on expedition name
2020-12-30 18:47:32 -05:00
hg
c09ada67d6 Add expedition lock message constants to perl 2020-12-30 18:47:32 -05:00
hg
cc5dd4cd82 Add missing expedition perl api declaration 2020-12-30 18:47:32 -05:00
hg
8708564889 Don't send info packet when new member added
It isn't necessary to send this packet to current members when a new
expedition member is added. The member list packet changes the current
player count on the window
2020-12-30 18:47:32 -05:00
hg
f506ce9d58 Reduce packet updates when expedition member added
This fixes unnecessary packets and compass updates being sent for
invited members and better matches live's packet update pattern

This also fixes duplicate updates being sent to the added member

Live only sends a MemberListName update for members added through a
swap (player count doesn't change). For members added through an
invite it sends expedition info and a full member list update

A full member list update is sent for both cases in this patch. This
is because MemberListName currently always adds members with status
"unknown". This is either due to unknown packet fields or a change
in future clients
2020-12-30 18:47:32 -05:00
hg
074b7096df Use fmt join for simple query strings 2020-12-30 18:47:32 -05:00
hg
b46eca4ec6 Store expeditions with dz id not instance id
This exposes dynamic zone ids for any future changes and will make it
easier to preserve historic dz and expedition data. This also cleans up
some dynamic zone creation for expedition requests

When purging instances the expedition table is no longer updated
since dynamic zone ids are not re-used like instance ids are

Update #dz list commands to show dz id

Add GetDynamicZoneID and get_expedition_by_dz_id quest apis
2020-12-30 18:47:32 -05:00
hg
54500b0e72 Use column aliases for expedition request query 2020-12-30 18:47:31 -05:00
hg
d2ad2ec078 Add comment to FormatName 2020-12-30 18:47:31 -05:00
hg
b85feb5461 Rename expedition packet fields 2020-12-30 18:47:31 -05:00
hg
022f82291a Rename world expedition cache to state 2020-12-30 18:47:31 -05:00
hg
579c300cbc Rename expeditions table 2020-12-30 18:47:31 -05:00
hg
0f051b68ae Separate world expedition source files 2020-12-30 18:47:31 -05:00
hg
58b3708a47 Use named args in CreateExpedition lua api
This is a breaking api change

All expedition request parameters are now passed via a single table
containing hash keyed options to define values
2020-12-30 18:47:31 -05:00
hg
b68994f25c Change all expedition tables to latin1
The lockout tables are latin1 to support older MySQL and MariaDB
versions that limit indexes
2020-12-30 18:47:31 -05:00
hg
ad51de052c Cleanup expedition perl api croak messages 2020-12-30 18:47:31 -05:00
hg
77406d7322 Add AddReplayLockoutDuration api 2020-12-30 18:47:31 -05:00
hg
3ed7215a92 Rename character expedition lockouts table 2020-12-30 18:47:31 -05:00
hg
3a1eb51890 Send lockout times with client rounding offset
Add 60s to lockout times sent to clients. Lockout timers
are rounded down to the nearest minute when displayed

This replaces the lockout leeway rule with better behavior
2020-12-30 18:47:31 -05:00
hg
ca113cdd85 Let world dispatch expedition expire warnings
This depends on C++14 remaining enabled for chrono literals
2020-12-30 18:47:31 -05:00
hg
da5d4b9830 Send all members expedition expire warnings
All expedition members are notified not just those in dz

This will only work if the dz is running. It might make more sense to
move this to client or world processing so members are notified even if
the zone instance isn't running
2020-12-30 18:47:31 -05:00
hg
79287fc507 Require zone id to get expedition by instance id
This is a breaking api change
eq.get_expedition_by_instance_id(instance_id) is replaced with
eq.get_expedition_by_zone_instance(zone_id, instance_id)

This replaces the FindCachedExpeditionByInstanceID method of
obtaining expeditions via instance id with a new method that
requires the dz zone id as well
2020-12-30 18:47:31 -05:00
hg
cd98b8bc6f Only send member updates after caching dz data
This fixes characters not receiving a compass if they're already
in the compass zone when an expedition is created from another zone
2020-12-30 18:47:31 -05:00
hg
18dd9e6637 Add #dz expedition unlock command
Add expedition name and zone to #dz expedition list

Adjust #dz list output
2020-12-30 18:47:31 -05:00
hg
6266aa86a4 Add perl expedition api 2020-12-30 18:47:31 -05:00
hg
c26c6af356 Remove rule to verify expedition leader with db
This is a holdover from earlier system design and shouldn't be necessary
2020-12-30 18:47:11 -05:00
hg
a3a6e55d22 Add lockout timer multiplier rule
This allows servers to adjust all new lockout durations added
during special events like live does
2020-12-30 18:47:11 -05:00
hg
b965a165b1 Add api to update expedition expire time
Add SetSecondsRemaining method to set expire time on expedition
2020-12-30 18:47:11 -05:00
hg
2c2c2ac5ee Add api to get expedition's zone name 2020-12-30 18:47:11 -05:00
hg
cbccd72050 Truncate members after conflict checks
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.
2020-12-30 18:47:11 -05:00
hg
3db23e402c Add api to add lockout to all clients in zone 2020-12-30 18:47:11 -05:00
hg
c45840173e Load dz from cache on client switchlist reply 2020-12-30 18:47:11 -05:00
hg
76b5803f83 Let MovePCDynamicZone filter on zone version
Add client GetDynamicZones method to provide a single method to get all
associated client dynamic zones

Refactor compass update and MovePCDynamicZone to use this method
instead of searching for client dzs separately

Add optional disable message arg to MovePCDynamicZone
2020-12-30 18:47:11 -05:00
hg
b377fd183a Add api to add lockout duration
Also supports reducing lockout duration

Add Expedition::AddLockoutDuration

Add Client::AddExpeditionLockoutDuration

Some expeditions require adding to existing lockout durations
during progression. These add the specified seconds to individual
member lockout timers instead of setting a static duration based on
internal expedition lockout like UpdateLockoutDuration.
2020-12-30 18:47:11 -05:00
hg
8e52dd0579 Add expedition lock messages 2020-12-30 18:47:11 -05:00
hg
b5db40cba6 Add GetZoneVersion to expedition api 2020-12-30 18:47:11 -05:00
hg
ea34aa2030 Add group and raid api to check for lockout
Add Group and Raid method DoesAnyMemberHaveExpeditionLockout

This is required by some expeditions that perform a manual check for
custom dialogue (Ikkinz group expeditions)
2020-12-30 18:47:11 -05:00
hg
40717970ff Cleanup some expedition message formatting 2020-12-30 18:47:10 -05:00
hg
1d24432e47 Truncate expedition members to max on creation
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)
2020-12-30 18:47:10 -05:00
hg
a597753bee Increase default early dz shutdown time
Increases default from 15 minutes to 25 minutes

This compensates for current default graveyard timer code. Otherwise
instances may shutdown before graveyards can process any corpses.

A better fix needs implemented later to deal with corpses inside
expired dynamic zone/instances. Zones without graveyards should move
corpses to the non-instance version and zones with graveyards should
somehow still be processed (maybe offloaded to world?)
2020-12-30 18:47:10 -05:00
hg
4d1abce084 Allow zone name in alt CreateExpedition api 2020-12-30 18:47:10 -05:00
hg
f822798c63 Cleanup some vector emplacements in expeditions 2020-12-30 18:47:10 -05:00
hg
0c5bd9b338 Escape expedition and event names in queries
Fixes names that have apostrophes
2020-12-30 18:47:10 -05:00
hg
779fc6265e Load character lockouts without looping 2020-12-30 18:47:10 -05:00
hg
d6ab87e2c4 Avoid world message on offline member invite
Expedition member status can be used to choose the message
2020-12-30 18:47:10 -05:00
hg
6e5ca19d18 Get dz safe return from cache not db
This was loading the dz from database to get safe return data every time
a client's dz removal timer triggered

Add the Zone::GetDynamicZone() method so zones that are dz instances can
find the data from the cache of any dz systems
2020-12-30 18:47:10 -05:00
hg
fba078bbe9 Format name in expedition invite message
Live uses the original unformatted user input in invite messages, but
this doesn't seem necessary to emulate
2020-12-30 18:47:10 -05:00
hg
ce19deb5d1 Add rule to always notify new expedition leader
On live, new expedition leaders are only notified if made leader from
the /dzmakeleader command (or from ui). This rule makes it so the new
leader is always messaged on a leader change for cases where previous
leader goes offline or quits
2020-12-30 18:47:10 -05:00
hg
1f3c5af996 Add #dz makeleader command 2020-12-30 18:47:10 -05:00
hg
9c4df6f026 Don't set member offline before linkdead
This prevents toggling to offline state before setting to and from
linkdead status. Without this change, a new expedition leader will be
chosen as soon as the current leader goes linkdead. On live an
expedition leader retains leadership while linkdead
2020-12-30 18:47:10 -05:00