question

Lars Krakhecke avatar image
Lars Krakhecke asked

Progressive Reward Recipe after Unity SDK Upgrade not working anymore

Hey there,

I've been using the Progressive Reward Recipe for Daily Login rewards but after updating to the newest SDK version it stopped working at

List<ItemInstance> grantedItems = (List<ItemInstance>)result.FunctionResult;

Throwing a "Cannot cast source type to destination type" error in unity.

Any idea how this is happening? The FunctionResult coming back from CloudScript is now empty, it wasn't before upgrading the SDK.

Thanks

10 |1200

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

Zac Bragg avatar image
Zac Bragg Deactivated answered

Hey Lars,

I just updated the repo using the proper deserialization syntax to fix this issue.

Happy Developing!

-Zac

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.

Lars Krakhecke avatar image Lars Krakhecke commented ·

Thank you Zac, I appreciate your work! Love you guys.

0 Likes 0 ·
alex2d avatar image
alex2d answered

Hi!

With just dowloaded from GitHub examples, after correction function name "CheckkkkIn"

:) in ProgressiveRewards.cs

I got this error message again:

InvalidCastException: Cannot cast from source type to destination type.
ProgressiveRewards.OnCheckInCallback (PlayFab.ClientModels.ExecuteCloudScriptResult result) (at Assets/PlayFab_Recipes/ProgressiveRewards/Scripts/ProgressiveRewards.cs:73)

Anything wrong? :)

Sorry for Googletranslate...

10 |1200

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

brendan avatar image
brendan answered
@alex2d

Could you try updating to the latest version of that sample? The "CheckkkkIn" typo was fixed back in May, along with quite a few other updates.

10 |1200

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

alex2d avatar image
alex2d answered

Before you asked this question, I was sure that the latest version...

Downloaded from:

https://github.com/PlayFab/PlayFab-Samples, master branch, zip

archive's contents:


timestamps on files: 2016-09-16 == "11 days ago" as stated in the GitHub comments... exactly... :)

Where did I go wrong? don't understand...


10 |1200

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

brendan avatar image
brendan answered

I'm not sure how your local version would have a recent date with an older version of the files, but here's the diff from back in May showing the change:https://github.com/PlayFab/PlayFab-Samples/commit/630ba669a9d9d12c979943e0d63a4f7a68e52d1a#diff-0ca8401297d13a6b14c79544f8c5203f. Could you try creating a fresh project and using the current version from GitHub?

10 |1200

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

alex2d avatar image
alex2d answered

But...That's what I did :)

-New Unity project, install PlayFab Editor Extensions, download SDK,

download samples from: https://github.com/PlayFab/PlayFab-Samples, without SVN or Git

just downloaded full archive ( https://github.com/PlayFab/PlayFab-Samples/archive/master.zip)

unzip, import unitypackage

made setting in GameManager according to the instructions from Readme, upload catalog JSON, upload

CloudScript.js...

PrizeWheel - worked well,

ProgressiveRewards, ReferralCodes - throw that Error :(

RegeneratingCurrency - not tested...

Yes, I certainly see the difference in the source code at your link, but for the first time faced with a situation when downloading a complete archive file from GitHub does not get as a result of the latest version... :) Dont understand...

PS Installl SourceTree, cloned Samples repository...

I'm an absolute noob in svn, git... :)))) Heh... But still I cloned and saw it:

2016-09-16 - and everything should be ОК! :) But...

Even with this clonned project, I saw again:

Don't undestand... :)))))))))))))))

PPS Could you throw me a very-very direct link where I could download the latest examples version?

-I need a vacation... from GitHub repository... :)))

Sincerely yours, Alex!


10 |1200

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

brendan avatar image
brendan answered

Wow - you have my sincere apologies. I have the latest version, as we did indeed fix this back in May. However, I created a clean project, grabbed the latest version of that repo, installed the Unity Package, and found that the code in it isn't up-to-date. It looks like the package was not re-built when the code was updated. Our tools folks will be re-generating those packages and updating the repo shortly.

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

alex2d avatar image alex2d commented ·

Thank you very much! :) I'll wait for fixes...

Sincerely yours, Alex!

0 Likes 0 ·
info-3 avatar image info-3 commented ·

Im waiting the update too, thanks!

,

im waiting too, thanks

0 Likes 0 ·
brendan avatar image brendan commented ·

Okay, all the samples have had their Unity packages re-generated, so they're all up to date. Let us know if you see any other issues.

0 Likes 0 ·
alex2d avatar image alex2d commented ·

Thank you very much! :)
-Everething ok now.

Sincerely yours, Alex!

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.