Making a Lobby in the Game

Here’s a rundown, I want to make something similar to how Animal Crossing and Dragon Quest IX handled multiplayer. For those of you who never played those games, here’s how they work.

  1. You play the game offline at first.
  2. You go to a specific location in the game such as a train station or an inn.
  3. You connect to the internet after deciding to do so.
  4. You or your friend create the room for the other to join.
  5. the person who did not create the room joins by selecting from a list of availible rooms.
  6. You and your friend play the game together for a few hours until you decide to stop.
  7. The room creator can kick everyone out at once or the players can leave through an option in the menu or by going back to the train station or inn or wherever and saying you want to leave.
  8. The players leave and you can either leave the room open or close it so you don’t get some random dude coming in and wrecking up the place.
  9. Connection to the internet is terminated for the game and you can either reconnect to create or join another room by going through the process again or just play offline and have fun by yourself.

If anyone knows how I’d start going about doing this, I’d really appreciate it. Also, if there would be a way to add password protection for rooms, I’d appreciate a few tips about how to do that too.

I’m not asking you to make this yourself and send me the code. I’m asking for any advice on how I’d make it myself, or a link to a tutorial on how to start making something like this so I can modify it and make it the way I need it.

Thanks for reading, and any input is appreciated.