// 해당 함수는 로그인 이후 모든 게임 정보를 불러오는 함수입니다.
void GetDataAll(){
GetData("UserInfo", 3);
}
// repeatCount는 재귀함수를 시도할 횟수입니다. 재귀를 돌수록 하나씩 감소합니다.
void GetData(string tableName, int repeatCount = 3) {
if(repeatCount <= 0) {
Debug.LogError("3번을 시도해보았지만 전부 실패했습니다.");
}
Backend.GameData.Get(tableName, new Where(), callback => {
// 500, 502등의 서버 에러가 발생할 경우 한번 더 호출하도록 재귀함수를 호출합니다.
if(callback.IsServerError() || callback.IsClientRequestFailError() || callback.GetMessage().Contains("signature")) {
GetData(repeatCount - 1);
}
});
}