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.
Now that the websockets server is integrated into PRUDPServer, we have
to question if we even want to remove these casts, since it doesn't make
much sense for HPP.
Also updaete SecureConnection::Register to support TCP addresses on the
client for websocket implementations.
The `MatchmakeSessionSearchCriteria` is intended to be compared with the
original session to find valid sessions. Thus, we can remove the
`SearchCriteria` field that we are storing internally and instead
compare values with the session.
With this, we implement comparing attributes by default, unless
game-specific checks are defined, in which case the attribute search
gets overriden. This allows overriding region-locked matchmaking.
This also allows removing session creation that requires search criteria
`CreateSessionBySearchCriteria` and instead move everything to
`CreateSessionByMatchmakeSession`.
We can also remove the cleanup of search criteria, since it's redundant
considering we allow game-specific checks.
Friends-only matches are also now supported, and requires setting the
`GetUserFriendPIDs` handler on `MatchmakeExtension`.
This improves accuracy finding sessions and is how Rambo's MK8 server is
implemented.
Tested successfully with:
- Mario Kart 7
- Steel Diver: Sub Wars
- IRONFALL Invasion