Download LyraStarterGame/Source/LyraGame/GameModes/LyraUserFacingExperienceDefinition.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.06 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/GameModes/LyraUserFacingExperienceDefinition.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/GameModes/LyraUserFacingExperienceDefinition.cpp
-
curl -L -o LyraUserFacingExperienceDefinition.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/GameModes/LyraUserFacingExperienceDefinition.cpp
2.06 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| UCommonSession_HostSessionRequest* ULyraUserFacingExperienceDefinition::CreateHostingRequest(const UObject* WorldContextObject) const | |
| { | |
| const FString ExperienceName = ExperienceID.PrimaryAssetName.ToString(); | |
| const FString UserFacingExperienceName = GetPrimaryAssetId().PrimaryAssetName.ToString(); | |
| UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::ReturnNull); | |
| UGameInstance* GameInstance = World ? World->GetGameInstance() : nullptr; | |
| UCommonSession_HostSessionRequest* Result = nullptr; | |
| if (UCommonSessionSubsystem* Subsystem = GameInstance ? GameInstance->GetSubsystem<UCommonSessionSubsystem>() : nullptr) | |
| { | |
| Result = Subsystem->CreateOnlineHostSessionRequest(); | |
| } | |
| if (!Result) | |
| { | |
| // Couldn't use the subsystem so create one | |
| Result = NewObject<UCommonSession_HostSessionRequest>(); | |
| Result->OnlineMode = ECommonSessionOnlineMode::Online; | |
| Result->bUseLobbies = true; | |
| Result->bUseLobbiesVoiceChat = false; | |
| // We always enable presence on this session because it is the primary session used for matchmaking. For online systems that care about presence, only the primary session should have presence enabled | |
| Result->bUsePresence = !IsRunningDedicatedServer(); | |
| } | |
| Result->MapID = MapID; | |
| Result->ModeNameForAdvertisement = UserFacingExperienceName; | |
| Result->ExtraArgs = ExtraArgs; | |
| Result->ExtraArgs.Add(TEXT("Experience"), ExperienceName); | |
| Result->MaxPlayerCount = MaxPlayerCount; | |
| if (ULyraReplaySubsystem::DoesPlatformSupportReplays()) | |
| { | |
| if (bRecordReplay) | |
| { | |
| Result->ExtraArgs.Add(TEXT("DemoRec"), FString()); | |
| } | |
| } | |
| return Result; | |
| } | |