瀏覽代碼

基本上切断了socket和webrtc

xushiting 3 年之前
父節點
當前提交
7c4d6c4431
共有 6 個文件被更改,包括 276 次插入247 次删除
  1. 1 0
      src/NetworkController.js
  2. 41 37
      src/Rtcp.js
  3. 4 1
      src/ServerData.js
  4. 48 48
      src/Socket.js
  5. 169 149
      src/Workers.js
  6. 13 12
      src/Xverse_Room.js

+ 1 - 0
src/NetworkController.js

@@ -143,6 +143,7 @@ export default class NetworkController extends EventEmitter {
             //     r(n)
             // }
             // ),
+            
             this.socket.start()
         }
         )

+ 41 - 37
src/Rtcp.js

@@ -72,46 +72,49 @@ export default class Rtcp extends EventEmitter {
         E(this, "setRemoteDescription", async(e,t)=>{
             var a, s, l;
             if (!this.connection)
+            {
                 return;
+            }
             const r = JSON.parse(atob(e))
               , n = new RTCSessionDescription(r);
             await this.connection.setRemoteDescription(n);
             const o = await this.connection.createAnswer();
-            if (o.sdp = (a = o.sdp) == null ? void 0 : a.replace(/(a=fmtp:111 .*)/g, "$1;stereo=1;sprop-stereo=1"),
-            ((l = (s = o.sdp) == null ? void 0 : s.match(/a=mid:1/g)) == null ? void 0 : l.length) == 2) {
-                const u = o.sdp.lastIndexOf("a=mid:1");
-                o.sdp = o.sdp.slice(0, u) + "a=mid:2" + o.sdp.slice(u + 7)
-            }
+            // if (o.sdp = (a = o.sdp) == null ? void 0 : a.replace(/(a=fmtp:111 .*)/g, "$1;stereo=1;sprop-stereo=1"),
+            // ((l = (s = o.sdp) == null ? void 0 : s.match(/a=mid:1/g)) == null ? void 0 : l.length) == 2) {
+            //     const u = o.sdp.lastIndexOf("a=mid:1");
+            //     o.sdp = o.sdp.slice(0, u) + "a=mid:2" + o.sdp.slice(u + 7)
+            // }
             try {
                 await this.connection.setLocalDescription(o)
             } catch (u) {
                 logger.error("error", u)
             }
-            this.isAnswered = !0,
-            this.network.rtcp.flushCandidate(),
+            this.isAnswered = !0;
+            this.network.rtcp.flushCandidate();
             this.network.socket.send({
                 id: "answer",
                 data: btoa(JSON.stringify(o))
-            }),
-            t.srcObject = this.mediaStream
+            });
+            // t.srcObject = this.mediaStream
         }
         );
         E(this, "flushCandidate", ()=>{
-            this.isFlushing || !this.isAnswered || (this.isFlushing = !0,
-            this.candidates.forEach(e=>{
-                const t = atob(e)
-                  , r = JSON.parse(t);
-                if (/172\./.test(r.candidate))
-                    return;
-                const n = new RTCIceCandidate(r);
-                this.connection && this.connection.addIceCandidate(n).then(()=>{}
-                , o=>{
-                    logger.info("add candidate failed", o)
-                }
-                )
+            if(!this.isFlushing && this.isAnswered){
+                this.isFlushing = !0;
+                this.candidates.forEach(e=>{
+                    const t = atob(e)
+                      , r = JSON.parse(t);
+                    if (/172\./.test(r.candidate))
+                        return;
+                    const n = new RTCIceCandidate(r);
+                    this.connection && this.connection.addIceCandidate(n).then(()=>{}
+                    , o=>{
+                        logger.info("add candidate failed", o)
+                    }
+                    )
+                });
+                this.isFlushing = !1;
             }
-            ),
-            this.isFlushing = !1)
         }
         );
         E(this, "input", e=>{
@@ -157,7 +160,7 @@ export default class Rtcp extends EventEmitter {
             logger.info(`ondatachannel: ${t.channel.label}`);
            
             this.inputChannel = t.channel;
-            this.inputChannel.onopen = ()=>{
+            //this.inputChannel.onopen = ()=>{
                 // var r;
                 // logger.info("The input channel has opened, id:", (r = this.inputChannel) == null ? void 0 : r.id),
                 // this.inputReady = !0;
@@ -173,30 +176,31 @@ export default class Rtcp extends EventEmitter {
                 //     group: "joinRoom"
                 // }))
                 // console.log('this.inputChannel',this.inputChannel)
-            }
-            ,
-            this.inputChannel.onclose = ()=>{
+            //}
+            //,
+            //this.inputChannel.onclose = ()=>{
                 // var r;
                 // return logger.info("The input channel has closed, id:", (r = this.inputChannel) == null ? void 0 : r.id)
-            },
+            //},
             this.inputChannel.onmessage = r=>{
                 // console.log('this.workers',this.workers)
                 // console.log('inputChannel',r.data)
-                this.workers.dataHandle(r.data)
+                // this.workers.dataHandle(r.data)
             }
-        }
-        ,
+        };
+
         this.connection.oniceconnectionstatechange = this.onIceConnectionStateChange,
         this.connection.onicegatheringstatechange = this.onIceStateChange,
         this.connection.onicecandidate = this.onIcecandidate,
         this.connection.onicecandidateerror = this.onIcecandidateerror;
 
-        this.network.socket.send({
-            id: "init_webrtc",
-            data: JSON.stringify({
-                is_mobile: !0
-            })
-        })
+        //服务器收到这个请求后,会发送webrtc的相关信息
+        // this.network.socket.send({
+        //     id: "init_webrtc",
+        //     data: JSON.stringify({
+        //         is_mobile: !0
+        //     })
+        // })
     }
     addCandidate(e) {
         e === "" ? this.network.rtcp.flushCandidate() : this.candidates.push(e)

+ 4 - 1
src/ServerData.js

@@ -161,7 +161,10 @@ var ServerData = {
         },
         "pts": null,
         "alreadyUpdateYUV": true
-    }
+    },
+    width:1728,
+    height:720
+
 }
 
 export default ServerData

