xushiting 3 роки тому
батько
коміт
0c2f0dbb04

+ 550 - 0
dist/assets/component_list.json

@@ -0,0 +1,550 @@
+{
+    "components": {
+        "thumbnail": "",
+        "url": "meshes/body_man.glb",
+        "url_lod2": "meshes/body_man_lod2.glb",
+        "url_lod4": "meshes/body_man_lod4.glb"
+    },
+    "animations": [
+{
+            "thumbnail": "",
+            "id":"1",
+            "name":"Dance01",
+            "sex":"woman",
+            "url":"animations/Dance01.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"2",
+            "name":"Dance01c",
+            "sex":"woman",
+            "url":"animations/Dance01c.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"3",
+            "name":"Dance01b",
+            "sex":"woman",
+            "url":"animations/Dance01b.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"4",
+            "name":"Waving",
+            "sex":"woman",
+            "url":"animations/Waving.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"5",
+            "name":"WaveHipHopDance",
+            "sex":"woman",
+            "url":"animations/WaveHipHopDance.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"6",
+            "name":"TurnBack",
+            "sex":"woman",
+            "url":"animations/TurnBack.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"7",
+            "name":"Thankful",
+            "sex":"woman",
+            "url":"animations/Thankful.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"8",
+            "name":"Talking",
+            "sex":"woman",
+            "url":"animations/Talking.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"9",
+            "name":"Yaotou",
+            "sex":"woman",
+            "url":"animations/Yaotou.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"10",
+            "name":"Walking",
+            "sex":"woman",
+            "url":"animations/Walking.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"11",
+            "name":"Dance02",
+            "sex":"woman",
+            "url":"animations/Dance02.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"12",
+            "name":"GiftClap",
+            "sex":"woman",
+            "url":"animations/GiftClap.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"13",
+            "name":"Qiangtui",
+            "sex":"woman",
+            "url":"animations/Qiangtui.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"14",
+            "name":"Hallo",
+            "sex":"woman",
+            "url":"animations/Hallo.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"15",
+            "name":"StopWalking",
+            "sex":"woman",
+            "url":"animations/StopWalking.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"16",
+            "name":"StartWalking",
+            "sex":"woman",
+            "url":"animations/StartWalking.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"17",
+            "name":"Singing",
+            "sex":"woman",
+            "url":"animations/Singing.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"18",
+            "name":"Running",
+            "sex":"woman",
+            "url":"animations/Running.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"19",
+            "name":"RumbaDancing",
+            "sex":"woman",
+            "url":"animations/RumbaDancing.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"20",
+            "name":"PHOTO_9",
+            "sex":"woman",
+            "url":"animations/PHOTO_9.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"21",
+            "name":"PHOTO_8",
+            "sex":"woman",
+            "url":"animations/PHOTO_8.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"22",
+            "name":"PHOTO_7",
+            "sex":"woman",
+            "url":"animations/PHOTO_7.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"23",
+            "name":"PHOTO_5",
+            "sex":"woman",
+            "url":"animations/PHOTO_5.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"24",
+            "name":"PHOTO_3",
+            "sex":"woman",
+            "url":"animations/PHOTO_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"25",
+            "name":"PHOTO_2",
+            "sex":"woman",
+            "url":"animations/PHOTO_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"26",
+            "name":"PHOTO_1",
+            "sex":"woman",
+            "url":"animations/PHOTO_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"27",
+            "name":"PHOTO_12",
+            "sex":"woman",
+            "url":"animations/PHOTO_12.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"28",
+            "name":"PHOTO_11",
+            "sex":"woman",
+            "url":"animations/PHOTO_11.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"29",
+            "name":"PHOTO_10",
+            "sex":"woman",
+            "url":"animations/PHOTO_10.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"30",
+            "name":"JumpPart2",
+            "sex":"woman",
+            "url":"animations/JumpPart2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"31",
+            "name":"JumpPart1",
+            "sex":"woman",
+            "url":"animations/JumpPart1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"32",
+            "name":"Jump_all",
+            "sex":"woman",
+            "url":"animations/Jump_all.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"33",
+            "name":"Idle",
+            "sex":"woman",
+            "url":"animations/Idle.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"34",
+            "name":"HappyIdle",
+            "sex":"woman",
+            "url":"animations/HappyIdle.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"35",
+            "name":"Dance04",
+            "sex":"woman",
+            "url":"animations/Dance04.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"36",
+            "name":"Dance05",
+            "sex":"woman",
+            "url":"animations/Dance05.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"37",
+            "name":"Dance03",
+            "sex":"woman",
+            "url":"animations/Dance03.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"38",
+            "name":"Cheering",
+            "sex":"woman",
+            "url":"animations/Cheering.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"39",
+            "name":"BlowAKiss",
+            "sex":"woman",
+            "url":"animations/BlowAKiss.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"40",
+            "name":"LockingHipHopDance",
+            "sex":"woman",
+            "url":"animations/LockingHipHopDance.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"41",
+            "name":"YaotouLoop",
+            "sex":"woman",
+            "url":"animations/YaotouLoop.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"42",
+            "name":"QiangtuiLoop",
+            "sex":"woman",
+            "url":"animations/QiangtuiLoop.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"43",
+            "name":"HalloLoop",
+            "sex":"woman",
+            "url":"animations/HalloLoop.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"44",
+            "name":"JumpLoop",
+            "sex":"woman",
+            "url":"animations/JumpLoop.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"45",
+            "name":"LeftTurn",
+            "sex":"woman",
+            "url":"animations/LeftTurn.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"46",
+            "name":"Song01_1",
+            "sex":"woman",
+            "url":"animations/Song01_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"47",
+            "name":"Song01_2",
+            "sex":"woman",
+            "url":"animations/Song01_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"48",
+            "name":"Song01_3",
+            "sex":"woman",
+            "url":"animations/Song01_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"49",
+            "name":"Song02_1",
+            "sex":"woman",
+            "url":"animations/Song02_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"50",
+            "name":"Song02_2",
+            "sex":"woman",
+            "url":"animations/Song02_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"51",
+            "name":"Song02_3",
+            "sex":"woman",
+            "url":"animations/Song02_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"52",
+            "name":"Song03_1",
+            "sex":"woman",
+            "url":"animations/Song03_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"53",
+            "name":"Song03_2",
+            "sex":"woman",
+            "url":"animations/Song03_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"54",
+            "name":"Song03_3",
+            "sex":"woman",
+            "url":"animations/Song03_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"55",
+            "name":"Song04_1",
+            "sex":"woman",
+            "url":"animations/Song04_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"56",
+            "name":"Song04_2",
+            "sex":"woman",
+            "url":"animations/Song04_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"57",
+            "name":"Song04_3",
+            "sex":"woman",
+            "url":"animations/Song04_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"58",
+            "name":"Song05_1",
+            "sex":"woman",
+            "url":"animations/Song05_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"59",
+            "name":"Song05_2",
+            "sex":"woman",
+            "url":"animations/Song05_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"60",
+            "name":"Song05_3",
+            "sex":"woman",
+            "url":"animations/Song05_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"61",
+            "name":"Song06_1",
+            "sex":"woman",
+            "url":"animations/Song06_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"62",
+            "name":"Song06_2",
+            "sex":"woman",
+            "url":"animations/Song06_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"63",
+            "name":"Song06_3",
+            "sex":"woman",
+            "url":"animations/Song06_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"64",
+            "name":"Song07_1",
+            "sex":"woman",
+            "url":"animations/Song07_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"65",
+            "name":"Song07_2",
+            "sex":"woman",
+            "url":"animations/Song07_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"66",
+            "name":"Song07_3",
+            "sex":"woman",
+            "url":"animations/Song07_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"67",
+            "name":"Song08_1",
+            "sex":"woman",
+            "url":"animations/Song08_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"68",
+            "name":"Song08_2",
+            "sex":"woman",
+            "url":"animations/Song08_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"69",
+            "name":"Song08_3",
+            "sex":"woman",
+            "url":"animations/Song08_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"70",
+            "name":"Song09_1",
+            "sex":"woman",
+            "url":"animations/Song09_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"71",
+            "name":"Song09_2",
+            "sex":"woman",
+            "url":"animations/Song09_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"72",
+            "name":"Song09_3",
+            "sex":"woman",
+            "url":"animations/Song09_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"73",
+            "name":"Song10_1",
+            "sex":"woman",
+            "url":"animations/Song10_1.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"74",
+            "name":"Song10_2",
+            "sex":"woman",
+            "url":"animations/Song10_2.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"75",
+            "name":"Song10_3",
+            "sex":"woman",
+            "url":"animations/Song10_3.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"76",
+            "name":"animations_dance",
+            "sex":"woman",
+            "url":"animations/animations_dance.glb"
+        },
+        {
+            "thumbnail": "",
+            "id":"77",
+            "name":"animations_woman",
+            "sex":"woman",
+            "url":"animations/animations_woman.glb"
+        }
+],
+    "textures": []
+}

