Launcher.js 41.6 KB

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/script/game/Launcher.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'f191b3NyXtCubDaTGld/tHG', 'Launcher');
// script/game/Launcher.ts

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const simba_sdk_1 = require("simba-sdk");
const AVG_1 = require("../avg/AVG");
const CCDummyObjects_1 = require("../common/CCDummyObjects");
const simba_cc_audio_manager_1 = require("simba-cc-audio-manager");
const UIManager_1 = require("../common/gameplay/managers/UIManager");
const AnimationUtils_1 = require("../common/utils/AnimationUtils");
const GameConfig_1 = require("../GameConfig");
const GameModelManager_1 = require("./model/GameModelManager");
const AlertDialogViewPresenter_1 = require("./ui/presenter/AlertDialogViewPresenter");
const MainViewPresenter_1 = require("./ui/presenter/MainViewPresenter");
const simba_cc_resutils_1 = require("simba-cc-resutils");
const CustomerServiceDataCenter_1 = require("../customerService/script/CustomerServiceDataCenter");
const UnlockSpecialPlotEventManager_1 = require("./model/UnlockSpecialPlotEventManager");
const simba_sdk_exchangecode_1 = require("simba-sdk-exchangecode");
const EventKit_1 = require("../event/EventKit");
const EventCenter_1 = require("../event/EventCenter");
const { ccclass, property } = cc._decorator;
let Launcher = /** @class */ (() => {
    let Launcher = class Launcher extends cc.Component {
        constructor() {
            super(...arguments);
            this.progressBar = CCDummyObjects_1.DummyProgressBar;
            this.progressLabel = CCDummyObjects_1.DummyLabel;
            this.uiRootNode = CCDummyObjects_1.DummyNode;
            this.toastParentNode = CCDummyObjects_1.DummyNode;
            this.loadingNode = CCDummyObjects_1.DummyNode;
            this.loadingRoleNode = CCDummyObjects_1.DummyNode;
            this.VerbRoot = CCDummyObjects_1.DummyNode;
            this.isLoadGameCenter = false;
            this.userIdLabel = CCDummyObjects_1.DummyLabel;
            this.hotUpdateNode = CCDummyObjects_1.DummyNode;
            this.bgSpr = CCDummyObjects_1.DummySprite;
            this.loginCount = 0;
            this._gameCenterViewNode = CCDummyObjects_1.DummyNode;
            this._disposable = new EventKit_1.CompositeDisposable;
            /**控制游戏列表是否展示 */
            this.onShowGameCenterListView = (isShow) => {
                if (!this._gameCenterViewNode) {
                    return;
                }
                this._gameCenterViewNode.active = isShow;
            };
            this.onGameStart = () => {
                this.initializeGame();
            };
            this.lateInit = async () => {
                let mainViewPromise = UIManager_1.UIManager.pushPresenter(MainViewPresenter_1.default, undefined);
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.6, 1, this.progressLabel);
                if (CC_DEV) {
                    globalThis['PlotManager'] = AVG_1.PlotManager;
                    globalThis['GameRecord'] = AVG_1.GameRecord;
                    let ConfigManager = require('simba-config-manager');
                    globalThis['ConfigManager'] = ConfigManager;
                }
                await AVG_1.initAVG();
                //解决清档
                await this.dealEmptyRecord();
                if (GameConfig_1.GameConfig.EMPTY_RECORD_WHEN_LOGIN) {
                    AVG_1.PlotManager.stop();
                    await AVG_1.GameRecord.emptyRecords();
                }
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.8, 1, this.progressLabel);
                await AVG_1.PlotManager.start(0, false);
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.9, 1, this.progressLabel);
                await simba_sdk_exchangecode_1.initExchangeCode();
                // init game data
                await GameModelManager_1.GameModelManager.init((value) => {
                    AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, value, 1, this.progressLabel);
                });
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.95, 1, this.progressLabel);
                (await mainViewPromise).start();
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 1.0, 1, this.progressLabel);
                this.loadingNode.active = false;
                //检查是否解锁手表次留番外
                UnlockSpecialPlotEventManager_1.default.getInstance().nextDayUnlockedSpecialPlot(4);
            };
            this.loginGame = async () => {
                return new Promise(async (resolve, reject) => {
                    this.loginCount++;
                    try {
                        let ret = await simba_sdk_1.SDK.login();
                        if (ret) {
                            this.userIdLabel.string = ret.playerId;
                            await this.lateInit();
                            resolve();
                        }
                    }
                    catch (error) {
                        if (this.loginCount > 3) {
                            this.showLoginFailed();
                            reject(new Error("登录失败"));
                        }
                        else if (error == "timeout") {
                            this.loginGame();
                        }
                    }
                });
            };
        }
        async onLoad() {
            this.screenAdapter();
            if (cc.sys.isNative) {
                this._disposable.add(EventCenter_1.EventCenter.GameStart.on(this.onGameStart));
                let hotNode = await simba_cc_resutils_1.ResUtils.createWithPrefab('prefab/HotUpdate');
                hotNode.parent = this.hotUpdateNode;
            }
            this.scheduleOnce(() => {
                this.preloadView();
                this.preloadDir();
            });
            //关闭fps展示
            cc.debug.setDisplayStats(GameConfig_1.GameConfig.showFPS);
            /**关闭多点触摸 特效层将不能使用 */
            cc.macro.ENABLE_MULTI_TOUCH = false;
            this.fixScreenSize();
            this.scheduleOnce(async () => {
                try {
                    let node = await simba_cc_resutils_1.ResUtils.createWithPrefab('prefab/ui/VerbView');
                    node.parent = this.VerbRoot;
                }
                catch (error) {
                    console.error(error);
                }
            });
            CustomerServiceDataCenter_1.default.getInstance().init();
            simba_cc_resutils_1.ResUtils.loadRes("audio/bgm/bayinhe", cc.AudioClip);
            simba_cc_resutils_1.ResUtils.loadRes("audio/bgm/wanshengj", cc.AudioClip);
        }
        /**创建prefab对应的节点 */
        createNode(gameCenterViewPrefab) {
            if (!gameCenterViewPrefab) {
                cc.error("gameCenterViewPrefab is not set , please check it over");
            }
            else {
                this._gameCenterViewNode = cc.instantiate(gameCenterViewPrefab);
            }
            let parentNode = cc.director.getScene();
            this._gameCenterViewNode.parent = parentNode;
            this._gameCenterViewNode.position = cc.v3(cc.winSize.width / 2, cc.winSize.height / 2, 0);
        }
        fixScreenSize() {
            let sf = this.bgSpr.spriteFrame;
            this.node.getComponent(cc.Widget).updateAlignment();
            let sizeSF = sf.getOriginalSize();
            let nodeSize = cc.size(this.node.width, this.node.height);
            let scaleTemp = 1;
            let scaleX = nodeSize.width / sizeSF.width;
            let scaleY = nodeSize.height / sizeSF.height;
            scaleTemp = Math.max(scaleX, scaleY);
            this.bgSpr.node.scale = scaleTemp;
        }
        preloadView() {
            let viewList = [
                'prefab/ui/MainView',
                'prefab/ui/MessageView',
                'prefab/ui/message/MessageEntryItem'
            ];
            cc.resources.preload(viewList, (error, items) => {
            });
        }
        preloadDir() {
            cc.resources.preloadDir('plots'); //剧情数据
            cc.resources.preloadDir('userdata/language'); //语言配置
            cc.resources.preloadDir('config'); //剧情配置
            // cc.resources.preloadDir('textures/items');
        }
        screenAdapter() {
            let winSize = cc.winSize;
            if (winSize.width / winSize.height > 720 / 1280) {
                let canvas = this.node.getComponent(cc.Canvas);
                canvas.fitWidth = true;
                canvas.fitHeight = true;
            }
        }
        start() {
            if (!cc.sys.isNative)
                this.initializeGame();
        }
        async initializeGame() {
            simba_cc_audio_manager_1.AudioManager.init("audio/bgm/", "audio/effect/", "audio/voice/");
            while (true) {
                try {
                    await UIManager_1.UIManager.init(this.uiRootNode, this.toastParentNode);
                    break;
                }
                catch (e) {
                    console.error(e);
                }
            }
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.2);
            let ret = false;
            let tryCount = 0;
            while (!ret && tryCount < 3) {
                tryCount++;
                ret = await simba_sdk_1.SDK.init();
                // initExchangeCode();
            }
            if (!ret) {
                UIManager_1.UIManager.showToast("SDK init failed. sdk初始化失败");
                return;
            }
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.4, 1, this.progressLabel);
            await this.loginGame();
        }
        showLoginFailed() {
            let temp = {
                dataptr: {},
                titlecontent: "网络错误",
                content: "是否重新连接?",
                ishasad: false,
                istwobtn: true,
                adconfig: "",
                hasBanner: false,
                callback: (type, ret) => {
                    if (ret) {
                        this.loginCount = 0;
                        this.loginGame();
                    }
                    else {
                        cc.director.end();
                    }
                }
            };
            UIManager_1.UIManager.pushPresenter(AlertDialogViewPresenter_1.default, temp);
        }
        async dealEmptyRecord() {
            /**此次执行清档操作的版本号 */
            let optionV = "1.0.2";
            /**需要清档的玩家注册版本号列表 */
            let needEmptyRegVersionArr = ["1.0.0", "1.0.1"];
            let emptyVersionRecordKey = "empty_record_versions";
            let needEmpty = this.checkIsNeedEmptyRecord(optionV, emptyVersionRecordKey, needEmptyRegVersionArr);
            console.log("是否需要清档操作:", needEmpty);
            if (needEmpty) {
                await AVG_1.GameRecord.emptyRecords();
                AVG_1.GameRecord.globalVariables[emptyVersionRecordKey] = optionV;
                AVG_1.GameRecord.saveRecord();
            }
        }
        checkIsNeedEmptyRecord(optionV, emptyVersionRecordKey, needEmptyRegVersionArr) {
            let empty = false;
            let regV = AVG_1.GameRecord.globalVariables["register_version"];
            //不存在或者当前注册版本不在需要清档的版本内容中,则直接返回不需要清档
            if (!regV || needEmptyRegVersionArr.findIndex((v) => v == regV) === (-1)) {
                return false;
            }
            let emptyRecordVersionString = AVG_1.GameRecord.globalVariables[emptyVersionRecordKey];
            if (!emptyRecordVersionString || "" === emptyRecordVersionString.trim()) {
                return true;
            }
            empty = emptyRecordVersionString != optionV;
            return empty;
        }
    };
    __decorate([
        property({ type: cc.ProgressBar, displayName: "进度条" })
    ], Launcher.prototype, "progressBar", void 0);
    __decorate([
        property({ type: cc.Label, displayName: "进度展示文本" })
    ], Launcher.prototype, "progressLabel", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "UI根结点" })
    ], Launcher.prototype, "uiRootNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "场景最上层弱提示根结点" })
    ], Launcher.prototype, "toastParentNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "加载界面节点" })
    ], Launcher.prototype, "loadingNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "加载界面人物图" })
    ], Launcher.prototype, "loadingRoleNode", void 0);
    __decorate([
        property({ type: cc.Node })
    ], Launcher.prototype, "VerbRoot", void 0);
    __decorate([
        property({ tooltip: "是否加载导量UI" })
    ], Launcher.prototype, "isLoadGameCenter", void 0);
    __decorate([
        property({ type: cc.Label, displayName: "玩家ID文本" })
    ], Launcher.prototype, "userIdLabel", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "热更节点" })
    ], Launcher.prototype, "hotUpdateNode", void 0);
    __decorate([
        property(cc.Sprite)
    ], Launcher.prototype, "bgSpr", void 0);
    Launcher = __decorate([
        ccclass
    ], Launcher);
    return Launcher;
})();
exports.default = Launcher;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvZ2FtZS9MYXVuY2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlDQUFnQztBQUNoQyxvQ0FBOEQ7QUFDOUQsNkRBQWdHO0FBQ2hHLG1FQUFzRDtBQUN0RCxxRUFBa0U7QUFDbEUsbUVBQWdFO0FBQ2hFLDhDQUEyQztBQUMzQywrREFBNEQ7QUFDNUQsc0ZBQStFO0FBQy9FLHdFQUFpRTtBQUVqR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ICAgIH1cblxuICAgICAgICB0aGlzLnNjaGVkdWxlT25jZSgoKSA9PiB7XG4gICAgICAgICAgICB0aGlzLnByZWxvYWRWaWV3KCk7XG4gICAgICAgICAgICB0aGlzLnByZWxvYWREaXIoKTtcbiAgICAgICAgfSk7XG4gICAgICAgIC8v5YWz6ZetZnBz5bGV56S6XG4gICAgICAgIGNjLmRlYnVnLnNldERpc3BsYXlTdGF0cyhHYW1lQ29uZmlnLnNob3dGUFMpO1xuICAgICAgICAvKirlhbPpl63lpJrngrnop6bmkbgg54m55pWI5bGC5bCG5LiN6IO95L2/55SoICovXG4gICAgICAgIGNjLm1hY3JvLkVOQUJMRV9NVUxUSV9UT1VDSCA9IGZhbHNlO1xuICAgICAgICB0aGlzLmZpeFNjcmVlblNpemUoKTtcbiAgICAgICAgdGhpcy5zY2hlZHVsZU9uY2UoYXN5bmMgKCkgPT4ge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBsZXQgbm9kZSA9IGF3YWl0IFJlc1V0aWxzLmNyZWF0ZVdpdGhQcmVmYWIoJ3ByZWZhYi91aS9WZXJiVmlldycpO1xuICAgICAgICAgICAgICAgIG5vZGUucGFyZW50ID0gdGhpcy5WZXJiUm9vdDtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlcnJvcik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBDdXN0b21lclNlcnZpY2VEYXRhQ2VudGVyLmdldEluc3RhbmNlKCkuaW5pdCgpO1xuICAgICAgICBSZXNVdGlscy5sb2FkUmVzKFwiYXVkaW8vYmdtL2JheWluaGVcIiwgY2MuQXVkaW9DbGlwKTtcbiAgICAgICAgUmVzVXRpbHMubG9hZFJlcyhcImF1ZGlvL2JnbS93YW5zaGVuZ2pcIiwgY2MuQXVkaW9DbGlwKTtcbiAgICB9XG5cbiAgICAvKirliJvlu7pwcmVmYWLlr7n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zLnByb2dyZXNzQmFyLCB2YWx1ZSwgMSwgdGhpcy5wcm9ncmVzc0xhYmVsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIEFuaW1hdGlvblV0aWxzLmFuaW1hdGVQcm9ncmVzcyh0aGlzLnByb2dyZXNzQmFyLCAwLjk1LCAxLCB0aGlzLnByb2dyZXNzTGFiZWwpO1xuICAgICAgICAoYXdhaXQgbWFpblZpZXdQcm9taXNlKS5zdGFydCgpO1xuICAgICAgICBBbmltYXRpb25VdGlscy5hbmltYXRlUHJvZ3Jlc3ModGhpcy5wcm9ncmVzc0JhciwgMS4wLCAxLCB0aGlzLnByb2dyZXNzTGFiZWwpO1xuICAgICAgICB0aGlzLmxvYWRpbmdOb2RlLmFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAvL+ajgOafpeaYr+WQpuino+mUgeaJi+ihqOasoeeVmeeVquWkllxuICAgICAgICBVbmxvY2tTcGVjaWFsUGxvdEV2ZW50TWFuYWdlci5nZXRJbnN0YW5jZSgpLm5leHREYXlVbmxvY2tlZFNwZWNpYWxQbG90KDQpO1xuICAgIH1cblxuICAgIGxvZ2luR2FtZSA9IGFzeW5jICgpID0+IHtcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlPHZvaWQ+KGFzeW5jIChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgIHRoaXMubG9naW5Db3VudCsrO1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBsZXQgcmV0ID0gYXdhaXQgU0RLLmxvZ2luKCk7XG4gICAgICAgICAgICAgICAgaWYgKHJldCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnVzZXJJZExhYmVsLnN0cmluZyA9IHJldC5wbGF5ZXJJZDtcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5sYXRlSW5pdCgpO1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5sb2dpbkNvdW50ID4gMykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dMb2dpbkZhaWxlZCgpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKFwi55m75b2V5aSx6LSlXCIpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IFwidGltZW91dFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9naW5HYW1lKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaG93TG9naW5GYWlsZWQoKSB7XG4gICAgICAgIGxldCB0ZW1wOiBBbGVydERpYWxvZ1ZpZXdQcm9wcyA9XG4gICAgICAgIHtcbiAgICAgICAgICAgIGRhdGFwdHI6IHt9LFxuICAgICAgICAgICAgdGl0bGVjb250ZW50OiBcIue9kee7nOmUmeivr1wiLFxuICAgICAgICAgICAgY29udGVudDogXCLmmK/lkKbph43mlrDov57mjqU/XCIsXG4gICAgICAgICAgICBpc2hhc2FkOiBmYWxzZSxcbiAgICAgICAgICAgIGlzdHdvYnRuOiB0cnVlLFxuICAgICAgICAgICAgYWRjb25maWc6IFwiXCIsXG4gICAgICAgICAgICBoYXNCYW5uZXI6IGZhbHNlLFxuICAgICAgICAgICAgY2FsbGJhY2s6ICh0eXBlLCByZXQpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAocmV0KSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9naW5Db3VudCA9IDA7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9naW5HYW1lKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2MuZGlyZWN0b3IuZW5kKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xu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