Class GroupFinderRules
The decisions the dungeon group finder makes, as pure functions.
public static class GroupFinderRules
- Inheritance
-
GroupFinderRules
- Inherited Members
Remarks
Kept free of network, database and Unity state so each rule is a truth table that can be tested without a server. The scene server's matching pump calls these; the client calls ResolveGroupSize(DungeonDifficultyDefinition, int) only to decide whether to offer the button, and the server re-decides everything on its own copy of the same asset.
Fields
MinimumGroupSize
The smallest group the finder will ever form. A group of one is not a group, and the solo case is served by the entrance's own "Open New Dungeon".
public const int MinimumGroupSize = 2
Field Value
Methods
ResolveGroupSize(DungeonDifficultyDefinition, int)
How many players the finder gathers for one difficulty before opening a run.
public static int ResolveGroupSize(DungeonDifficultyDefinition difficulty, int capacity)
Parameters
difficultyDungeonDifficultyDefinitionThe difficulty's ruleset. Null means a dungeon with no template, which the finder does not serve.
capacityintResolved instance capacity at this difficulty.
Returns
- int
The group size, or
0when Find Group is not available at this difficulty.
Remarks
- Off when the author turned it off, or when the capacity cannot seat two.
- The author's GroupFinderSize when set, otherwise the capacity: a finder fills groups.
- Never below MinimumGroupSize or the difficulty's MinimumPartySize, because the run would refuse a smaller party at the door.
- Never above the capacity, because the run could not hold them.
- Off when those two bounds cross — a difficulty demanding more players than it can hold is unopenable by anyone, and the finder should not queue people for it.
ResolveMatchedTransfer(bool, double, double)
Decides whether a matched character is moved, left for the next pump, or dropped.
public static GroupFinderRules.MatchedTransferAction ResolveMatchedTransfer(bool canTransfer, double secondsSinceMatch, double graceSeconds)
Parameters
canTransferboolWhether the character may leave the scene right now (not in combat, not dead, not mid-teleport, and still at the entrance).
secondsSinceMatchdoubleHow long ago the group formed.
graceSecondsdoubleHow long a matched character may stay untransferable before the group goes on without them.
Returns
Remarks
A player matched mid-fight is not punished for the fight: they are moved the moment it ends. But the rest of their group is already inside, or about to be, and a slot held forever by someone who never becomes free would be a run that never fills — so the grace is bounded, and running out of it means the group left without them.
ResolveQueueRefusal(int, bool, bool)
Why a character may not join the queue, decided from what the scene server already knows about them before it touches the database.
public static GroupFinderRefusalReason ResolveQueueRefusal(int groupSize, bool isInInstance, bool inPartyWithOthers)
Parameters
groupSizeintResolved group size for the difficulty; 0 means the finder is off there.
isInInstanceboolWhether the character is already inside instanced content.
inPartyWithOthersboolWhether the character shares a party with anybody else.
Returns
- GroupFinderRefusalReason
None when nothing here refuses them.
Remarks
Order matters and is deliberate. "Not offered here" is the answer whatever the player's state, and a player already inside a dungeon should be told that before being told about their party. Whether they already hold an instance needs a database read and is decided by the caller afterwards.
ResolveWaitingCancel(bool, bool, bool)
Why a waiting character is taken out of the queue by their own scene server, decided from what it can see about them on each pump.
public static GroupFinderRefusalReason ResolveWaitingCancel(bool isInInstance, bool inParty, bool nearEntrance)
Parameters
isInInstanceboolWhether the character entered instanced content by other means.
inPartyboolWhether the character joined a party by other means.
nearEntranceboolWhether the character is still within the leash of the entrance they queued at.
Returns
- GroupFinderRefusalReason
None when they stay queued.
Remarks
Waiting is done at the entrance. That is the whole guarantee that being moved into the dungeon is never a surprise: a player who walks off is removed, told why, and can come back and queue again. Entering an instance or joining a party by other means each make the wait moot and are reported ahead of position, because they are the more useful thing to say — a player who did one of those is unlikely to be standing at the door.