Session Still Available in Search(Solved)

I was able to resolve my issue with adding an updatesession call to the start game session function on gameinstance. I added a update deleagte to init above the network error delegate. I probably could have that code in a seperate function and just call the fuction itself instead of directly in start game. The way I have it set is basically updating the session right after we start it. I have it set to just hide the session after we start it allowing people to join if they had the session name, but having this in own function would futher allow someone to modify the session as they change game modes to creating a new session.

SessionInterface->OnUpdateSessionCompleteDelegates.AddUObject(this,&UPuzzlePlatformsGameInstance::OnUpdateSessionComplete);

        if(GEngine != nullptr)

        {

            GEngine->OnNetworkFailure().AddUObject(this, &UPuzzlePlatformsGameInstance::OnNetworkFailure);

        }

void UPuzzlePlatformsGameInstance::StartSession()

{

if(SessionInterface.IsValid())

{

    FOnlineSessionSettings UpdateSettings;

    UpdateSettings.bShouldAdvertise = false;

    UpdateSettings.bUsesPresence = true;

    UpdateSettings.bUseLobbiesIfAvailable = true;

    UpdateSettings.bIsDedicated = false;

    SessionInterface->StartSession(NAME_GameSession);

    SessionInterface->UpdateSession(NAME_GameSession, UpdateSettings,true);

}

}

It looks like this was changed in 5.1 and this will only apply if you are using lanmatch. I tried to call update sessions settings via game start. But still seems to advetrtise the game regardless of what I do. So not sure where else to go with this. I am sure if the steam sub system was selected this would also work as intended. With NULL OSS and Not using lan match makes it so the session is always advertised. Meaning there is no solution that I can figure out at the moment and I am just going to move on as I don’t think it matters all too much at this point.

Is this within the editor.? The session persists as long as the editor remains open so you need to close the editor and open again to clear them.

I think clearing the session is covered later but I can’t remember where or how it is done.

This is not within the editor I am using launch game, and I fire up 3 games. 2 to test the game start and one to make sure the session is no longer showing up. I am not sure why the search results are still populating. I might have to wait until the game server travel happens and then open the third game. But if I load up 3 games in a row it still shows up. I haven’t gone through debugging yet, I will when I have time, I just wasn’t sure if it’s something I am missing or something else. I am also wandering if I need to call super game start since that super call seems to be really important for version 5 or later. I will do some testing and debugging as I have time.

Sorry, to be clear, are you using Steam or the NULL OSS?
For Steam, you would expect to see many sessions because you would see others if you are not using your own Steam Developer ID. The NULL OSS should clear as long as you’re running from the command line.

It does depend on the OSS you’re using.

I am not running from command line and yes using null oss. So I will try running from cmd and see if that fixes it

To add to my own discovery/troubleshooting. The reason why the update session wasn’t working was because i had it before the start game function call. seems obvious now looking back, but putting the update after the start solved my problem. So my take away for this is function call order does matter because you cant update a session that doesnt exist…figures.

1 Like

Privacy & Terms