本文整理汇总了C++中IOnlineSubsystem::GetNamedInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ IOnlineSubsystem::GetNamedInterface方法的具体用法?C++ IOnlineSubsystem::GetNamedInterface怎么用?C++ IOnlineSubsystem::GetNamedInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOnlineSubsystem
的用法示例。
在下文中一共展示了IOnlineSubsystem::GetNamedInterface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get
UOnlineHotfixManager* UOnlineHotfixManager::Get(UWorld* World)
{
UOnlineHotfixManager* DefaultObject = UOnlineHotfixManager::StaticClass()->GetDefaultObject<UOnlineHotfixManager>();
IOnlineSubsystem* OnlineSub = Online::GetSubsystem(World, DefaultObject->OSSName.Len() > 0 ? FName(*DefaultObject->OSSName) : NAME_None);
if (OnlineSub != nullptr)
{
UOnlineHotfixManager* HotfixManager = Cast<UOnlineHotfixManager>(OnlineSub->GetNamedInterface(NAME_HotfixManager));
if (HotfixManager == nullptr)
{
FString HotfixManagerClassName = DefaultObject->HotfixManagerClassName;
UClass* HotfixManagerClass = LoadClass<UOnlineHotfixManager>(nullptr, *HotfixManagerClassName, nullptr, LOAD_None, nullptr);
if (HotfixManagerClass == nullptr)
{
// Just use the default class if it couldn't load what was specified
HotfixManagerClass = UOnlineHotfixManager::StaticClass();
}
// Create it and store it
HotfixManager = NewObject<UOnlineHotfixManager>(GetTransientPackage(), HotfixManagerClass);
OnlineSub->SetNamedInterface(NAME_HotfixManager, HotfixManager);
}
return HotfixManager;
}
return nullptr;
}