BlaiseRideout / MahjongSite

A site with various mahjong utilities
0 stars 1 forks source link

An entry for player "230" was entered on 10/2/17 into the seattlemahjong.club site #18

Open JMCanning78 opened 7 years ago

JMCanning78 commented 7 years ago

The player entry was probably for unused riichi points at the end of a match. If the game editor issue (Issue #17) is fixed, this can be corrected through the GUI.

JMCanning78 commented 7 years ago

Thinking more about this, Blaise says that the unused points player ID is 233, which means that this mis-entered score was created as a new player record. The fix to Issue #17 is not going to be able to repair that because it looks for unused points player ID in the Scores record. I think the correct way to fix this is to manipulate the Scores record by hand. Here's the command that I think would do it:

sqlite3 scores.db "UPDATE Scores SET PlayerId = 233 WHERE PlayerId = (SELECT Id FROM PLAYERS WHERE Name = '230')"

Once that is corrected, we can get rid of the bad Players record using

sqlite3 scores.db "DELETE FROM Players WHERE Name = '230'"

Assigning to Blaise since he has access to the database.

BlaiseRideout commented 7 years ago

I fixed the game record manually as suggested. Should I mark this issue closed since the offending game was fixed, or should we leave it open since we're not yet sure why it happened?

JMCanning78 commented 6 years ago

That's a good question. I tried replicating the error by putting in scores that totaled more than 100,000, filling a fifth player with a score of 1000 and then adjusting player scores so that the first 4 players totaled 99000. As soon as the the total score goes to 100,000, however, the fifth player was removed and so were the 1000 points assigned to it. I can't think of how someone could have entered in the fifth player as "230" with 1K points and got the "Add" button to become enabled to save the game.