Browse Source

send empty null cards. fix #15

Maxim Sokhatsky 11 years ago
parent
commit
45f8a615c8

+ 1 - 0
apps/server/src/okey/okey_scoring.erl

@@ -333,6 +333,7 @@ check_reveal([TopRow, BottomRow], Gosterge) ->
                       false_okey -> Okey;
                        _ -> E
                   end || E <- FlatList],
+    gas:info(?MODULE,"check_reveal/2 ~n    ~p ~p~n",[Normalized, Gosterge]), 
     Sets = split_by_delimiter(null, Normalized),
     ProperHand = lists:all(fun(S) -> is_set(S) orelse is_run(S) end, Sets),
     Pairs = lists:all(fun(S) -> is_pair(S) end, Sets),

+ 3 - 2
apps/web/priv/static/app/js/okey/deck.js

@@ -177,8 +177,9 @@ function DeckScope(scope) {
 
         hand: function(discarded) {
             return result = [ [], [] ], this.each(function(card, i, j) {
-                card && card != discarded && result[j].push(tuple(atom("OkeyPiece"), scope.CARD_COLORS.indexOf(card.color) + 1, card.value));
-            }), result;
+                if (null == card || card == discarded) result[j].push(atom('null'));
+                else result[j].push(tuple(atom("OkeyPiece"),
+                        scope.CARD_COLORS.indexOf(card.color) + 1, card.value)); }), result;
         },
 
         dir: function() {

+ 1 - 0
apps/web/src/logallow.erl

@@ -6,6 +6,7 @@ log_modules() -> [
     n2o_bullet,
     game_session,
     bullet_handler,
+    okey_scoring,
 %    n2o_secret,
 %    js_session,
     okey