Updating Lobby Session
In most cases you will want to update the Session Settings of the lobby at some point because of changes in the game (such as playing on a new map).
Updating Session Settings
To update the Session Settings of a session you first have to get a copy of its current settings, make the changes on the copy, and then push the changes back to the session through the Online Subsystem. The KronosOnlineSession class contains all the necessary functionality to update sessions.

#include "KronosOnlineSession.h"// Get the online session. Note that the OnlineSession class is the manager
// and not the actual session we are updating!
UKronosOnlineSession* OnlineSession = UKronosOnlineSession::Get(this);
if (OnlineSession)
{
// Get the current session settings for the match that we are in.
FKronosSessionSettings UpdatedSettings;
if (OnlineSession->GetSessionSettings(NAME_GameSession, UpdatedSettings))
{
// Change the playlist of the match.
UpdatedSettings.Playlist = TEXT("NewPlaylist");
// Whether we want to push the changes to the backend (e.g. Steam) or not.
// If this is false, only the local player's view of the session will be updated.
bool bRefreshOnlineData = true;
// Update the session. This operation is async and may not finish immediately!
OnlineSession->UpdateSession(NAME_GameSession, UpdatedSettings, bRefreshOnlineData);
}
}Important Note About Null Online Subsystem
The Null Online Subsystem doesn't support updating data online, so only the local player will see the changes. For other limitations of the Null OSS please refer to Using the Null Subsystem section of the documentation.
Last updated