FetchJoinableSpaces (Unreal Engine)

- Declaration

static void FetchJoinableSpaces(CavrnusAllSpacesInfoEvent OnRecvCurrentJoinableSpaces);

Delegates Options:

DECLARE_DYNAMIC_DELEGATE_OneParam(FCavrnusAllSpacesInfoEvent, TArray<FCavrnusSpaceInfo>, SpacesInfo);

typedef TFunction<void(const TArray<FCavrnusSpaceInfo>&)> CavrnusAllSpacesInfoEvent;

- Description

Gets a list of all current spaces which can be joined.

Note that this list will not update as new spaces are added, removed, or modified. To maintain those changes in your menu consider instead using BindJoinableSpaces (TODO: LINK).

- Blueprint Sample

- Code Sample

#include "CavrnusFunctionLibrary.h" #include "Types/CavrnusCallbackTypes.h" void UClassName::Init() { // Member is FCavrnusAllSpacesInfoEvent ReceiveSpacesList; ReceiveSpacesList.BindUFunction(this, GET_FUNCTION_NAME_CHECKED(UClassName, OnSpacesListReceived)); UCavrnusFunctionLibrary::FetchJoinableSpaces(ReceiveSpacesList); } void UClassName::OnSpacesListReceived(TArray<FCavrnusSpaceInfo> SpacesInfo) { for (auto& SpaceInfo : SpacesInfo) { UE_LOG(LogTemp, Log, TEXT("Space ID %s (Name=%s) can be joined."), *SpaceInfo.SpaceId, *SpaceInfo.SpaceName); } }

 

Related pages