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?