Різницю між файлами не показано, бо вона завелика
+ 2082 - 1
dist/assets/config.json


+ 16 - 2
dist/index.html

@@ -29,7 +29,7 @@
     <script src="./libs/babylon.inspector.bundle.js"></script>
     <script src="./libs/socket.2.3.js"></script>
     <script src="./libs/events.js"></script>
-    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+    <script src="./libs/axios.min.js"></script>
 
     <!-- <script src="./webrtc//adapter-7.4.0.min.js"></script>
     <script src="./webrtc/srs.sdk.js"></script> -->
@@ -60,8 +60,22 @@
         , NET_INTERVAL = 1;
     const VERSION$1 = "1.0.75"
     , ENV = "production";
+  
+    const COMPONENT_LIST_PREFIX = "./assets/component_list.json";
+    const isFunction = i=>typeof i == "function";
 
-
+    const blobToDataURI = async i=>new Promise((e,t)=>{
+        const r = new FileReader;
+        r.readAsDataURL(i),
+        r.onload = function(n) {
+            var o;
+            e((o = n.target) == null ? void 0 : o.result)
+        }
+        ,
+        r.onerror = function(n) {
+            t(n)
+        }
+    });
 
     var De = Object.defineProperty
     , Ne = Object.defineProperties;

Різницю між файлами не показано, бо вона завелика
+ 847 - 904
dist/js/index.js


Різницю між файлами не показано, бо вона завелика
+ 1 - 1
dist/js/index.js.map


Різницю між файлами не показано, бо вона завелика
+ 93 - 0
dist/libs/axios.js


Різницю між файлами не показано, бо вона завелика
+ 2 - 0
dist/libs/axios.min.js


+ 2 - 2
src/AxiosCanceler.js

