Hey I am thinking about how to handle offline sync I have 2 ways
I will save the data locally with playerpref and with OnApplicationQuit I will invoke Azure function and I will check if the info is OK and compare it to the old player info
for each level that the player passes I will invoke the Azure function ^
I am thinking on the amount of the calls that I am going to send to the server in the first option, I send it when the player exits from the app and send all the info in one package
the second option is when the player passes a level so it could be up to the maximum levels in the app but if I have 1000 or more levels it could be a lot of calls
what do you think will be the best and most optimized way to do it?
And my second question is when should I check if the player is offline? should I let him send request and if the request is null tell him that he is offline? or should I use this code ?
IEnumerator CheckConnection()
{
using (UnityWebRequest request = new UnityWebRequest("https://google.com"))
{
yield return request.SendWebRequest();
if (request.error != null)
{
}
else
{
}
}
}
If yes for how long should I wait between pings? thank you