Closed DaniElectra closed 2 weeks ago
About the database concerns: I think for now we should probably just be opinionated on using Postgres here. I do agree that we should try to be more database-agnostic about it in the future, but that comes with some overhead that I'm not sure we should spend time investing in right now.
I have issues with matchmaking on pretendo network from both Wii U and CemU, but I have open NAT type and I can perfectly do matchmaking on other services such as Wiimmfi, WiiLink, Nintendo Switch. But not on any pretendo modified games I own like Splatoon and Mario Kart 8. I get error code 118-0516 and sometimes error code 118-0519
Checked Existing
What enhancement would you like to see?
Current issues
The current matchmaking implementation has many issues, including the following:
Sessions
map doesn't use any mutexesMatchmakeSession
, it doesn't work for games that use other gathering types. For example, Mario Kart 7 communities usePersistentGathering
which uses the same gathering ID count asMatchmakeSession
and must be always preserved between server reboots/crashes, but bothMatchmakeSession
andPersistentGathering
useUnregisterGathering
to delete them (which would require various hacks to handle on the current model). This model is also problematic for tracking, since we don't keep records of previous sessionsProposal
PR #28 fixes the race conditions issue and it could be expanded to fix the second one, but as explained above this isn't enough. We will have to redo matchmaking from scratch. On Discord it has been proposed to store everything on an SQL database (since it's what Nintendo does) which would be managed by the common protocols implementation, while giving the liberty to the servers to choose a specific SQL database.
On this new implementation we still need to take into account race conditions and avoid them along the way, and we would also store connections based on the PID. This new model would also solve the session tracking issues since we are keeping records of all previous sessions
Any other details to share? (OPTIONAL)
As a nice to have, it would be great to design the new matchmaking model in a way that could support any
Gathering
type and not be limited to onlyMatchmakeSession
andPersistentGathering
. I think this could be reasonably done but we will have to see until it gets implemented.Since we intend to use SQL, this issue partially depends on https://github.com/PretendoNetwork/nex-go/pull/56 since the current NEX primitive types limit us on how we use them as native types.
On this new implementation we would also like to allow any SQL database, but we currently have a big dependency on Postgres and the
pq.Array
function (among possibly other Postgres-specific queries) across our different servers. While it may be doable, we would require some assistance from people that would be interested on this and would like to use other SQL databases.