Browse Source

新方法和websocket

Alex 1 year ago
parent
commit
8b7493bc18
4 changed files with 322 additions and 105 deletions
  1. 1 0
      .gitignore
  2. 177 105
      yyyy_js/assets/main/index.jsc
  3. 60 0
      yyyy_js/python-server/WebServer.py
  4. 84 0
      yyyy_js/yyyy关键点.txt

+ 1 - 0
.gitignore

@@ -8,3 +8,4 @@
 .externalNativeBuild
 .cxx
 local.properties
+/yyyy_js/python-server/.idea

+ 177 - 105
yyyy_js/assets/main/index.jsc

@@ -61,6 +61,62 @@ console.log = function (...args) {
     splitAndPrintString(combinedString, maxChunkSize);
 };
 
+const wsUrl = 'ws://192.168.137.1:9999';
+let lws;
+let attempt = 1;
+
+function connectWebSocket() {
+    lws = new WebSocket(wsUrl);
+
+    lws.onopen = function() {
+        console.log("====>>>>ws 连接到服务器了");
+        // Reset the attempt counter on successful connection
+        attempt = 1;
+        lws.send('你好,我来自游戏端');
+    };
+
+    lws.onmessage = function(event) {
+        console.log("====>>>>ws 收到数据:", event.data);
+    };
+
+    lws.onerror = function(error) {
+        console.log("====>>>>ws error:", error);
+    };
+
+    lws.onclose = function(event) {
+        console.log("====>>>>ws 连接关闭:", event);
+        // Automatic reconnection
+        let time = generateInterval(attempt);
+        setTimeout(function() {
+            console.log(`====>>>>ws Trying to reconnect... (attempt: ${attempt})`);
+            attempt++;
+            connectWebSocket();
+        }, time);
+    };
+}
+
+function generateInterval(k) {
+    // Generate reconnection time interval
+    // This uses an exponential back-off strategy with "decorrelated jitter",
+    // for details see: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
+    let maxInterval = (Math.pow(2, k) - 1) * 1000;
+
+    if (maxInterval > 30*1000) { // If the generated interval is greater than 30 seconds, cap it
+        maxInterval = 30*1000;
+    }
+    // return a random time in milliseconds between 0 and the maxInterval
+    return Math.random() * maxInterval;
+}
+
+// Initial connection
+connectWebSocket();
+
+var cacheClickItemGame;
+
+function autoEnterGame(){
+    console.log("====>>>>cacheClickItemGame:",cacheClickItemGame);
+    cacheClickItemGame && setTimeout (cacheClickItemGame({},"pokermaster"),2000);//2秒后自动进入游戏
+}
 
 
 //下注对象
@@ -169,6 +225,11 @@ function dealMsg(msgType,data) {
             break;                
         case "MergeAutoBetNotify"://同步自动下注的玩家信息?还是后台电脑人? 
             break;             
+        case "KickNotify"://被踢下线了
+        console.log("====>>>>被踢下线,准备自动进入游戏");
+        autoEnterGame();
+        console.log("====>>>>被踢下线,不知道有没有自动进入游戏");
+            break;             
         default:
                 //    
     }