@@ -1,6 +1,6 @@
-class AxiosCanceler {
+export default class AxiosCanceler {
     constructor() {
-        E(this, "pendingMap", new Map)
+        this.pendingMap = new Map
     }
     addPending(e) {
         return new axios.CancelToken(t=>{

+ 1 - 0
src/Http.js

@@ -1,6 +1,7 @@
 //const log$b = new Logger("http");
 import {logger} from "./Logger.js"
 import Xverse from "./Xverse.js"
+import {modelTable} from "./ModelTable.js"
 
 class Http extends EventEmitter {
     async get({url: e, useIndexedDb: t=!1, timeout: r=15e3, key: n, isOutPutObjectURL: o=!0}) {

+ 97 - 0
src/Http1.js

@@ -0,0 +1,97 @@
+import {logger} from "./Logger.js"
+import Xverse from "./Xverse.js"
+import {modelTable} from "./ModelTable.js"
+import AxiosCanceler from "./AxiosCanceler"
+
+class Http1 extends EventEmitter {
+    constructor() {
+        super()
+        this.instatnce = axios.create(),
+        this.canceler = new AxiosCanceler
+    }
+
+    requestConstant(){
+        return {
+            x_nounce: this.randomString(),
+            x_timestamp: new Date().getTime(),
+            x_os: "web"
+        }
+    }
+
+    requestParams(e){
+        return oe({}, e.params)
+    }
+
+    get(e) {
+        return this.request(le(oe({}, e), {
+            method: "GET"
+        }))
+    }
+    post(e) {
+        return this.request(le(oe({}, e), {
+            method: "POST"
+        }))
+    }
+    request(e) {
+        const {url: t, timeout: r=1e4, method: n, key: o, beforeRequest: a, responseType: s, data: l} = e;
+        let {retry: u=0} = e;
+        const c = this.patchUrl(t)
+          , h = this.canceler.addPending(t);
+        a && isFunction(a) && a(e);
+        const f = this.requestParams(e);
+        let d = {
+            url: c,
+            method: n,
+            timeout: r,
+            cancelToken: h,
+            responseType: s,
+            params: f
+        };
+        n === "POST" && (d = oe({
+            data: l
+        }, d));
+        const _ = Date.now()
+          , g = ()=>this.instatnce.request(d).then(m=>(o && logger.infoAndReportMeasurement({
+            metric: "http",
+            startTime: _,
+            extra: t,
+            group: "http",
+            tag: o
+        }),
+        this.canceler.removeCancelToken(t),
+        m)).catch(m=>{
+            const v = axios.isCancel(m);
+            return u > 0 && !v ? (u--,
+            logger.warn(`request ${t} retry, left retry count`, u),
+            g()) : (logger.infoAndReportMeasurement({
+                metric: "http",
+                startTime: _,
+                error: m,
+                extra: {
+                    url: t,
+                    isCanceled: v
+                },
+                tag: o,
+                group: "http"
+            }),
+            this.canceler.removeCancelToken(t),
+            Promise.reject(m))
+        }
+        );
+        return g()
+    }
+    patchUrl(e) {
+        return e
+    }
+    randomString() {
+        let e = "";
+        const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
+          , r = t.length;
+        for (let n = 0; n < 8; n++)
+            e += t.charAt(Math.floor(Math.random() * r));
+        return e
+    }
+}
+
+const http1 = new Http1();
+export { http1 };

+ 147 - 0
src/Http2.js

@@ -0,0 +1,147 @@
+import {logger} from "./Logger.js"
+import Xverse from "./Xverse.js"
+import {modelTable} from "./ModelTable.js"
+
+class Http2 extends EventEmitter {
+    async get({url: e, useIndexedDb: t=!1, timeout: r=1e4, key: n}) {
+        if (t)
+            if (isIndexedDbSupported$1()) {
+                const o = window.performance.now();
+                let a = null;
+                try {
+                    a = await modelTable.models.where("name").equals(e).first()
+                } catch {
+                    return logger.warn("unable to query data from indexedDB"),
+                    Promise.resolve(e)
+                }
+                const s = window.performance.now();
+                logger.debug(`search ${e} takes:${s - o}ms`);
+                const l = `${a && a.model ? "found" : "notFound"} data by search ${e} `;
+                if (logger.debug(l),
+                reporter$1.report("measurement", {
+                    metric: "indexedDB",
+                    value: s - o,
+                    extra: l
+                }),
+                a && a.model) {
+                    const u = dataURItoBlob$1(a.model);
+                    return Promise.resolve(URL.createObjectURL(u))
+                } else
+                    return this.request({
+                        url: e,
+                        timeout: r,
+                        contentType: "blob",
+                        key: n
+                    }).then(async u=>{
+                        const c = await blobToDataURI$2(u.response);
+                        try {
+                            modelTable.models.add({
+                                name: e,
+                                model: c
+                            })
+                        } catch {
+                            logger.warn("unable to add data to indexedDB")
+                        }
+                        return Promise.resolve(URL.createObjectURL(u.response))
+                    }
+                    ).catch(u=>Promise.reject(u))
+            } else
+                return this.request({
+                    url: e,
+                    timeout: r,
+                    contentType: "blob",
+                    key: n
+                }).then(o=>{
+                    const a = o.response;
+                    return Promise.resolve(URL.createObjectURL(a))
+                }
+                ).catch(o=>Promise.reject(o));
+        else
+            return this.request({
+                url: e,
+                timeout: 5e3,
+                key: n
+            }).then(o=>o.getResponseHeader("content-type") === "application/json" ? Promise.resolve(JSON.parse(o.responseText)) : Promise.resolve(o.responseText)).catch(o=>{
+                Promise.reject(o)
+            }
+            )
+    }
+    request({url: e, timeout: t=15e3, contentType: r, key: n}) {
+        return new Promise((o,a)=>{
+            const s = window.performance.now()
+              , l = new XMLHttpRequest;
+            r && (l.responseType = r),
+            l.timeout = t,
+            l.addEventListener("readystatechange", ()=>{
+                if (l.readyState == 4)
+                    if (l.status == 200) {
+                        const u = window.performance.now();
+                        return logger.debug(`download ${e} takes:${u - s}ms`),
+                        reporter$1.report("measurement", {
+                            metric: "http",
+                            value: u - s,
+                            extra: e
+                        }),
+                        this.emit("loadend", {
+                            message: `request ${e} load success`
+                        }),
+                        o(l)
+                    } else {
+                        const u = `Unable to load the request ${e}`;
+                        return this.emit("error", {
+                            message: u
+                        }),
+                        logger.error(u),
+                        a(u)
+                    }
+            }
+            ),
+            l.open("GET", e),
+            l.send()
+        }
+        )
+    }
+}
+
+const http2 = new Http2();
+export { http2 };
+
+// const http = new Http
+//   , isIndexedDbSupported = ()=>(window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB) !== void 0
+//   , blobToDataURI = async i=>new Promise((e,t)=>{
+//     const r = new FileReader;
+//     r.readAsDataURL(i),
+//     r.onload = function(n) {
+//         var o;
+//         e((o = n.target) == null ? void 0 : o.result)
+//     }
+//     ,
+//     r.onerror = function(n) {
+//         t(n)
+//     }
+// }
+// )
+//   , dataURItoBlob = i=>{
+//     let e;
+//     i.split(",")[0].indexOf("base64") >= 0 ? e = atob(i.split(",")[1]) : e = unescape(i.split(",")[1]);
+//     const t = i.split(",")[0].split(":")[1].split(";")[0]
+//       , r = new Uint8Array(e.length);
+//     for (let o = 0; o < e.length; o++)
+//         r[o] = e.charCodeAt(o);
+//     return new Blob([r],{
+//         type: t
+//     })
+// }
+//   , urlMap = new Map
+//   , urlTransformer = async(i,e=!1)=>typeof i != "string" ? (console.warn("url transformer error", i),
+// i) : i.startsWith("blob:") ? i : e ? http.get({
+//     url: i,
+//     useIndexedDb: !0,
+//     key: "url",
+//     isOutPutObjectURL: !1
+// }) : urlMap.has(i) ? urlMap.get(i) : http.get({
+//     url: i,
+//     useIndexedDb: !0,
+//     key: "url"
+// }).then(t=>(urlMap.set(i, t),
+// t));

+ 1 - 1
src/Logger.js

@@ -1,4 +1,4 @@
-import Codes from "./Codes.js"
+import Codes from "./enum/Codes.js"
 import {reporter} from "./Reporter.js"
 import util from "./util.js"
 

+ 5 - 4
src/ModelManager.js

@@ -1,7 +1,7 @@
 //const log$f = new Logger("model-manager")
 import {logger} from "./Logger.js"
 import Xverse from "./Xverse.js"
-import {http} from "./Http.js"
+import {http1} from "./Http1.js"
 
 export default class ModelManager{
     constructor(e, t) {
@@ -83,13 +83,14 @@ export default class ModelManager{
         // const t = Xverse.USE_TME_CDN ? "https://static.xverse.cn/tmeland/config/tme_config.json" : e;
         const t = './assets/config.json'
         try {
-            const r = await http.get({
+            const r = await http1.get({
                 url: `${t}?t=${Date.now()}`,
                 key: "config",
                 timeout: 6e3,
                 retry: 2
-            })
-              , {config: n, preload: o} = JSON.parse(r).data || {};
+            });
+
+            const {config: n, preload: o} = r.data.data || {};
             if (!n)
                 throw new Error("config data parse error" + r.data);
             return this.config = {

+ 22 - 20
src/NetworkController.js

@@ -1,4 +1,6 @@
-const log$i = new Logger("NetworkController");
+import Codes from "./enum/Codes.js"
+import {logger} from "./Logger.js"
+
 class NetworkController extends EventEmitter {
     constructor(e) {
         super();
@@ -32,8 +34,8 @@ class NetworkController extends EventEmitter {
         this.rtcp = new Rtcp(this),
         this.stream = new Stream,
         this._networkMonitor = new NetworkMonitor(()=>{
-            log$i.info("network changed, online:", this._networkMonitor.isOnline),
-            this._state === "disconnected" && this._networkMonitor.isOnline && (log$i.info("network back to online, try to reconnect"),
+            logger.info("network changed, online:", this._networkMonitor.isOnline),
+            this._state === "disconnected" && this._networkMonitor.isOnline && (logger.info("network back to online, try to reconnect"),
             this.reconnect())
         }
         ),
@@ -42,11 +44,11 @@ class NetworkController extends EventEmitter {
         new VisibilityChangeHandler().subscribe(r=>{
             var n, o;
             r ? ((o = this.room.stats) == null || o.disable(),
-            log$i.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "pageHide",
                 startTime: Date.now()
             })) : ((n = this.room.stats) == null || n.enable(),
-            log$i.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "pageShow",
                 startTime: Date.now(),
                 extra: {
@@ -69,7 +71,7 @@ class NetworkController extends EventEmitter {
         this.blockedActions.splice(t, 1)
     }
     setState(e) {
-        this._state !== e && (log$i.info("Set network state to ", e),
+        this._state !== e && (logger.info("Set network state to ", e),
         this._state = e)
     }
     async connectAndStart(e) {
@@ -86,15 +88,15 @@ class NetworkController extends EventEmitter {
             }
             ),
             this.rtcp.on("rtcDisconnected", ()=>{
-                log$i.info("rtc disconnected"),
+                logger.info("rtc disconnected"),
                 this._state === "connecting" ? (this.setState("disconnected"),
                 r(new InternalError("rtc connect failed"))) : (this.setState("disconnected"),
-                log$i.info("rtc disconnected, start to reconnect"),
+                logger.info("rtc disconnected, start to reconnect"),
                 this.reconnect())
             }
             ),
             this.socket.on("socketQuit", ()=>{
-                log$i.info("socket quit success"),
+                logger.info("socket quit success"),
                 this.setState("closed")
             }
             ),
@@ -114,32 +116,32 @@ class NetworkController extends EventEmitter {
         const e = Date.now();
         if (this.reconnectCount++,
         this.reconnectCount > MAX_RECONNECT_COUNT) {
-            log$i.error("reconnect failed, reached max reconnect count", MAX_RECONNECT_COUNT),
+            logger.error("reconnect failed, reached max reconnect count", MAX_RECONNECT_COUNT),
             this.reconnectCount = 0,
             this.emit("stateChanged", {
                 state: "disconnected"
             });
             return
         }
-        return log$i.info("start reconnect, count:", this.reconnectCount),
+        return logger.info("start reconnect, count:", this.reconnectCount),
         this._reconnect().then(()=>{
-            log$i.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 startTime: e,
                 metric: "reconnect"
             })
         }
         ).catch(t=>{
-            if (log$i.infoAndReportMeasurement({
+            if (logger.infoAndReportMeasurement({
                 startTime: e,
                 metric: "reconnect",
                 error: t
             }),
-            t.code === Codes$1.RepeatLogin) {
+            t.code === Codes.RepeatLogin) {
                 this.room.handleRepetLogin();
                 return
             }
             const r = 1e3;
-            log$i.info("reconnect failed, wait " + r + " ms for next reconnect"),
+            logger.info("reconnect failed, wait " + r + " ms for next reconnect"),
             setTimeout(()=>{
                 this.reconnect()
             }
@@ -148,8 +150,8 @@ class NetworkController extends EventEmitter {
         )
     }
     _reconnect() {
-        return this._state === "closed" ? (log$i.warn("connection closed already"),
-        Promise.reject()) : this._state === "connecting" ? (log$i.warn("connection is already in connecting state"),
+        return this._state === "closed" ? (logger.warn("connection closed already"),
+        Promise.reject()) : this._state === "connecting" ? (logger.warn("connection is already in connecting state"),
         Promise.reject()) : this._state !== "disconnected" ? Promise.reject() : (this.prepareReconnect(),
         this._state = "connecting",
         this.emit("stateChanged", {
@@ -167,7 +169,7 @@ class NetworkController extends EventEmitter {
             reporter.updateBody({
                 serverSession: e
             }),
-            log$i.info("reconnect success"),
+            logger.info("reconnect success"),
             this.setState("connected"),
             this.reconnectCount = 0,
             this.emit("stateChanged", {
@@ -190,13 +192,13 @@ class NetworkController extends EventEmitter {
     }
     sendRtcData(e) {
         if (this.blockedActions.includes(e.action_type)) {
-            log$i.info(`action: ${Actions[e.action_type]} was blocked`);
+            logger.info(`action: ${Actions[e.action_type]} was blocked`);
             return
         }
         this.rtcp.sendData(e)
     }
     sendSocketData(e) {
-        log$i.debug("ws send ->", e),
+        logger.debug("ws send ->", e),
         this.socket.send(e)
     }
     quit() {

+ 6 - 4
src/Panorama.js

@@ -1,9 +1,11 @@
-const log$5 = new Logger("panorama");
+import Codes from "./enum/Codes.js"
+import {logger} from "./Logger.js"
+
 class Panorama {
     constructor(e) {
         E(this, "_actived", !1);
         E(this, "handleReceivePanorama", async(e,t)=>{
-            log$5.warn("handle panorama", e.uuid, e.pos, e.finished);
+            logger.warn("handle panorama", e.uuid, e.pos, e.finished);
             const r = {
                 data: e.data,
                 pose: {
@@ -41,8 +43,8 @@ class Panorama {
     }
     bindListener(e) {
         this.room.networkController.rtcp.workers.registerFunction("panorama", r=>{
-            log$5.warn("receive panorama", r.uuid, r.pos),
-            r.uuid && eventsManager.remove(r.uuid, Codes$1.Success, r, !0),
+            logger.warn("receive panorama", r.uuid, r.pos),
+            r.uuid && eventsManager.remove(r.uuid, Codes.Success, r, !0),
             this.room.isFirstDataUsed || (this.room.isFirstDataUsed = !0,
             this.handleReceivePanorama(r, this.room.options.camera).then(e))
         }

+ 12 - 12
src/Preload.js

@@ -3,7 +3,7 @@ import {logger} from "./Logger.js"
 import {reporter} from "./Reporter.js"
 import {modelTable} from "./ModelTable.js"
 import util from "./util.js"
-import {http} from "./Http.js"
+import {http1} from "./Http1.js"
 
 export default class Preload {
     constructor(e) {
@@ -60,7 +60,7 @@ export default class Preload {
         this.requests[e].stopped = !0;
         const t = this.requests[e].requests;
         Object.keys(t).forEach(r=>{
-            http.canceler.removePending(r),
+            http1.canceler.removePending(r),
             delete t[r]
         }
         )
@@ -77,8 +77,8 @@ export default class Preload {
             !this.requests[e])
                 return Promise.reject(new ParamError("invalid stage name: " + e));
             this.clearPreload(e);
-            const a = await this.getConfig(e)
-              , s = await this.getAllKeys();
+            const a = await this.getConfig(e);
+            const s = await this.getAllKeys();
             try {
                 await this.deleteOldResources(a.assetUrls.map(d=>d.url), s)
             } catch (d) {
@@ -100,12 +100,12 @@ export default class Preload {
                 h = u
             }
             let f = h.filter(d=>!s.includes(d.url));
-            r && isFunction(r) && (f = f.filter(r)),
-            o = f.length,
-            logger.debug("keysNeedToPreload", f),
-            f.length || t && t(h.length, h.length),
-            n = Date.now(),
-            await this._preload(e, f, t),
+            r && isFunction(r) && (f = f.filter(r));
+            o = f.length;
+            logger.debug("keysNeedToPreload", f);
+            f.length || t && t(h.length, h.length);
+            n = Date.now();
+            await this._preload(e, f, t);
             logger.infoAndReportMeasurement({
                 tag: e,
                 startTime: n,
@@ -155,7 +155,7 @@ export default class Preload {
         , 1e3);
         return util.mapLimit(t, 10, async s=>{
             const {size: l, url: u} = s;
-            return this.requests[e].stopped ? Promise.reject(new PreloadCanceledError) : http.get({
+            return this.requests[e].stopped ? Promise.reject(new PreloadCanceledError) : http1.get({
                 url: u,
                 timeout: Preload.getTimeoutBySize(l),
                 responseType: "blob",
@@ -168,7 +168,7 @@ export default class Preload {
                 if (!(h instanceof Blob))
                     return logger.error("request blob failed, type:", typeof h, u),
                     Promise.reject("request blob failed " + u);
-                const f = await blobToDataURI$1(h);
+                const f = await blobToDataURI(h);
                 try {
                     await modelTable.put({
                         url: u,

+ 11 - 8
src/Signal.js

@@ -1,4 +1,7 @@
-const log$4 = new Logger("xverse-signal");
+//const log$4 = new Logger("xverse-signal");
+import Codes from "./enum/Codes.js"
+import {logger} from "./Logger.js"
+
 class Signal {
     constructor(e) {
         E(this, "_room");
@@ -16,7 +19,7 @@ class Signal {
         !r) {
             const u = (a = t.newUserStates) == null ? void 0 : a.find(c=>c.userId === this._room.userId);
             if ((u == null ? void 0 : u.renderInfo) && ((s = this._room._userAvatar) == null ? void 0 : s.isMoving)) {
-                log$4.debug("stream stoped, make avatar to stop");
+                logger.debug("stream stoped, make avatar to stop");
                 const {isMoving: c, isRotating: h} = u.renderInfo;
                 this._room.avatarManager._updateAvatarMovingStatus({
                     id: u.userId,
@@ -29,14 +32,14 @@ class Signal {
         this.isUpdatedYUV = r;
         const n = t;
         if (!t) {
-            log$4.warn("metadata signal is empty");
+            logger.warn("metadata signal is empty");
             return
         }
-        if (n.code === Codes$1.RepeatLogin) {
+        if (n.code === Codes.RepeatLogin) {
             this._room.handleRepetLogin();
             return
         }
-        n.code !== void 0 && n.code !== Codes$1.Success && n.code !== Codes$1.ActionMaybeDelay && n.code !== Codes$1.DoActionBlocked && n.code !== Codes$1.GetOnVehicle && (log$4.error("signal errcode: ", n),
+        n.code !== void 0 && n.code !== Codes.Success && n.code !== Codes.ActionMaybeDelay && n.code !== Codes.DoActionBlocked && n.code !== Codes.GetOnVehicle && (logger.error("signal errcode: ", n),
         this._room.emit("error", n));
         const o = (l = n.newUserStates) == null ? void 0 : l.find(u=>u.userId === this._room.userId);
         if (n.broadcastAction)
@@ -44,7 +47,7 @@ class Signal {
                 const u = JSON.parse(n.broadcastAction.data);
                 Broadcast.handlers.forEach(c=>c(u))
             } catch (u) {
-                log$4.error(u)
+                logger.error(u)
             }
         if (n.newUserStates && n.newUserStates.length > 0 && this._room.avatarManager.handleAvatar(n),
         o != null && o.playerState) {
@@ -73,8 +76,8 @@ class Signal {
         if (o != null && o.renderInfo && this._room.camera.handleRenderInfo(o),
         n.actionType !== void 0) {
             const {actionType: u, code: c, echoMsg: h, traceId: f} = n;
-            u === Actions.Echo && c === Codes$1.Success && this._room.networkController.rtcp.heartbeat.pong(h, f),
-            c !== Codes$1.Success ? eventsManager.remove(f, c) : [Actions.GetReserveStatus, Actions.Broadcast, Actions.ChangeNickname, Actions.ConfirmEvent, Actions.ReserveSeat, Actions.Rotation, Actions.TurnTo, Actions.RotateTo, Actions.SetPlayerState, Actions.GetNeighborPoints, Actions.TurnToFace, Actions.AudienceChangeToVisitor, Actions.RemoveVisitor, Actions.GetUserWithAvatar].includes(u) && eventsManager.remove(f, c, n)
+            u === Actions.Echo && c === Codes.Success && this._room.networkController.rtcp.heartbeat.pong(h, f),
+            c !== Codes.Success ? eventsManager.remove(f, c) : [Actions.GetReserveStatus, Actions.Broadcast, Actions.ChangeNickname, Actions.ConfirmEvent, Actions.ReserveSeat, Actions.Rotation, Actions.TurnTo, Actions.RotateTo, Actions.SetPlayerState, Actions.GetNeighborPoints, Actions.TurnToFace, Actions.AudienceChangeToVisitor, Actions.RemoveVisitor, Actions.GetUserWithAvatar].includes(u) && eventsManager.remove(f, c, n)
         }
     }
     handleActionResponses(e) {

+ 0 - 1
src/XverseDatabase.js

@@ -1,7 +1,6 @@
 class XverseDatabase extends Dexie$1 {
     constructor() {
         super("XverseDatabase1");
-        E(this, "models");
         this.version(1).stores({
             models: "++id,name"
         }),

+ 3 - 2
src/XverseError.js

@@ -1,4 +1,5 @@
-const COMPONENT_LIST_PREFIX = "/component_list.json";
+import Codes from "./enum/Codes.js"
+
 class XverseError extends Error {
     constructor(e, t) {
         super(t);
@@ -35,7 +36,7 @@ class AvatarAnimationError extends XverseError$1 {
 }
 class TimeoutError$1 extends XverseError$1 {
     constructor(e) {
-        super(Codes$2.Timeout, e || "[Engine] \u8D85\u65F6\u9519\u8BEF")
+        super(Codes.Timeout, e || "[Engine] \u8D85\u65F6\u9519\u8BEF")
     }
 }
 class DuplicateAvatarIDError extends XverseError$1 {

+ 34 - 31
src/XverseRoom.js

@@ -1,3 +1,6 @@
+import Codes from "./enum/Codes.js"
+import {logger} from "./Logger.js"
+
 class XverseRoom extends XverseRoom$1 {
     constructor() {
         super(...arguments);
@@ -8,7 +11,7 @@ class XverseRoom extends XverseRoom$1 {
     }
 }
 
-const log$3 = new Logger("xverse-room");
+//const log$3 = new Logger("xverse-room");
 class XverseRoom$1 extends EventEmitter {
     constructor(e) {
         super();
@@ -48,12 +51,12 @@ class XverseRoom$1 extends EventEmitter {
         E(this, "signal", new Signal(this));
         E(this, "firstFrameTimestamp");
         E(this, "receiveRtcData", async()=>{
-            log$3.info("Invoke receiveRtcData");
+            logger.info("Invoke receiveRtcData");
             let e = !1
               , t = !1
               , r = !1
               , n = !1;
-            return this.viewMode === "serverless" ? (log$3.warn("set view mode to serverless"),
+            return this.viewMode === "serverless" ? (logger.warn("set view mode to serverless"),
             this.setViewMode("observer").then(()=>this, ()=>this)) : new Promise(o=>{
                 const a = this.networkController.rtcp.workers;
                 a.registerFunction("signal", s=>{
@@ -66,21 +69,21 @@ class XverseRoom$1 extends EventEmitter {
                         timestamp: Date.now()
                     }),
                     t || (t = !0,
-                    log$3.info("Invoke stream event")),
+                    logger.info("Invoke stream event")),
                     s.stream) {
                         r || (r = !0,
-                        log$3.info("Invoke updateRawYUVData")),
+                        logger.info("Invoke updateRawYUVData")),
                         this.isUpdatedRawYUVData = !1;
                         const u = (l = this._currentState.skin) == null ? void 0 : l.fov;
                         this.sceneManager.materialComponent.updateRawYUVData(s.stream, s.width, s.height, u),
                         this.isUpdatedRawYUVData = !0
                     }
-                    e || (log$3.info("Invoke isAfterRenderRegistered"),
+                    e || (logger.info("Invoke isAfterRenderRegistered"),
                     e = !0,
                     this.scene.registerAfterRender(()=>{
                         this.engineProxy.frameRenderNumber >= 2 && (n || (n = !0,
-                        log$3.info("Invoke registerAfterRender")),
-                        this.isFirstDataUsed || (log$3.info("Invoke isStreamAvailable"),
+                        logger.info("Invoke registerAfterRender")),
+                        this.isFirstDataUsed || (logger.info("Invoke isStreamAvailable"),
                         this.isFirstDataUsed = !0,
                         this.firstFrameTimestamp = Date.now(),
                         o(this),
@@ -96,7 +99,7 @@ class XverseRoom$1 extends EventEmitter {
                 ),
                 a.registerFunction("reconnectedFrame", ()=>{}
                 ),
-                log$3.info("Invoke decoderWorker.postMessage"),
+                logger.info("Invoke decoderWorker.postMessage"),
                 a.decoderWorker.postMessage({
                     t: 5
                 })
@@ -112,7 +115,7 @@ class XverseRoom$1 extends EventEmitter {
         const n = e
           , {canvas: t} = n
           , r = Oe(n, ["canvas"]);
-        log$3.infoAndReportMeasurement({
+        logger.infoAndReportMeasurement({
             metric: "startJoinRoomAt",
             startTime: Date.now(),
             group: "joinRoom",
@@ -195,7 +198,7 @@ class XverseRoom$1 extends EventEmitter {
     async _initRoom() {
         const e = this.validateOptions(this.options);
         if (e)
-            return log$3.error("initRoom param error", e),
+            return logger.error("initRoom param error", e),
             Promise.reject(e);
         const {canvas: t, avatarId: r, skinId: n, userId: o, wsServerUrl: a, role: s, token: l, pageSession: u, rotationRenderType: c, isAllSync: h=!1, appId: f, camera: d, player: _, avatarComponents: g, nickname: m, avatarScale: v, firends: y=[], syncByEvent: b=!1, areaName: T, attitude: C=MotionType.Walk, pathName: A, viewMode: S="full", person: P, roomId: R, roomTypeId: M, hasAvatar: x=!1, syncToOthers: I=!1, prioritySync: w=!1, removeWhenDisconnected: O=!0, extra: D} = this.options;
         this.setCurrentNetworkOptions({
@@ -243,7 +246,7 @@ class XverseRoom$1 extends EventEmitter {
         });
         try {
             await Promise.all([this.initNetwork(), this.initConfig(), this.initWasm()]),
-            log$3.info("network config wasm all ready, start to create game");
+            logger.info("network config wasm all ready, start to create game");
             const F = await this.requestCreateRoom({
                 skinId: n
             })
@@ -272,7 +275,7 @@ class XverseRoom$1 extends EventEmitter {
     afterJoinRoom() {
         this.joined = !0,
         this.viewMode === "observer" && this.setViewModeToObserver(),
-        log$3.infoAndReportMeasurement({
+        logger.infoAndReportMeasurement({
             tag: this.viewMode,
             value: this.firstFrameTimestamp - this._startTime,
             startTime: Date.now(),
@@ -292,7 +295,7 @@ class XverseRoom$1 extends EventEmitter {
     }
     leave() {
         var e, t;
-        return log$3.info("Invoke room.leave"),
+        return logger.info("Invoke room.leave"),
         (e = this.eventsController) == null || e.clearEvents(),
         (t = this.networkController) == null || t.quit(),
         this
@@ -313,18 +316,18 @@ class XverseRoom$1 extends EventEmitter {
         const e = Date.now();
         try {
             await this.networkController.connect()._timeout(8e3, new InitNetworkTimeoutError),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "networkInitAt",
                 startTime: this._startTime,
                 group: "joinRoom"
             }),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "networkInitCost",
                 startTime: e,
                 group: "joinRoom"
             })
         } catch (t) {
-            throw log$3.infoAndReportMeasurement({
+            throw logger.infoAndReportMeasurement({
                 metric: "networkInitAt",
                 startTime: e,
                 group: "joinRoom",
@@ -337,18 +340,18 @@ class XverseRoom$1 extends EventEmitter {
         const e = Date.now();
         try {
             await this.modelManager.getApplicationConfig()._timeout(8e3, new InitConfigTimeoutError),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "configInitAt",
                 startTime: this._startTime,
                 group: "joinRoom"
             }),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "configInitCost",
                 startTime: e,
                 group: "joinRoom"
             })
         } catch (t) {
-            throw log$3.infoAndReportMeasurement({
+            throw logger.infoAndReportMeasurement({
                 metric: "configInitAt",
                 startTime: e,
                 group: "joinRoom",
@@ -362,12 +365,12 @@ class XverseRoom$1 extends EventEmitter {
         try {
             this.engineProxy = new EngineProxy(this),
             await this.engineProxy.initEngine(e),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "webglInitAt",
                 startTime: this._startTime,
                 group: "joinRoom"
             }),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "webglInitCost",
                 startTime: t,
                 group: "joinRoom"
@@ -375,9 +378,9 @@ class XverseRoom$1 extends EventEmitter {
             return
         } catch (r) {
             let n = r;
-            return r.code !== Codes$1.InitEngineTimeout && (n = new InitEngineError),
-            log$3.error(r),
-            log$3.infoAndReportMeasurement({
+            return r.code !== Codes.InitEngineTimeout && (n = new InitEngineError),
+            logger.error(r),
+            logger.infoAndReportMeasurement({
                 metric: "webglInitAt",
                 startTime: t,
                 group: "joinRoom",
@@ -393,7 +396,7 @@ class XverseRoom$1 extends EventEmitter {
         try {
             await this.networkController.rtcp.workers.init(this.options.resolution)._timeout(8e3, new InitDecoderTimeoutError),
             this.networkController.rtcp.workers.registerFunction("error", t=>{
-                log$3.error("decode error", t);
+                logger.error("decode error", t);
                 const {code: r, message: n} = t;
                 this.emit("error", {
                     code: r,
@@ -401,12 +404,12 @@ class XverseRoom$1 extends EventEmitter {
                 })
             }
             ),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "wasmInitAt",
                 group: "joinRoom",
                 startTime: this._startTime
             }),
-            log$3.infoAndReportMeasurement({
+            logger.infoAndReportMeasurement({
                 metric: "wasmInitCost",
                 group: "joinRoom",
                 startTime: e
@@ -416,7 +419,7 @@ class XverseRoom$1 extends EventEmitter {
             }
             )
         } catch (t) {
-            throw log$3.infoAndReportMeasurement({
+            throw logger.infoAndReportMeasurement({
                 metric: "wasmInitAt",
                 group: "joinRoom",
                 startTime: e,
@@ -464,7 +467,7 @@ class XverseRoom$1 extends EventEmitter {
             }),
             s
         } catch (r) {
-            throw log$3.error("Request create room error", r),
+            throw logger.error("Request create room error", r),
             r
         }
     }
@@ -479,7 +482,7 @@ class XverseRoom$1 extends EventEmitter {
     }
     async setViewMode(e) {}
     handleRepetLogin() {
-        log$3.warn("receive " + Codes$1.RepeatLogin + " for repeat login"),
+        logger.warn("receive " + Codes.RepeatLogin + " for repeat login"),
         this.emit("repeatLogin"),
         reporter.disable(),
         this.networkController.quit()

+ 6 - 0
src/enum/ChangeMode.js

@@ -0,0 +1,6 @@
+var ChangeMode = {
+    Preview:0,
+    Confirm:1,
+    Cancel:2
+}
+export default ChangeMode

+ 7 - 0
src/enum/ClickType.js

@@ -0,0 +1,7 @@
+var ClickType = {
+    Screen:0,
+    ThreeDimension:1,
+    ThreeDimensionQuick:2,
+    IgnoreView:3
+}
+export default ClickType

src/Codes.js → src/enum/Codes.js


+ 6 - 0
src/enum/LandingType.js

@@ -0,0 +1,6 @@
+var LandingType = {
+    Stay:0,
+    InitPoint:1,
+    NewPoint:2
+}
+export default LandingType

+ 5 - 0
src/enum/Person.js

@@ -0,0 +1,5 @@
+var Person = {
+    Third:0,
+    First:1
+}
+export default Person

+ 7 - 0
src/enum/PointType.js

@@ -0,0 +1,7 @@
+var PointType = {
+    Path:0,
+    Item:1,
+    Closeup:2,
+    NoValidMatched:3
+}
+export default PointType

+ 10 - 0
src/enum/RenderType.js

@@ -0,0 +1,10 @@
+var RenderType = {
+    PathVideo:0,
+    RotationVideo:1,
+    RotationImage:2,
+    PanoramaImage:3,
+    CGVideo:4,
+    ClientRotationPano:5,
+    CloudRotationPano:6
+}
+export default RenderType

+ 2 - 2
src/main.js

@@ -1,5 +1,5 @@
 import Xverse from "./Xverse.js"
-import Codes from "./Codes.js"
+import Codes from "./enum/Codes.js"
 
 const xverse = new Xverse({
     env: "DEV",
@@ -13,7 +13,7 @@ const l = async()=>{
     try {
         await ((R = xverse.preload) == null ? void 0 : R.start('full', (M,x)=>{
             const I = `(${M}/${x})`;
-            s(I)
+            //s(I)
         }
         ))
     } catch (M) {