Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Anatoly Volnov · Dec 03, 2019 at 01:33 AM · entitiesdocumentation

Entity files docs sample doesn't compile and other docs gripes

Trying to get file uploads working, and the code sample on https://docs.microsoft.com/en-us/gaming/playfab/features/data/playerdata/entity-files does not compile for me in Unity 2019.2.6f1, complaining that it "cannot convert from 'method group' to 'Action '" on arg 3 of SimplePutCall in OnInitFileUpload, so that's the FinalizeUpload method in the sample. I'm attaching a screenshot of the place in the code.

screenshot-2019-12-02-at-183905.jpg

Also overall I find that the entity docs feel really undercooked without enough samples, the code language selection on the old docs platform doesn't function, it's stuck on Unity C# (So I can't look at syntax samples on how to deal with entities in CloudScript, for example, so I never got that to work, never figured out how to simply GetObjects from CloudScript). The github samples aren't that much help either. Having to scrounge the forums just for some samples is not a very good experience. Have I missed something or is it really like this?

Something like a sample Unity project (that has entities and isn't 3 years old) that just has most of the things in the SDK implemented and CloudScript entity samples would go miles towards aiding in understanding the platform for someone like me who's a jack of all trades solo developer and not a professional programmer by trade. Working with stats, leaderboards, and player data is really easy by comparison, for example, just because there are samples for most of what you'd want to do with them.

screenshot-2019-12-02-at-183905.jpg (245.3 kB)
Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Sarah Zhang · Dec 03, 2019 at 07:42 AM

We will try to inform our team about this documentation issue about the sample code doesn't suit the latest SDK. Currently, you can modify the code to the following one.

PlayFabHttp.SimplePutCall(response.UploadDetails[0].UploadUrl, 
payload,
//FinalizeUpload, 
success => { FinalizeUpload(); }, 
error => { Debug.Log(error); } 
);

About the Entity examples on CloudScript, you can find a SetObject sample in the first(default) CloudScript revision, on the line 78 handlers.makeEntityAPICall, it also contains some information in the comments, you can refer to it to call GetObject and other Entity API.

Comment

People who like this

0 Show 8 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Anatoly Volnov · Dec 03, 2019 at 12:03 PM 0
Share

Thank you for the response and the clarification, that does compile now.

What's not clear to me in regards to GetObject is not the call itself necessarily, but how to treat the result in CloudScript. This may be just an issue of me not being too familiar with JS and its dynamic typing, but I'd still appreciate at least one example somewhere of getting an actual value out of an object in CloudScript.

avatar image Sarah Zhang ♦ Anatoly Volnov · Dec 04, 2019 at 01:43 AM 0
Share

Have you checked this doc Writing custom CloudScript for a tutorial and a simple sample of CloudScript? The methods of treating results are similar.

avatar image Sarah Zhang ♦ Sarah Zhang ♦ · Dec 05, 2019 at 07:44 AM 2
Share

>> Could you please point me in the right direction?

You can refer to the above content to modify the field name in the second last line. The field's name that you write after dot or in the brackets should have the same content and structure as the response of GetObjects. You can test PlayFab API using external REST API testing tools (like Postman) and check the responses before you call them on CloudScript. Or you can also check the API references to confirm the correct field name.

>> Are segment and other actions supported by the entity system?

No, Segment is targeted for players, not entities. PlayFabId is the entity Id of master_player_account, but Segment operation is targeted for players, you can convert entity Id of master_player_account to playfabId to get a player's segment via API GetPlayerSegments but they have no other relevances.

Show more comments
Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    Entity Global Title Policy for weaker bans 1 Answer

    Please document Content Type on custom build upload...,Please document Content-Type on custom build upload.... 1 Answer

    Mock Vm Local testing issue! 1 Answer

    List playFabIds in a party using Groups API 1 Answer

    Inviting to Group using Username 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges