Browse Source

yyyy游戏的通信协议解析

Alex 1 year ago
parent
commit
ffeb21bce0
2 changed files with 125 additions and 100 deletions
  1. 115 100
      yyyy_js/assets/main/index.jsc
  2. 10 0
      yyyy_js/yyyy关键点.txt

+ 115 - 100
yyyy_js/assets/main/index.jsc

@@ -360792,53 +360792,57 @@ window.__require = function e(t, n, o) {
                 }
             };
                 e.prototype._fetchInfo = function (wpkOrpkw, t, doLogicType) {
-                console.log("====>>>>正在处理消息类型:",doLogicType);
-                var r = this, a = this.INFOS[wpkOrpkw];
-                if (a) {
-                    if (a._isMsgIgnored) if (wpkOrpkw == o.WPK && doLogicType == window.WePokerWebSocketMsgTypes.upDateRoomNotify && "joinRoom" == t.originOpt) {
-                        a._isMsgIgnored = !1;
-                        a.resetSettlement();
+                console.log("====>>>>正在处理消息类型:",wpkOrpkw,`__  ${t}  __`,doLogicType);
+                
+                const stack = new Error().stack;
+                console.log("报错堆栈:",stack);
+
+                var r = this, gameSence = this.INFOS[wpkOrpkw];
+                if (gameSence) {
+                    if (gameSence._isMsgIgnored) if (wpkOrpkw == o.WPK && doLogicType == window.WePokerWebSocketMsgTypes.upDateRoomNotify && "joinRoom" == t.originOpt) {
+                        gameSence._isMsgIgnored = !1;
+                        gameSence.resetSettlement();
                     } else {
                         if (wpkOrpkw != o.PKW || "NoticeGameSnapshot" != doLogicType) return;
-                        a._isMsgIgnored = !1;
-                        a.resetSettlement();
+                        gameSence._isMsgIgnored = !1;
+                        gameSence.resetSettlement();
                     }
                     if (wpkOrpkw == o.WPK) {
-                        if (t.sysTime && t.sysTime < a._lastMsgMs) return;
+                        if (t.sysTime && t.sysTime < gameSence._lastMsgMs) return;
                         var wePokerWsMsgTypes = window.WePokerWebSocketMsgTypes, l = window.CurrentUserInfo, u = window.HMFUtils, p = t.msgBody, h = function (e, t, n) {
                             if (e) {
-                                a.cards = e;
-                                n && (a.lightCards = Array.from(e));
+                                gameSence.cards = e;
+                                n && (gameSence.lightCards = Array.from(e));
                             }
-                            t && (a.cardsType = u.getLanguageStr("gameAround.cardTypeLayer." + t));
+                            t && (gameSence.cardsType = u.getLanguageStr("gameAround.cardTypeLayer." + t));
                         }, f = function () {
-                            a.sitUsers.sort(function (e, t) {
+                            gameSence.sitUsers.sort(function (e, t) {
                                 var n = e.seatNum, o = t.seatNum;
-                                n < a.sbSeatNum && (n += a.seatCount);
-                                o < a.sbSeatNum && (o += a.seatCount);
+                                n < gameSence.sbSeatNum && (n += gameSence.seatCount);
+                                o < gameSence.sbSeatNum && (o += gameSence.seatCount);
                                 return n - o;
                             });
-                            a.roomStatus = 3 == p.roomStatus || a.sitUsers.length < a.minPlayersCount ? s.WAITING : s.NONE;
-                            a.resetSeatNameIndex();
-                            for (var e = 0; e < a.sitUsers.length; e++) if (a.sitUsers[e].userId == l.user.userId) {
-                                a.seatNameIndex = e;
+                            gameSence.roomStatus = 3 == p.roomStatus || gameSence.sitUsers.length < gameSence.minPlayersCount ? s.WAITING : s.NONE;
+                            gameSence.resetSeatNameIndex();
+                            for (var e = 0; e < gameSence.sitUsers.length; e++) if (gameSence.sitUsers[e].userId == l.user.userId) {
+                                gameSence.seatNameIndex = e;
                                 break;
                             }
                         };
                         if (doLogicType == wePokerWsMsgTypes.upDateRoomNotify || doLogicType == wePokerWsMsgTypes.updateRoomUserNotify) {
-                            1 == p.playType ? a.roomType = i.DP : 2 == p.playType ? a.roomType = i.AMH : 3 == p.playType ? a.roomType = i.SNG : a.roomType = i.DZ;
-                            a.isSTR = p.isThirdBlind;
-                            a.seatCount = p.gamePersonNum;
-                            a.minPlayersCount = 2;
-                            a.seatNum = p.currentUserSeatNum - 1;
-                            a.sbSeatNum = p.sBSeatNum;
-                            a.sitUsers = Array.from(p.sitUserList);
+                            1 == p.playType ? gameSence.roomType = i.DP : 2 == p.playType ? gameSence.roomType = i.AMH : 3 == p.playType ? gameSence.roomType = i.SNG : gameSence.roomType = i.DZ;
+                            gameSence.isSTR = p.isThirdBlind;
+                            gameSence.seatCount = p.gamePersonNum;
+                            gameSence.minPlayersCount = 2;
+                            gameSence.seatNum = p.currentUserSeatNum - 1;
+                            gameSence.sbSeatNum = p.sBSeatNum;
+                            gameSence.sitUsers = Array.from(p.sitUserList);
                             f();
-                            a.resetCards();
-                            a.isFold = !1;
-                            for (var g = 0, m = a.sitUsers; g < m.length; g++) if ((L = m[g]).userId == l.user.userId) {
+                            gameSence.resetCards();
+                            gameSence.isFold = !1;
+                            for (var g = 0, m = gameSence.sitUsers; g < m.length; g++) if ((L = m[g]).userId == l.user.userId) {
                                 h(L.handCards, L.cardType, !0);
-                                a.isFold = L.actionPO && "FOLD" == L.actionPO.actionType;
+                                gameSence.isFold = L.actionPO && "FOLD" == L.actionPO.actionType;
                                 break;
                             }
                             this._setInfoGameRound(wpkOrpkw, p.round);
@@ -360864,42 +360868,42 @@ window.__require = function e(t, n, o) {
                                 _ = p.userAciton;
                             } else _ = p;
                             if (_ && _.userId == l.user.userId) setTimeout(function () {
-                                for (var t = !1, n = 0, o = a.cards; n < o.length; n++) if (o[n] > 0) {
+                                for (var t = !1, n = 0, o = gameSence.cards; n < o.length; n++) if (o[n] > 0) {
                                     t = !0;
                                     break;
                                 }
                                 h(_.handCards, _.cardType, !t);
-                                a.updateActMs(1e3 * _.countDown, 1e3 * _.totalCountDown);
+                                gameSence.updateActMs(1e3 * _.countDown, 1e3 * _.totalCountDown);
                                 r.notifyInfoChanged(wpkOrpkw);
                             }, 500); else {
-                                a.resetActMs();
+                                gameSence.resetActMs();
                                 this.notifyInfoChanged(wpkOrpkw);
                             }
                         } else if (doLogicType == wePokerWsMsgTypes.prolongNotify) {
-                            p.userId == l.user.userId ? a.updateActMs(1e3 * p.countDown, 1e3 * p.countDown) : a.resetActMs();
+                            p.userId == l.user.userId ? gameSence.updateActMs(1e3 * p.countDown, 1e3 * p.countDown) : gameSence.resetActMs();
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if (doLogicType == wePokerWsMsgTypes.userChooseDoubleNotify) {
-                            a.resetActMs();
+                            gameSence.resetActMs();
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if (doLogicType == wePokerWsMsgTypes.actionNotify) {
                             p.selfInfo && h(p.selfInfo.handCards, null, !1);
                             for (var y = 0, b = p.actionList; y < b.length; y++) {
                                 var v = b[y];
-                                if (v.userId == l.user.userId && "FOLD" == v.actionType) a.isFold = !0; else if ("SMALL_BLIND" == v.actionType) {
-                                    a.sbSeatNum = v.seatNum;
+                                if (v.userId == l.user.userId && "FOLD" == v.actionType) gameSence.isFold = !0; else if ("SMALL_BLIND" == v.actionType) {
+                                    gameSence.sbSeatNum = v.seatNum;
                                     f();
                                 }
                             }
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if (doLogicType == wePokerWsMsgTypes.playResultNotify) {
-                            a.resetActMs();
+                            gameSence.resetActMs();
                             for (var S = 0, C = p.thanList; S < C.length; S++) {
                                 var T = C[S];
                                 if (T.userId == l.user.userId) {
-                                    p.highPublicCards.length >= 3 && (a.lightCards = T.highHandCards);
-                                    a.settlementScore = T.addScore;
-                                    a.isSettlement = !0;
-                                    a.isSettlementAniming = !1;
+                                    p.highPublicCards.length >= 3 && (gameSence.lightCards = T.highHandCards);
+                                    gameSence.settlementScore = T.addScore;
+                                    gameSence.isSettlement = !0;
+                                    gameSence.isSettlementAniming = !1;
                                     this.notifyInfoChanged(wpkOrpkw);
                                     break;
                                 }
@@ -360909,38 +360913,38 @@ window.__require = function e(t, n, o) {
                             this.notifyInfoChanged(wpkOrpkw);
                         } else {
                             if (doLogicType != wePokerWsMsgTypes.cleanNotify) return;
-                            a.resetCards();
-                            a.resetActMs();
-                            a.isFold = !1;
-                            a.resetSettlement();
+                            gameSence.resetCards();
+                            gameSence.resetActMs();
+                            gameSence.isFold = !1;
+                            gameSence.resetSettlement();
                             this.notifyInfoChanged(wpkOrpkw);
                         }
-                        t.sysTime && (a._lastMsgMs = t.sysTime);
+                        t.sysTime && (gameSence._lastMsgMs = t.sysTime);
                     } else if (wpkOrpkw == o.PKW) {
-                        if ("NoticeGameSnapshot" == doLogicType) a.roomId = t.roomid; else if (t.roomid && t.roomid != a.roomId) return;
-                        var w = function () {
-                            a.sitUsers.sort(function (e, t) {
+                        if ("NoticeGameSnapshot" == doLogicType) gameSence.roomId = t.roomid; else if (t.roomid && t.roomid != gameSence.roomId) return;
+                        var resetSeatInfo = function () {
+                            gameSence.sitUsers.sort(function (e, t) {
                                 var n = e.seatid, o = t.seatid;
-                                n < a.sbSeatNum && (n += a.seatCount);
-                                o < a.sbSeatNum && (o += a.seatCount);
+                                n < gameSence.sbSeatNum && (n += gameSence.seatCount);
+                                o < gameSence.sbSeatNum && (o += gameSence.seatCount);
                                 return n - o;
                             });
-                            a.roomStatus = a.sitUsers.length < a.minPlayersCount ? s.WAITING : s.NONE;
-                            a.resetSeatNum();
-                            a.resetSeatNameIndex();
-                            for (var e = 0; e < a.sitUsers.length; e++) {
-                                var t = a.sitUsers[e];
+                            gameSence.roomStatus = gameSence.sitUsers.length < gameSence.minPlayersCount ? s.WAITING : s.NONE;
+                            gameSence.resetSeatNum();
+                            gameSence.resetSeatNameIndex();
+                            for (var e = 0; e < gameSence.sitUsers.length; e++) {
+                                var t = gameSence.sitUsers[e];
                                 if (t.playerid == d.default.dataHandler.getUserData().u32Uid) {
-                                    a.seatNum = t.seatid;
-                                    a.seatNameIndex = e;
+                                    gameSence.seatNum = t.seatid;
+                                    gameSence.seatNameIndex = e;
                                     break;
                                 }
                             }
                         }, P = function () {
-                            a.resetCards();
-                            a.resetActMs();
-                            a.isFold = !1;
-                            a.resetSettlement();
+                            gameSence.resetCards();
+                            gameSence.resetActMs();
+                            gameSence.isFold = !1;
+                            gameSence.resetSettlement();
                             r.notifyInfoChanged(wpkOrpkw);
                         }, A = function (e) {
                             r._timeoutNoticeGameSettlement && clearTimeout(r._timeoutNoticeGameSettlement);
@@ -360949,72 +360953,72 @@ window.__require = function e(t, n, o) {
                             }, 3200) : P();
                         };
                         if ("NoticeGameSnapshot" == doLogicType) {
-                            d.default.roomManager.checkGameIsZoom(t.gameid) ? a.roomType = i.JS : t.gameid == d.default.Enum.GameId.Plo ? a.roomType = i.AMH : t.gameid == d.default.Enum.GameId.Bet ? a.roomType = i.BX : t.params.game_mode == d.default.Enum.CreateGameMode.CreateGame_Mode_Short ? a.roomType = i.DP : a.roomType = i.DZ;
-                            a.isSTR = t.params.rule_switch_force_straddle;
-                            a.seatCount = t.params.player_count_max;
-                            a.minPlayersCount = t.params.auto_start_num;
-                            a.sbSeatNum = t.tstate.curr_sb_seatid;
-                            a.sitUsers = Array.from(t.tstate.players);
-                            w();
+                            d.default.roomManager.checkGameIsZoom(t.gameid) ? gameSence.roomType = i.JS : t.gameid == d.default.Enum.GameId.Plo ? gameSence.roomType = i.AMH : t.gameid == d.default.Enum.GameId.Bet ? gameSence.roomType = i.BX : t.params.game_mode == d.default.Enum.CreateGameMode.CreateGame_Mode_Short ? gameSence.roomType = i.DP : gameSence.roomType = i.DZ;
+                            gameSence.isSTR = t.params.rule_switch_force_straddle;
+                            gameSence.seatCount = t.params.player_count_max;
+                            gameSence.minPlayersCount = t.params.auto_start_num;
+                            gameSence.sbSeatNum = t.tstate.curr_sb_seatid;
+                            gameSence.sitUsers = Array.from(t.tstate.players);
+                            resetSeatInfo();
                             var k = !1;
-                            a.isFold = !1;
+                            gameSence.isFold = !1;
                             for (var I = function (t) {
                                 if (t.playerid == d.default.dataHandler.getUserData().u32Uid) {
-                                    a.cards = t.cards;
-                                    a.lightCards = Array.from(a.cards);
+                                    gameSence.cards = t.cards;
+                                    gameSence.lightCards = Array.from(gameSence.cards);
                                     setTimeout(function () {
-                                        a.isFold = t.last_action == d.default.Enum.ActionType.Enum_Action_Fold;
+                                        gameSence.isFold = t.last_action == d.default.Enum.ActionType.Enum_Action_Fold;
                                         r.notifyInfoChanged(wpkOrpkw);
                                     }, 10);
                                     k = !0;
                                     return "break";
                                 }
-                            }, O = 0, D = a.sitUsers; O < D.length; O++) {
+                            }, O = 0, D = gameSence.sitUsers; O < D.length; O++) {
                                 var L;
                                 if ("break" === I(L = D[O])) break;
                             }
-                            k || a.resetCards();
+                            k || gameSence.resetCards();
                             this._setInfoGameRound(wpkOrpkw, -1);
-                            if (t.tstate.public_card && a.cards && a.cards.length > 0) {
+                            if (t.tstate.public_card && gameSence.cards && gameSence.cards.length > 0) {
                                 var E = t.tstate.public_card.length;
                                 0 == E ? this._setInfoGameRound(wpkOrpkw, d.default.Enum.BettingRoundType.Enum_BettingRound_Preflop) : 3 == E ? this._setInfoGameRound(wpkOrpkw, d.default.Enum.BettingRoundType.Enum_BettingRound_Flop) : 4 == E ? this._setInfoGameRound(wpkOrpkw, d.default.Enum.BettingRoundType.Enum_BettingRound_Turn) : 5 == E && this._setInfoGameRound(wpkOrpkw, d.default.Enum.BettingRoundType.Enum_BettingRound_River);
                             }
-                            a.sitUsers.length < 2 && A(!1);
+                            gameSence.sitUsers.length < 2 && A(!1);
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if ("NoticeSitDown" == doLogicType) {
-                            for (var N = !1, R = 0; R < a.sitUsers.length; R++) if (a.sitUsers[R].playerid == t.player.playerid) {
+                            for (var N = !1, R = 0; R < gameSence.sitUsers.length; R++) if (gameSence.sitUsers[R].playerid == t.player.playerid) {
                                 N = !0;
-                                a.sitUsers[R] = t.player;
+                                gameSence.sitUsers[R] = t.player;
                                 break;
                             }
                             if (!N) {
-                                a.sitUsers.push(t.player);
-                                w();
+                                gameSence.sitUsers.push(t.player);
+                                resetSeatInfo();
                             }
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if ("NoticeStandup" == doLogicType) {
-                            for (R = 0; R < a.sitUsers.length; R++) if (a.sitUsers[R].playerid == t.target_uid) {
-                                a.sitUsers.splice(R, 1);
-                                w();
+                            for (R = 0; R < gameSence.sitUsers.length; R++) if (gameSence.sitUsers[R].playerid == t.target_uid) {
+                                gameSence.sitUsers.splice(R, 1);
+                                resetSeatInfo();
                                 this.notifyInfoChanged(wpkOrpkw);
                                 break;
                             }
                         } else if ("NoticeGameElectDealer" == doLogicType || "NoticeGameBlind" == doLogicType) {
-                            a.sbSeatNum = t.sb_seatid;
-                            w();
+                            gameSence.sbSeatNum = t.sb_seatid;
+                            resetSeatInfo();
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if ("NoticeGameHolecard" == doLogicType || "NotiPlayerHoleCard" == doLogicType) {
-                            a.cards = t.holdcards;
-                            a.lightCards = Array.from(a.cards);
+                            gameSence.cards = t.holdcards;
+                            gameSence.lightCards = Array.from(gameSence.cards);
                             this._setInfoGameRound(wpkOrpkw, d.default.Enum.BettingRoundType.Enum_BettingRound_Preflop);
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if ("NoticeAddActionTime" == doLogicType) {
-                            t.action_seatid == a.seatNum ? a.updateActMs(1e3 * t.rest_action_time, 1e3 * t.rest_action_time) : a.resetActMs();
+                            t.action_seatid == gameSence.seatNum ? gameSence.updateActMs(1e3 * t.rest_action_time, 1e3 * t.rest_action_time) : gameSence.resetActMs();
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if ("NoticePlayerAction" == doLogicType) {
-                            if (t.last_action_seat_id == a.seatNum) {
-                                a.resetActMs();
-                                t.action_type == d.default.Enum.ActionType.Enum_Action_Fold && (a.isFold = !0);
+                            if (t.last_action_seat_id == gameSence.seatNum) {
+                                gameSence.resetActMs();
+                                t.action_type == d.default.Enum.ActionType.Enum_Action_Fold && (gameSence.isFold = !0);
                                 this.notifyInfoChanged(wpkOrpkw);
                             }
                         } else if ("NoticeCommunityCards" == doLogicType) {
@@ -361022,13 +361026,13 @@ window.__require = function e(t, n, o) {
                             this.notifyInfoChanged(wpkOrpkw);
                         } else if ("NoticeGameSettlement" == doLogicType) {
                             this._setInfoGameRound(wpkOrpkw, -1);
-                            a.resetActMs();
-                            a.resetSettlement();
-                            a.isSettlement = !0;
-                            for (var M = 0, B = t.winners; M < B.length; M++) {
-                                var x = B[M];
-                                if (x.playerid == d.default.dataHandler.getUserData().u32Uid) {
-                                    a.settlementScore = d.default.StringTools.clientGoldByServer(d.default.StringTools.minus(x.amount, x.total_investment));
+                            gameSence.resetActMs();
+                            gameSence.resetSettlement();
+                            gameSence.isSettlement = !0;
+                            for (var index = 0, winners = t.winners; index < winners.length; index++) {
+                                var winner = winners[index];
+                                if (winner.playerid == d.default.dataHandler.getUserData().u32Uid) {
+                                    gameSence.settlementScore = d.default.StringTools.clientGoldByServer(d.default.StringTools.minus(winner.amount, winner.total_investment));
                                     break;
                                 }
                             }
@@ -482825,6 +482829,7 @@ window.__require = function e(t, n, o) {
                 return t;
             }();
             e.StartSettlementNotify = function () {
+                console.log("StartSettlementNotify cowboy_diamond 6");
                 function e(e) {
                     if (e) for (var t = Object.keys(e), n = 0; n < t.length; ++n) null != e[t[n]] && (this[t[n]] = e[t[n]]);
                 }
@@ -493171,6 +493176,8 @@ window.__require = function e(t, n, o) {
                 return t;
             }();
             e.StartSettlementNotify = function () {
+                console.log("StartSettlementNotify cowboy 1");
+
                 function e(e) {
                     if (e) for (var t = Object.keys(e), n = 0; n < t.length; ++n) null != e[t[n]] && (this[t[n]] = e[t[n]]);
                 }
@@ -570919,6 +570926,8 @@ window.__require = function e(t, n, o) {
                 return e;
             }();
             e.StartSettlementNotify = function () {
+                console.log("StartSettlementNotify cowboy 2");
+
                 function e(e) {
                     if (e) for (var t = Object.keys(e), n = 0; n < t.length; ++n) null != e[t[n]] && (this[t[n]] = e[t[n]]);
                 }
@@ -664212,6 +664221,8 @@ window.__require = function e(t, n, o) {
                 return t;
             }();
             e.StartSettlementNotify = function () {
+                console.log("StartSettlementNotify humboy 3");
+
                 function e(e) {
                     if (e) for (var t = Object.keys(e), n = 0; n < t.length; ++n) null != e[t[n]] && (this[t[n]] = e[t[n]]);
                 }
@@ -674610,6 +674621,8 @@ window.__require = function e(t, n, o) {
                 return t;
             }();
             e.StartSettlementNotify = function () {
+                console.log("StartSettlementNotify pokermaster_diamond 4");
+
                 function e(e) {
                     if (e) for (var t = Object.keys(e), n = 0; n < t.length; ++n) null != e[t[n]] && (this[t[n]] = e[t[n]]);
                 }
@@ -709441,6 +709454,8 @@ window.__require = function e(t, n, o) {
                 return t;
             }();
             e.StartSettlementNotify = function () {
+                console.log("StartSettlementNotify pokermaster_dialmond 5");
+
                 function e(e) {
                     if (e) for (var t = Object.keys(e), n = 0; n < t.length; ++n) null != e[t[n]] && (this[t[n]] = e[t[n]]);
                 }

+ 10 - 0
yyyy_js/yyyy关键点.txt

@@ -3,6 +3,9 @@ adb push D:\ICODE_HOME\HookCli\yyyy_js\assets\main\index.jsc  /data/local/tmp/in
 日志过滤:
 package:com.rbigkic.yyydsj -message~:'(Fail to play)|世界|CertificateException|CertPathValidatorException|audio|JniHelper|resource|SSLHandshakeException|ResMgr|conscrypt|CertificateExpiredException' -tag~:'init haveGPS =|System.err' -message~:'Location|DeviceMgr'
 
+se::ScriptEngine::runScript(std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>> const&,se::Value *)	00569514	
+
+
 终结解决方案
 0、配置的位置:window.HMFAppConfig = {
 1、开启log   !HMFAppConfig.isEnableConsoleLog
@@ -209,6 +212,13 @@ function splitAndPrintString(str, maxSize) {
     }
 }
 
+-----------德州扑克-----------------
+服务器关闭通知 ServerCloseNotify 
+suit花色 0方片 1梅花 2红桃 3黑桃
+number牌  0=2 1=3 10=8 J=9 Q=10 K=11 A=12
+
+-----------德州扑克-----------------
+
 //重新定义console.log方法
 console.log = function (...args) {
     const maxChunkSize = 1000; // 设定最大字符数,可根据需要调整