diff --git a/Source/EventCenterPlugin/Private/EventSourceActor.cpp b/Source/EventCenterPlugin/Private/EventSourceActor.cpp index a29229b..1edf81d 100644 --- a/Source/EventCenterPlugin/Private/EventSourceActor.cpp +++ b/Source/EventCenterPlugin/Private/EventSourceActor.cpp @@ -14,7 +14,7 @@ AEventSourceActor::AEventSourceActor() : PrimaryActorTick.bCanEverTick = true; //redis = NewObject(this, TEXT("RedisObject")); - redis = CreateDefaultSubobject(TEXT("RedisObject")); + //redis = CreateDefaultSubobject(TEXT("RedisObject")); //RootComponent = redis; } @@ -63,11 +63,11 @@ void AEventSourceActor::Tick(float DeltaTime) void AEventSourceActor::ConstructClient() { if (redis != nullptr) { - UE_LOG(EventSourceLog, Log, TEXT("Construct(): Redis is NOT null")); + UE_LOG(EventSourceLog, Log, TEXT("Construct2(): Redis is NOT null")); return; } - UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()")); + UE_LOG(EventSourceLog, Log, TEXT("construct2(): redis = new Redis()")); redis = NewObject(this, TEXT("RedisObject")); } @@ -75,24 +75,24 @@ void AEventSourceActor::ConstructClient() void AEventSourceActor::Init() { if (redis == nullptr) { - UE_LOG(EventSourceLog, Log, TEXT("Init(): Redis is null")); + UE_LOG(EventSourceLog, Log, TEXT("Init2(): Redis is null")); return; } - UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()")); - redis = NewObject(this, TEXT("RedisObject")); - UE_LOG(EventSourceLog, Log, TEXT("Init(): redis->Init()")); + //UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()")); + //redis = NewObject(this, TEXT("RedisObject")); + UE_LOG(EventSourceLog, Log, TEXT("Init2(): redis->Init()")); redis->Init(redisHost, redisPort, redisPassword); } void AEventSourceActor::Subscribe(const FString& Channel) { if (redis == nullptr) { - UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): Redis is null")); + UE_LOG(EventSourceLog, Log, TEXT("Subscribe2(): Redis is null")); return; } - UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): redis->Subscribe()")); + UE_LOG(EventSourceLog, Log, TEXT("Subscribe2(): redis->Subscribe()")); redis->Subscribe(Channel); }