Bug 324022 - AssertionError after nine east wind wins in a row.
Summary: AssertionError after nine east wind wins in a row.
Status: RESOLVED FIXED
Alias: None
Product: kajongg
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Wolfgang Rohdewald
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-25 18:48 UTC by ospalh@gmail.com
Modified: 2013-08-29 12:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.1


Attachments
Score with eight of nine E wins. (64.72 KB, image/png)
2013-08-25 18:48 UTC, ospalh@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ospalh@gmail.com 2013-08-25 18:48:27 UTC
Created attachment 81925 [details]
Score with eight of nine E wins.

With a ruleset based on the DMJL rules with “Nine east wind wins in a row = 1 limit”, actually managing that gave 
"""
 Error for player Ospalh:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/spread/pb.py", line 565, in expressionReceived
    method(*sexp[1:])
  File "/usr/lib64/python2.7/site-packages/twisted/spread/pb.py", line 935, in proto_answer
    d.callback(self.unserialize(netResult))
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 368, in callback
    self._startRunCallbacks(result)
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 551, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/kommunalka/roland/work/github/kajongg-fork/src/deferredutil.py", line 168, in __gotAnswer
    self.callbackIfDone()
  File "/kommunalka/roland/work/github/kajongg-fork/src/deferredutil.py", line 185, in callbackIfDone
    self.callbackMethod(answers, *self.__callbackArgs)
  File "/kommunalka/roland/work/github/kajongg-fork/src/server.py", line 747, in moved
    answers = self.processAnswers(requests)
  File "/kommunalka/roland/work/github/kajongg-fork/src/server.py", line 742, in processAnswers
    answer.answer.serverAction(self, answer)
  File "/kommunalka/roland/work/github/kajongg-fork/src/message.py", line 217, in serverAction
    table.claimMahJongg(msg)
  File "/kommunalka/roland/work/github/kajongg-fork/src/server.py", line 673, in claimMahJongg
    if not player.hand.won:
  File "/kommunalka/roland/work/github/kajongg-fork/src/player.py", line 164, in fget
    self.__hand = self.computeHand()
  File "/kommunalka/roland/work/github/kajongg-fork/src/player.py", line 632, in computeHand
    return Hand.cached(self, ' '.join(melds), computedRules=rules, robbedTile=robbedTile)
  File "/kommunalka/roland/work/github/kajongg-fork/src/hand.py", line 73, in cached
    computedRules=computedRules, robbedTile=robbedTile)
  File "/kommunalka/roland/work/github/kajongg-fork/src/hand.py", line 145, in __init__
    self.__applyRules()
  File "/kommunalka/roland/work/github/kajongg-fork/src/hand.py", line 225, in __applyRules
    if self.__hasExclusiveRules():
  File "/kommunalka/roland/work/github/kajongg-fork/src/hand.py", line 265, in __hasExclusiveRules
    self.won = self.__maybeMahjongg()
  File "/kommunalka/roland/work/github/kajongg-fork/src/hand.py", line 208, in fset
    assert not value
exceptions.AssertionError:
"""
The hand N1i (North one india) does not appear in the image.
After the assertion, the game table is blank. Using “Resume game” starts somewhere early in the streak, in my case with hand 555999191/N1a.
Comment 1 Wolfgang Rohdewald 2013-08-29 12:19:45 UTC
Git commit 6990f27db1706653e9522ef0e4f99a65f26754b5 by Wolfgang Rohdewald.
Committed on 29/08/2013 at 00:22.
Pushed by wrohdewald into branch 'KDE/4.11'.

fix handling of "east won nine times in a row"

1. that rule is not absolute anymore because we still want to know
which rule lead to Mah Jongg

2. raise LongHand only for scoring games. In real games, the program
logic prevents this anyway.
FIXED-IN: 4.11.1

M  +1    -1    src/predefined.py
M  +8    -0    src/rulecode.py

http://commits.kde.org/kajongg/6990f27db1706653e9522ef0e4f99a65f26754b5
Comment 2 Wolfgang Rohdewald 2013-08-29 12:23:36 UTC
Git commit b1e596b99df42efcef84afe724d615474644ff8c by Wolfgang Rohdewald.
Committed on 29/08/2013 at 00:22.
Pushed by wrohdewald into branch 'master'.

fix handling of "east won nine times in a row"

1. that rule is not absolute anymore because we still want to know
which rule lead to Mah Jongg

2. raise LongHand only for scoring games. In real games, the program
logic prevents this anyway.
FIXED-IN: 4.11.1

M  +1    -1    src/predefined.py
M  +8    -0    src/rulecode.py

http://commits.kde.org/kajongg/b1e596b99df42efcef84afe724d615474644ff8c