How do non-local game hosts work?

Firstly, Id like to say that I succeeded in making the official tutorial for networking, but thats only for localhost players. I understood everything that was written in that tutorial, yet I can`t think of a method to make it work on the internet as a whole, not only on localhost.

I thought that I should use a mysql database with names and passwords for each player. But then, if I dont press HOST from the NetworkManagerHUD, then who does it? I thought that I should have a computer somewhere that acts like a server and it has to have a high capacity of RAM or whatever is needed to accept as many players as possible. And then again, how will and how should I use a mysql database to identify players (by their names and passwords)? I have worked with php&mysql before (did an online register&login system) and have worked with unity networking before, so this shouldnt be that hard.

I know that I ask for a LOT, but if I would not have done this, there would be no way I would evolve further.

Any tips are highly appreciated!

Thank you,
Eric

You’re talking about two different things; authentication and matchmaking. Unity provides multiplayer matchmaking/connection services already. This still relies on someone creating a match and advertising it to other players.

If you’re trying to do something like a persistent world then that’s a bit different and not something Unity supports out of the box AFAIK.

There are a bunch of authentication schemes/solutions out there so I’d say just pick one that works for you. Don’t write it yourself.