Vixen
caa30e12
csharp
public sealed class Matchmaker

One queue: tickets go in, matches come out, and something else allocates the shard.

Read the guide page for this →

Remarks

Open Match's four concepts and none of its deployment. Doc 28 is explicit that what is worth taking is the separation of filtering, proposing, evaluating and allocating — and that the Kubernetes-and-Go topology is not, which is the same objection doc 27 ADR-019 already made about the substrate.

⚠ Allocating is not here. The director's job is IMapGrain.Place, doc 27's placement, and a second allocator is the thing this must not become: two of them disagree about capacity and the disagreement is a shard nobody can join. Matched is where a caller hands an accepted match to placement.

⚠ A widening band is what actually bounds a queue time, and it is here rather than in the match function because every mode needs it and none of them should have to write it. A pool's rating range grows with the oldest wait in it; without that, the top and bottom of a ladder never match anybody.

Fields and properties (7)

  • public IMatchFunction Function

    What makes matches.

  • public MatchPool Pool

    Which tickets it will consider.

  • public IMatchEvaluator Evaluator

    What settles overlapping proposals.

  • public double WideningPerSecond

    How much the rating band grows per second waited.

  • public IReadOnlyList<MatchTicket> Waiting

    What is waiting, oldest first.

  • public int Count

    How many parties are waiting.

  • public int Players

    How many players are.

Events (1)

  • public Action<MatchProposal>? Matched

    Raised for every match that is made. Where a caller calls placement.

Methods (6)

  • public Matchmaker(IMatchFunction function, MatchPool? pool = null, IMatchEvaluator? evaluator = null, double wideningPerSecond = 0)

    Makes a queue.

  • public bool Enqueue(MatchTicket ticket)

    Puts a party in.

  • public bool Cancel(string id)

    Takes a party out.

  • public IReadOnlyList<MatchProposal> Cycle(float now)

    Runs one cycle: snapshot, propose, evaluate, remove.

  • public double BandFor(MatchTicket ticket, float now)

    How wide a ticket's acceptable rating band has grown.

  • public bool Compatible(MatchTicket left, MatchTicket right, float now)

    Whether two tickets are close enough to be matched, given how long they have waited.

Used by (2)

  • DuelsVixen.Live.Matchmaking.Tests
  • MatchmakerTestsVixen.Live.Matchmaking.Tests