Create/Find Oculus Sessions using C++ Oculus subsytem
Hey Oculus Dev's,
I'm looking at setting up Oculus sessions using C++. I'm basically trying to get the same functionality as the blueprint nodes but in C++, I want to do this because I want to add custom properties to the session settings, which you cannot do via blueprints.
The oculus documentation is very vague on how to create/find oculus sessions. I have managed to create a session but it is not listed when I try to find sessions. With the OVR blueprint nodes you can use find matchmaking sessions and you have to provide the pool names, I'm assuming this is where the problem lies when creating the C++ sessions?
So my questions are:
1. Is there a special way that you need to create/find sessions when using the Oculus Sub System? Is there a particular create session function that needs to be used via C++?
In comparison to the steps taken here: https://wiki.unrealengine.com/How_To_Use_Sessions_In_C%2B%2B
2. How do you provide the pool name when Creating/Finding sessions via C++?
Do I need to add it to the session settings, here is an example:
Any pointers would be greatly appreciated!
I'm looking at setting up Oculus sessions using C++. I'm basically trying to get the same functionality as the blueprint nodes but in C++, I want to do this because I want to add custom properties to the session settings, which you cannot do via blueprints.
The oculus documentation is very vague on how to create/find oculus sessions. I have managed to create a session but it is not listed when I try to find sessions. With the OVR blueprint nodes you can use find matchmaking sessions and you have to provide the pool names, I'm assuming this is where the problem lies when creating the C++ sessions?
So my questions are:
1. Is there a special way that you need to create/find sessions when using the Oculus Sub System? Is there a particular create session function that needs to be used via C++?
In comparison to the steps taken here: https://wiki.unrealengine.com/How_To_Use_Sessions_In_C%2B%2B
2. How do you provide the pool name when Creating/Finding sessions via C++?
Do I need to add it to the session settings, here is an example:
SessionSettings = MakeShareable(new FOnlineSessionSettings());
SessionSettings->bIsLANMatch = bIsLAN;
SessionSettings->bUsesPresence = bIsPresence;
SessionSettings->NumPublicConnections = MaxNumPlayers;
SessionSettings->NumPrivateConnections = 0;
SessionSettings->bAllowInvites = true;
SessionSettings->bAllowJoinInProgress = true;
SessionSettings->bShouldAdvertise = true;
SessionSettings->bAllowJoinViaPresence = true;
SessionSettings->bAllowJoinViaPresenceFriendsOnly = false;
SessionSettings->Set(SETTING_MAPNAME, FString("NewMap"), EOnlineDataAdvertisementType::ViaOnlineService);
// Set the delegate to the Handle of the SessionInterface
OnCreateSessionCompleteDelegateHandle = Sessions->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
// Our delegate should get called when this is complete (doesn't need to be successful!)
return Sessions->CreateSession(*UserId, SessionName, *SessionSettings);
Any pointers would be greatly appreciated!
