PretendoNetwork / nex-protocols-common-go

Reusable implementations of NEX methods found in many servers
GNU Affero General Public License v3.0
19 stars 8 forks source link

[Enhancement]: Rework matchmaking #33

Closed DaniElectra closed 2 weeks ago

DaniElectra commented 5 months ago

Checked Existing

What enhancement would you like to see?

Current issues

The current matchmaking implementation has many issues, including the following:

Proposal

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 only MatchmakeSession and PersistentGathering. 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.

jonbarrow commented 5 months 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.

ItsPancho8 commented 1 month ago

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