Download

Joining online session through steam successfully, then UniqueNetId = Null

Hi guys,
I am currently working at a small multiplayer project. Some days ago I implemented the session managment following this tutorial (https://wiki.unrealengine.com/How_To_Use_Sessions_In_C%2B%2B) and it basically worked like a charm. Then I wanted to replace Unreals onlineSubsystem with steam, and after some struggle with integrating steamworks the game can now host and find sessions using steam. The problem arises while joining a session. It connects succesfully, the right map appears in the viewport (although no spawned pawn yet), then the listenserver crashes immediatly, because the UniqueNetId becomes null, although I know it was valid at some point of the joining. I switched back to Unrealss OnlineSubsystem for now (which works perfectly), but I would like to return to Steam, if possible.

Has anyone an idea what could cause the problem?

For any person having the same problem I finally figured out the problem was the existence of two local players. While the Unreal Online Subsystem creates dynamically new UniqueNetIds for every player, steam can use only one: The id of the steam account you are logged into while starting the game. Therefore the second PlayerController just doesn`t has any Id.
I have started creating a workaround in which just one playerController joins the session and is replicated, taking the inputs from the other local player controllers and forwarding them to the correct pawns. I am not really sure if this workaround is going to work, would be cool if someone else had any other idea to solve the problem in a cleaner way :slight_smile: