question

Sasha Vigneron avatar image
Sasha Vigneron asked

Can't serialize descriptor: the network descriptor is a placeholder that cannot be used on this device at this time

Hi there, I'm trying to serialize my descriptor, which is then sent to the server via CloudScripts.
Another client is then able to fetch this serialized string, and deserialize it again in order to connect to the network.

However, whenever I'm serializing my descriptor string, the char buffer doesn't get changed at all.
And the following error pops up:

"the network descriptor is a placeholder that cannot be used on this device at this time"

I've stumbled upon this question which didn't help me that much, and I'm hoping that this issue has been resolved already? (I'm currently using the latest version of the NuGet package)

This is the code snippet concerning the serialization:

void CloudScript_SetDescriptor(const Party::PartyNetworkDescriptor& descriptor)
{
    ExecuteCloudScriptRequest cloudScriptRequest;
    cloudScriptRequest.authenticationContext = authenticationContext;
    cloudScriptRequest.FunctionName = "save_network_descriptor";


    char descriptorChar[Party::c_maxSerializedNetworkDescriptorStringLength + 1] = {};
    auto err = Party::PartyManager::GetSingleton().SerializeNetworkDescriptor(&descriptor, descriptorChar);
    if (PARTY_FAILED(err)) PrintErrorMessage(err);


    Json::Value functionParameters;
    functionParameters["roomId"] = "1";
    functionParameters["networkDescriptor"] = descriptorChar;


    cloudScriptRequest.FunctionParameter = functionParameters;
    PlayFabClientAPI::ExecuteCloudScript(cloudScriptRequest, OnCloudScript_SetDescriptor, OnCloudScriptFail_SetDescriptor);
}

I can confirm that this happens after the network is created.
I also tried to execute this when the localuser has connected to the network and even authenticated, neither of these seemed to be making a difference.

Could anyone help me out please?

Thanks in advance!

Sasha

sdksCloudScript
3 comments
10 |1200

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

JayZuo avatar image JayZuo ♦ commented ·

It seems the code snippet is missing. Could you please update your question with the code snippet?

0 Likes 0 ·
Sasha Vigneron avatar image Sasha Vigneron JayZuo ♦ commented ·

Yes of course, I've just edited my question to include the small code snippet.
Keep in mind, this is a test application solely used for testing connectivity, so the code itself isn't the prettiest

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ commented ·

I cannot see your code snippet. Could you send it again? You may also refer to the link below to see how serializing network descriptor is implemented in our PlayFab sample:

PlayFab-Samples/NetworkManager.cpp at f6739049d2b177b7f7f19bbe15a8e9876d69861a PlayFab/PlayFab-Samples GitHub

0 Likes 0 ·

1 Answer

·
Sasha Vigneron avatar image
Sasha Vigneron answered

@Rick Chen

As mentioned in the reply above, I updated my question with the correct code snippet, sorry for that mistake.

I just had a look at the sample, and it seems like the code related to the serialization itself is near identical to mine. However, it does seem to be polling for the "ConnectToNetworkCompleted" event first.

I currently made a quick and dirty workaround to test this, and it looks like it's properly serializing the string now! So thanks a lot for forwarding me there!

It does look like I'm having some issues deserializing the string again, but that's irrelevant to this question.

For other people experiencing the same issue:

The problem is that the "ConnectToNetworkCompleted" event hadn't been executed yet.
So my solution was to start the serialization process once this event is ran.

10 |1200

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

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.