Thank you very much for this. It will help me a lot. In case of getting the leaderboard scores, do any other errors than server not reachable exist?
I can't answer what all the error messages would be and it might depend on which methods you are using. I check if the server is reachable, if a post for a new score was successful (return code of 201 or 202 maybe - not sure which), and for an error message containing the word profane (return code 403 is what is returned) so I can tell the player they can't use a username with a bad word in it). But, in looking through Daniel's client side code, the StatusCode.cs file contains a bunch of return codes and you might be able to check for these. I would verify with Daniel though. You could also test some of them like a 401 maybe is a bad public key (maybe), 204 might be a submission with a required param like username missing. Here are the codes that I saw, but I have no idea which ones are returned for which methods/functions. Hope this helps some.
public enum StatusCode
{
FailedToConnect = 0,
Ok = 200,
Created = 201,
Accepted = 202,
NoContent = 204,
BadRequest = 400,
Unauthorized = 401,
Forbidden = 403,
NotFound = 404,
Conflict = 409,
TooManyRequests = 429,
InternalServerError = 500,
NotImplemented = 501,
ServiceUnavailable = 503
}
Hi Broi, I was having an issue with GetPersonalEntry so I've stopped using it. Not sure what it would call if you haven't uploaded anything. Probably a null value or an error. I'd say just call it and see. You can always delete your test entry from the leaderboard and check. You might have to clear PlayerPrefs too but not sure on that. If you have an entry uploaded, for each Entry returned on looping through, you can call the function called IsMine() to see if it is your entry. I think a GUID is assigned on the server side and then Daniel persists this locally using PlayerPrefs, but I'm not 100% sure on that. You can see this in one of the scripts.
PlayerPrefs.SetString(GUID_KEY, guid);