+ 48 - 48
src/Socket.js

@@ -65,36 +65,36 @@ export default class Socket extends EventEmitter {
                     extra: JSON.stringify(R)
                 })
             };
-            this.send(x),
-            logger.warn("startGame", le(oe({}, x), {
-                data: JSON.parse(x.data)
-            }))
+            this.send(x);
+            // logger.warn("startGame", le(oe({}, x), {
+            //     data: JSON.parse(x.data)
+            // }))
         }
         );
-        this.network = e,
-        this.heartbeat = new Heartbeat({
-            ping: t=>{
-                var r;
-                if (!this.connected) {
-                    this.heartbeat.stop(),
-                    (r = e.room.stats) == null || r.assign({
-                        rtt: 0
-                    });
-                    return
-                }
-                this.send({
-                    id: "heartbeat",
-                    data: t
-                })
-            }
-            ,
-            pong(t) {
-                var r;
-                (r = e.room.stats) == null || r.assign({
-                    rtt: t
-                })
-            }
-        })
+        this.network = e;
+        // this.heartbeat = new Heartbeat({
+        //     ping: t=>{
+        //         var r;
+        //         if (!this.connected) {
+        //             this.heartbeat.stop(),
+        //             (r = e.room.stats) == null || r.assign({
+        //                 rtt: 0
+        //             });
+        //             return
+        //         }
+        //         this.send({
+        //             id: "heartbeat",
+        //             data: t
+        //         })
+        //     }
+        //     ,
+        //     pong(t) {
+        //         var r;
+        //         (r = e.room.stats) == null || r.assign({
+        //             rtt: t
+        //         })
+        //     }
+        // })
     }
 
     get connection() {
@@ -106,11 +106,11 @@ export default class Socket extends EventEmitter {
         logger.info(`connecting to ${e}`);
         const t = Date.now();
         this._ws = new WebSocket(e),
-        this._openTimer = new Timeout(()=>{
-            const r = `Failed to open websocket in ${DEFAULT_OPEN_TIMEOUT_MS} ms`;
-            this._hasTimeout = !0,
-            this.emit("socketClosed", new InitNetworkTimeoutError(r))
-        },DEFAULT_OPEN_TIMEOUT_MS),
+        // this._openTimer = new Timeout(()=>{
+        //     const r = `Failed to open websocket in ${DEFAULT_OPEN_TIMEOUT_MS} ms`;
+        //     this._hasTimeout = !0,
+        //     this.emit("socketClosed", new InitNetworkTimeoutError(r))
+        // },DEFAULT_OPEN_TIMEOUT_MS),
 
         // this._ws.onopen = ()=>{
         //     var r;
@@ -129,7 +129,7 @@ export default class Socket extends EventEmitter {
         //     }))
         // },
         this.connected = !0;
-        this.handleWSEvent()
+        //this.handleWSEvent()
     }
     getAddress() {
         const {wsServerUrl: e, reconnect: t, sessionId: r, token: n, roomId: o, userId: a, pageSession: s} = this.network.room.currentNetworkOptions
@@ -176,28 +176,28 @@ export default class Socket extends EventEmitter {
                     case "fail":
                         break;
                     case "init":
-                        try {
-                            const o = r.data.slice(-37, -1);
-                            reporter.updateBody({
-                                serverSession: o
-                            })
-                        } catch (o) {
-                            console.error(o)
-                        }
-                        this.network.rtcp.start();
+                    //     try {
+                    //         const o = r.data.slice(-37, -1);
+                    //         reporter.updateBody({
+                    //             serverSession: o
+                    //         })
+                    //     } catch (o) {
+                    //         console.error(o)
+                    //     }
+                    //     this.network.rtcp.start();
                         break;
                     // case "heartbeat":
                     //     this.heartbeat.pong(r.data);
                     //     break;
                     case "offer":
-                        this.network.rtcp.setRemoteDescription(r.data, this.network.stream.el);
+                        //this.network.rtcp.setRemoteDescription(r.data, this.network.stream.el);
                         break;
                     case "ice_candidate":
-                        this.network.rtcp.addCandidate(r.data);
-                        break;
-                    case "start":
-                        this.emit("gameRoomAvailable", r);
+                        //this.network.rtcp.addCandidate(r.data);
                         break;
+                    // case "start":
+                    //     this.emit("gameRoomAvailable", r);
+                    //     break;
                     // case "error":
                     //     try {
                     //         const {Code: o, Msg: a} = JSON.parse(r.data);

+ 169 - 149
src/Workers.js

@@ -172,7 +172,23 @@ export default class Workers {
         }
         ,
         this._rtcp = e
+
+        this.initCach()
     }
+
+    //xst
+    initCach(){
+        const r = 0;
+        this.cachedStreams[r] = ServerData.star.signal;
+        // this.cachedMetas[r] = e.data.metadata;
+        // this.cachedPtss[r] = e.data.pts;
+        this.cachedRender[r] = !1;
+        this.cachedResolution[r] = {
+            width: ServerData.width,
+            height: ServerData.height
+        };
+    }
+
     registerLogger(e) {
         //defaultLogger = e
     }
@@ -360,30 +376,31 @@ export default class Workers {
         this.receiveIframes = e.data.receivedIframe,
         this.decodeIframes = e.data.decodedIframe
     }
+
     ReceiveDecodeMessage(e) {
-        var n;
-        if (!this.firstYUVReceived) {
-            this.firstYUVDecoded = e.data.yuv_ts;
-            const o = this.firstYUVDecoded - this.rtcp.network.room._startTime;
-            defaultLogger.infoAndReportMeasurement({
-                metric: "firstYUVDecodedAt",
-                value: o,
-                group: "joinRoom"
-            }),
-            this.firstRender = Date.now();
-            const a = this.firstYUVDecoded - this.rtcp.network.room._startTime;
-            defaultLogger.infoAndReportMeasurement({
-                metric: "firstRenderAt",
-                value: a,
-                group: "joinRoom"
-            }),
-            this.firstYUVReceived = !0,
-            this.lastRenderTs = Date.now()
-        }
-        if(!this.cachedRender[this.setPtr] && this.cachedMetas[this.setPtr] != null){
-            if(this.cachedStreams[this.setPtr] != null && this.cachedStreams[this.setPtr].byteLength != 0)
-            {
-                if(e.data.data == null){
+        //var n;
+        // if (!this.firstYUVReceived) {
+        //     this.firstYUVDecoded = e.data.yuv_ts;
+        //     const o = this.firstYUVDecoded - this.rtcp.network.room._startTime;
+        //     defaultLogger.infoAndReportMeasurement({
+        //         metric: "firstYUVDecodedAt",
+        //         value: o,
+        //         group: "joinRoom"
+        //     }),
+        //     this.firstRender = Date.now();
+        //     const a = this.firstYUVDecoded - this.rtcp.network.room._startTime;
+        //     defaultLogger.infoAndReportMeasurement({
+        //         metric: "firstRenderAt",
+        //         value: a,
+        //         group: "joinRoom"
+        //     }),
+        //     this.firstYUVReceived = !0,
+        //     this.lastRenderTs = Date.now()
+        // }
+        //if(!this.cachedRender[this.setPtr] && this.cachedMetas[this.setPtr] != null){
+            // if(this.cachedStreams[this.setPtr] != null && this.cachedStreams[this.setPtr].byteLength != 0)
+            // {
+                // if(e.data.data == null){
                     // this.executeFunction("stream", {
                     //     stream: this.cachedStreams[this.setPtr],
                     //     width: this.cachedResolution[this.setPtr].width,
@@ -395,48 +412,48 @@ export default class Workers {
                     //     pts: this.cachedPtss[this.setPtr],
                     //     alreadyUpdateYUV: !0
                     // })
-                }
-                else{
-                    this.updateDropFrame += 1
-                }
+                // }
+                // else{
+                //     this.updateDropFrame += 1
+                // }
                 // this.decoderWorker.postMessage({
                 //     t: 2,
                 //     frameCnt: this.cachedPtss[this.setPtr],
                 //     buffer: this.cachedStreams[this.setPtr]
                 // }, [this.cachedStreams[this.setPtr].buffer])
-            }
-            this.getPtr = (this.getPtr + 1) % this.cachedLength
-        }
+            // }
+            //this.getPtr = (this.getPtr + 1) % this.cachedLength
+        //}
 
-        const t = e.data.metadata;
-        if ((n = t == null ? void 0 : t.traceIds) != null && n.length) {
-            for (const o of t.traceIds)
-                if (this.traceIdMap.has(o)) {
-                    const a = this.traceIdMap.get(o);
-                    a != null && (a.readyTime = Date.now(),
-                    a.status = 2)
-                }
-        }
+        // const t = e.data.metadata;
+        // if ((n = t == null ? void 0 : t.traceIds) != null && n.length) {
+        //     for (const o of t.traceIds)
+        //         if (this.traceIdMap.has(o)) {
+        //             const a = this.traceIdMap.get(o);
+        //             a != null && (a.readyTime = Date.now(),
+        //             a.status = 2)
+        //         }
+        // }
 
-        e.data.pts == this.moveStartPts && (this.MoveProcessDelay = Date.now() - this.StartMovingTs);
-        this.userId_test = this.rtcp.network.room.userId;
+        // e.data.pts == this.moveStartPts && (this.MoveProcessDelay = Date.now() - this.StartMovingTs);
+        // this.userId_test = this.rtcp.network.room.userId;
 
-        if (this.inMovingMode) {
-            const o = Date.now()
-            const a = o - this.lastMoveProcessTime;
-            this.moveProcessCircular.add(a);
-            this.lastMoveProcessTime = o;
-        }
-        const r = this.setPtr;
-        this.cachedStreams[r] = e.data.data;
-        this.cachedMetas[r] = e.data.metadata;
-        this.cachedPtss[r] = e.data.pts;
-        this.cachedRender[r] = !1;
-        this.cachedResolution[r] = {
-            width: e.data.width,
-            height: e.data.height
-        },
-        this.setPtr = (this.setPtr + 1) % this.cachedLength
+        // if (this.inMovingMode) {
+        //     const o = Date.now()
+        //     const a = o - this.lastMoveProcessTime;
+        //     this.moveProcessCircular.add(a);
+        //     this.lastMoveProcessTime = o;
+        // }
+        //const r = this.setPtr;
+        // this.cachedStreams[r] = e.data.data;
+        // this.cachedMetas[r] = e.data.metadata;
+        // this.cachedPtss[r] = e.data.pts;
+        // this.cachedRender[r] = !1;
+        // this.cachedResolution[r] = {
+        //     width: e.data.width,
+        //     height: e.data.height
+        // };
+        //this.setPtr = (this.setPtr + 1) % this.cachedLength
     }
     // SendCacheFrameInfo(e) {
     //     var h, f, d, _, g, m, v;
@@ -539,87 +556,90 @@ export default class Workers {
             config: e
         });
 
-        return new Promise(r=>{
+        return new Promise(resolve=>{
             this.decoderWorker.onmessage = n=>{
                 switch (n.data.t) {
-                case 0:
-                    this.ReceiveDecodeMessage(n);
-                    break;
-                case 1:
-                    this.UpdateStats(n);
-                    break;
-                case 2:
-                    r();
-                    break;
-                case 3:
-                    //this.SendCacheFrameInfo(n);
-                    break;
-                case 4:
-                    {
-                        const o = new Date().toISOString()
-                          , a = USER_ID + "-" + PAGE_SESSION + "-" + SERVER_SESSION + "-" + o + ".264";
-                        
-                          let downloadURL = function(r, n) {
-                            const o = document.createElement("a");
-                            o.href = r,
-                            o.download = n,
-                            document.body.appendChild(o),
-                            o.style.display = "none",
-                            o.click(),
-                            o.remove()
+                    case 0:
+                        //this.ReceiveDecodeMessage(n);
+                        //break;               
+                    // case 1:
+                    //     this.UpdateStats(n);
+                    //     break;
+                    case 2:
+                        resolve();
+                        break;
+                    /*
+                    case 3:
+                        //this.SendCacheFrameInfo(n);
+                        break;
+                    case 4:
+                        {
+                            const o = new Date().toISOString()
+                            , a = USER_ID + "-" + PAGE_SESSION + "-" + SERVER_SESSION + "-" + o + ".264";
+                            
+                            let downloadURL = function(r, n) {
+                                const o = document.createElement("a");
+                                o.href = r,
+                                o.download = n,
+                                document.body.appendChild(o),
+                                o.style.display = "none",
+                                o.click(),
+                                o.remove()
+                            }
+                            downloadURL(n.data.link, a)
+                            //uploadStream(COS_PREFIX + a, n.data.fileObj);
+                            break
                         }
-                        downloadURL(n.data.link, a)
-                        //uploadStream(COS_PREFIX + a, n.data.fileObj);
-                        break
-                    }
-                case 5:
-                    // this.executeFunction("signal", {
-                    //     signal: n.data.metadata,
-                    //     pts: -1,
-                    //     alreadyUpdateYUV: !1
-                    // });
-                    break;
-                case 6:
-                    defaultLogger.infoAndReportMeasurement(n.data),
-                    defaultLogger.debug("WASM Ready Cost");
-                    break;
-                case 7:
-                    this.ReceivePanoramaDecodeMessage(n);
-                    break;
-                case 8:
-                    {
-                        const o = {
-                            MstType: 0
-                        };
-                        let a = "";
-                        try {
-                            a = JSON.stringify(o)
-                        } catch (l) {
-                            defaultLogger.error(l);
-                            return
+                    case 5:
+                        // this.executeFunction("signal", {
+                        //     signal: n.data.metadata,
+                        //     pts: -1,
+                        //     alreadyUpdateYUV: !1
+                        // });
+                        break;
+                
+                    case 6:
+                        defaultLogger.infoAndReportMeasurement(n.data),
+                        defaultLogger.debug("WASM Ready Cost");
+                        break;
+                    case 7:
+                        this.ReceivePanoramaDecodeMessage(n);
+                        break;
+                    case 8:
+                        {
+                            const o = {
+                                MstType: 0
+                            };
+                            let a = "";
+                            try {
+                                a = JSON.stringify(o)
+                            } catch (l) {
+                                defaultLogger.error(l);
+                                return
+                            }
+                            const s = "wasm:" + a;
+                            this._rtcp.sendStringData(s);
+                            break
                         }
-                        const s = "wasm:" + a;
-                        this._rtcp.sendStringData(s);
-                        break
-                    }
-                case 9:
-                    {
-                        defaultLogger.info(n.data.printMsg);
-                        break
-                    }
-                case 10:
-                    {
-                        defaultLogger.error(n.data.printMsg),
-                        this.executeFunction("error", {
-                            code: n.data.code,
-                            message: n.data.printMsg
-                        });
+                    case 9:
+                        {
+                            defaultLogger.info(n.data.printMsg);
+                            break
+                        }
+                    case 10:
+                        {
+                            defaultLogger.error(n.data.printMsg),
+                            this.executeFunction("error", {
+                                code: n.data.code,
+                                message: n.data.printMsg
+                            });
+                            break
+                        }
+                    */
+                    default:
+                        // defaultLogger.error("Receive unknown message event from decoder"),
+                        // defaultLogger.debug(n.data);
                         break
-                    }
-                default:
-                    defaultLogger.error("Receive unknown message event from decoder"),
-                    defaultLogger.debug(n.data);
-                    break
                 }
             }
         }
@@ -631,7 +651,7 @@ export default class Workers {
         }
         var t, r;
         const e = this.getPtr;
-        if (this.cachedMetas[e] != null && !this.cachedRender[e]) {
+        //if (this.cachedMetas[e] != null && !this.cachedRender[e]) {
             const n = Date.now();
             if (this.firstUpdateYUV) {
                 const h = ((t = this.cachedStreams[e]) == null ? void 0 : t.byteLength) || 0;
@@ -699,11 +719,11 @@ export default class Workers {
                 pts: ServerData.star.pts,           //this.cachedPtss[e],
                 alreadyUpdateYUV: !0
             })
-            
+
             this.cachedRender[e] = !0;
             this.getPtr = (this.getPtr + 1) % this.cachedLength
             
-        }
+        //}
     }
     unmarshalPano(e) {
         const t = new DataView(e);
@@ -974,11 +994,11 @@ export default class Workers {
                     };
                     if (this.inPanoMode)
                     {
-                        // this.executeFunction("signal", {
-                        //     signal: L,
-                        //     pts: -1,
-                        //     alreadyUpdateYUV: !0
-                        // });
+                        this.executeFunction("signal", {
+                            signal: L,
+                            pts: -1,
+                            alreadyUpdateYUV: !0
+                        });
                         return !0;
                     }
                     this.decoderWorker.postMessage(z, [D.buffer]);
@@ -993,10 +1013,10 @@ export default class Workers {
                         this.firstMediaReceived = !0
                     }
                 } 
-                else
-                {
-                    this.cacheFrameComposes[O].size > m && defaultLogger.debug("I frame exceed, cache size is ", this.cacheSize, ", total size is ", m);
-                }
+                // else
+                // {
+                //     this.cacheFrameComposes[O].size > m && defaultLogger.debug("I frame exceed, cache size is ", this.cacheSize, ", total size is ", m);
+                // }
             }
             else if (O == -1) {
                 let D = this.hasFrmCntInCache(-1);
@@ -1045,10 +1065,10 @@ export default class Workers {
         // }
 
         const t = new Uint8Array(e);
-        if (t.length >= 4 && this.isHeartBeatPacket(t.buffer, t.length) == !0)
-        {
-            return;
-        }
+        // if (t.length >= 4 && this.isHeartBeatPacket(t.buffer, t.length) == !0)
+        // {
+        //     return;
+        // }
         
         if (t.length > 36 && this.unmarshalStream(t.buffer) == !0) {
             // if(this.reconnectSignal){

+ 13 - 12
src/Xverse_Room.js

@@ -80,17 +80,17 @@ export default class Xverse_Room extends EventEmitter {
                 });
 
                 a.registerFunction("stream", s=>{
-                    var l;
-                    this.emit("streamTimestamp", {
-                        timestamp: Date.now()
-                    });
-                    t || (t = !0,logger.info("Invoke stream event"));
+                    // var l;
+                    // this.emit("streamTimestamp", {
+                    //     timestamp: Date.now()
+                    // });
+                    // t || (t = !0,logger.info("Invoke stream event"));
                     if (s.stream) {
-                        r || (r = !0,logger.info("Invoke updateRawYUVData"));
-                        this.isUpdatedRawYUVData = !1;
-                        const fov = (l = this._currentState.skin) == null ? void 0 : l.fov;0
+                        // r || (r = !0,logger.info("Invoke updateRawYUVData"));
+                        // this.isUpdatedRawYUVData = !1;
+                        // const fov = (l = this._currentState.skin) == null ? void 0 : l.fov;0
                         
-                        this.sceneManager.materialComponent.updateRawYUVData(s.stream, s.width, s.height, fov);
+                        // this.sceneManager.materialComponent.updateRawYUVData(s.stream, s.width, s.height, fov);
                         
                         this.isUpdatedRawYUVData = !0
                     }
@@ -274,7 +274,8 @@ export default class Xverse_Room extends EventEmitter {
     async initRoom() {
         const {timeout: e=DEFAULT_JOINROOM_TIMEOUT} = this.options;
         if(util.isSupported()){
-            return this._initRoom()._timeout(e, new TimeoutError("initRoom timeout"))
+            //return this._initRoom()._timeout(e, new TimeoutError("initRoom timeout"))
+            return this._initRoom()
         }
         else{
             return Promise.reject(new UnsupportedError)
@@ -332,7 +333,7 @@ export default class Xverse_Room extends EventEmitter {
             skinId: skinId
         });
         try {
-            await Promise.all([this.initNetwork(), this.initConfig(), this.initWasm()]),
+            await Promise.all([this.initNetwork(), this.initConfig(), this.initWasm()]);
             logger.info("network config wasm all ready, start to create game");
             const F = await this.requestCreateRoom({
                 skinId: skinId
@@ -481,7 +482,7 @@ export default class Xverse_Room extends EventEmitter {
             return Promise.resolve();
         const e = Date.now();
         try {
-            await this.networkController.rtcp.workers.init(this.options.resolution)._timeout(8e3, new InitDecoderTimeoutError),
+            await this.networkController.rtcp.workers.init(this.options.resolution)._timeout(8e3, new InitDecoderTimeoutError);
             this.networkController.rtcp.workers.registerFunction("error", t=>{
                 logger.error("decode error", t);
                 const {code: code, message: n} = t;