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 344548 - top 10 score claim incorrect
top 10 score claim incorrect
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: gnomine
2.14.x
Other All
: Normal minor
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-11 09:40 UTC by Tino Meinen
Modified: 2006-06-12 03:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
screenshot showing the incorrect top 10 claim (489.52 KB, image/png)
2006-06-11 09:44 UTC, Tino Meinen
  Details
Truncate the file after writing new content over old stuff. (4.05 KB, patch)
2006-06-11 19:35 UTC, Richard Hoelscher
none Details | Review

Description Tino Meinen 2006-06-11 09:40:28 UTC
Please describe the problem:
After finishing the game, minesweeper claims i'm in the top 10 scorelist, while i'm actually not. The screenshot will show what i mean.

Perhaps part of it has to do with the fact that during one of the times i scored, i changed my name from tino to 10o, but that's just a guess

Steps to reproduce:
1. play the game 10 times
2. play it one more time but just aim just below number 10 score
3. watch the scorelist come up claiming you're in the top 10.


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Tino Meinen 2006-06-11 09:44:16 UTC
Created attachment 67116 [details]
screenshot showing the incorrect top 10 claim 

the score time for player with name Tino Meinen is 4:18 while the number 10 score (for player with name 10o is: 4:02 )
Comment 2 Richard Hoelscher 2006-06-11 13:56:56 UTC
I haven't been able to reproduce this yet, but I am seeing wierdness in the scores file... On the bottom line, usually about half my name by itself is just sitting there, "chard Hoelscher".
Comment 3 Tino Meinen 2006-06-11 14:50:06 UTC
Yep, I'm seeing that as well.
score file ending (line 11 and beyond) like:

einen
inen
en

Comment 4 Richard Hoelscher 2006-06-11 19:35:19 UTC
Created attachment 67145 [details] [review]
Truncate the file after writing new content over old stuff.

Because the file was open for reading and writing, anything we didn't overwrite when setting a new high score list was simply left in the file. It caused problems when the length of new content was shorter than the old content.

Patch truncates the file to the length of the new content.
Comment 5 Richard Hoelscher 2006-06-11 20:09:28 UTC
I've committed this to the HEAD and gnome-2-14 branches.
Comment 6 Callum McKenzie 2006-06-12 01:03:55 UTC
Speaking as the author of the buggy code: I'm embarrassed. Thanks for figuring it out Richard, I was looking at the symptoms and thinking "huh?".
Comment 7 Tino Meinen 2006-06-12 03:50:46 UTC
Well, this is excellent, Richard! Thanks for following up on this one so fast.
sincere gratitute.
Tino Meinen