question

Dylan Hunt avatar image
Dylan Hunt asked

ExecuteCloudScript won't return

Hmm, I never get a callback -- neither error or success.

EDIT: I changed a lot of my code to fix some cloud typos, so just giving the gist:

Unity execute cloud script >> cloud call >> No return.

Sure, I get an error for now on the cloudscript, but shouldn't it at least return an err?

CloudScript
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The contents of the Cloud Script aren't actually relevant, unless what you're seeing is that there is no return when you call that handler (which you can check in the Game Manager - just select a player a use the Run Cloud Script option). But I can't really see that being the case, as there's always a return, one way or the other.

I'm not able to reproduce what you're seeing - can you try setting a breakpoint in your code and stepping in to see what's happening, specifically?

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

Dylan Hunt avatar image Dylan Hunt commented ·

Oh cool way of testing cloud code. As for stepping through, that's actually what I did. It got to making the call and it poofs out of existence. I have like 30 other calls that have never done that.

EDIT: My scene may have been changing faster than I thought

EDIT 2: Nope, even when removing the next scene completely, it definitely never returns.

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt commented ·

EDIT: I think it's the cloud code. I broke it immediately by doing log.Debug instead of log.debug, so nothing got returned. I'm doing that test now running cloud script from a profile.

Hmm, I tested several times in different ways -- ensured my scene wasn't changing. All calls work except this one, doesn't make much sense that I can see. Hmmm.....

0 Likes 0 ·
cloudfail.jpg (69.0 KiB)
brendan avatar image brendan Dylan Hunt commented ·

So the part I'm not clear on is, is your error handler being called, or not?

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt brendan commented ·

it is not called -- not an error or success

0 Likes 0 ·
Show more comments
Dylan Hunt avatar image Dylan Hunt commented ·

What happens when you call the script from "Run Cloud Script" on a player?

I get an error that my cloudscript is failing at UpdateVirtualCurrency. Upon some research, I can't even get that working with just a basic json file with postman. Something is a bit mysterious with this. Either way, my cloud script needs work and maybe I had a typo somewhere. However, I thought it'd return an error if timed out or something? Nothing is ever returned.

What happens when you run it from Postman?

Bad values or something, I can't recall (something to do with UpdateVirtualCurrency call failing. I'll do it soon and get back to you (Our Alpha build was unstable so we had to delay, so there's pressure for me to take care of that first before testing this further. I'll post back shortly!!)

Do you mind if I create a player in your title and do some testing on this?

Go for it! I suspect weird happenings with server's UpdateVirtualCurrency and Unity's ExecuteCloudScript. I may have typos, but I believe it's beyond that.

Either way, I'll get back to you as soon as our Alpha build is fixed and I can jump back to PlayFab business and post back!

>> I made a tiny func to try to UpdateVirtualCurrency, nada

0 Likes 0 ·
brendan avatar image brendan Dylan Hunt commented ·

So, when I run your addGold handler, it does return an error - CloudScriptAPIRequestError. The Server API call in question is AddUserVirtualCurrency, and the reason for the error is that the request is missing the required parameter "Amount" (you have an "AmountValue" in the request object).

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.