From 641f3db8e81a800802e819451d570c338c320867 Mon Sep 17 00:00:00 2001 From: Kamil Gronek Date: Mon, 4 Nov 2024 13:18:27 +0100 Subject: [PATCH] Add wrappers to GetMemberships and GetChannelMembers. --- .../FunctionLibraries/PubnubJsonUtilities.cpp | 89 ++++++++++++ .../PubnubLibrary/Private/PubnubSubsystem.cpp | 127 +++++++++++++++--- .../FunctionLibraries/PubnubJsonUtilities.h | 6 + .../Public/PubnubStructLibrary.h | 26 ++++ Source/PubnubLibrary/Public/PubnubSubsystem.h | 21 ++- 5 files changed, 245 insertions(+), 24 deletions(-) diff --git a/Source/PubnubLibrary/Private/FunctionLibraries/PubnubJsonUtilities.cpp b/Source/PubnubLibrary/Private/FunctionLibraries/PubnubJsonUtilities.cpp index 4724a89..1c77fde 100644 --- a/Source/PubnubLibrary/Private/FunctionLibraries/PubnubJsonUtilities.cpp +++ b/Source/PubnubLibrary/Private/FunctionLibraries/PubnubJsonUtilities.cpp @@ -6,6 +6,11 @@ FString UPubnubJsonUtilities::JsonObjectToString(TSharedPtr JsonObject) { + if(!JsonObject) + { + return ""; + } + FString JsonString; TSharedRef< TJsonWriter<> > JsonWriter = TJsonWriterFactory<>::Create(&JsonString); FJsonSerializer::Serialize(JsonObject.ToSharedRef(), JsonWriter); @@ -309,6 +314,90 @@ void UPubnubJsonUtilities::GetMessageActionsJsonToData(FString ResponseJson, int } } +void UPubnubJsonUtilities::GetMembershipsJsonToData(FString ResponseJson, int& Status, TArray& MembershipsData, FString& PageNext, FString& PagePrev) +{ + TSharedPtr JsonObject = MakeShareable(new FJsonObject); + + if(!StringToJsonObject(ResponseJson, JsonObject)) + { + return; + } + + JsonObject->TryGetNumberField(ANSI_TO_TCHAR("status"), Status); + JsonObject->TryGetStringField(ANSI_TO_TCHAR("next"), PageNext); + JsonObject->TryGetStringField(ANSI_TO_TCHAR("prev"), PagePrev); + + if(JsonObject->HasField(ANSI_TO_TCHAR("data"))) + { + TArray> MembershipsJsonValue = JsonObject->GetArrayField(ANSI_TO_TCHAR("data")); + + for(auto MembershipJsonValue : MembershipsJsonValue) + { + FPubnubGetMembershipsWrapper CurrentMembership; + const TSharedPtr* ChannelJsonObject; + if(MembershipJsonValue->AsObject()->TryGetObjectField(ANSI_TO_TCHAR("channel"), ChannelJsonObject)) + { + CurrentMembership.Channel = GetChannelDataFromJson(JsonObjectToString(*ChannelJsonObject)); + } + + const TSharedPtr* CustomJsonObject; + if(MembershipJsonValue->AsObject()->TryGetObjectField(ANSI_TO_TCHAR("custom"), CustomJsonObject)) + { + CurrentMembership.Custom = JsonObjectToString(*CustomJsonObject); + } + + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("status"), CurrentMembership.Status); + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("type"), CurrentMembership.Type); + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("updated"), CurrentMembership.Updated); + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("eTag"), CurrentMembership.ETag); + + MembershipsData.Add(CurrentMembership); + } + } +} + +void UPubnubJsonUtilities::GetChannelMembersJsonToData(FString ResponseJson, int& Status, TArray& MembershipsData, FString& PageNext, FString& PagePrev) +{ + TSharedPtr JsonObject = MakeShareable(new FJsonObject); + + if(!StringToJsonObject(ResponseJson, JsonObject)) + { + return; + } + + JsonObject->TryGetNumberField(ANSI_TO_TCHAR("status"), Status); + JsonObject->TryGetStringField(ANSI_TO_TCHAR("next"), PageNext); + JsonObject->TryGetStringField(ANSI_TO_TCHAR("prev"), PagePrev); + + if(JsonObject->HasField(ANSI_TO_TCHAR("data"))) + { + TArray> MembershipsJsonValue = JsonObject->GetArrayField(ANSI_TO_TCHAR("data")); + + for(auto MembershipJsonValue : MembershipsJsonValue) + { + FPubnubGetChannelMembersWrapper CurrentMembership; + const TSharedPtr* UserJsonObject; + if(MembershipJsonValue->AsObject()->TryGetObjectField(ANSI_TO_TCHAR("uuid"), UserJsonObject)) + { + CurrentMembership.User = GetUserDataFromJson(JsonObjectToString(*UserJsonObject)); + } + + const TSharedPtr* CustomJsonObject; + if(MembershipJsonValue->AsObject()->TryGetObjectField(ANSI_TO_TCHAR("custom"), CustomJsonObject)) + { + CurrentMembership.Custom = JsonObjectToString(*CustomJsonObject); + } + + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("status"), CurrentMembership.Status); + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("type"), CurrentMembership.Type); + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("updated"), CurrentMembership.Updated); + MembershipJsonValue->AsObject()->TryGetStringField(ANSI_TO_TCHAR("eTag"), CurrentMembership.ETag); + + MembershipsData.Add(CurrentMembership); + } + } +} + FPubnubUserData UPubnubJsonUtilities::GetUserDataFromJson(FString ResponseJson) { TSharedPtr JsonObject = MakeShareable(new FJsonObject); diff --git a/Source/PubnubLibrary/Private/PubnubSubsystem.cpp b/Source/PubnubLibrary/Private/PubnubSubsystem.cpp index 8495f9a..a44c915 100644 --- a/Source/PubnubLibrary/Private/PubnubSubsystem.cpp +++ b/Source/PubnubLibrary/Private/PubnubSubsystem.cpp @@ -521,14 +521,25 @@ void UPubnubSubsystem::RemoveChannelMetadata(FString ChannelMetadataID) }); } -void UPubnubSubsystem::GetMemberships(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +void UPubnubSubsystem::GetMemberships(FString UUIDMetadataID, FOnGetMembershipsResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} QuickActionThread->AddFunctionToQueue( [this, UUIDMetadataID, OnGetMembershipResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] { - GetMemberships_priv(UUIDMetadataID, OnGetMembershipResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + GetMemberships_DATA_priv(UUIDMetadataID, OnGetMembershipResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + }); +} + +void UPubnubSubsystem::GetMemberships_JSON(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +{ + if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) + {return;} + + QuickActionThread->AddFunctionToQueue( [this, UUIDMetadataID, OnGetMembershipResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] + { + GetMemberships_JSON_priv(UUIDMetadataID, OnGetMembershipResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); }); } @@ -554,14 +565,25 @@ void UPubnubSubsystem::RemoveMemberships(FString UUIDMetadataID, FString RemoveO }); } -void UPubnubSubsystem::GetChannelMembers(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +void UPubnubSubsystem::GetChannelMembers(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] { - GetChannelMembers_priv(ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + GetChannelMembers_DATA_priv(ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + }); +} + +void UPubnubSubsystem::GetChannelMembers_JSON(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +{ + if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) + {return;} + + QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] + { + GetChannelMembers_JSON_priv(ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); }); } @@ -1972,15 +1994,9 @@ void UPubnubSubsystem::RemoveChannelMetadata_priv(FString ChannelMetadataID) } } -void UPubnubSubsystem::GetMemberships_priv(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, +FString UPubnubSubsystem::GetMemberships_pn(FString UUIDMetadataID, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { - if(!CheckIsUserIDSet()) - {return;} - - if(CheckIsFieldEmpty(UUIDMetadataID, "UUIDMetadataID", "GetMemberships")) - {return;} - pubnub_membership_opts PubnubOptions = pubnub_membership_opts(); auto CharConverterUuid = StringCast(*UUIDMetadataID); PubnubOptions.uuid = CharConverterUuid.Get(); @@ -1999,7 +2015,19 @@ void UPubnubSubsystem::GetMemberships_priv(FString UUIDMetadataID, FOnPubnubResp pubnub_get_memberships_ex(ctx_pub, PubnubOptions); - FString JsonResponse = GetLastResponse(ctx_pub); + return GetLastResponse(ctx_pub); +} + +void UPubnubSubsystem::GetMemberships_JSON_priv(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, + FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +{ + if(!CheckIsUserIDSet()) + {return;} + + if(CheckIsFieldEmpty(UUIDMetadataID, "UUIDMetadataID", "GetMemberships")) + {return;} + + FString JsonResponse = GetMemberships_pn(UUIDMetadataID, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetMembershipResponse, JsonResponse]() @@ -2009,6 +2037,32 @@ void UPubnubSubsystem::GetMemberships_priv(FString UUIDMetadataID, FOnPubnubResp }); } +void UPubnubSubsystem::GetMemberships_DATA_priv(FString UUIDMetadataID, FOnGetMembershipsResponse OnGetMembershipResponse, FString Include, int Limit, + FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +{ + if(!CheckIsUserIDSet()) + {return;} + + if(CheckIsFieldEmpty(UUIDMetadataID, "UUIDMetadataID", "GetMemberships")) + {return;} + + FString JsonResponse = GetMemberships_pn(UUIDMetadataID, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + + //Delegate needs to be executed back on Game Thread + AsyncTask(ENamedThreads::GameThread, [this, OnGetMembershipResponse, JsonResponse]() + { + //Parse Json response into data + int Status; + TArray MembershipsData; + FString PageNext; + FString PagePrev; + UPubnubJsonUtilities::GetMembershipsJsonToData(JsonResponse, Status, MembershipsData, PageNext, PagePrev); + + //Broadcast bound delegate with parsed response + OnGetMembershipResponse.ExecuteIfBound(Status, MembershipsData, PageNext, PagePrev); + }); +} + void UPubnubSubsystem::SetMemberships_priv(FString UUIDMetadataID, FString SetObj, FString Include) { if(!CheckIsUserIDSet()) @@ -2043,15 +2097,9 @@ void UPubnubSubsystem::RemoveMemberships_priv(FString UUIDMetadataID, FString Re } } -void UPubnubSubsystem::GetChannelMembers_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, +FString UPubnubSubsystem::GetChannelMembers_pn(FString ChannelMetadataID, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { - if(!CheckIsUserIDSet()) - {return;} - - if(CheckIsFieldEmpty(ChannelMetadataID, "UUIDMetadataID", "GetChannelMembers")) - {return;} - pubnub_members_opts PubnubOptions = pubnub_members_opts(); auto CharConverterInclude = StringCast(*Include); PubnubOptions.include = CharConverterInclude.Get(); @@ -2068,7 +2116,19 @@ void UPubnubSubsystem::GetChannelMembers_priv(FString ChannelMetadataID, FOnPubn pubnub_get_members_ex(ctx_pub,TCHAR_TO_ANSI(*ChannelMetadataID), PubnubOptions); - FString JsonResponse = GetLastResponse(ctx_pub); + return GetLastResponse(ctx_pub); +} + +void UPubnubSubsystem::GetChannelMembers_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, + FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +{ + if(!CheckIsUserIDSet()) + {return;} + + if(CheckIsFieldEmpty(ChannelMetadataID, "UUIDMetadataID", "GetChannelMembers")) + {return;} + + FString JsonResponse = GetChannelMembers_pn(ChannelMetadataID, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetMembersResponse, JsonResponse]() @@ -2078,6 +2138,33 @@ void UPubnubSubsystem::GetChannelMembers_priv(FString ChannelMetadataID, FOnPubn }); } +void UPubnubSubsystem::GetChannelMembers_DATA_priv(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, + FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +{ + if(!CheckIsUserIDSet()) + {return;} + + if(CheckIsFieldEmpty(ChannelMetadataID, "UUIDMetadataID", "GetChannelMembers")) + {return;} + + FString JsonResponse = GetChannelMembers_pn(ChannelMetadataID, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + + //Delegate needs to be executed back on Game Thread + AsyncTask(ENamedThreads::GameThread, [this, OnGetMembersResponse, JsonResponse]() + { + //Parse Json response into data + int Status; + TArray MembersData; + FString PageNext; + FString PagePrev; + UPubnubJsonUtilities::GetChannelMembersJsonToData(JsonResponse, Status, MembersData, PageNext, PagePrev); + + //Broadcast bound delegate with parsed response + OnGetMembersResponse.ExecuteIfBound(Status, MembersData, PageNext, PagePrev); + }); +} + + void UPubnubSubsystem::AddChannelMembers_priv(FString ChannelMetadataID, FString AddObj, FString Include) { if(!CheckIsUserIDSet()) diff --git a/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h b/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h index b8d30e4..35d929c 100644 --- a/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h +++ b/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h @@ -50,6 +50,12 @@ class PUBNUBLIBRARY_API UPubnubJsonUtilities : public UBlueprintFunctionLibrary UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetMessageActionsJsonToData(FString ResponseJson, int &Status, TArray &MessageActions); + + UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") + static void GetMembershipsJsonToData(FString ResponseJson, int &Status, TArray &MembershipsData, FString &PageNext, FString &PagePrev); + + UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") + static void GetChannelMembersJsonToData(FString ResponseJson, int &Status, TArray &MembershipsData, FString &PageNext, FString &PagePrev); UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static FPubnubUserData GetUserDataFromJson(FString ResponseJson); diff --git a/Source/PubnubLibrary/Public/PubnubStructLibrary.h b/Source/PubnubLibrary/Public/PubnubStructLibrary.h index e85cec1..faead1a 100644 --- a/Source/PubnubLibrary/Public/PubnubStructLibrary.h +++ b/Source/PubnubLibrary/Public/PubnubStructLibrary.h @@ -249,4 +249,30 @@ struct FPubnubChannelData UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; +}; + +USTRUCT(BlueprintType) +struct FPubnubGetMembershipsWrapper +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FPubnubChannelData Channel; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Custom = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Status = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; +}; + +USTRUCT(BlueprintType) +struct FPubnubGetChannelMembersWrapper +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FPubnubUserData User; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Custom = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Status = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; + UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; }; \ No newline at end of file diff --git a/Source/PubnubLibrary/Public/PubnubSubsystem.h b/Source/PubnubLibrary/Public/PubnubSubsystem.h index 5135bd1..f7162fa 100644 --- a/Source/PubnubLibrary/Public/PubnubSubsystem.h +++ b/Source/PubnubLibrary/Public/PubnubSubsystem.h @@ -33,6 +33,9 @@ DECLARE_DYNAMIC_DELEGATE_FourParams(FOnGetAllChannelMetadataResponse, int, Statu DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetChannelMetadataResponse, int, Status, FPubnubChannelData, ChannelData); DECLARE_DYNAMIC_DELEGATE_TwoParams(FOnGetMessageActionsResponse, int, Status, const TArray&, MessageActions); DECLARE_DYNAMIC_DELEGATE_OneParam(FOnAddMessageActionsResponse, FString, MessageActionTimetoken); +DECLARE_DYNAMIC_DELEGATE_FourParams(FOnGetMembershipsResponse, int, Status, const TArray&, MembershipsData, FString, PageNext, FString, PagePrev); +DECLARE_DYNAMIC_DELEGATE_FourParams(FOnGetChannelMembersResponse, int, Status, const TArray&, MembersData, FString, PageNext, FString, PagePrev); + UCLASS() class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem @@ -192,8 +195,11 @@ class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem void RemoveChannelMetadata(FString ChannelMetadataID); UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) - void GetMemberships(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::pbccNotSet); + void GetMemberships(FString UUIDMetadataID, FOnGetMembershipsResponse OnGetMembershipResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::pbccNotSet); + UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + void GetMemberships_JSON(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::pbccNotSet); + UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") void SetMemberships(FString UUIDMetadataID, FString SetObj, FString Include = ""); @@ -201,7 +207,10 @@ class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem void RemoveMemberships(FString UUIDMetadataID, FString RemoveObj, FString Include = ""); UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) - void GetChannelMembers(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::pbccNotSet); + void GetChannelMembers(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::pbccNotSet); + + UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + void GetChannelMembers_JSON(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::pbccNotSet); UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") void AddChannelMembers(FString ChannelMetadataID, FString AddObj, FString Include = ""); @@ -363,10 +372,14 @@ class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem void GetChannelMetadata_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include); void GetChannelMetadata_DATA_priv(FString ChannelMetadataID, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include); void RemoveChannelMetadata_priv(FString ChannelMetadataID); - void GetMemberships_priv(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + FString GetMemberships_pn(FString UUIDMetadataID, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void GetMemberships_JSON_priv(FString UUIDMetadataID, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void GetMemberships_DATA_priv(FString UUIDMetadataID, FOnGetMembershipsResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void SetMemberships_priv(FString UUIDMetadataID, FString SetObj, FString Include); void RemoveMemberships_priv(FString UUIDMetadataID, FString RemoveObj, FString Include); - void GetChannelMembers_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + FString GetChannelMembers_pn(FString ChannelMetadataID, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void GetChannelMembers_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void GetChannelMembers_DATA_priv(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void AddChannelMembers_priv(FString ChannelMetadataID, FString AddObj, FString Include); void SetChannelMembers_priv(FString ChannelMetadataID, FString SetObj, FString Include); void RemoveChannelMembers_priv(FString ChannelMetadataID, FString Include, FString RemoveObj);