After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 552963 - Default to use appropriate player name for high score list
Default to use appropriate player name for high score list
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: gtali
2.23.x
Other All
: Normal enhancement
: ---
Assigned To: Jason Clinton
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-20 00:40 UTC by Geoff Buchan
Modified: 2008-12-15 04:02 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Change name default for high score (1.42 KB, patch)
2008-09-20 00:42 UTC, Geoff Buchan
none Details | Review
Corrected patch implementing the new score behavior (3.73 KB, patch)
2008-10-02 00:49 UTC, Geoff Buchan
committed Details | Review

Description Geoff Buchan 2008-09-20 00:40:39 UTC
Unlike most gnome games, gtali allows multiple human players, and it lets the human players select a name different from the name associated with the login.

GTali should use the Player Name of the winning player as the default value should someone make the high score list.
Comment 1 Geoff Buchan 2008-09-20 00:42:24 UTC
Created attachment 119025 [details] [review]
Change name default for high score

This patch changes the default name for the high score list to use the  player name of the winning human player. 
I've also added my name to the credits in a fit of shameless self-promotion.
Comment 2 Geoff Buchan 2008-10-02 00:49:50 UTC
Created attachment 119748 [details] [review]
Corrected patch implementing the new score behavior

The previous patch always used the user defined name, even when the player overwrites it in the score dialog. This patch allows the update to happen correctly.

The problem before was that games_scores_update_score would only change a name when the old name was the g_get_real_name() value for the person logged in. This patch creates a new function, games_scores_update_score_name, which takes in an extra argument, gchar *old_name. When that is not NULL, the code compares the name in the list against the old_name argument. When it is NULL, it sets old_name to g_get_real_name() and acts as before. I've converted games_scores_update to a wrapper which calls games_scores_update_name with a NULL old_name argument (to preserve backwards compatibility). So now when the player changes a name in the scores dialog, it first looks up the old name, then passes that string to games_scores_update_name in addition to the new name.

This achieves the desired results: by default, the name in the high score list is the name the player chose in gtali, but if the player enters a different name, that is now stored correctly.
Comment 3 Jason Clinton 2008-12-15 04:02:31 UTC
Commited to trunk. Thanks!