{
  "code": "import { PlayerData } from \"./PlayerData\";\r\nimport { ServerManager, TeamWave } from \"./ServerManager\";\r\nimport { Global } from \"../Global\";\r\nexport class AccountManager {\r\n    constructor(_code, _userinfo, _nickname, _avatarurl, _gender, _province, _city, _country, _device, _shareid, _scene, _v) {\r\n        this.createTime = Laya.timer.currTimer;\r\n        AccountManager.ins = this;\r\n        this.code = _code;\r\n        this.userInfo = _userinfo;\r\n        this.nickName = _nickname;\r\n        this.avatarUrl = _avatarurl;\r\n        this.gender = _gender;\r\n        this.province = _province;\r\n        this.city = _city;\r\n        this.country = _country;\r\n        this.device = _device;\r\n        this.share_id = _shareid;\r\n        this.scene = _scene;\r\n        this.v = _v;\r\n    }\r\n    static get Instance() {\r\n        if (AccountManager.ins == null) {\r\n            new AccountManager(\"222222\", \"你找谁？\", \"1233\", \"123\", 1, \"中国\", \"上海\", \"上海\", \"iphone6s\", \"123\", \"123\", \"123\");\r\n        }\r\n        return AccountManager.ins;\r\n    }\r\n    ReSetting(data, cb = null) {\r\n        var zhengshu = data[\"token\"];\r\n        var netset = data[\"app_setting\"];\r\n        var user = data[\"user\"];\r\n        var jichu = data[\"user_base\"];\r\n        var qiandao = data[\"user_sign\"];\r\n        var chengjiu = data[\"user_achievement\"];\r\n        var invite = data[\"user_invite\"];\r\n        var lottery = data[\"user_lottery\"];\r\n        if (this.curplayerData == null) {\r\n            this.curplayerData = new PlayerData(zhengshu, null, netset, user, jichu, invite, null, qiandao, chengjiu, lottery);\r\n            this.JundgCfg(data.table_version, cb);\r\n        }\r\n        else {\r\n            if (netset) {\r\n                this.curplayerData.netzheshe = netset;\r\n            }\r\n            if (user) {\r\n                this.curplayerData.account = user;\r\n            }\r\n            if (jichu) {\r\n                this.curplayerData.accountssss = jichu;\r\n            }\r\n            if (qiandao) {\r\n                this.curplayerData.qiandao = qiandao;\r\n            }\r\n            if (chengjiu) {\r\n                this.curplayerData.renwu = chengjiu;\r\n            }\r\n        }\r\n    }\r\n    JundgCfg(ver, callball) {\r\n        var cfg = Laya.LocalStorage.getJSON(Global.CFG);\r\n        if (cfg) {\r\n            if (cfg.VER == ver) {\r\n                console.log(\"已经拥有,不用更新\");\r\n                this.SetCfg(cfg);\r\n                if (callball)\r\n                    callball(true);\r\n            }\r\n            else {\r\n                console.log(\"cfg存在但是过期了\");\r\n                Laya.LocalStorage.removeItem(Global.CFG);\r\n                ServerManager.Instance.SendHttp(TeamWave.Config, null, Laya.Handler.create(this, (data) => {\r\n                    data.configs.VER = ver;\r\n                    Laya.LocalStorage.setJSON(Global.CFG, data.configs);\r\n                    this.SetCfg(data.configs);\r\n                    if (callball)\r\n                        callball(true);\r\n                }), Laya.Handler.create(this, (data) => {\r\n                    console.log(\"配置获取失败\" + data);\r\n                    if (callball)\r\n                        callball(false);\r\n                    return;\r\n                }));\r\n            }\r\n        }\r\n        else {\r\n            console.log(\"本地没有cfg\");\r\n            ServerManager.Instance.SendHttp(TeamWave.Config, null, Laya.Handler.create(this, (data) => {\r\n                data.configs.VER = ver;\r\n                Laya.LocalStorage.setJSON(Global.CFG, data.configs);\r\n                this.SetCfg(data.configs);\r\n                if (callball)\r\n                    callball(true);\r\n            }), Laya.Handler.create(this, (data) => {\r\n                console.log(\"配置获取失败\" + data);\r\n            }));\r\n        }\r\n    }\r\n    SetCfg(data) {\r\n        this.curplayerData.peizhis = data;\r\n        this.curplayerData.GetRewardDic();\r\n    }\r\n    RessetConfig() {\r\n        ServerManager.Instance.SendHttp(TeamWave.Config, null, Laya.Handler.create(this, (data) => {\r\n            this.curplayerData.peizhis = data[\"configs\"];\r\n        }), null);\r\n    }\r\n    get ServerTime() {\r\n        let time = Laya.timer.currTimer;\r\n        let stime = this.SFSFSF + Math.ceil((time - this.createTime) / 1000);\r\n        return stime;\r\n    }\r\n}\r\n//# sourceMappingURL=AccountManager.js.map",
  "references": [
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/PlayerData.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/ServerManager.ts",
    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