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