channeldorg / channeld-ue-plugin

Enables distributed simulation with Unreal Engine's dedicated servers. 为虚幻引擎专用服务器提供分布式模拟能力的开源插件.
Apache License 2.0
132 stars 38 forks source link

FUnrealObjectPropertyDecorator GetCPPType #23

Open ganibc opened 1 year ago

ganibc commented 1 year ago

Hi,

Why the code is like this:

FString FUnrealObjectPropertyDecorator::GetCPPType()
{
    return TEXT("UObject*");
}

Instead of

FString FUnrealObjectPropertyDecorator::GetCPPType()
{
    return OriginalProperty->GetCPPType();
}

I feel the current code is maybe error prone, since TObjectPtr or TWeakObjectPtr both are translated to UObject. There's no guarantee both are saving UObject directly. I haven't read through their implementation, but it seems TWeakObjectPtr is not saving pointer value, instead if it save ObjectIndex to query GUObjectArray.

Augkit commented 1 year ago

ChanneldUE does not yet support TWeakObjectPtr, but has created an issue https://github.com/metaworking/channeld-ue-plugin/issues/26 and is welcome to join the development.