Hi riq,
I understand that score from the DB and Ranker needs to be deleted. However, I have a very limited knowledge on both Python and Databases, so I am still on Google figuring things out. I saw the link you gave, but it seems like if we want to implement that, we have to make some major changes to the code...
From what I can understand, the score deletion from the DB is a transaction, and the score deletion from the Ranker (by setScore(None)) is another transaction. And if the score deletion of the Ranker fail, we need to reverse the steps we've done to the DB score delete transaction, is that right?
If that is so, why don't we just run the transaction to delete score from the ranker first? If it does fail, then the score won't be deleted from the DB, which nothing will be changed and the user can try again. If it does succeed, then we will proceed to run the transaction to delete the score from the DB. If the DB transaction fails, nothing will be changed to the DB and CocosLive (besides the Ranker), so the user can have another chance to retry to delete the score again. Trying to delete again from the Ranker won't do anything harmful since if that score is gone, then it won't do anything.
To fill in what you posted:
user.py, line 806:
if score:
if game.ranking_enabled:
profile_id = "%s@%s" % (score.cc_playername, score.cc_device_id) #NOTE: this is the implementation to get profile ID in api.py
ranker = self.get_ranker( self.game.key(), self.category )
ranker.SetScore( profile_id, None )
self.delete_score_transac( score, game, score_country ) #Delete score from DB after score is deleted from Ranker
else:
raise Exception('EditScores: Score not not found')
Sorry if I am way off, still got a lot to learn from this..