question

ProjectAether avatar image
ProjectAether asked

Update Statistics on RealTime/Unity + Photon

hi i want to know how to update my player statistics on realtime ? like mmorpg stats like a Hp or Exp, lvls.

i test with via cloud server: StartCloudUpdatePlayerStats(); // on update funcion

and works for a little amoun of time but then display this msg : The client has exceeded the maximum API request rate and is being throttled

dada.png (14.3 KiB)
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.

ProjectAether avatar image ProjectAether commented ·
Edit i made a little mod to relay the update 



                if(CanUpdate)
                {
                    CanUpdate= false;
                    StartCoroutine(UpdateStatsTimer());
                }


        	IEnumerator UpdateStatsTimer()
        	{
            	yield return new WaitForSeconds(20);// seconds to delay update of the stats
            	StartCloudUpdatePlayerStats();
            	CanUpdate= true;
        	}

0 Likes 0 ·

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

You are using CloudScript to update players’ statistics, which seems alright to me. However, adding the “update statistic” logic into the Update() function might not be a good idea since it’s called every frame, which will surely result in the “throttled” issue (Regardless of any other limits, we currently allow an upper bound of 100 API calls from an individual client IP in a 2 minute window). Does the re-edited code meet your requirements?

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.

ProjectAether avatar image ProjectAether commented ·

Thanks that works fine!

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.