GNOME Bugzilla – Bug 744988
Loading scores does not work
Last modified: 2015-02-23 15:17:12 UTC
The library never loads scores, or at least they never make it as far as the scores dialog. Not sure when this broke.
Did a binary search through the log. Seems the following commit broke it. Looking into it right now. commit ff1e4cfe4f7590cc3de0217cb51cadb43d657ef2 Author: Michael Catanzaro <mcatanzaro@gnome.org> Date: Sun Feb 22 13:27:36 2015 -0600 scores: load scores from file when creating the Context
Hm, that was an attempt to fix this bug. :)
Created attachment 297650 [details] [review] Patch I think I've figured out the issue. It's similar to the problem we were facing when we were trying to implement signals for the first time. 'load_scores_from_files' requires the signal 'request_category' to be bound to a method. The signal can only be bound to a method in the game source after Context object has been created. Calling 'load_scores_from_files' in context means that there is no method to which 'request_category' is bound. This means that after the line var category = request_category (category_key); category would always be null. Here's a patch attached that basically just undoes the commit mentioned in the previous comment. I don't see any other fix for this at the moment. But I might be wrong.
Oh OK, good job. I bet I wasn't able to load scores because GNOME 2048 probably does not connect to that signal. So besides reverting my change, we should also make this harder to abuse....
Connecting to the signal is probably necessary because of the whole category name, key and translation issues that we'd discussed at length earlier. One thing that we can do is if no method's attached, keep the name the same as key which would be the same as the file name in which the score's stored. PS: Is it ok if we continue this chat here? I really feel like I'm spamming everyone cc'ed to this :P
I push this with some trepidation, because reverting my commit breaks usage of the Context.has_scores() function I added yesterday for games to use to decide whether the scores dialog should be accessible or not. I will file another bug for that. The following fixes have been pushed: ff5f3d4 scores: Rename Context.request_category() to Context.category_request() 9850d1e scores: warn if the game does not connect to Context.request_category() 22b345c Scores are now loading again.
Created attachment 297672 [details] [review] scores: Rename Context.request_category() to Context.category_request()
Created attachment 297673 [details] [review] scores: warn if the game does not connect to Context.request_category()
Created attachment 297674 [details] [review] Scores are now loading again. Basically undid one of the previous commits.