Commit graph

12 commits

Author SHA1 Message Date
Daniel López Guimaraes
59c7633654
fix(matchmake-extension): Remove inlined DateTime
This isn't allowed now with the update to the `FromTimestamp()` method.
2025-02-11 16:35:00 +00:00
Daniel López Guimaraes
2fd1f78759
fix(matchmake-extension): Handle zero values on communities properly 2025-02-09 19:48:47 +00:00
Daniel López Guimaraes
35aed21585 feat: Initial support for persistent gatherings/communities
Implement methods that are needed for Mario Kart 7 communities to work.
Note that support for communities on MK7 is partial since the community
statistics don't load because legacy Ranking isn't implemented. Aside
from that, players can create communities and join others without
issues. Other games which use persistent gatherings may or may not work.

In order to support the `ParticipationCount`, we replace matchmake
session joins with a wrapper which checks if the session is attached to
a community, and if it is, it will increment the participation count of
the player in a new table named `community_participations`. The
`MatchmakeSessionCount` is handled more easily by checking the sessions
that belong to the corresponding community.

A new parameter is also added named `PersistentGatheringCreationMax`
with a default value of 4, as reported and tested on various games. This
allows game servers to change the maximum number of active persistent
gatherings that a player can create. For example, Mario Kart 7 supports
up to 8 persistent gatherings instead of the default of 4.

In Mario Kart 7 there is no limitation on the number of players that can
"join" to a community. That is because they don't really join to it but
they create matchmake sessions linked to the persistent gathering (in
fact, the `MaximumParticipants` parameter on persistent gatherings is
set to 0). Thus, the `participants` parameter is unused in communities
(at least on MK7) and we instead log community participations with a new
tracking table `tracking.participate_community`.

Some changes also had to be done in other places like participant
disconnection handling or gathering registrations in order to implement
persistent gatherings accurately.
2025-02-09 00:04:03 +00:00
Daniel López Guimaraes
bcc53deac2
chore: Inline SQL queries with NEX types 2025-01-24 22:36:52 +00:00
Daniel López Guimaraes
d7f8b585c1
feat: Migrate to new nex-go types 2025-01-01 19:55:13 +00:00
Daniel López Guimaraes
e853c5df55
fix(match-making): Change host when host disconnects
Assign a new host when the current host is disconnecting from a
gathering. To simplify the implementation, set the owner of the
gathering as the new host.

Fixes Splatoon where the client doesn't transfer the host by
themselves.
2024-10-03 20:13:33 +01:00
Daniel López Guimaraes
0290f5c994
feat(match-making): Implement JoinMatchmakeSessionBehavior
Also include some minor fixes.
2024-09-01 01:54:36 +01:00
Daniel López Guimaraes
69e3b1f342
feat(match-making): Add tracking system
Keep tracking on gathering (un)registrations, participants joining and
leaving and host and owner changes. All tracking is managed inside the
database functions except for the host and owner changes.

The `matchmaking.participants` now remains useless from this change at
the moment, so remove it for now.
2024-08-31 00:27:51 +01:00
Daniel López Guimaraes
8caa52cbbe
feat: Add MatchmakingManager abstraction
Allows removal of matchmake_extension_database dependency inside
match-making
2024-07-03 02:08:45 +01:00
Daniel López Guimaraes
ed1f78ccfa
fix(match-making): Don't use "negative" PIDs for extra participants
The concept of negative PIDs was a guess and wouldn't make sense on the
Switch. Instead, replace it with storing the "main" PID multiple times
on the participants array.
2024-07-01 19:26:43 +01:00
Daniel López Guimaraes
cc89c2ed3f
feat(match-making): Split participant disconnect from new joins 2024-06-30 16:10:34 +01:00
Daniel López Guimaraes
e71f872ac1 feat!: Matchmaking rewrite 2024-06-30 14:08:39 +01:00