Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release/versions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
".pubnub.yml": [
{ "pattern": "^version: \"v(.+)\"$", "cleared": true },
{ "pattern": "^version: (.+)$", "cleared": false },
{ "pattern": "\/releases\/tag\/v([0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?)", "cleared": true }
],
"PubnubChat.uplugin": [
Expand Down
11 changes: 10 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
name: unreal-engine-chat
version: v0.4.2
version: v0.4.3
schema: 1
scm: github.com/pubnub/unreal-engine-chat
changelog:
- date: 2025-07-08
version: v0.4.3
changes:
- type: bug
text: "Fix crashes that could happen when empty or invalid parameters were passed to some functions. Add needed guard checks and print to log in case of incorrect input."
- type: bug
text: "Remove false warnings that were printed from C-Core."
- type: bug
text: "Adjust Copyrights in files and FabUrl to fix issues reported by FAB."
- date: 2025-06-16
version: v0.4.2
changes:
Expand Down
8 changes: 4 additions & 4 deletions PubnubChat.uplugin
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"FileVersion": 3,
"Version": 18,
"VersionName": "0.4.2",
"Version": 19,
"VersionName": "0.4.3",
"FriendlyName": "Pubnub Chat SDK",
"Description": "Quickly and easily integrate a real-time text chat solution that is reliable, flexible, and scalable.",
"Category": "Code",
"CreatedBy": "PubNub Inc.",
"CreatedByURL": "https://www.pubnub.com/",
"DocsURL": "https://www.pubnub.com/docs/chat/unreal-chat-sdk/overview",
"FabURL": "com.epicgames.launcher://ue/Fab/product/81b7deb9-82ad-41c8-b123-decccfb32fd8",
"DocsURL": "https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/configuration",
"FabURL": "com.epicgames.launcher://ue/Fab/product/69e7b3b4-6ef4-4c1c-b84a-0029c8ae63ae",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 PubNub Inc. All Rights Reserved.
// Copyright 2025 PubNub Inc. All Rights Reserved.


#include "FunctionLibraries/PubnubChatUtilities.h"
Expand Down Expand Up @@ -123,11 +123,11 @@ TArray<FPubnubMessageAction> UPubnubChatUtilities::CppMessageActionsToUnrealMess

Pubnub::Vector<Pubnub::Channel> UPubnubChatUtilities::UnrealChannelsToCppChannels(TArray<UPubnubChannel*> &PubnubChannels)
{
//Pubnub::Vector<Pubnub::Channel> CppChannels;
std::vector<Pubnub::Channel> CppChannels;

for(auto &PubnubChannel : PubnubChannels)
{
if(nullptr == PubnubChannel) {continue;}
CppChannels.push_back(*PubnubChannel->GetInternalChannel());
}
return Pubnub::Vector<Pubnub::Channel>(std::move(CppChannels));
Expand All @@ -139,6 +139,7 @@ Pubnub::Vector<Pubnub::User> UPubnubChatUtilities::UnrealUsersToCppUsers(TArray<

for(auto &PubnubUser : PubnubUsers)
{
if(nullptr == PubnubUser) {continue;}
CppUsers.push_back(*PubnubUser->GetInternalUser());
}
return CppUsers;
Expand All @@ -150,6 +151,7 @@ Pubnub::Vector<Pubnub::Message> UPubnubChatUtilities::UnrealMessagesToCppMessage

for(auto &PubnubMessage : PubnubMessages)
{
if(nullptr == PubnubMessage) {continue;}
CppMessages.push_back(*PubnubMessage->GetInternalMessage());
}
return CppMessages;
Expand All @@ -161,6 +163,7 @@ Pubnub::Vector<Pubnub::ThreadMessage> UPubnubChatUtilities::UnrealThreadMessages

for(auto &PubnubMessage : PubnubThreadMessages)
{
if(nullptr == PubnubMessage) {continue;}
CppMessages.push_back(*PubnubMessage->GetInternalThreadMessage());
}
return CppMessages;
Expand All @@ -172,6 +175,7 @@ Pubnub::Vector<Pubnub::Membership> UPubnubChatUtilities::UnrealMembershipsToCppM

for(auto &PubnubMembership : PubnubMemberships)
{
if(nullptr == PubnubMembership) {continue;}
CppMemberships.push_back(*PubnubMembership->GetInternalMembership());
}
return CppMemberships;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2024 PubNub Inc. All Rights Reserved.


#include "FunctionLibraries/PubnubLogUtilities.h"
#include "PubnubChatSubsystem.h"

FString UPubnubLogUtilities::GetNameFromFunctionMacro(FString FunctionName)
{
if(FunctionName.IsEmpty()) {return "";}
int Index = -1;
FunctionName.FindLastChar(TEXT(':'), Index);
return FunctionName.Mid(Index + 1);
}

void UPubnubLogUtilities::PrintEmptyFieldLog(FString FunctionName, FString FieldName)
{
UE_LOG(PubnubChatLog, Warning, TEXT("Failed to: %s, %s field can't be empty."), *GetNameFromFunctionMacro(FunctionName), *FieldName);
}

void UPubnubLogUtilities::PrintInvalidObjectFieldLog(FString FunctionName, FString FieldName)
{
UE_LOG(PubnubChatLog, Warning, TEXT("Failed to: %s, %s has to be a valid object."), *GetNameFromFunctionMacro(FunctionName), *FieldName);
}

void UPubnubLogUtilities::PrintEmptyArrayFieldLog(FString FunctionName, FString FieldName)
{
UE_LOG(PubnubChatLog, Warning, TEXT("Failed to: %s, %s has to contain at least one valid object."), *GetNameFromFunctionMacro(FunctionName), *FieldName);
}

void UPubnubLogUtilities::PrintFunctionError(FString FunctionName, FString Error)
{
UE_LOG(PubnubChatLog, Error, TEXT("Failed to: %s, Error: %s."), *GetNameFromFunctionMacro(FunctionName), *Error);
}
29 changes: 28 additions & 1 deletion Source/PubnubChatSDK/Private/PubnubAccessManager.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright 2024 PubNub Inc. All Rights Reserved.
// Copyright 2025 PubNub Inc. All Rights Reserved.


#include "PubnubAccessManager.h"
#include "PubnubChatSubsystem.h"
#include "PubnubMacroUtilities.h"
#include "FunctionLibraries/PubnubChatUtilities.h"
#include "FunctionLibraries/PubnubLogUtilities.h"

UPubnubAccessManager* UPubnubAccessManager::Create(Pubnub::AccessManager AccessManager)
{
Expand All @@ -19,20 +22,44 @@ UPubnubAccessManager::~UPubnubAccessManager()

bool UPubnubAccessManager::CanI(EPubnubAccessManagerPermission Permission, EPubnubAccessManagerResourceType ResourceType, FString ResourceName)
{
if(!IsInternalAccessManagerValid()) {return false;}

return InternalAccessManager->can_i((Pubnub::AccessManager::Permission)(uint8)Permission, (Pubnub::AccessManager::ResourceType)(uint8)ResourceType, UPubnubChatUtilities::FStringToPubnubString(ResourceName));
}

FString UPubnubAccessManager::ParseToken(FString Token)
{
if(!IsInternalAccessManagerValid()) {return "";}

PUBNUB_RETURN_IF_EMPTY(Token, "");

return UPubnubChatUtilities::PubnubStringToFString(InternalAccessManager->parse_token(UPubnubChatUtilities::FStringToPubnubString(Token)));
}

void UPubnubAccessManager::SetAuthToken(FString Token)
{
if(!IsInternalAccessManagerValid()) {return;}

PUBNUB_RETURN_IF_EMPTY(Token);

InternalAccessManager->set_auth_token(UPubnubChatUtilities::FStringToPubnubString(Token));
}

int UPubnubAccessManager::SetPubnubOrigin(FString Origin)
{
if(!IsInternalAccessManagerValid()) {return -1;}

PUBNUB_RETURN_IF_EMPTY(Origin, -1);

return InternalAccessManager->set_pubnub_origin(UPubnubChatUtilities::FStringToPubnubString(Origin));
}

bool UPubnubAccessManager::IsInternalAccessManagerValid()
{
if(InternalAccessManager == nullptr)
{
UE_LOG(PubnubChatLog, Error, TEXT("This Access Manager is invalid"));
return false;
}
return true;
}
2 changes: 1 addition & 1 deletion Source/PubnubChatSDK/Private/PubnubCallbackStop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 PubNub Inc. All Rights Reserved.
// Copyright 2025 PubNub Inc. All Rights Reserved.


#include "PubnubCallbackStop.h"
Expand Down
Loading
Loading