Dedicated server created with advanced session acts as a listen server

I’m using the advanced session plugin to create a multiplayer session. However, even though I have the option ‘Is Dedicated Server’ checked and ‘Use Presence’ unchecked, the first client still acts as a listen server. In the editor I have the option ‘Run Dedicated Server’ under play checked as well. I know it acts as a listen server because if I want to change something only for the local client, it is changed for all other clients as well.

For example, I want to turn off the visibility of the text render that shows the name of a player for the local client, because you don’t want to look at your own name in third person mode. However if I do that for the first client, the text render is also removed for the other clients. Removing the text render of the second / third client etc. does work only locally, with it still being visible for other clients.

Does anybody know a solution to this problem?

You cannot create a dedicated server via GUI (i. e. from within client game), as a dedicated server is a complete UE instance and you cannot start that from another instance easily. So using your HostButton always creates a listen server. In fact I do not understand the “Is Dedicated Server” option of AdvancedSessions.

However, you can can indeed (as you already tried) check “Run Dedicated Server” in the play options and in an Init or BeginPlay event check if the game instance is a dedicated server (there is a blueprint node). If yes, create a session like you did above. The player controller in that case is empty/invalid and is not needed.

Thanks for your answer.

I tried creating the Advanced Session from the BeginPlay event in the GameMode blueprint, see image. For some reason, both the On Success and On Failure nodes are called (both strings are printed). The screen on both clients is black. In the logs, there is the following warning: LogOnlineSession: Warning: OSS: Cannot create session ‘GameSession’: session already exists. However, searching for sessions without trying to create one in the GameMode BeginPlay event gives no results. Do you have any clue?

  1. First of all, is your initial question answered? If so please mark. If this is a new question, I would suggest a new thread. If you suppose this to get a never ending story, the forum might be the right place.
  2. The Has Authority switch is useless as GameMode only runs on the server. Furthermore, you had an if statement right before and ask if this is a (dedicated) server.
  3. So here’s my clue: First run is successful and opens your lobby. As your lobby uses the same GameMode class (???), but GameMode is new constructed after loading of level, you get a second BeginPlay and this fails, because there is already a session. And that’s why you get the above mentioned warning. Solution: Select another GameMode for your lobby level. Correct?
  1. You’re right, my question was answered, I should have continued this elsewhere. I marked this answer.
  2. I see that now, I kinda guessed it already but thanks for explaining.
  3. You are correct, I set the default GameMode to the GameMode I created and didn’t specify any GameMode Override, so both levels used the same GameMode. By setting a different GameMode on the loaded level only the On Succes node is now called. The client screens are still black, but this is another issue, if I create a new question or forum thread I’ll link it here. Thanks again for your help.