question

jwang avatar image
jwang asked

Moving FEntityKey from Client namespace to Entity namespace in C++?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jwang avatar image jwang commented ·

I have been able to receive an "FEntityKey" structure from my login using the ClientAPI with "LoginTitlePlayerAccountEntity" set to true.


However, the key returned is a ClientModels::FEntityKey.

When I try to use this structure to set entity objects in a EntityModels::FSetObjectsRequest, this stucture expects an EntityModels::FEntityKey.


I can create a conversion function, but I wonder if maybe I'm using the SDK incorrectly.

I haven't seen any examples using the new entity API in C++.

Anyone with experience in this would be a big help!

0 Likes 0 ·

1 Answer

·
1807605288 avatar image
1807605288 answered

Hello, thanks for your question.

The conversion function you've written for now, is your best option. We don't have a better solution at this time.

I will file this as a feature request that improves customer quality of life. Since our SDKs are automatically generated, this is slightly more complicated than just copy-pasting here or there.

My own solution for now is to have an

EntityModels::EntityKey myKey;

somewhere in my project, and set myKey like this:

OnLoginSuccess(result) {
	myKey.Id = result.EntityToken.Entity.Id;
	myKey.Type = result.EntityToken.Entity.Type;
	myKey.TypeString = result.EntityToken.Entity.TypeString;
}

Any similar conversion function is also fine.

I apologize that we are unlikely to have a better answer anytime soon.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jwang avatar image jwang commented ·

Thanks for your help. This approach seems to work fine.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.