|
|
|
@ -16,11 +16,17 @@ void UMainMenuWidget::NativeConstruct() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UMainMenuWidget::OnHostOnlineGameButtonClicked() {
|
|
|
|
|
// Ensure we have left any session
|
|
|
|
|
GetMyGameSubsystem()->DestroySession();
|
|
|
|
|
|
|
|
|
|
GetMyGameSubsystem()->CreateSession(
|
|
|
|
|
"Lobby " + FString::FromInt(FMath::RandRange(1, 1e6)), 2, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UMainMenuWidget::StartSessionWhenCreatingSessonComplete(bool bSuccess) {
|
|
|
|
|
if (!bSuccess) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
GetMyGameSubsystem()->StartSession();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|