Skip to content
Snippets Groups Projects
Commit 743ec407 authored by Jonathan Ehret's avatar Jonathan Ehret
Browse files

use object's full name instead of id in cluster event wrapper

parent 8f059904
No related branches found
No related tags found
2 merge requests!2pull changes forward,!1Fix/cluster event wrapper
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
...@@ -29,9 +29,9 @@ public: ...@@ -29,9 +29,9 @@ public:
checkf(Object == nullptr, TEXT("The event is already attached.")); checkf(Object == nullptr, TEXT("The event is already attached."));
Object = NewObject; Object = NewObject;
ObjectId = Object->GetUniqueID(); ObjectName = Object->GetFullName();
UE_LOG(LogTemp, Warning, TEXT("[DisplayClusterEventWrapper] Object UniqueID: %d."), ObjectId) UE_LOG(LogTemp, Warning, TEXT("[DisplayClusterEventWrapper] Object name: %s and method name %s."), *ObjectName, *MethodName)
EDisplayClusterOperationMode OperationMode = IDisplayCluster::Get().GetOperationMode(); EDisplayClusterOperationMode OperationMode = IDisplayCluster::Get().GetOperationMode();
if (OperationMode == EDisplayClusterOperationMode::Cluster) if (OperationMode == EDisplayClusterOperationMode::Cluster)
...@@ -50,13 +50,13 @@ public: ...@@ -50,13 +50,13 @@ public:
FMemoryReader MemoryReader(Event.EventData); FMemoryReader MemoryReader(Event.EventData);
uint32 EventObjectId; FString EventObjectName;
// This reads the value! // This reads the value!
MemoryReader << EventObjectId; MemoryReader << EventObjectName;
if (EventObjectId != ObjectId) if (EventObjectName != ObjectName)
{ {
// Event does not belong to this object. // Event does not belong to this object.
UE_LOG(LogTemp, Warning, TEXT("[DisplayClusterEventWrapper] Event does not belong to this object %d vs %d (this object)."), EventObjectId, ObjectId) UE_LOG(LogTemp, Warning, TEXT("[DisplayClusterEventWrapper] Event does not belong to this object %s vs %s (this object)."), *EventObjectName, *ObjectName)
return; return;
} }
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
ClusterEvent.bShouldDiscardOnRepeat = false; ClusterEvent.bShouldDiscardOnRepeat = false;
FMemoryWriter MemoryWriter(ClusterEvent.EventData); FMemoryWriter MemoryWriter(ClusterEvent.EventData);
MemoryWriter << ObjectId; MemoryWriter << const_cast<FString&>(ObjectName);
MemoryWriter << const_cast<FString&>(MethodName); MemoryWriter << const_cast<FString&>(MethodName);
SerializeParameters(&MemoryWriter, Forward<ArgTypes>(Arguments)...); SerializeParameters(&MemoryWriter, Forward<ArgTypes>(Arguments)...);
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
private: private:
const FString MethodName; const FString MethodName;
uint32 ObjectId; FString ObjectName;
ObjectType* Object = nullptr; ObjectType* Object = nullptr;
FOnClusterEventBinaryListener ClusterEventListenerDelegate; FOnClusterEventBinaryListener ClusterEventListenerDelegate;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment