Introduce error logging for elo system
This commit is contained in:
parent
2d00bc363a
commit
43e474467b
@ -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
|
||||
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user