I am trying to get an in editor workflow working to aid simpler network debugging.
I have written in c++ session creation and loading into a lobby. Not using seamless travel.
Using “UGameplayStatics::OpenLevel(GetWorld(), “Lobby”, true, options);”
During the lobby initialization before any actors or gamemodes get BeginPlay, RegisterPlayers is called
“bool FOnlineSessionNull::RegisterPlayers(FName SessionName, const TArray< TSharedRef >& Players, bool bWasInvited)”
When launching in standalone with one window/one player everything works perfectly. This is the order of events…
- Load Map (the projects start up map)
- Creation Session: (IOnlineSubsystem::Get used and gets an Instance called “DefaultInstance”)
- Call OpenLevel lobby
- FOnlineSessionNull:RegisterPlayers gets called and this instance is called “DefaultInstance”
- All is well.
When launching from the in selected viewport window again with just one player.
- Load Map (the projects start up map)
- Creation Session: (IOnlineSubsystem::Get used and gets an Instance called “DefaultInstance”)
- Call OpenLevel lobby
- FOnlineSessionNull:RegisterPlayers gets called and this instance is called “Context1”
- In this instance Conext1 there is no session in its session array is its borked.
- I cached a pointer to the other onlinesubsystem called DefaultInstance and it still has the session there. But because the
engine code has found “the” other instance it cannot find any sessions to register players with.
What is the correct way around this issue which I have observed working in a pure blueprint implimentation!