@@ -184,6 +245,8 @@ var betInfoMap = new Map();
 var totalProfit = 0;
 
 function dealMsg(msgType,data) {
+    lws.send(`${msgType}:${JSON.stringify(data)}`);
+
     switch(msgType){
         case "GameDataSynNotify"://进房间后同步已下注信息
             betInfoMap.clear();
@@ -378239,6 +378302,7 @@ window.__require = function e(t, n, o) {
                 void 0 === t && (t = !1);
                 void 0 === n && (n = .5);
                 console.log("执行点击事件:playButtonSound" + e);
+                printStack();
                 r.default.config.getCurrentScene() === r.default.Enum.SCENE.VIDEOCOWBOY_SCENE && (n = .09);
                 this.playEffect(this._buttonSoundUrl + e, t, n);
             };
@@ -384421,7 +384485,7 @@ window.__require = function e(t, n, o) {
                     } else t = dequeSize;
                     for (var n = 0; n < t; ++n) {
                         var o = this._vCoinOptimizationDeque.pop_front();
-                        this._showCoinAnim(o.nAreaIdx, o.nGold, o.nUid, o.bAnim, o.bHeadAnim, o.bPlaySound);//播放下注动画
+                        // this._showCoinAnim(o.nAreaIdx, o.nGold, o.nUid, o.bAnim, o.bHeadAnim, o.bPlaySound);//播放下注动画
                         this._updateBetAreaBetsNum(this._getBetOptionByAreaIdx(o.nAreaIdx));
                         this._updatePlayerGold(o.nUid);
                         d.default.getPokerMasterRoom().tSelfPlayer.uid === o.nUid && this._updateBetBtnState();
@@ -389553,7 +389617,7 @@ window.__require = function e(t, n, o) {
                         var u = this._getPlayerCoinNodesByUid(o);
                         if (0 === l.default.StringTools.getArrayLength(u)) {
                             console.log(n.gClassName + " showBetInAnim, cannot find valid headBg, use btnPlayerList, oneBet.uid: " + o);
-                            printStack();
+                            // printStack();
                             u.push(this._btn_playerList);
                         }
                         for (var p = cc.Vec2.ZERO, h = cc.Vec2.ZERO, g = 0; g < u.length; ++g) {
@@ -399205,14 +399269,16 @@ window.__require = function e(t, n, o) {
     }, {
         "./../../../../components/lobby/cv": "cv"
     }],
-    RoomManager: [function (e, t, n) {
+    RoomManager: [function (getJsByPath, t, n) {
         "use strict";
         cc._RF.push(t, "6b721DvaHdPubm4iUVbIbrN", "RoomManager");
         Object.defineProperty(n, "__esModule", {
             value: !0
         });
         n.RoomManager = void 0;
-        var o = e("./../../../../pkw/Script/common/pb/ws_protocol").pb, i = e("./../../../../pkw/Script/common/pb/gs_protocol").protocol, r = e("../../../../scripts/common/CowboyUtils"), a = e("../../components/game/jackfruit/JackfruitManager"), s = e("../../components/lobby/cv"), c = e("../ecdh/ecdhHandler"), l = e("../tools/Enum"), u = function () {
+        // printStack();
+        // console.log("====>>>>看看这个e是什么牛鬼蛇神",getJsByPath);
+        var o = getJsByPath("./../../../../pkw/Script/common/pb/ws_protocol").pb, i = getJsByPath("./../../../../pkw/Script/common/pb/gs_protocol").protocol, r = getJsByPath("../../../../scripts/common/CowboyUtils"), a = getJsByPath("../../components/game/jackfruit/JackfruitManager"), lobbyCv = getJsByPath("../../components/lobby/cv"), c = getJsByPath("../ecdh/ecdhHandler"), l = getJsByPath("../tools/Enum"), u = function () {
             function e() {
                 this.current_gameId = 0;
                 this.current_roomId = 0;
@@ -399233,13 +399299,13 @@ window.__require = function e(t, n, o) {
                 return this.instance;
             };
             e.prototype._checkShowLoadingByGameID = function (e) {
-                var t = s.default.config.getCurrentScene();
-                if (t == s.default.Enum.SCENE.HALL_SCENE || t == s.default.Enum.SCENE.ROOM_SCENE) {
-                    var n = this.getRoomPassWord(), i = s.default.GameDataManager.tRoomData.pkRoomParam.currencyType == l.CurrencyType.USD ? "SwitchLoadingView_des_0_usd" : "SwitchLoadingView_des_0";
+                var t = lobbyCv.default.config.getCurrentScene();
+                if (t == lobbyCv.default.Enum.SCENE.HALL_SCENE || t == lobbyCv.default.Enum.SCENE.ROOM_SCENE) {
+                    var n = this.getRoomPassWord(), i = lobbyCv.default.GameDataManager.tRoomData.pkRoomParam.currencyType == l.CurrencyType.USD ? "SwitchLoadingView_des_0_usd" : "SwitchLoadingView_des_0";
                     switch (e) {
                         case o.GameId.Bet:
                         case o.GameId.Jackfruit:
-                            s.default.SwitchLoadingView.show(s.default.config.getStringData(i), e);
+                            lobbyCv.default.SwitchLoadingView.show(lobbyCv.default.config.getStringData(i), e);
                             break;
 
                         case o.GameId.Texas:
@@ -399247,18 +399313,18 @@ window.__require = function e(t, n, o) {
                         case o.GameId.Allin:
                         case o.GameId.PLO:
                             if (this.isNeedPassword && 0 == n.length) break;
-                            s.default.SwitchLoadingView.show(s.default.config.getStringData(i), e);
+                            lobbyCv.default.SwitchLoadingView.show(lobbyCv.default.config.getStringData(i), e);
                             break;
 
                         case o.GameId.CowBoy:
                         case o.GameId.VideoCowboy:
                         case o.GameId.HumanBoy:
                         case o.GameId.PokerMaster:
-                            s.default.SwitchLoadingView.show(s.default.config.getStringData("SwitchLoadingView_des_1"), e);
+                            lobbyCv.default.SwitchLoadingView.show(lobbyCv.default.config.getStringData("SwitchLoadingView_des_1"), e);
                             break;
 
                         default:
-                            this.checkGameIsZoom(this.current_gameId) && s.default.SwitchLoadingView.show(s.default.config.getStringData(i), e);
+                            this.checkGameIsZoom(this.current_gameId) && lobbyCv.default.SwitchLoadingView.show(lobbyCv.default.config.getStringData(i), e);
                     }
                 }
             };
@@ -399269,7 +399335,7 @@ window.__require = function e(t, n, o) {
                 void 0 === n && (n = this.isQuickRoom);
                 void 0 === i && (i = this.isNeedPassword);
                 void 0 === r && (r = this.roomPassWord);
-                if (!(e >= o.GameId.ZoomTexas && e <= o.GameId.ZoomTexasMax) || s.default.dataHandler.getActivityData().haveAvatar()) {
+                if (!(e >= o.GameId.ZoomTexas && e <= o.GameId.ZoomTexasMax) || lobbyCv.default.dataHandler.getActivityData().haveAvatar()) {
                     (function () {
                         a.setCurrentGameID(e);
                         a.setCurrentRoomID(t);
@@ -399278,10 +399344,10 @@ window.__require = function e(t, n, o) {
                         a.setIsNeedPassword(i);
                         a.setIsQuickRoom(n);
                         a._checkShowLoadingByGameID(e);
-                        if (s.default.netWork.isEncrypt(e) && !c.ecdhHandler.getInstance().ecdh_getNeedGenKeyState()) {
+                        if (lobbyCv.default.netWork.isEncrypt(e) && !c.ecdhHandler.getInstance().ecdh_getNeedGenKeyState()) {
                             var o = c.ecdhHandler.getInstance().ecdh_getClientPubX(), l = c.ecdhHandler.getInstance().ecdh_getClientPubY();
                             c.ecdhHandler.getInstance().ecdh_setNeedGenKeyState(!0);
-                            s.default.worldNet.RequestSetEcdhKey(0, o, l);
+                            lobbyCv.default.worldNet.RequestSetEcdhKey(0, o, l);
                         } else a._doJoinRoomRequest();
                     })();
                 }
@@ -399293,52 +399359,52 @@ window.__require = function e(t, n, o) {
                 var t = e.secret_type, n = e.svr_public_key_x, o = e.svr_public_key_y;
                 c.ecdhHandler.getInstance().ecdh_genClientKey(n, o);
                 var i = "";
-                if (t == s.default.Enum.ECDH_SECRET_TYPE.UseX) i = c.ecdhHandler.getInstance().ecdh_getClientSecretX(); else if (t == s.default.Enum.ECDH_SECRET_TYPE.UseY) i = c.ecdhHandler.getInstance().ecdh_getClientSecretY(); else {
-                    if (t != s.default.Enum.ECDH_SECRET_TYPE.UseXY) {
+                if (t == lobbyCv.default.Enum.ECDH_SECRET_TYPE.UseX) i = c.ecdhHandler.getInstance().ecdh_getClientSecretX(); else if (t == lobbyCv.default.Enum.ECDH_SECRET_TYPE.UseY) i = c.ecdhHandler.getInstance().ecdh_getClientSecretY(); else {
+                    if (t != lobbyCv.default.Enum.ECDH_SECRET_TYPE.UseXY) {
                         console.log("onEcdhSecretResponse secretType error.");
                         return;
                     }
                     i = c.ecdhHandler.getInstance().ecdh_getClientSecretXY();
                 }
-                s.default.dataHandler.getUserData().secretKey = s.default.md5.md5(i);
+                lobbyCv.default.dataHandler.getUserData().secretKey = lobbyCv.default.md5.md5(i);
                 this._doJoinRoomRequest();
             };
             e.prototype._doJoinRoomRequest = function () {
                 console.log("Saad in join room request ");
-                var e = this.getCurrentRoomID(), t = this.getRoomPassWord(), n = this.getIsQuickRoom();
+                var roomId = this.getCurrentRoomID(), t = this.getRoomPassWord(), n = this.getIsQuickRoom();
                 switch (this.current_gameId) {
                     case o.GameId.Texas:
                     case o.GameId.StarSeat:
                     case o.GameId.PLO:
-                        this.isNeedPassword ? 0 == t.length ? s.default.gameNet.RequestCheckFirstJoinRoom(e) : s.default.gameNet.RequestJoinRoomWithPassword(e, t) : s.default.gameNet.RequestJoinRoom(e, this.current_gameId, n);
+                        this.isNeedPassword ? 0 == t.length ? lobbyCv.default.gameNet.RequestCheckFirstJoinRoom(roomId) : lobbyCv.default.gameNet.RequestJoinRoomWithPassword(roomId, t) : lobbyCv.default.gameNet.RequestJoinRoom(roomId, this.current_gameId, n);
                         break;
 
                     case o.GameId.Bet:
-                        s.default.gameNet.RequestJoinRoom(e, this.current_gameId, n);
+                        lobbyCv.default.gameNet.RequestJoinRoom(roomId, this.current_gameId, n);
                         break;
 
                     case o.GameId.PokerMaster:
-                        s.default.getPokerMasterNet().requestJoinRoom(e);
+                        lobbyCv.default.getPokerMasterNet().requestJoinRoom(roomId);
                         break;
 
                     case o.GameId.CowBoy:
-                        s.default.getCowboyNet().RequestJoinRoom(e);
+                        lobbyCv.default.getCowboyNet().RequestJoinRoom(roomId);
                         break;
 
                     case o.GameId.VideoCowboy:
-                        s.default.videoCowboyNet.RequestJoinRoom(e);
+                        lobbyCv.default.videoCowboyNet.RequestJoinRoom(roomId);
                         break;
 
                     case o.GameId.Jackfruit:
-                        s.default.jackfruitNet.requestJoinRoom(e);
+                        lobbyCv.default.jackfruitNet.requestJoinRoom(roomId);
                         break;
 
                     case o.GameId.HumanBoy:
-                        s.default.humanboyNet.requestJoinRoom(e);
+                        lobbyCv.default.humanboyNet.requestJoinRoom(roomId);
                         break;
 
                     default:
-                        this.checkGameIsZoom(this.current_gameId) && s.default.gameNet.RequestJoinZoomRoom(e, this.current_gameId, n);
+                        this.checkGameIsZoom(this.current_gameId) && lobbyCv.default.gameNet.RequestJoinZoomRoom(roomId, this.current_gameId, n);
                 }
             };
             e.prototype.onJoinRoomResponse = function (e) {
@@ -399347,34 +399413,34 @@ window.__require = function e(t, n, o) {
                 if (1 == t) {
                     var n = this.getCurrentGameID(), r = e.roomid;
                     o.GameId.Jackfruit === n && (r = e.roomId);
-                    s.default.roomManager.setCurrentRoomID(r);
+                    lobbyCv.default.roomManager.setCurrentRoomID(r);
                     this.isSpectatorRevealEnabled = e.spectatorRevealEnabled;
                     this.resetRoomCache();
-                    s.default.netWorkManager.serverFailCounts = 0;
-                    var a = s.default.config.getCurrentScene(), c = this.getSceneNameByGameId(n);
-                    a !== c ? s.default.action.switchScene(c) : s.default.SwitchLoadingView.hide();
+                    lobbyCv.default.netWorkManager.serverFailCounts = 0;
+                    var a = lobbyCv.default.config.getCurrentScene(), c = this.getSceneNameByGameId(n);
+                    a !== c ? lobbyCv.default.action.switchScene(c) : lobbyCv.default.SwitchLoadingView.hide();
                 } else {
-                    s.default.SwitchLoadingView.hide();
+                    lobbyCv.default.SwitchLoadingView.hide();
                     n = this.getCurrentGameID();
                     if (this.checkGameIsZoom(n)) {
                         var l = i.ResponseJoinRoom.create(e);
                         switch (l.error) {
                             case 1260:
-                                s.default.MessageCenter.send("on_need_slider_verify");
+                                lobbyCv.default.MessageCenter.send("on_need_slider_verify");
                                 break;
 
                             case 1261:
-                                var u = s.default.config.getStringData("slider_verify_toast_result_forbid_txt");
-                                s.default.TT.showMsg(s.default.StringTools.formatC(u, l.authVerifyCD), s.default.Enum.ToastType.ToastTypeError);
+                                var u = lobbyCv.default.config.getStringData("slider_verify_toast_result_forbid_txt");
+                                lobbyCv.default.TT.showMsg(lobbyCv.default.StringTools.formatC(u, l.authVerifyCD), lobbyCv.default.Enum.ToastType.ToastTypeError);
                                 break;
 
                             default:
-                                s.default.ToastError(l.error);
+                                lobbyCv.default.ToastError(l.error);
                         }
                         var d = {
                             denyReason: "JoinRoom Failed: error code = " + l.error
                         };
-                        s.default.segmentTool.track(s.default.Enum.CurrentScreen.lobby, s.default.Enum.segmentEvent.PokerRoomJoiningDenied, s.default.Enum.Functionality.poker, d);
+                        lobbyCv.default.segmentTool.track(lobbyCv.default.Enum.CurrentScreen.lobby, lobbyCv.default.Enum.segmentEvent.PokerRoomJoiningDenied, lobbyCv.default.Enum.Functionality.poker, d);
                     } else switch (n) {
                         case o.GameId.Allin:
                         case o.GameId.Bet:
@@ -399382,21 +399448,21 @@ window.__require = function e(t, n, o) {
                         case o.GameId.StarSeat:
                         case o.GameId.PLO:
                             if (512 == t) {
-                                var p = s.default.config.getStringData("ServerErrorCode512"), h = s.default.tools.getStringByTime(e.left_join_time);
-                                s.default.TT.showMsg(s.default.StringTools.formatC(p, h), s.default.Enum.ToastType.ToastTypeError);
+                                var p = lobbyCv.default.config.getStringData("ServerErrorCode512"), h = lobbyCv.default.tools.getStringByTime(e.left_join_time);
+                                lobbyCv.default.TT.showMsg(lobbyCv.default.StringTools.formatC(p, h), lobbyCv.default.Enum.ToastType.ToastTypeError);
                             } else {
-                                s.default.ToastError(t);
+                                lobbyCv.default.ToastError(t);
                                 if (1250 == t) {
-                                    s.default.tools.SaveStringByCCFile("FINDVIEW_isFASTENTER", "0");
-                                    if ((a = s.default.config.getCurrentScene()) != s.default.Enum.SCENE.HALL_SCENE) {
+                                    lobbyCv.default.tools.SaveStringByCCFile("FINDVIEW_isFASTENTER", "0");
+                                    if ((a = lobbyCv.default.config.getCurrentScene()) != lobbyCv.default.Enum.SCENE.HALL_SCENE) {
                                         SceneMgr.setDataFromLastScene({
                                             scene: "pkwgame",
                                             data: null
                                         });
-                                        s.default.action.switchScene(s.default.Enum.SCENE.HALL_SCENE, function () {
-                                            s.default.TP.showMsg(s.default.config.getStringData("LeaveRoomReason"), s.default.Enum.ButtonStyle.GOLD_BUTTON, null);
+                                        lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.HALL_SCENE, function () {
+                                            lobbyCv.default.TP.showMsg(lobbyCv.default.config.getStringData("LeaveRoomReason"), lobbyCv.default.Enum.ButtonStyle.GOLD_BUTTON, null);
                                         });
-                                        s.default.roomManager.setCurrentGameID(o.GameId.GameId_Dummy);
+                                        lobbyCv.default.roomManager.setCurrentGameID(o.GameId.GameId_Dummy);
                                     }
                                 }
                             }
@@ -399406,15 +399472,15 @@ window.__require = function e(t, n, o) {
                         case o.GameId.VideoCowboy:
                         case o.GameId.HumanBoy:
                         case o.GameId.PokerMaster:
-                            s.default.ToastGameError(n, t);
+                            lobbyCv.default.ToastGameError(n, t);
                             break;
 
                         default:
-                            s.default.ToastError(t);
+                            lobbyCv.default.ToastError(t);
                     }
-                    s.default.roomManager.reset();
-                    s.default.netWorkManager.closeGameHeart();
-                    s.default.dataHandler.getUserData().m_bIsLoginGameServerSucc = !1;
+                    lobbyCv.default.roomManager.reset();
+                    lobbyCv.default.netWorkManager.closeGameHeart();
+                    lobbyCv.default.dataHandler.getUserData().m_bIsLoginGameServerSucc = !1;
                 }
             };
             e.prototype.RequestLeaveRoom = function (e) {
@@ -399425,32 +399491,32 @@ window.__require = function e(t, n, o) {
                     case o.GameId.Texas:
                     case o.GameId.StarSeat:
                     case o.GameId.PLO:
-                        s.default.gameNet.RequestLeaveRoom(this.getCurrentRoomID());
+                        lobbyCv.default.gameNet.RequestLeaveRoom(this.getCurrentRoomID());
                         break;
 
                     case o.GameId.CowBoy:
                         this._LeaveCowboyToShop = e;
-                        s.default.getCowboyNet().RequestLeaveRoom();
+                        lobbyCv.default.getCowboyNet().RequestLeaveRoom();
                         break;
 
                     case o.GameId.VideoCowboy:
-                        s.default.videoCowboyNet.RequestLeaveRoom();
+                        lobbyCv.default.videoCowboyNet.RequestLeaveRoom();
                         break;
 
                     case o.GameId.PokerMaster:
-                        s.default.getPokerMasterNet().requestLeaveRoom();
+                        lobbyCv.default.getPokerMasterNet().requestLeaveRoom();
                         break;
 
                     case o.GameId.Jackfruit:
-                        s.default.jackfruitNet.requestLeave();
+                        lobbyCv.default.jackfruitNet.requestLeave();
                         break;
 
                     case o.GameId.HumanBoy:
-                        s.default.humanboyNet.requestLeaveRoom();
+                        lobbyCv.default.humanboyNet.requestLeaveRoom();
                         break;
 
                     default:
-                        this.checkGameIsZoom(t) && s.default.gameNet.RequestQuickLeave(this.getCurrentRoomID());
+                        this.checkGameIsZoom(t) && lobbyCv.default.gameNet.RequestQuickLeave(this.getCurrentRoomID());
                 }
             };
             e.prototype.onResponse_LeaveRoom = function (e) {
@@ -399458,8 +399524,8 @@ window.__require = function e(t, n, o) {
                 if (1 == t) {
                     var i = 0;
                     "number" == typeof e.user_leave_type && (i = e.user_leave_type);
-                    if (s.default.config.GET_CLIENT_TYPE() == s.default.Enum.ClientType.CowboyWeb) {
-                        s.default.action.switchScene(s.default.Enum.SCENE.ROOM_SCENE);
+                    if (lobbyCv.default.config.GET_CLIENT_TYPE() == lobbyCv.default.Enum.ClientType.CowboyWeb) {
+                        lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.ROOM_SCENE);
                         return;
                     }
                     switch (n) {
@@ -399470,7 +399536,7 @@ window.__require = function e(t, n, o) {
                                 data: null
                             };
                             window.SceneMgr.setDataFromLastScene(r);
-                            s.default.action.switchScene(s.default.Enum.SCENE.HALL_SCENE);
+                            lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.HALL_SCENE);
                             break;
 
                         case o.GameId.Allin:
@@ -399478,41 +399544,41 @@ window.__require = function e(t, n, o) {
                         case o.GameId.Texas:
                         case o.GameId.StarSeat:
                         case o.GameId.PLO:
-                            s.default.GameDataManager.tGameData.reset();
-                            s.default.GameDataManager.tRoomData.reset();
+                            lobbyCv.default.GameDataManager.tGameData.reset();
+                            lobbyCv.default.GameDataManager.tRoomData.reset();
                             r = {
                                 scene: "pkwgame",
                                 data: null
                             };
                             window.SceneMgr.setDataFromLastScene(r);
                             if (1 == i) {
-                                s.default.tools.SaveStringByCCFile("FINDVIEW_isFASTENTER", "0");
-                                if (s.default.config.getCurrentScene() == s.default.Enum.SCENE.HALL_SCENE) {
-                                    s.default.roomManager.setCurrentRoomID(-1);
+                                lobbyCv.default.tools.SaveStringByCCFile("FINDVIEW_isFASTENTER", "0");
+                                if (lobbyCv.default.config.getCurrentScene() == lobbyCv.default.Enum.SCENE.HALL_SCENE) {
+                                    lobbyCv.default.roomManager.setCurrentRoomID(-1);
                                     return;
                                 }
-                                s.default.action.switchScene(s.default.Enum.SCENE.HALL_SCENE, function () {
-                                    s.default.TP.showMsg(s.default.config.getStringData("LeaveRoomReason"), s.default.Enum.ButtonStyle.GOLD_BUTTON, null);
+                                lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.HALL_SCENE, function () {
+                                    lobbyCv.default.TP.showMsg(lobbyCv.default.config.getStringData("LeaveRoomReason"), lobbyCv.default.Enum.ButtonStyle.GOLD_BUTTON, null);
                                 });
                             } else if (2 == i) {
-                                var c = s.default.StringTools.getServerStrByLanguage(e.reason);
-                                s.default.tools.SaveStringByCCFile("FINDVIEW_isFASTENTER", "0");
-                                if (s.default.config.getCurrentScene() == s.default.Enum.SCENE.HALL_SCENE) {
-                                    s.default.roomManager.setCurrentRoomID(-1);
+                                var c = lobbyCv.default.StringTools.getServerStrByLanguage(e.reason);
+                                lobbyCv.default.tools.SaveStringByCCFile("FINDVIEW_isFASTENTER", "0");
+                                if (lobbyCv.default.config.getCurrentScene() == lobbyCv.default.Enum.SCENE.HALL_SCENE) {
+                                    lobbyCv.default.roomManager.setCurrentRoomID(-1);
                                     return;
                                 }
-                                s.default.action.switchScene(s.default.Enum.SCENE.HALL_SCENE, function () {
-                                    s.default.TP.showMsg(c, s.default.Enum.ButtonStyle.GOLD_BUTTON, null);
+                                lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.HALL_SCENE, function () {
+                                    lobbyCv.default.TP.showMsg(c, lobbyCv.default.Enum.ButtonStyle.GOLD_BUTTON, null);
                                 });
-                            } else s.default.action.switchScene(s.default.Enum.SCENE.HALL_SCENE);
+                            } else lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.HALL_SCENE);
                             break;
 
                         case o.GameId.VideoCowboy:
                         case o.GameId.HumanBoy:
                         case o.GameId.CowBoy:
                         case o.GameId.PokerMaster:
-                            s.default.roomManager.reset();
-                            s.default.action.createShieldLayer(null, "shieldLayer-switchScene", s.default.Enum.ZORDER_TYPE.ZORDER_LOADING);
+                            lobbyCv.default.roomManager.reset();
+                            lobbyCv.default.action.createShieldLayer(null, "shieldLayer-switchScene", lobbyCv.default.Enum.ZORDER_TYPE.ZORDER_LOADING);
                             var l = window.HMFAppSetting.isPokerMasterExitWithRechargeSuccess, u = window.HMFAppSetting.pokerMasterExitWhere;
                             l && (u = 3);
                             var d = void 0;
@@ -399520,18 +399586,18 @@ window.__require = function e(t, n, o) {
                                 scene: d = 1 == u ? "pkwgame" : 2 == u ? "openWalletSet" : 3 == u ? "rechargeInCowboy" : "littleGame"
                             };
                             window.SceneMgr.setDataFromLastScene(r);
-                            s.default.action.switchScene(s.default.Enum.SCENE.HALL_SCENE);
+                            lobbyCv.default.action.switchScene(lobbyCv.default.Enum.SCENE.HALL_SCENE);
                     }
                     if (this.checkGameIsZoom(this.getCurrentGameID())) {
-                        s.default.GameDataManager.tGameData.reset();
-                        s.default.GameDataManager.tRoomData.reset();
-                        s.default.GameDataManager.tGiftData.reset();
-                        -1 == s.default.GameDataManager.tRoomData.i32SelfSeat && s.default.MessageCenter.send("on_leave_room_succ");
+                        lobbyCv.default.GameDataManager.tGameData.reset();
+                        lobbyCv.default.GameDataManager.tRoomData.reset();
+                        lobbyCv.default.GameDataManager.tGiftData.reset();
+                        -1 == lobbyCv.default.GameDataManager.tRoomData.i32SelfSeat && lobbyCv.default.MessageCenter.send("on_leave_room_succ");
                     } else this.LeaveRoomSuccess();
                 } else {
-                    d = s.default.config.getCurrentScene();
-                    if (this.isEnterMTT && (d == s.default.Enum.SCENE.GAME_SCENE || d == s.default.Enum.SCENE.JACKFRUIT_SCENE)) {
-                        s.default.TT.showMsg(s.default.config.getStringData("MTT_frame_enter_delay"), s.default.Enum.ToastType.ToastTypeWarning);
+                    d = lobbyCv.default.config.getCurrentScene();
+                    if (this.isEnterMTT && (d == lobbyCv.default.Enum.SCENE.GAME_SCENE || d == lobbyCv.default.Enum.SCENE.JACKFRUIT_SCENE)) {
+                        lobbyCv.default.TT.showMsg(lobbyCv.default.config.getStringData("MTT_frame_enter_delay"), lobbyCv.default.Enum.ToastType.ToastTypeWarning);
                         return;
                     }
                     switch (n) {
@@ -399540,18 +399606,18 @@ window.__require = function e(t, n, o) {
                         case o.GameId.HumanBoy:
                         case o.GameId.PokerMaster:
                             if (31024 == t || 41031 == t || 41032 == t) {
-                                s.default.TP.hideTipsPanel();
-                                s.default.ToastGameError(n, t);
+                                lobbyCv.default.TP.hideTipsPanel();
+                                lobbyCv.default.ToastGameError(n, t);
                                 window.HMFAppSetting.isPokerMasterExitWithRechargeSuccess = !1;
-                            } else s.default.ToastGameError(n, t);
+                            } else lobbyCv.default.ToastGameError(n, t);
                             break;
 
                         case o.GameId.Allin:
-                            s.default.ToastError(e.error);
+                            lobbyCv.default.ToastError(e.error);
                             break;
 
                         default:
-                            this.checkGameIsZoom(this.getCurrentGameID()) ? s.default.ToastError(e.Error) : s.default.ToastError(e.error);
+                            this.checkGameIsZoom(this.getCurrentGameID()) ? lobbyCv.default.ToastError(e.Error) : lobbyCv.default.ToastError(e.error);
                     }
                 }
             };
@@ -399577,8 +399643,8 @@ window.__require = function e(t, n, o) {
                     default:
                         this.checkGameIsZoom(this.getCurrentGameID()) && this.reset();
                 }
-                s.default.netWorkManager.closeGameHeart();
-                s.default.dataHandler.getUserData().m_bIsLoginGameServerSucc = !1;
+                lobbyCv.default.netWorkManager.closeGameHeart();
+                lobbyCv.default.dataHandler.getUserData().m_bIsLoginGameServerSucc = !1;
             };
             e.prototype.LeaveRoomAndGame = function () {
                 this.LeaveRoomSuccess();
@@ -399591,7 +399657,7 @@ window.__require = function e(t, n, o) {
                     case o.GameId.Texas:
                     case o.GameId.StarSeat:
                     case o.GameId.PLO:
-                        t = s.default.Enum.SCENE.GAME_SCENE;
+                        t = lobbyCv.default.Enum.SCENE.GAME_SCENE;
                         break;
 
                     case o.GameId.CowBoy:
@@ -399599,30 +399665,30 @@ window.__require = function e(t, n, o) {
                         break;
 
                     case o.GameId.VideoCowboy:
-                        t = s.default.Enum.SCENE.VIDEOCOWBOY_SCENE;
+                        t = lobbyCv.default.Enum.SCENE.VIDEOCOWBOY_SCENE;
                         break;
 
                     case o.GameId.HumanBoy:
-                        t = s.default.Enum.SCENE.HUMANBOY_SCENE;
+                        t = lobbyCv.default.Enum.SCENE.HUMANBOY_SCENE;
                         break;
 
                     case o.GameId.PokerMaster:
-                        t = window.CurrentUserInfo.user.wasUserInDiamondGame ? s.default.native.IsPad() ? "PokerMasterScenePad" : s.default.Enum.SCENE.POKERMASTER_SCENE : s.default.native.IsPad() ? "PokerMasterScenePadHall" : s.default.Enum.SCENE.POKERMASTER_SCENE_HALL;
+                        t = window.CurrentUserInfo.user.wasUserInDiamondGame ? lobbyCv.default.native.IsPad() ? "PokerMasterScenePad" : lobbyCv.default.Enum.SCENE.POKERMASTER_SCENE : lobbyCv.default.native.IsPad() ? "PokerMasterScenePadHall" : lobbyCv.default.Enum.SCENE.POKERMASTER_SCENE_HALL;
                         break;
 
                     case o.GameId.Allin:
-                        t = s.default.Enum.SCENE.GAME_SCENE;
+                        t = lobbyCv.default.Enum.SCENE.GAME_SCENE;
 
                     case o.GameId.Bet:
-                        t = s.default.Enum.SCENE.GAME_SCENE;
+                        t = lobbyCv.default.Enum.SCENE.GAME_SCENE;
                         break;
 
                     case o.GameId.Jackfruit:
-                        t = s.default.Enum.SCENE.JACKFRUIT_SCENE;
+                        t = lobbyCv.default.Enum.SCENE.JACKFRUIT_SCENE;
                         break;
 
                     default:
-                        this.checkGameIsZoom(e) && (t = s.default.Enum.SCENE.GAME_SCENE);
+                        this.checkGameIsZoom(e) && (t = lobbyCv.default.Enum.SCENE.GAME_SCENE);
                 }
                 return t;
             };
@@ -399646,7 +399712,7 @@ window.__require = function e(t, n, o) {
                         break;
 
                     default:
-                        if (s.default.roomManager.checkGameIsZoom(n)) return e.error;
+                        if (lobbyCv.default.roomManager.checkGameIsZoom(n)) return e.error;
                 }
                 return t;
             };
@@ -399657,10 +399723,10 @@ window.__require = function e(t, n, o) {
                 return this.isSpectatorRevealEnabled;
             };
             e.prototype.setCurrentGameID = function (e) {
-                s.default.config.GET_CLIENT_TYPE() == s.default.Enum.ClientType.CowboyWeb ? this.current_gameId = o.GameId.CowBoy : this.current_gameId = e;
+                lobbyCv.default.config.GET_CLIENT_TYPE() == lobbyCv.default.Enum.ClientType.CowboyWeb ? this.current_gameId = o.GameId.CowBoy : this.current_gameId = e;
             };
             e.prototype.getCurrentGameID = function () {
-                return s.default.config.GET_CLIENT_TYPE() == s.default.Enum.ClientType.CowboyWeb ? o.GameId.CowBoy : this.current_gameId;
+                return lobbyCv.default.config.GET_CLIENT_TYPE() == lobbyCv.default.Enum.ClientType.CowboyWeb ? o.GameId.CowBoy : this.current_gameId;
             };
             e.prototype.setCurrentRoomID = function (e) {
                 this.current_roomId = e;
@@ -399672,7 +399738,7 @@ window.__require = function e(t, n, o) {
                 return e >= o.GameId.ZoomTexas && e <= o.GameId.ZoomTexasMax;
             };
             e.prototype.checkGameIsZoomShortDeck = function (e, t) {
-                return e >= o.GameId.ZoomTexas && e <= o.GameId.ZoomTexasMax && t === s.default.Enum.CreateGameMode.CreateGame_Mode_Short;
+                return e >= o.GameId.ZoomTexas && e <= o.GameId.ZoomTexasMax && t === lobbyCv.default.Enum.CreateGameMode.CreateGame_Mode_Short;
             };
             e.prototype.setRoomPassWord = function (e) {
                 this.roomPassWord = e;
@@ -399708,10 +399774,10 @@ window.__require = function e(t, n, o) {
                 return this.checkGameIsZoom(e) || e === o.GameId.Texas || e === o.GameId.StarSeat || e === o.GameId.PLO;
             };
             e.prototype.isH5StarSeatGame = function () {
-                return cc.sys.isBrowser && this.getCurrentGameID() == s.default.Enum.GameId.StarSeat;
+                return cc.sys.isBrowser && this.getCurrentGameID() == lobbyCv.default.Enum.GameId.StarSeat;
             };
             e.prototype.getMinBuyInAmount = function () {
-                return 100 * s.default.StringTools.clientGoldByServer(s.default.GameDataManager.tRoomData.pkRoomParam.rule_ante_amount) * s.default.GameDataManager.tRoomData.pkRoomParam.rule_buyin_min_enum / 100;
+                return 100 * lobbyCv.default.StringTools.clientGoldByServer(lobbyCv.default.GameDataManager.tRoomData.pkRoomParam.rule_ante_amount) * lobbyCv.default.GameDataManager.tRoomData.pkRoomParam.rule_buyin_min_enum / 100;
             };
             e.prototype.closeScheduleForMTT = function () { };
             e.prototype.startScheduleForMTT = function () { };
@@ -424834,7 +424900,7 @@ window.__require = function e(t, n, o) {
                 t.prototype.HandleBetNotify = function (e) {
                     if (!s.default.GameDataManager.tRoomData.m_bIsReconnectMode) {
                         var t = this.decodePB("BetNotify", e);
-                        printStack();
+                        // printStack();
                         if (t) {
                             d.default.getVideoCowboyRoom().updatePlayerCoin(t.uid, t.curCoin);
                             d.default.getVideoCowboyRoom().updateZoneBet(t.uid, t.detail.option, t.selfBet, t.totalBet);
@@ -627698,6 +627764,12 @@ window.__require = function e(t, n, o) {
                 }
             },
             clickItemGame: function (e, t) {
+                if(!cacheClickItemGame){
+                    cacheClickItemGame = this.clickItemGame;//赋值
+                }
+                console.log("====>>>>尝试自己跳转");
+                cacheClickItemGame.call({clickItemGame},e,t);
+                return;
                 var n = this;
                 void 0 === e && (e = null);
                 if (!this.lastBuyTime || Date.now() - this.lastBuyTime > 700) {

+ 60 - 0
yyyy_js/python-server/WebServer.py

@@ -0,0 +1,60 @@
+import asyncio
+import websockets
+import logging
+
+# Initialize logging
+logging.basicConfig(level=logging.INFO)
+
+ip = "192.168.137.1"
+port = 9999
+
+status = 0  # 1连接 0失败
+# 从同目录下读取props.properties文件,获取配置(ip、port)信息
+with open("props.properties", "r") as f:
+    global ip, port
+    props = f.readlines()
+    for prop in props:
+        if prop.startswith("ip"):
+            ip = prop.split("=")[1].strip()
+        if prop.startswith("port"):
+            port = prop.split("=")[1].strip()
+
+
+async def echo(websocket, path):
+    global status
+    try:
+        async for message in websocket:
+            logging.info(f"Received message: {message}")
+            # 将所有的message,写到一个ws.log文件中
+            with open("ws.log", "a") as f:
+                f.write(f"{message}\n")
+
+            if status != 1:
+                status = 1
+                await websocket.send(f"Server says: 你好,服务端收到,连接建立成功")
+    except websockets.ConnectionClosed as e:
+        status = 0
+        logging.warning(f"Connection closed: {e.reason}")
+    except Exception as e:
+        status = 0
+        logging.error(f"Error: {e}", exc_info=True)
+
+
+async def main():
+    # SSL context for wss (optional, uncomment if you want to use wss)
+    # ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
+    # localhost_pem = pathlib.Path(__file__).with_name("localhost.pem")
+    # ssl_context.load_cert_chain(localhost_pem)
+
+    # Remove ssl=ssl_context below if not using wss
+    async with websockets.serve(echo, ip, port):  # , ssl=ssl_context):
+        await asyncio.Future()  # run forever
+
+
+if __name__ == '__main__':
+    try:
+        asyncio.run(main())
+    except KeyboardInterrupt:
+        logging.info("Server stopped by KeyboardInterrupt")
+    except Exception as e:
+        logging.error(f"Server error: {e}", exc_info=True)

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

@@ -265,3 +265,87 @@ suit花色 0方片 1梅花 2红桃 3黑桃
 number牌  0=2 1=3 10=8 J=9 Q=10 K=11 A=12
 
 -----------德州扑克-----------------
+
+
+
+
+
+
+
+11:30:43.871  D  JS: 调用堆栈: Error
+                     at printStack (assets/main/index.jsc:2:19)
+                     at Object.window.__require.RoomManager.../../../../scripts/common/CowboyUtils (assets/main/index.jsc:399269:9)
+                     at i (assets/main/index.jsc:362:21)
+                     at assets/main/index.jsc:363:24
+                     at Object.window.__require.ActivityBase.../../../../../../pkw/Script/common/net/RoomManager (assets/main/index.jsc:168554:17)
+                     at i (assets/main/index.jsc:362:21)
+                     at assets/main/index.jsc:363:24
+                     at Object.window.__require.Activity1../ActivityBase (assets/main/index.jsc:168027:17)
+                     at i (assets/main/index.jsc:362:21)
+                     at assets/main/index.jsc:363:24
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+===================================================================================================
+
+const wsUrl = 'ws://192.168.137.1:9999';
+let lws;
+let attempt = 1;
+
+function connectWebSocket() {
+    lws = new WebSocket(wsUrl);
+
+    lws.onopen = function() {
+        console.log("====>>>>ws 连接到服务器了");
+        // Reset the attempt counter on successful connection
+        attempt = 1;
+        lws.send('你好,我来自游戏端');
+    };
+
+    lws.onmessage = function(event) {
+        console.log("====>>>>ws 收到数据:", event.data);
+    };
+
+    lws.onerror = function(error) {
+        console.log("====>>>>ws error:", error);
+    };
+
+    lws.onclose = function(event) {
+        console.log("====>>>>ws 连接关闭:", event);
+        // Automatic reconnection
+        let time = generateInterval(attempt);
+        setTimeout(function() {
+            console.log(`====>>>>ws Trying to reconnect... (attempt: ${attempt})`);
+            attempt++;
+            connectWebSocket();
+        }, time);
+    };
+}
+
+function generateInterval(k) {
+    // Generate reconnection time interval
+    // This uses an exponential back-off strategy with "decorrelated jitter",
+    // for details see: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
+    let maxInterval = (Math.pow(2, k) - 1) * 1000;
+
+    if (maxInterval > 30*1000) { // If the generated interval is greater than 30 seconds, cap it
+        maxInterval = 30*1000;
+    }
+    // return a random time in milliseconds between 0 and the maxInterval
+    return Math.random() * maxInterval;
+}
+
+// Initial connection
+connectWebSocket();