Introduce error logging for elo system

This commit is contained in:
Marcel Schwarz 2020-06-25 18:22:17 +02:00
parent 2d00bc363a
commit 43e474467b

View File

@ -55,12 +55,16 @@ class EloHelper {
}
static func reportScore(score: Int64) {
let gkScoreElo = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: GameCenterManager.sharedInstance.localPlayer)
let gkScoreElo = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: GKLocalPlayer.local)
gkScoreElo.value = score
let gkScoreAll = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ALL_ELO, player: GameCenterManager.sharedInstance.localPlayer)
let gkScoreAll = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ALL_ELO, player: GKLocalPlayer.local)
gkScoreAll.value = score
GKScore.report([gkScoreAll, gkScoreElo], withCompletionHandler: { error in
os_log("New Scores reported to EloSystem", log: self.LOG, type: .info)
if error != nil {
os_log("Could not report %@", log: LOG, type: .error, error!.localizedDescription)
} else {
os_log("New Scores reported to EloSystem", log: self.LOG, type: .info)
}
})
}
}