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 /
  • General Discussion /
avatar image
Question by Yoo SeungJi · Apr 21, 2021 at 02:14 PM · Player DatadataCharacter Data

About Set data OnApplicationQuit

This question could be about Unity.

If it is not important data, I am thinking of not updating it to the server immediately after the change, but only in special circumstances. I'm considering updating the application when I close it this way, what do you think about this?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Sarah Zhang · Apr 22, 2021 at 10:32 AM

Setting the data in the OnApplicationQuit() function is ok. The code could be something like this code snippet of PlayFab SDK.

Of course, we would still suggest you store the data regularly including saving the data locally to prevent data loss due to program crashes. If as you said, the data is not important, you can entirely store the data temporarily locally, then upload it when the application quit. If so, when the game crashes, the client can still hold the data and wait for the next upload.

Besides, you can also consider using the Unity method Unity - Scripting API: Application.quitting (unity3d.com) or Unity - Scripting API: Application.wantsToQuit (unity3d.com) to raise the event when the application quitting. If you have the more advanced questions about Unity API and the Unity script life cycle, please navigate to the Unity forum for the professional support.

Comment

People who like this

0 Show 4 · 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 Yoo SeungJi · Apr 22, 2021 at 10:53 AM 0
Share

@Sarah Zhang Thank you, but I have one question. Is there a way to distinguish if the server's data and local backup data are different when receiving user data from the server, whether it is tampered with or not uploaded to the server?

avatar image Sarah Zhang Yoo SeungJi · Apr 23, 2021 at 09:35 AM 0
Share

Generating MD5 value for local data file can prevent some cheaters. Or you can consider using asymmetric encryption for your data, you can encrypt it in Unity, and unencrypt it on Cloud Script using Azure Functions.

But if you have high security requirements for this part of the data, please upload the encrypted data directly instead of storing it locally.

avatar image Yoo SeungJi Sarah Zhang · Apr 26, 2021 at 10:50 AM 0
Share

Thank you for your kind answer.
I'm sorry, but could you explain the encryption in detail?

Show more comments
avatar image

Answer by Jung Ho June · Apr 21, 2021 at 03:52 PM

i was used that solution for my ue4 game

but sometimes the data not upload so it cause critical error.

so i decided to auto upload every 50 sec.

Comment

People who like this

0 Show 0 · 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

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

    What happens after I overstep the free limit of updates per user 1 Answer

    Questions on storing a list of strings on PlayFab to be accessed by all users, or similar methods 2 Answers

    Stay logged in when the scene changes 1 Answer

    Soccer Manager - Handling of soccer players / data 1 Answer

    After trying to delete userdata (for testing) with DeleteAll() function, it doesnt work anymore? 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