tang biao vor 5 Jahren
Ursprung
Commit
58dbe7f24d

+ 7 - 7
assets/resources/prefabs/precedence/login_reward.prefab

@@ -938,8 +938,8 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
+      "x": -30.675,
+      "y": -13,
       "z": 0
     },
     "_scale": {
@@ -996,7 +996,7 @@
     "asset": {
       "__uuid__": "14b5feef-28d0-4b1c-8cd3-2d606864fb8b"
     },
-    "fileId": "c2rADi8BdJX7BV+UnfGeIX",
+    "fileId": "8335Oga3xEb7pTQXCOyZHE",
     "sync": false
   },
   {
@@ -1069,7 +1069,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": -171,
+      "x": -191,
       "y": -25,
       "z": 0
     },
@@ -1123,7 +1123,7 @@
     "alignMode": 1,
     "_target": null,
     "_alignFlags": 8,
-    "_left": 40,
+    "_left": 20,
     "_right": 0,
     "_top": 0,
     "_bottom": 0,
@@ -1195,7 +1195,7 @@
     },
     "_position": {
       "__type__": "cc.Vec3",
-      "x": 112,
+      "x": 122,
       "y": -27.5,
       "z": 0
     },
@@ -1390,7 +1390,7 @@
     "_target": null,
     "_alignFlags": 33,
     "_left": 0,
-    "_right": 45,
+    "_right": 35,
     "_top": 76,
     "_bottom": 0,
     "_verticalCenter": 0,

+ 1 - 1
assets/scripts/game/Game.js

@@ -195,7 +195,7 @@ cc.Class({
             autoConnect: true,          // 自动连接
             reconnection: true,         // 断开自动重连
             reconnectionDelay: 3000,    // 重连间隔时间,单位毫秒
-            reconnectionAttempts: 5     // 最大重连尝试次数,默认为Infinity
+            // reconnectionAttempts: 5     // 最大重连尝试次数,默认为Infinity
         });
 
         Global._wxSocket = ws;

+ 7 - 6
assets/scripts/net/Ws.js

@@ -193,7 +193,7 @@ function WsManager(url, opts) {
     this.readyState = 'closed' //当前socket状态
     this.binaryType = opts.binaryType || 'blob' //数据传输类型
     this._reconnectTimes = 0 //重连次数
-    this._reconnectionDelay = opts.reconnectionDelay || 1000 //重连延迟
+    this._reconnectionDelay = opts.reconnectionDelay || 3000 //重连延迟
     this.reconnection(opts.reconnection !== false) // 是否自动重连
     this.reconnectionAttempts(opts.reconnectionAttempts || Infinity) //重连最大尝试次数
     this.timeout(null == opts.timeout ? 20000 : opts.timeout)
@@ -221,7 +221,7 @@ WsManager.prototype.connect = function(fn) {
 }
 
 WsManager.prototype.reconnect = function() {
-    clearInterval(this.keepAliveTimeout);
+    // clearInterval(this.keepAliveTimeout);
 
     if(this._reconnectTimes < this._reconnectionAttempts) {
         if(this.socket) {
@@ -288,10 +288,10 @@ WsManager.prototype.openWxConnect = function() {
 
     _socket.onClose((res) => {
         this.readyState = 'closed';
-        
+        clearInterval(this.keepAliveTimeout);
         //只要关闭就重连(暂时性处理)并且不是在后台 不进行重连
         if(this._reconnection && !Global.isOnHide ) {
-            this.reconnect()
+            this.reconnect();
         }
 
         this.emit('close', res)
@@ -313,10 +313,11 @@ WsManager.prototype.openWxConnect = function() {
 
     _socket.onError((res) => {
         this.readyState = 'closed';
+        clearInterval(this.keepAliveTimeout);
         if(this._reconnection && !Global.isOnHide) {
-            this.reconnect()
+            this.reconnect();
         } else {
-            _socket.close()
+            _socket.close();
         }
 
         this.emit('error', res.errMsg);