How Does the Client-Server Model Work in Packaged Games?

I’m trying to create a feature for creating lobbies and joining games. Currently my goal is to get it working on LAN. I have read and implemented this guide A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums and it works fine, meaning I can create, find, and join sessions. I have also read this page https://docs.unrealengine.com/en-us/Programming/Online/Interfaces/Session.

My confusion lies in the difference between using the editor’s standalone PIE and using a packaged version of the game. If I play in the standalone version of the game, the model works as I understand: one player is designated the listen server and the other (assuming only 2) is designated the client. The two are then paired up automatically and the game plays as normal.

In the packaged version, if I doubleclick MyGame.exe it loads up what appears to be a listen server version of the game. Using command-line arguments, I can start up one game as a listen server, and start up the second games as a client and attach it to localhost. Then the games function just like the standalone PIE. What happens if I don’t use the command line arguments? Are both players listen servers? If so, lets say one player creates a session, and a second player joins that session, does the second player get downgraded to a client? When I do that in my game, the server (whichever created the session and did not join one) still doesn’t see the client.

Looking through the code for ShooterGame hasn’t really helped me yet, but I’m still looking at it. My first guess is I need to append something to the travel URL of the session to indicate the incoming player is a client, but I honestly have no clue.

When you “open” the map, you can pass listen as a parameter…

typically the player selects whether to host or join … eg (listen or not)

Right, thank you. I was thinking about it backwards. I have a followup question (I will edit the title to reflect it), now that I have sessions working and can independently start two copies of my game and join into the same session and play, do I need to use another service to get it working online? If so, what are the options for PC-only games? Steam seems like the obvious choice but it looks like it requires getting my game approved (and it’s nothing more than a concept at this point honestly). I also see that I can do it by connecting directly to the IP assuming port 7777 is forwarded. Are there other options?

Steam uses tech like STUN and ice to portforward automatically…

if you are targeting pc might make sense

If you are doing a PC-only game I would say go for Steam. Even if you don’t register on Steam Direct($100) you can still use the 480 product-id to test your game.
If you decide for Steam I can recommend the UWorks plugin.