question

Dylan Hunt avatar image
Dylan Hunt asked

Can't convert ExecuteCloudScript results (vanilla server call return) to an obj

If I successfully return

return server.GetPlayerCombinedInfo(req);

from an ExecuteCloudScript() call,

I can't parse into a GetPlayerCombinedInfoResult -- it's a direct return. Is there a different object I need to use for server returns? Here is what I am doing now:

GetPlayerCombinedInfoResult infoResult = null;
try 
{
	infoResult = (GetPlayerCombinedInfoResult)result.FunctionResult;
}
.... // Result is null, can't parse

.

CloudScriptdata
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.

Dylan Hunt avatar image Dylan Hunt commented ·

hmm, or should I add the server SDK to my Unity project to get a Server result obj?

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Yes, casting directly can be problematic. Can you give this a try?

PlayFab.Json.JsonWrapper.DeserializeObject<GetPlayerCombinedInfoResult>(result.FunctionResult.ToString());

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.