I’m not sure the exact version it was removed, but as of 4.19.2 AddOnCreateSessionCompleteDelegate no longer exists in IOnlineSession. The replacement is AddOnCreateSessionCompleteDelegate_Handle, which does not support the AddUObject macro and results in the following compiler error:
error C2228: left of ‘.AddUObject’ must have class/struct/union
The solution is simple enough and can actually be found in the ShooterGame example project.
First, you need to declare a delegate handle in the game instance header:
FOnCreateSessionCompleteDelegate OnCreateSessionCompleteDelegate;
Next, in the game instance constructor you obtain the handle via the CreateUObject function:
OnCreateSessionCompleteDelegate = FOnCreateSessionCompleteDelegate::CreateUObject(this, &UPuzzlePlatformerGameInstance::OnCreateSessionComplete);
Now you can simply pass this handle to AddOnCreateSessionCompleteDelegate_Handle after creating the session:
pSession->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
Hope that helps anyone who encounters the same error.
Cheers!