Bug 444188 - New Numbered Game Limited To 9 (Nine) Numbers
Summary: New Numbered Game Limited To 9 (Nine) Numbers
Status: RESOLVED FIXED
Alias: None
Product: kmahjongg
Classification: Applications
Component: general (show other bugs)
Version: 0.9.21043
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-21 12:12 UTC by Shadders
Modified: 2021-10-30 10:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
kmahjongg_10digit_game (441.81 KB, image/jpeg)
2021-10-21 22:59 UTC, Shadders
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shadders 2021-10-21 12:12:07 UTC
SUMMARY
The New Numbered Game entry has a limit of 9 (nine) numbers, where many games are 10 numbers. hence cannot restart an older game. 

STEPS TO REPRODUCE
1. Select Menu: Game -> New Numbered Game
2. Text box does not allow a 10 (ten) numbered game to be restarted.
3. 

OBSERVED RESULT
Unable to type in the tenth digit.

EXPECTED RESULT
Should be able to type in all 10 (ten) digits

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 34
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Albert Astals Cid 2021-10-21 21:41:49 UTC
Do you remember which version you had before that allowed you to enter more numbers?
Comment 2 Shadders 2021-10-21 22:16:25 UTC
Hi,
Last version that i had installed as per distro (7th November 2020 installed) is :

kmahjongg-19.12.2-1.fc32.x86_64

It seems fedora packaged kmahjongg in F32 for F33 build.

Last time i repeated a game was May 2021. Update to version as per bug report was 16th October 2021, upgrade from F33 to F34. 

Regards,
Shadders.
Comment 3 Albert Astals Cid 2021-10-21 22:23:59 UTC
I just checked that version and the maximum number you can enter is 2147483647, same as with the current version. Which number are you expecting to be able to enter?
Comment 4 Shadders 2021-10-21 22:32:10 UTC
Hi,
In May 2021 i replayed the following games :
1086501009, 1813846301, 1805500308

All three are 10 digit numbers. The version as per bug report only allow 9 numbers to be entered. 

Game i am attempting to replay is 4162709682. 

Regards,
Shadders.
Comment 5 Albert Astals Cid 2021-10-21 22:37:24 UTC
(In reply to Shadders from comment #4)
> Hi,
> In May 2021 i replayed the following games :
> 1086501009, 1813846301, 1805500308
> 
> All three are 10 digit numbers. The version as per bug report only allow 9
> numbers to be entered. 

Are you sure about that? I can enter 1086501009 just fine, as said the max number is 2147483647

> Game i am attempting to replay is 4162709682. 

I'm sorry but I can't find any version in which such game number was allowed. 

Anyhow game numbers changed since 20.12 and the numbers don't mean exactly what they meant, so playing the same number won't get you the same game as pre-20.12 verisons.
Comment 6 Shadders 2021-10-21 22:52:51 UTC
Hi,
Yes, i just click new game and the number is :
4097895855

A few more new game clicks and 3165032516, 3297680504.

So, yesterday i noted the game 4162709682. This is the number i cannot replay on kmahjongg 0.9.21043 (as per Help -> About Mahjongg).

Regards,
Shadders.
Comment 7 Shadders 2021-10-21 22:59:42 UTC
Created attachment 142747 [details]
kmahjongg_10digit_game

Example of 10 digit game Mahjongg
Comment 8 Bug Janitor Service 2021-10-22 19:49:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/games/kmahjongg/-/merge_requests/3
Comment 9 Albert Astals Cid 2021-10-22 19:50:28 UTC
Ah, i see the problem now, the new random code is generating too big numbers.
Comment 10 Albert Astals Cid 2021-10-30 10:06:26 UTC
Git commit 21f71613273f38454dc9644883f9e4b112af8d67 by Albert Astals Cid.
Committed on 22/10/2021 at 19:48.
Pushed by aacid into branch 'release/21.08'.

Don't generate random game numbers bigger than INT_MAX

Since we don't allow users to enter a numbered number bigger than it
either

M  +1    -1    src/gameview.cpp

https://invent.kde.org/games/kmahjongg/commit/21f71613273f38454dc9644883f9e4b112af8d67