mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
no segfault through to subscribe
This commit is contained in:
@@ -14,7 +14,7 @@ AEventSourceActor::AEventSourceActor() :
|
|||||||
PrimaryActorTick.bCanEverTick = true;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
//redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
//redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||||
redis = CreateDefaultSubobject<URedisObject>(TEXT("RedisObject"));
|
//redis = CreateDefaultSubobject<URedisObject>(TEXT("RedisObject"));
|
||||||
|
|
||||||
//RootComponent = redis;
|
//RootComponent = redis;
|
||||||
}
|
}
|
||||||
@@ -63,11 +63,11 @@ void AEventSourceActor::Tick(float DeltaTime)
|
|||||||
void AEventSourceActor::ConstructClient()
|
void AEventSourceActor::ConstructClient()
|
||||||
{
|
{
|
||||||
if (redis != nullptr) {
|
if (redis != nullptr) {
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("Construct(): Redis is NOT null"));
|
UE_LOG(EventSourceLog, Log, TEXT("Construct2(): Redis is NOT null"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()"));
|
UE_LOG(EventSourceLog, Log, TEXT("construct2(): redis = new Redis()"));
|
||||||
redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,24 +75,24 @@ void AEventSourceActor::ConstructClient()
|
|||||||
void AEventSourceActor::Init()
|
void AEventSourceActor::Init()
|
||||||
{
|
{
|
||||||
if (redis == nullptr) {
|
if (redis == nullptr) {
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("Init(): Redis is null"));
|
UE_LOG(EventSourceLog, Log, TEXT("Init2(): Redis is null"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()"));
|
//UE_LOG(EventSourceLog, Log, TEXT("construct(): redis = new Redis()"));
|
||||||
redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
//redis = NewObject<URedisObject>(this, TEXT("RedisObject"));
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("Init(): redis->Init()"));
|
UE_LOG(EventSourceLog, Log, TEXT("Init2(): redis->Init()"));
|
||||||
redis->Init(redisHost, redisPort, redisPassword);
|
redis->Init(redisHost, redisPort, redisPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AEventSourceActor::Subscribe(const FString& Channel)
|
void AEventSourceActor::Subscribe(const FString& Channel)
|
||||||
{
|
{
|
||||||
if (redis == nullptr) {
|
if (redis == nullptr) {
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): Redis is null"));
|
UE_LOG(EventSourceLog, Log, TEXT("Subscribe2(): Redis is null"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UE_LOG(EventSourceLog, Log, TEXT("Subscribe(): redis->Subscribe()"));
|
UE_LOG(EventSourceLog, Log, TEXT("Subscribe2(): redis->Subscribe()"));
|
||||||
redis->Subscribe(Channel);
|
redis->Subscribe(Channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user