import GlobalStorage, { STORAGE_KEY } from "./GlobalStorage"; import GameM, { VIDEO_TYPE } from "../manager/GameM"; import Main from "../Main"; import UiM, { PANEL_NAME } from "../manager/UiM"; import Task from "../ui/Task"; import CashOut from "../ui/CashOut"; import RewardNode from "../ui/RewardNode"; import AdM from "../manager/AdM"; import Shop from "../ui/Shop"; import Sciencen_M from "../utils/Sciencen_M"; import HttpM from "../manager/HttpM"; import LogUtil from "../utils/LogUtil"; import SafeDepositBox from "../ui/SafeDepositBox"; import BankQipaoTip from "../ui/BankQipaoTip"; import LocalManagerData from "./LocalManagerData"; import OfficialNode from "../ui/OfficialNode"; import CashRecordNode from "../ui/CashRecordNode"; import RedCodeNode from "../ui/RedCodeNode"; import TreasureData from "./TreasureData"; import TurntableData from "./TurntableData"; import DailyData from "./DailyData"; import InvestData from "./InvestData"; import CashOutData from "./CashOutData"; import { PlayerPrefs } from "../tools/MyExtends"; import UIMng from "../uiFrames/UIMng"; import { FightData } from "./FightData"; import { MateData } from "./MateData"; import { Utils } from "../utils/Utils"; import UsualCaidanData from "./UsualCaidanData"; import GuideMng from "../manager/GuideMng"; import DailyCashData from "./DailyCashData"; import NativeAdAwardData from "../manager/NativeAdAwardData"; import { GameController } from "../manager/GameController"; import { WealthData } from "./WealthData"; import { RichData } from "./RichData"; import DownloadApkData from "./DownloadApkData"; import SwitchM from "../manager/SwitchM"; import MoreGameNode from "../ui/MoreGameNode"; import EffectNode from "../ui/EffectNode"; import Setting from "../ui/Setting"; import { TuCaoData } from "./TuCaoData"; const { ccclass, property } = cc._decorator; @ccclass export default class CommonData { private static instance: CommonData = null static get Instance(): CommonData { if (!this.instance) { this.instance = new CommonData() } return this.instance } //西游 /**是否使用西游版生成金币*/ isUseXiYouAddCoin: boolean = true; /**解锁点击生产金币 最高车等级 默认就解锁*/ unlockStrikeLv: number = 1; /**本日点击生产金币次数*/ clickStrikeNum: number = 0; /**本日点击生产金币次数上限*/ clickStrikeMaxNum: number = 2000; /**点击武将生成金币引导 最高车等级*/ strikeGuideLv: number = 8; //strikeGuideLv: number = 4; /**(弃用 继续使用 maxCarLevel) 当前合成的角色的最大等级 必须是合成的车*/ composeMaxRoleLv: number = 0; /**战斗统一配置*/ fightCfg: any = null; /**战斗角色配置*/ fightRoleCfg: any = null; /**战斗角色服务端配置*/ fightRoleServerCfg: any = null; /**战斗奖励*/ fightRewardCfg: any = null; /**角色buff配置*/ buffCfg: any = null; /**角色buffbag buff库*/ buffbagCfg: any = null; /**伙伴统一配置*/ mateCfg: any = null; /**伙伴天赋配置 本地加载 然后被服务端配置替换*/ mateTalentCfg: any = null; /**主页背景配置*/ mainBgCfg: any = null; /**三国战戟 天赋配置 根据最高武将等级获取对应天赋等级*/ mateTalentDataCfg: any = null; unlockWealthLevel: number = 13; /**是否为测试*/ IsTest: boolean = false; /**是否连接服务器数据*/ static IsServer: boolean = true; /** topon广告是否加载完成 */ toponLoaded = false //通信结束 serverFinish = false /** 广告测试 */ isVideoTest = false loginTest = false /** 用本地数据 */ useLocalData = false /** 红包开关 开 显示 关 不显示 */ redSwitch = true /** 隐私开关 */ popPrivacySwitch = false /** 认证开关 */ popIdentifySwitch = false /** 是否同意隐私和协议 */ passPrivacy = false ranKey = '' ranKeyNew = '' tmp_uin = '' uin = '' login_ticket = '' session_key = '' wxCode = '' //西游 //appid = 'wxef592f91d2d125f5' //三国战戟 // appid = 'wxcc1ce79d026cc35f' //三国战戟 appid = 'wxefd10800332fee04' //航海 //appid = 'wx22b3f0f8005f0e51' // appid = 'wx07895e2f78748daf' /** 是否有微信老数据 */ isNew = false /** 第一次登录 */ isFirstIn = false //西游配置版本 version = '1.0.1' //version = '1.0.0' //强更(整包更新) -1 还没出结果 0 不需要 1 需要 needForceUpdate = -1 installVersion: string = '' installUrl: string = '' updateDes: string = '' fixDes: string = '' /** loader跳过更新 */ skipUpdate = false //oss地址 resURL: string = 'https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/HundredsOfMillions/wxGame/' /** app版本号 */ appVersion = '' /** 是否是第一天 0 不是 1 是*/ isFirstDay = 0 /** 友盟渠道 */ umengChannel = '' /** 设备型号 */ deviceType = '' /** 安卓版本号 */ androidVersion = '' /** 投放渠道 1 巨量 2 快手 3 广点通 */ advertisingChannel = 1 /** banner和插屏显示开关 */ adShowConfig = null /** 提现、每日提现、钱庄按钮显示状态 1 显示 0 不显示 */ cashStateBtnsArr = ["1", "1", "1"] toponId = 'a600b9cb61b556' toponKey = '66b742dd0e502b64d783d9c66a9d30c4' rewardPlaceId = 'b600b9daa737ff' interPlaceId = 'b600b9d639cf05' nativePlaceId = 'b600b9d7ca9ac1' fullInterPlaceId = 'b5f9649a8c0f9c' bannerPlaceId = 'b600b9cde9d982' /** 金币 */ gold: string = String(2000000) /**购买车系数表 */ buyCarPriceArr = [] lastDate = '' curData = '' //毫秒 lastTime = 0 //服务器时间毫秒 currentTime = 0 /** 购买车升级加等级 */ carLvUpAdd = 0 /** 购买车升级减等级 */ carLvUpMinus = 0 inter_weight = 0.3 /** 每秒收益 */ goldSecond: number = 0 /** 红包币 */ redMoney: number = 0 // recordAwardTypeArr = ['登录奖励', '在线奖励', '幸运转盘', '投资收益', '日常任务', '成就任务', '挂机礼包', // '武将升级', '账号升级', '武将等级奖励', '惊喜红包', '新人奖励', '购买新武将'] recordAwardTypeArr = ['', '武将提现', '每日提现', '夺宝提现', '钱庄提现', '招募任务提现', '每日招募提现', '累计招募提现', '', '彩蛋提现', "视频红包", "视频大额红包"] typeArr = ['恭喜发财,大吉大利', '登录大红包', '准点红包', '红包币红包'] /** 红包记录 */ redMoneyRecord = [] /** 提现记录 */ cashRecord = [] /** 累计提现金额 */ cashTotalNum = 0 curSelChatItem = null /** 看视频次数 */ videoTimes: number = 0 /** 所有可买车当前价格 下标0开始 是1级车 */ allCarCurPriceArr = [] /** 当前可以视频购买的车 */ curVideoCarType = 1 /** 今日游戏时间 未成年人才计时 */ todayPlayTime = 0 /** 认证 0 未认证 1 认证成人 2 认证未成年人 */ identification = 0 //车位掉落红包币礼包配置 giftBagRedMoney = [ [0, 100, 58], [100, 200, 158], [200, 1000000, 258] ] /** 背包中车数据 车位:车类型 */ bagCar = [ { 'pos': 0, 'type': 0, 'num': 1 }, { 'pos': 1, 'type': 0, 'num': 1 }, { 'pos': 2, 'type': 0, 'num': 1 }, { 'pos': 3, 'type': 0, 'num': 1 }, { 'pos': 4, 'type': 0, 'num': 1 }, { 'pos': 5, 'type': 0, 'num': 1 }, { 'pos': 6, 'type': 0, 'num': 1 }, { 'pos': 7, 'type': 0, 'num': 1 }, { 'pos': 8, 'type': 0, 'num': 1 }, { 'pos': 9, 'type': 0, 'num': 1 }, { 'pos': 10, 'type': 0, 'num': 1 }, { 'pos': 11, 'type': 0, 'num': 1 }, { 'pos': 12, 'type': 0, 'num': 1 }, { 'pos': 13, 'type': 0, 'num': 1 }, { 'pos': 14, 'type': 0, 'num': 1 } ] /** 人物信息 */ roleData = { 'lv': 1, 'exp': '0', 'newuser': 0, 'hangupVideoTimes': 0, 'clickVideoTimes': 0, //每日视频次数 用来计算金币衰减 'shop': 0, //是否已经打开商店强制引导 0 打开 1 关闭 'dailyGet': '0,0,0,0,0,0,0', 'hangVideoFree': 0, //今日是否免费领取主动拉视频奖励 'canDailyCash': 0, //能否当日提现 0 可以 1 不可以 'dailyFinishIndex': 0, //每日提现完成index 'dailyPro': 0, //当日提现进度 'TypeCar4Times': 0, //合成4级车次数为2时弹出每日提现界面 'videoTimes': 0, //看视频次数 放到人物信息里 'investGuide': 0, //投资引导 'dailyGuide': 0, //每日豪礼引导 'ticket': 0, //夺宝券个数 'active': 0, //是否激活 'secondActive': 0, //次留 'composeGuide': 0, //新车合成奖励 'ifGuideSecrtary': 0, //秘书引导 'dailyCashAniPlayed': 0, // 每日提现随机动画播放 0 未播放 1 已播放 'investTimes': 0, //每日投资次数 'turntableCard': 0, // 转盘卡 "speedCard": 0, //投资加速券 'investTotal': 0, //投资总次数 'turntableTotal': 0, //转盘总次数 'shopTotal': 0, //累计妖洞购买次数 'treasureTotal': 0, //累计夺宝次数 'airshipTotal': 0, //累计热气球次数 'inviteTotal': 0, //累计有效邀请人数 'activeNum': 0, //活跃值 'activeGet': [0, 0, 0], //活跃宝箱领取 'turntableUseCard': 0, //转盘卡消耗次数。跟随时间重置 'airshipSpeedCard': 0, //每日空投掉落加速卡次数 'airshipTurntableCard': 0, //每日空投掉落转盘卡次数 'airshipTicket': 0, //每日夺宝券掉落次数 'boxSpeedCard': 0, //每日惊喜宝箱加速卡掉落次数 'boxTurntableCard': 0, //每日惊喜宝箱转盘掉落次数 "boxTicket": 0, //每日惊喜宝箱夺宝券掉落次数 "addRichBankFinishIndex": 1, //富翁银行正在进行过的档位 "turntableExtrasReward": [] //转盘次数额外奖励 } nickname = '未授权' headimgurl = '' //西游 /**角色*/ roleArr = [] /** 跑道上车数组 */ carArr = [] /** 每个等级车购买次数数据 */ buyTimeData = [] /** 每个等级车主界面购买次数数据 */ buyTimeDataMain = [] /** 可买车的最大等级 */ maxCarLvCanBuy = 0 /** 购买车总次数 */ buyTimeTotal: number = 0 /** 当前车最大等级 */ maxCarLevel: number = 0 /** 合成车辆的次数 */ composeCarTimes: number = 0 /** 累计登陆天数 */ loginDays = 1 /** 引导步骤 */ step: number = 5 /** 车位满了 待发放奖励个数 */ giftCacheNum = 0 /** 车位满了 待发放box个数 */ boxCacheNum = 0 /** 离线获得奖励上限次数 */ giftCacheMax = 0 /** 每日奖励次数 */ giftTimes = 0 /** 每日奖励上限次数 */ giftMaxTimes = 0 /** 离线时间 秒 */ offlineTime = 0 /** 离线收益最大时间 半个个小时 */ offlineTimeMax = 3600 * 0.5 /** 成就任务领取数据 * key * 1:合成车辆地次数 2:解锁XX等级地新车 3:成功观看广告地次数 4:玩家等级达到XX级别 5: 加速累计次数 */ achieveGetData = [] /** 每日任务完成次数 * key * 1:观看广告 2:转盘 3:飞艇 4:加速 */ dailyFinishTimesData = [] /** 每日任务领取数据 * key * 1:观看广告 2:转盘 3:飞艇 4:加速 */ dailyGetData = [] composeAwardGet = [] /** --------- 配置表--------- */ /** 车信息配置表 */ carCfg: any = null /** 购买次数对应车类型 */ buyNumCfg: any = null /** 购买次数对应车类型 */ giftCfg: any = null /** 全局配置 */ globalCfg: any = null /** 人物经验配置 */ roleCft: any = null /** 任务配置 */ taskCft: any = null /** 任务活跃奖励配置 */ taskAwardCft: any = null /** 成就配置 */ achieveCft: any = null /** 文本配置 */ TxtCft: any = null /** 飞船配置 */ airshipCfg: any = null /** 保险箱配置信息 */ richBankConfig = null /** 保险箱解锁轮船等级 */ richBankUnLockLevel: number = 20 /** 银行存入金额 */ richBankCashAmount = 0 /** 当前任务的id,也就是index字段 */ currentRichBankCashTaskIndex = 0 /** 开始银行任务后 每日观看的视频数 */ richBankDailyVideoTimes = 0 /** 开始银行任务后 连续登录数 */ richbank_logindays = 0 /** 当前有没有提现过 1:豪车升级 2:每日提现*/ richbank_noSave = 0 // isopenrichbank: number = 0 /**每日提现 */ dailyCashOpenLevel = 0 /**转盘*/ turntableOpenLevel = 0 /**提现 */ cashOpenLevel = 5 /**工厂开启等级 */ factoryOpenLevel = 8 /**登录豪礼 */ loginRewardOpenLevel = 0 /**投资开启等级 */ investOpenLevel = 0 /**现金夺宝开启等级 */ //trerasureOpenLevel = 11 trerasureOpenLevel = 0 /**任务开启等级 */ //taskOpenLevel = 13 taskOpenLevel = 0 /**俱乐部 */ clubOpenLevel = 0 /** 伙伴开启等级 */ mateOpenLevel = 10 /**是否开启俱乐部功能 */ isOpenClub = 0 dropGiftOpenLevel = 10 /**分享页选择 0:应用宝,1:落地页 默认为应用宝*/ clubSharePageMode = 0 /** 是否显示过任务引导 */ taskGuide = 0 /** 买车计算公式配置 */ priceCfg: any = null /** 需要加载配置个数 */ needCfgNum = 0 /** 获取配置个数 */ getCfgNum = 0 /** 需要加载配置名称数组 */ cfgKeyArr = [] curFactory = null /** 游戏最近时间戳,用来计算离线时间 毫秒*/ gameTime: number = 0 /** 玩家装游戏后玩的时间 计2小时内发视频次数用*/ gameAdd: number = 0 /** 是否有红包币,有就不会增加 */ hasRedMoney: number = 0 //礼包奖励数组 private _giftArr = [] /** 飞艇领取次数 */ airshipTimes = 0 /** 任务红点用 可领取个数 */ taskRedNum = 0 dailyTaskRedNum = 0 achieveTaskRedNum = 0 /** 上次视频升级车等级购买次数 */ lastVideoUpCarBuyTimes = 0 /** 是否在看广告 */ isWatchVideo = false /** 玩家10秒内是否操作界面 */ hasTouch = false hasPopVideo = false dailyFirstLogin = false /** 是否授权 */ isAuth = false /** 弹出插屏界面数组 */ popInterArr = [] /** 工厂升级车最大速度 */ maxSpeedState = false //品质 quality = 2 /** 每日买车视频上线 */ dayBuyCarVideoLimitTimes = 15 /** 设备信息字段 */ machineInfo = null /** 投放渠道号 */ tf_channel = '' /** 是否启用topon */ useTopOn = true /** 是否是新的一天 1:新的一天 */ userIsNewDay = 0 /** 开屏广告配置控制 */ pullSplashAd = 0 /** 开屏需要提现次数 */ splashNeedCashNum = 0 /** 插屏显示概率数组 */ interAdArr = ['0.04', '0.85', '0.03'] /** 配置获得视频间隔 */ videoCoolTime = 0 /** 视频间隔倒计时 */ videoCoolDown = 0 /** 视频调用规则 */ videoRule = [] /** 今日播放视频次数 */ todayVideoTimes = 0 /** 今日全屏视频次数 */ todayFullInterTimes = 0 /** 播放全屏视频 */ showFull = false /** 提现完成返回显示每日豪礼 */ backShowDaily = false /** 每日提现随机动画播放 0 未播放 1 已播放 */ dailyCashAniPlayed = 0 /** topon锁价配置 */ toponPriceLockCfg: any = null /** 清除冷却时间开关 */ clearCoolTimeLVOpen: number = 0 newMonsterArr = [] /**兑换码数据 * code: 1 redemption: appName: "三国战戟" content: Array(2) 0: {type: "10001", count: "100000"} 1: {type: "10002", count: "30"} length: 2 __proto__: Array(0) endTime: "2021-04-08 00:00:00" id: 1 nebulaAppId: "wxef592f91d2d125f5" sort: 1 startTime: "2021-03-29 00:00:00" title: "新手礼包" version: "1.1.4" __proto__: Object __proto__: Object errcode: 0 errmsg: "ok" */ redeemData: any = null; /**教程视频类型 1 红包兑换 2 礼包兑换*/ teachVideoType: number = 1; /** 重置数据 */ resetDatas() { this.serverFinish = false this.carArr = [] this.composeAwardGet = [] this.dailyGetData = [] this.dailyFinishTimesData = [] this.achieveGetData = [] this.allCarCurPriceArr = [] this.cashRecord = [] this.redMoneyRecord = [] this.buyCarPriceArr = [] DailyData.Instance.dailyGetArr = [] this.popInterArr = [] this._giftArr = [] CashOutData.Instance.cashStatus = [] DailyCashData.Instance.dailyCashStatus = [] this.toponLoaded = false //西游 UIMng.Ins.Destroy(); GameController.Ins.Destroy(); GuideMng.Ins.Destroy(); WealthData.Ins.Destroy(); RichData.Ins.Destroy(); TuCaoData.Ins.Destroy(); GameM.audioM.stopAllAudio(); } /** 更新金币 减 */ updateGoldMinus(gold: string) { let result = Sciencen_M.instance.subtraction(this.gold, gold) // console.log('this.gold ', this.gold) // console.log('gold ', gold) // console.log('updateGoldMinus ', result) if (result[0] != '-') { this.gold = result if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.gold, this.gold, 1) } //航海 //UiM.Instance.hallNode.getComponent(Main).labGold.string = Sciencen_M.instance.format(this.gold, false) //西游 UiM.Instance.hallNode.getComponent(Main).UpdateCoinTxt(Sciencen_M.instance.format(this.gold, false)) return true } else { console.log('金币不足') return false } } /** 更新金币 */ updateGold(gold: string) { this.gold = Sciencen_M.instance.addition(this.gold, gold) // console.log('updateGold ', this.gold) if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.gold, this.gold, 1) } //航海 //UiM.Instance.hallNode.getComponent(Main).labGold.string = Sciencen_M.instance.format(this.gold, false) //西游 UiM.Instance.hallNode.getComponent(Main).UpdateCoinTxt(Sciencen_M.instance.format(this.gold, false)) } /** 更新红包币 */ updateRedMoney(redmoney: number, type: RecordTYPE = -1) { let num = this.redMoney + redmoney if (num >= 0) { let data if (this.useLocalData) { data = { 'type': type, 'number': redmoney, 'createTime': this.gameTime, 'totalNumber': num } this.redMoney = num GameM.globalStorage.setStorage(STORAGE_KEY.redMoney, this.redMoney) if (GameM.commonData.redSwitch) { if (cc.isValid(cc.isValid(UiM.Instance.hallNode))) { UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney} ≈ ${(GameM.commonData.redMoney * 0.0001).toFixed(2)}元` } } else { if (cc.isValid(cc.isValid(UiM.Instance.hallNode))) { UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney}` } } this.redMoneyRecord.push(data) GameM.globalStorage.setStorage(STORAGE_KEY.redMoneyRecord, this.redMoneyRecord, 2) } else { data = { 'type': type, 'number': redmoney, 'totalNumber': num } GameM.httpM.sendDatas(HTTP_TYPE.addRedMoney, data, GameM.commonData.resultRedMoney.bind(this)) // console.log('data ', data) } return true } else { return false } } /** 服务器返回成功赋值 */ resultRedMoney(data, param: any) { GameM.commonData.redMoney = param.totalNumber CashOutData.Instance.checkCanCash() if (GameM.commonData.redSwitch) { if (cc.isValid(UiM.Instance)) { UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney} ≈ ${(GameM.commonData.redMoney * 0.0001).toFixed(2)}元` } } else { if (cc.isValid(UiM.Instance)) { UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney}` } } // UiM.Instance.checkDelayShow(() => { if (cc.isValid(UiM.Instance)) { UiM.Instance.rewardNode.getComponent(RewardNode).onEnter() } // }) if (cc.isValid(UiM.Instance) && cc.isValid(UiM.Instance.cashNode)) { UiM.Instance.cashNode.getComponent(CashOut).checkEnable() } GameM.httpM.sendDatas(HTTP_TYPE.getRedMoneyRecord, null, GameM.commonData.resultRedMoneyRecord.bind(this)) } resultRedMoneyRecord(data, param) { this.redMoneyRecord = data // console.log('this.redMoneyRecord ', this.redMoneyRecord) } resultCashRecord(data: any, param) { LogUtil.logV('resultCashRecord ', data) console.log("------>Cash Record:" + JSON.stringify(data)); this.cashRecord = new Array() GameM.ClubData.cashRecord = new Array() //cashType 5,6,7为裂变提现记录类型 for (let entry of data) { if (entry.cashType != 5 && entry.cashType != 6 && entry.cashType != 7) { this.cashRecord.push(entry) } else { GameM.ClubData.cashRecord.push(entry) } } if (UiM.Instance.cashRecordNode) { UiM.Instance.cashRecordNode.getComponent(CashRecordNode).freshRecord() } if (UiM.Instance.redCodeNode) { UiM.Instance.redCodeNode.getComponent(RedCodeNode).freshRecord() } if (UiM.Instance.settingNode) { UiM.Instance.settingNode.getComponent(Setting).freshRecord() } GameM.ClubData.sendInviteInfo() } getRedCodeByCashType(cashType) { let arr = [] for (var i = 0; i < this.cashRecord.length; i++) { if (this.cashRecord[i].cashType == cashType && this.cashRecord[i].CashMode == 2) { arr.push(this.cashRecord[i]) } } return arr } /** 更新每秒收益 */ updateGoldSecond() { let goldadd = 0 let dataPer = null let secondPer = 0 if (this.maxSpeedState) { this.bagCar.forEach(element => { if (element.type != 0 && element.type < 10000) { dataPer = GameM.commonData.carCfg[element.type.toString()] secondPer = Math.floor(Number(dataPer.money) / 3) goldadd += secondPer } }); GameM.commonData.goldSecond = goldadd UiM.Instance.hallNode.getComponent(Main).labGoldSecond.string = Sciencen_M.instance.format(goldadd.toString()) + '/秒' } else { this.bagCar.forEach(element => { if (element.type != 0 && element.type < 10000) { dataPer = GameM.commonData.carCfg[element.type.toString()] secondPer = Math.floor((Number(dataPer.money * (1 + MateData.Ins.Mate1Talent1 * 0.01)) / Number(dataPer.cost_time * (1 - MateData.Ins.Mate1Talent2 * 0.01)))); //secondPer = Math.floor(Number(dataPer.money) / Number(dataPer.cost_time)) goldadd += secondPer } }); GameM.commonData.goldSecond = goldadd //this.freshGoldSecond() } UiM.Instance.hallNode.getComponent(Main).labGoldSecond.string = Sciencen_M.instance.format(goldadd.toString()) + '/秒' } updateBagCarData(pos: string, type: number, num: number = 1, send = true) { let len = this.bagCar.length for (var i = 0; i < len; i++) { if (this.bagCar[i].pos == Number(pos)) { this.bagCar[i].type = type this.bagCar[i].num = num break } } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.bagCar, GameM.commonData.bagCar, 2) } else { if (send) { let data = { 'bagCar': this.bagCar } GameM.httpM.sendDatas(HTTP_TYPE.updateBagCar, data) } } } getBagCarDataByPos(pos: number) { let data = null for (var i = 0; i < this.bagCar.length; i++) { if (this.bagCar[i].pos == pos) { data = this.bagCar[i] break } } return data } /** 更新最近视频升级车等级 */ updatelastVideoUpCarBuyTimes() { GameM.commonData.lastVideoUpCarBuyTimes = GameM.commonData.buyTimeTotal if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.lastVideoUpCarBuyTimes, GameM.commonData.lastVideoUpCarBuyTimes) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateLastVideoUpCarBuyTimes, { 'lastVideoUpCarBuyTimes': GameM.commonData.lastVideoUpCarBuyTimes }) } } updateMaxCarLevel(lv, upLvOnly = false) { LogUtil.logV("updateMaxCarLevel", "") if (lv > this.maxCarLevel) { this.maxCarLevel = lv UiM.Instance.hallNode.getComponent(Main).playCarProEff() for (var i = 0; i < this.newMonsterArr.length; i++) { if (this.newMonsterArr[i] == this.maxCarLevel.toString()) { UiM.Instance.onPanel(PANEL_NAME.NormalCashProNode) break } } this.getAdShowConfig() if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.maxCarLevel, GameM.commonData.maxCarLevel) } else { //HttpM.Instance.SendData(HTTP_TYPE.updateMaxCarLevel,{ 'maxCarLevel': this.maxCarLevel },(res)=>{ // console.log("-->update max Car:"+JSON.stringify(res)); //}); //新增 version入参 //GameM.httpM.sendDatas(HTTP_TYPE.updateMaxCarLevel, { 'maxCarLevel': this.maxCarLevel, "version": this.version }) HttpM.Instance.SendData(HTTP_TYPE.updateMaxCarLevel, { 'maxCarLevel': this.maxCarLevel, "version": this.version }, (res) => { LogUtil.logV("-->MaxData:", res); console.log("--->MaxData:", res); if (res.data != null) { //解锁伙伴 目前孙悟空 //解锁伙伴 if (res.data.unlock_partner_list != null && res.data.unlock_partner_list.length > 0) { //let mateid = Number(res.data.unlock_partner_id); // //let matelv = this.mateTalentCfg[mateid - 1].boss_code; //FightData.Ins.UnlockMate(mateid, matelv); FightData.Ins.UnLockMateSanGuo(res.data.unlock_partner_list); // if (mateid == 4) { // } else if (mateid == 5) { // //开通富翁银行请求 // GameM.httpM.sendDatas(HTTP_TYPE.backIsOpenRichBank, {}); // GameM.commonData.isopenrichbank = 1; // UiM.Instance.hallNode.getComponent(Main).checkMateLockBtn(4, 0); // } } else { //第一次合成战斗判断 FightData.Ins.CheckComposeFight(); //MateData.Ins.UpdateTalentLv(); //三国战戟 } if (res.data.unlock_talent_List != null && res.data.unlock_talent_List.length > 0) { //解锁天赋 //三国战戟 在解锁伙伴中判断解锁天赋 //MateData.Ins.CheckUnlockTalentServer(res.data.unlock_talent_List); MateData.Ins.CheckUnlockTalentServerSanGuo(res.data.unlock_talent_List); } } }); } AdM.onKSEvent(2, this.maxCarLevel) if (upLvOnly) { return } CashOutData.Instance.checkCanCash() // let arr = this.globalCfg.TrigerDailyCarLv.split(',') // if (arr.indexOf(lv.toString()) != -1) { // UiM.Instance.panelFuns.push(() => { // if (UiM.Instance.hallNode) { // UiM.Instance.hallNode.getComponent(Main).showDialyPanel() // } // }) // } UiM.Instance.checkDelayShow(() => { //航海 不显示新车解锁界面 //UiM.Instance.giftNode.active = true //let gift = UiM.Instance.giftNode.getComponent(Gift) //let num = this.carCfg[this.maxCarLevel.toString()].reward_num //gift.init(MONEY_TYPE.getNewCar, num) //第一次合成战斗判断 //FightData.Ins.CheckComposeFight(); }) if (this.maxCarLevel == GameM.commonData.dropGiftOpenLevel) { if (UiM.Instance.hallNode) { UiM.Instance.hallNode.getComponent(Main).startAddTimer() } //解锁伙伴猪八戒 解锁探索 //FightData.Ins.UnlockMate(4, 19); //UiM.Instance.hallNode.getComponent(Main).checkMateLockBtn(3, 0); //GuideMng.Ins.CheckInvestGuide5(); } // if (UiM.Instance.hallNode) { // UiM.Instance.hallNode.getComponent(Main).checkTixianPro() // } //西游 //五福引导 //if (this.maxCarLevel == this.dailyCashOpenLevel) { // UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); // GuideMng.Ins.CheckFiveluckGuide2(); //} else if (this.maxCarLevel == this.investOpenLevel) { //UiM.Instance.hallNode.getComponent(Main).checkMateLockBtn(3, 0); //GuideMng.Ins.CheckInvestGuide5(); UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); // //探索 投资引导 // GuideMng.Ins.CheckInvestGuide5(); } else if (this.maxCarLevel == this.turntableOpenLevel) { UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); //转盘开启引导 // GuideMng.Ins.CheckTurntableGuide15(); } // else if (this.maxCarLevel == this.cashOpenLevel) { // //UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); // //提现开启引导 // //GuideMng.Ins.CheckCashGuide14() // } else if (this.maxCarLevel == this.trerasureOpenLevel) { UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); //夺宝引导 //注释掉 // GuideMng.Ins.CheckTreasureGuide6() } else if (this.maxCarLevel == this.unlockWealthLevel) { UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); WealthData.Ins.CheckUnLockWealth(); } else if (this.maxCarLevel == 12) { //看视频领红包引导 GuideMng.Ins.CheckAdRbGuide28(); } //else if (this.maxCarLevel == this.taskOpenLevel) { else if (this.maxCarLevel == 14) { //UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); // //日常任务引导 // GuideMng.Ins.CheckTaskGuide8() } else if (this.maxCarLevel == this.loginRewardOpenLevel) { //UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); //登录豪礼引导 //if (PlayerPrefs.GetInt("GGuide9", 0) == 2) { // PlayerPrefs.SetInt("GGuide9", 1); //} //GuideMng.Ins.CheckDailyGuide9() } else if (this.maxCarLevel == this.strikeGuideLv) { //点击武将生产金币引导 //注释掉 不用此引导了 // GuideMng.Ins.CheckStrikeGuide11(); } if (this.maxCarLevel == this.richBankUnLockLevel) { //开通富翁银行请求 LogUtil.logV('unlockRichBank', '1111') GameM.httpM.sendDatas(HTTP_TYPE.backIsOpenRichBank); GameM.commonData.isopenrichbank = 1; UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock(); //钱庄 富翁银行引导 //GuideMng.Ins.CheckBankGuide7() } UiM.Instance.taskNode.getComponent(Task).freshState() UiM.Instance.hallNode.getComponent(Main).UpdateMainBg() //更新战斗触发概率 FightData.Ins.UpdateTriggerFightRate(); //更换背景 //UiM.Instance.hallNode.getComponent(Main).DisplayMate(); } else { if (UiM.Instance) { UiM.Instance.displayPanel(); } //西游 已解锁武将 概率触发战斗 FightData.Ins.CheckTriggerFight(lv); } } updateBuyTimeTotal() { this.buyTimeTotal++ // //发送激活巨量 // if (this.globalCfg.activate == this.buyTimeTotal) { // let activate = this.roleData.active // if (activate == 0 || activate == undefined) { // this.roleData.active = 1 // this.updateRoleData() // console.log('发送激活巨量') // if (this.advertisingChannel == 1) { // this.sendActivate(0) // } // else if (this.advertisingChannel == 3) { // this.sendQQActivate(0) // } // } // } let type = this.getMaxCarLvCanBuy() if (type > this.maxCarLvCanBuy) { this.maxCarLvCanBuy = type if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.maxCarLvCanBuy, GameM.commonData.maxCarLvCanBuy) } if (UiM.Instance.shopNode) { UiM.Instance.shopNode.getComponent(Shop).onEnable() } } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.buyTimeTotal, GameM.commonData.buyTimeTotal) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateBuyTimeTotal, { 'buyTimeTotal': this.buyTimeTotal }) } } // // ## 新计算公式 暂时注释 // /** 通过车等级获取当前价格 // */ // getPriceByType(type, isTotal = true) { // let times // if (isTotal) { // times = this.getBuyTimesByType(type) // } // else { // times = this.getBuyTimesByTypeMain(type) // } // let price = '0' // if (!times) { // times = 1 // } // else { // times++ // } // //基础价格 // price = this.carCfg[type.toString()].price // let curPriceCfg // for (var i = 0; i < this.priceCfg.length; i++) { // if (type <= this.priceCfg[i].lv) { // curPriceCfg = this.priceCfg[i] // break // } // } // let c // if (times <= curPriceCfg.buyTimes) { // c = Math.pow(curPriceCfg.times, times - 1) // price = Sciencen_M.instance.accMul(price, c.toString()) // } // else { // let d = Math.pow(curPriceCfg.times, curPriceCfg.buyTimes - 1) // let basePrice = Sciencen_M.instance.accMul(price, d.toString()) // c = Math.pow(curPriceCfg.timesN, times - curPriceCfg.buyTimes) // price = Sciencen_M.instance.accMul(basePrice, c.toString()) // } // return price // } /** 通过车等级获取当前价格 * 购车价格 = INT(价格*(1+a*(购买次数-1))) * INT(价格*(1+a*(购买次数-1)) + if (购买次数<30,0,价格 * 1.2^(购买次数 -30))) */ getPriceByType(type, isTotal = true) { let times if (isTotal) { times = this.getBuyTimesByType(type) } else { times = this.getBuyTimesByTypeMain(type) } let price = '0' if (!times) { times = 1 } else { times++ } price = this.carCfg[type.toString()].price let a = 1 + Number(this.buyCarPriceArr[0]) * (times - 1) let b = 0 if (times >= 30) { b = Math.pow(1.05, times - 30) } let c = a + b let cstr = Sciencen_M.instance.toNonExponential(c) price = Sciencen_M.instance.accMul(price, cstr) LogUtil.logV('getPriceByType ', 'cstr ' + cstr + ' price ' + price) return price } /** 获取每圈收益 * @param type 车等级 */ getCarPerCircleGetByType(type) { return this.carCfg[type.toString()].money } /** 获取车初始价格 * @param type 车等级 */ getFristPriceByType(type) { return this.carCfg[type.toString()].price } /** 通过车等级获取红包币价格 */ getMoneyPriceBuyType(type) { let times = this.getBuyTimesByType(type) let price = '0' if (!times) { times = 1 } else { times++ } price = this.carCfg[type.toString()].gold_price let a = (1 + 0.2 * (times - 1)) price = Sciencen_M.instance.accMul(a.toString(), price) return price } checkShowLvUp() { let cfg = this.buyNumCfg[(this.buyTimeTotal + 1).toString()] let lv = Number(cfg.car_level) let comLv = Number(cfg.min) + this.carLvUpAdd let result = -1 if (lv < comLv) { result = Number(cfg.max) + GameM.commonData.carLvUpMinus } return result } /** 更新总购买次数 */ updateBuyTimeData(type, shop = false) { let times = this.getBuyTimesByType(type) if (!times) { times = 1 } else { times++ } this.setBuyTimesByType(type, times) if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.buyTimeData, GameM.commonData.buyTimeData, 2) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateBuyTimeData, { 'buyTimeData': GameM.commonData.buyTimeData }) } if (!shop) { this.updateBuyTimeDataMain(type) } } /** 更新主界面购买次数 */ updateBuyTimeDataMain(type) { let times = this.getBuyTimesByTypeMain(type) if (!times) { times = 1 } else { times++ } this.setBuyTimesByTypeMain(type, times) if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.buyTimeDataMain, GameM.commonData.buyTimeDataMain, 2) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateBuyTimeDataMain, { 'buyTimeDataMain': GameM.commonData.buyTimeDataMain }) } // console.log('updateBuyTimeDataMain ', JSON.stringify(GameM.commonData.buyTimeDataMain)) } updateStep() { if (this.useLocalData) { GameM.commonData.step++ GameM.globalStorage.setStorage(STORAGE_KEY.step, GameM.commonData.step) } else { GameM.commonData.step++ let data = { 'step': GameM.commonData.step } GameM.httpM.sendDatas(HTTP_TYPE.updateStep, data, GameM.commonData.resultStep.bind(this)) } } resultStep() { if (UiM.Instance) { UiM.Instance.hallNode.getComponent(Main).checkShowAirship() } } /** 更新礼包数据 */ updateGiftCacheNum(num) { this.giftCacheNum += num if (num > 0) { if (this.giftCacheNum > this.giftCfg.times) { this.giftCacheNum = this.giftCfg.times return } else { this.giftTimes++ if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.giftTimes, this.giftTimes) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateGiftTimes, { 'giftTimes': this.giftTimes }) } } } else { if (this.giftCacheNum < 0) { this.giftCacheNum = 0 } } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.giftCacheNum, this.giftCacheNum) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateGiftCacheNum, { 'giftCacheNum': this.giftCacheNum }) } } /** 更新box数据 */ updateBoxCacheNum(num) { this.boxCacheNum += num if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.boxCacheNum, this.boxCacheNum) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateBoxCacheNum, { 'boxCacheNum': this.boxCacheNum }) } } checkCanAdd(data) { let rewardId = Number(data[0]) let times = 0 let canAdd = true switch (rewardId) { case MONEY_TYPE.speedCard: times = this.roleData.boxSpeedCard if (this.maxCarLevel < GameM.commonData.investOpenLevel) { canAdd = false } break; case MONEY_TYPE.treasureCard: times = this.roleData.boxTicket if (this.maxCarLevel < GameM.commonData.trerasureOpenLevel) { canAdd = false } break; case MONEY_TYPE.turnTableCard: times = this.roleData.boxTurntableCard break; } if (!canAdd || Number(data[3]) >= 0 && Number(data[3]) <= times) { return false } else { return true } } /** 概率增加礼包 * @returns 礼包数据 */ giftRandomAdd() { let totalPer = 0 let weightArr = [] let weight = 0 for (var i = 0; i < this._giftArr.length; i++) { if (this.hasRedMoney >= 3 || !this.redSwitch) { if (this._giftArr[i][0] != MONEY_TYPE.redMoney) { //道具掉落限制判断 let rewardId = Number(this._giftArr[i][0]) if (rewardId == MONEY_TYPE.speedCard || rewardId == MONEY_TYPE.turnTableCard || rewardId == MONEY_TYPE.treasureCard) { let canAdd = this.checkCanAdd(this._giftArr[i]) if (!canAdd) { weightArr[i] = 0 } else { totalPer += Number(this._giftArr[i][2]) weight += Number(this._giftArr[i][2]) weightArr[i] = weight } } else { totalPer += Number(this._giftArr[i][2]) weight += Number(this._giftArr[i][2]) weightArr[i] = weight } } else { weightArr[i] = 0 } } else { let canAdd = this.checkCanAdd(this._giftArr[i]) if (canAdd) { totalPer += Number(this._giftArr[i][2]) weight += Number(this._giftArr[i][2]) weightArr[i] = weight } else { weightArr[i] = 0 } } } let data = null let ran = Math.random() * totalPer for (var i = 0; i < weightArr.length; i++) { if (ran <= weightArr[i]) { data = this._giftArr[i] if (data[0] == MONEY_TYPE.redMoney) { this.hasRedMoney++ } else if (data[0] == MONEY_TYPE.speedCard || data[0] == MONEY_TYPE.turnTableCard || data[0] == MONEY_TYPE.treasureCard) { let rewaridId = new Number(data[0]).valueOf() switch (rewaridId) { case MONEY_TYPE.speedCard: this.roleData.boxSpeedCard++ break; case MONEY_TYPE.treasureCard: this.roleData.boxTicket++ break; case MONEY_TYPE.turnTableCard: this.roleData.boxTurntableCard++ break; } LogUtil.logV("giftRandomAdd", "data[0]" + data[0]) this.updateRoleData() } break } } return data } /** 更新每日任务领取奖励数据 * @param type 类型 */ updateDailyGetData(type: number) { let has = false let index = 1 this.dailyGetData.forEach(element => { if (element.type == type) { element.index++ index = element.index has = true } }); if (!has) { this.dailyGetData.push({ 'type': type, "index": 1 }) } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.dailyGetData, this.dailyGetData, 2) } else { let data = { 'dailyGetData': this.dailyGetData } GameM.httpM.sendDatas(HTTP_TYPE.updateDailyGetData, data) AdM.onSendEvent(`task_${type}_${index}`, `任务${type}奖励领取成功`, 'task') } } getDailyGetData(type: number): number { let count = 0 for (var i = 0; i < this.dailyGetData.length; i++) { if (this.dailyGetData[i].type == type) { count = this.dailyGetData[i].index break } } return count } /** 更新成就任务领取奖励数据 * @param type 类型 */ updateAchieveGetData(type) { let has = false this.achieveGetData.forEach(element => { if (element.type == type) { element.index++ has = true } }); if (!has) { this.achieveGetData.push({ 'type': type, "index": 1 }) } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.achieveGetData, this.achieveGetData, 2) } else { let data = { 'achieveGetData': this.achieveGetData } GameM.httpM.sendDatas(HTTP_TYPE.updateAchieveGetData, data) } } getAchieveGetData(type: number): number { let count = 0 for (var i = 0; i < this.achieveGetData.length; i++) { if (this.achieveGetData[i].type == type) { count = this.achieveGetData[i].index break } } return count } /** 检查是否显示全屏视频插屏 */ checkShowFull() { let len = this.videoRule.length let curTime = -1 let lastKey = 0 for (var i = 0; i < len; i++) { let data = this.videoRule[i] if (this.todayVideoTimes <= data.key) { curTime += Math.floor((this.todayVideoTimes - lastKey) / data.value) // console.log('gggggggg curTime ' + curTime + ' ' + 'this.todayFullInterTimes ', this.todayFullInterTimes) if ((this.todayVideoTimes - lastKey) % data.value == 0) { if (this.todayFullInterTimes == curTime) { this.showFull = true } else { this.showFull = false } } break } else { curTime += Math.floor((data.key - lastKey) / data.value) } lastKey = data.key } // console.log('gggggggg checkShowFull ', this.showFull) } /** 检查是否可以显示开屏广告 */ checkCanShowSplash() { let can = false if (GameM.commonData.pullSplashAd == 1 && (CashOutData.Instance.cashStatus.length + DailyCashData.Instance.dailyCashStatus.length) >= GameM.commonData.splashNeedCashNum) { AdM.canShowSplash(1) can = true } else { AdM.canShowSplash(0) can = false } return can } /** 更新观看广告次数 */ updateVideoTimes(placementId = '', adunit_format = '', network_type = '', network_placement_id = '', network_firm_id, adsource_id, adsource_index, adsource_price, adsource_isheaderbidding, publisher_revenue, precision, ecpm_level) { // if (this.isVideoTest) { // return // } this.todayVideoTimes++ GameM.globalStorage.setStorage(STORAGE_KEY.todayVideoTimes, this.todayVideoTimes) GameM.commonData.checkShowFull() //达到任务之后计算视频 if (this.currentRichBankCashTaskIndex > 0) { this.richBankDailyVideoTimes++ let currentConfig = null if (this.richBankConfig) { currentConfig = this.getBankTaskIndex() if (currentConfig) { if (this.richBankDailyVideoTimes == currentConfig.videotimes) { AdM.onSendEvent("Bank_04", "钱庄-当日任务完成", 'Bank') } } } } this.videoTimes++ CashOutData.Instance.checkCanCash() if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.videoTimes, this.videoTimes) this.addDailyFinishTimesDataByType(1) } else { this.addDailyFinishTimesDataByType(1) if (!this.machineInfo) { this.machineInfo = {} } let ad_sbuTypeValue = ""; //看视频领红包 if (AdM.videoType == VIDEO_TYPE.adRbProgressAd) { ad_sbuTypeValue = "RedMoney"; } //Test if (GameM.commonData.globalCfg.VideoRedBagEmpty == 1) { placementId = ""; network_placement_id = ""; adsource_id = ""; adsource_price = TuCaoData.Ins.adsource_id_value; //console.log("-->adsource_id:" + adsource_id); } let data = { "imei": this.machineInfo.imei, "idfa": this.machineInfo.idfa, "oaid": this.machineInfo.oaid, "uin": this.uin, "version": this.appVersion, "tf_channel": this.tf_channel, "destoon_ad_place": placementId, "ad_type": 1, "adunit_format": adunit_format, "network_type": network_type, "network_placement_id": network_placement_id, "network_firm_id": network_firm_id, "adsource_id": adsource_id, "adsource_index": adsource_index, "adsource_price": adsource_price, "adsource_isheaderbidding": adsource_isheaderbidding, "publisher_revenue": publisher_revenue, "precision": precision, "ecpm_level": ecpm_level, "ad_sbuType": ad_sbuTypeValue } LogUtil.logV('updateVideo ', data) //GameM.httpM.sendDatas(HTTP_TYPE.updateVideo, data) GameM.httpM.SendData(HTTP_TYPE.updateVideo, data, (res) => { console.log("-->UpdateVideo:", res); console.log("-->VideoType:", AdM.videoType); //if (AdM.videoType == VIDEO_TYPE.adRbProgressAd) { //videoTYpe会被设置成-1 if (ad_sbuTypeValue == "RedMoney") { if (res.data != null) { TuCaoData.Ins.UpdateVideoProgress(res.data); } } }) } } /** 更新其他广告次数 * @param type 1:激励视频完播、2:插屏展示、3:信息流展示、 4:激励视频展⽰、5:激励视频加载失败、6:开屏展示、7:banner展示、 * 8:插屏-全屏视频 完播、9:插屏-全屏视频 展示、10:插屏-全屏视频 加载失败、11:插屏加载失败、12:信息流加载失败、13:开屏加载失败、14:banner加载失败 */ updateADLog(type, placementId, adunit_format = '', network_type = '', network_placement_id = '', network_firm_id = 0, adsource_id = '', adsource_index = 0, adsource_price = 0, adsource_isheaderbidding = 0, publisher_revenue = 0, precision = '', ecpm_level = 0) { if (this.isVideoTest) { return } if (!this.machineInfo) { this.machineInfo = {} } let data = { "imei": this.machineInfo.imei, "idfa": this.machineInfo.idfa, "oaid": this.machineInfo.oaid, "uin": this.uin, "version": this.appVersion, "tf_channel": this.tf_channel, "destoon_ad_place": placementId, "ad_type": type, "adunit_format": adunit_format, "network_type": network_type, "network_placement_id": network_placement_id, "network_firm_id": network_firm_id, "adsource_id": adsource_id, "adsource_index": adsource_index, "adsource_price": adsource_price, "adsource_isheaderbidding": adsource_isheaderbidding, "publisher_revenue": publisher_revenue, "precision": precision, "ecpm_level": ecpm_level } GameM.httpM.sendDatas(HTTP_TYPE.updateADLog, data) } /** 获取每日任务次数 * @param type * 1:观看广告 2:转盘 3:飞艇 4:投资次数 5:工厂点击次数 6:现金夺宝 7:看视频得金币 8: 完成财神降临 */ getDailyFinishTimesDataByType(type: number): number { let count = 0 for (var i = 0; i < this.dailyFinishTimesData.length; i++) { if (this.dailyFinishTimesData[i].type == type) { count = this.dailyFinishTimesData[i].times break } } return count } /** 增加每日任务次数 * @param type * 1:观看广告 2:转盘 3:飞艇 4:投资次数 5:工厂点击次数 西游 点击武将 6:现金夺宝 7:看视频得金币 8: 完成财神降临 */ addDailyFinishTimesDataByType(type: number) { let has = false this.dailyFinishTimesData.forEach(element => { if (element.type == type) { element.times++ has = true } }); if (!has) { this.dailyFinishTimesData.push({ 'type': type, 'times': 1 }) } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.dailyFinishTimesData, this.dailyFinishTimesData, 2) } else { let data = { 'dailyFinishTimesData': this.dailyFinishTimesData } GameM.httpM.sendDatas(HTTP_TYPE.updateDailyFinishTimesData, data) } if (UiM.Instance && UiM.Instance.taskNode) { UiM.Instance.taskNode.getComponent(Task).freshState() } } // resultDailyFinishTimesData(param) { // console.log('resultDailyFinishTimesData ', param) // this.dailyFinishTimesData = param // UiM.Instance.taskNode.getComponent(Task).freshState() // } /** * 检查在哪个段位 */ getBankTaskIndex(): any { let configInfo = this.richBankConfig if (configInfo == null || configInfo == undefined) { return } let curIndex = this.roleData.addRichBankFinishIndex if (curIndex > configInfo.length) { return configInfo[configInfo.length - 1] } for (let entry of configInfo) { if (entry.index == curIndex) { return entry } } // for (let entry of configInfo) { // if (entry.money <= richBankCashAmount) { // currentConfig = entry // } // } // return currentConfig } requestRichBankInfo() { if (this.maxCarLevel < this.richBankUnLockLevel) { return } let hour = new Date(GameM.commonData.gameTime).getHours() let minutes = new Date(GameM.commonData.gameTime).getMinutes() let second = new Date(GameM.commonData.gameTime).getSeconds() //判断每日凌晨前10秒内刷新 if (this.currentRichBankCashTaskIndex > 0 && hour == 0 && minutes == 0 && second <= 10) { GameM.httpM.sendDatas(HTTP_TYPE.getRichBankInfo, null, GameM.commonData.getRichBankInfo.bind(this)) } } getRichBankInfo(data) { LogUtil.logV("getRichBankInfo", this.richBankDailyVideoTimes) LogUtil.logV("getRichBankInfo", this.richbank_logindays) if (data && data.richBankDailyVideoTimes >= 0) { this.richBankDailyVideoTimes = data.richBankDailyVideoTimes } if (data && data.richbankLoginDays >= 0) { this.richbank_logindays = data.richbankLoginDays if (this.richbank_logindays == 0) { this.richbank_logindays = 1 } } if (cc.isValid(UiM.Instance.safeDepositBoxNode)) { UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).setTaskProgress() } } /** 更新每日加速次数 */ updateDailySpeedUpTimes() { this.addDailyFinishTimesDataByType(4) } /** 更新每日点击飞艇次数 */ updateAirShipTimes() { if (this.useLocalData) { GameM.commonData.airshipTimes++ GameM.globalStorage.setStorage(STORAGE_KEY.airshipTimes, this.airshipTimes) if (UiM.Instance && UiM.Instance.hallNode) { UiM.Instance.hallNode.getComponent(Main).checkShowAirship() } } else { let times = GameM.commonData.airshipTimes + 1 GameM.httpM.sendDatas(HTTP_TYPE.updateAirshipTimes, { 'airshipTimes': times }, GameM.commonData.resultAirShipTimes.bind(this)) if (UiM.Instance && UiM.Instance.hallNode) { UiM.Instance.hallNode.getComponent(Main).airshipAni.node.active = false } GameM.commonData.roleData.airshipTotal++ GameM.commonData.updateRoleData() } } resultAirShipTimes(data, param) { GameM.commonData.airshipTimes = param.airshipTimes GameM.commonData.addDailyFinishTimesDataByType(3) if (UiM.Instance && UiM.Instance.hallNode) { UiM.Instance.hallNode.getComponent(Main).checkShowAirship() } } getComposeAwardGet(lv: number): boolean { let get = false this.composeAwardGet.forEach(element => { if (element.lv == lv) { get = true } }); return get } updateComposeCarTimes() { this.composeCarTimes++ if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.composeCarTimes, this.composeCarTimes) } else { GameM.httpM.sendDatas(HTTP_TYPE.updateComposeCarTimes, { 'composeCarTimes': this.composeCarTimes }) } UiM.Instance.taskNode.getComponent(Task).freshState() } /** 更新新玩家状态 */ updateRoleNewUser() { if (!this.roleData.newuser) { this.roleData.newuser = 1 } else { this.roleData.newuser++ } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } /** 更新人物信息 * @param value 经验增加值 */ updateRoleDataExp(value: string) { this.roleData.exp = Sciencen_M.instance.addition(this.roleData.exp.toString(), value) let lv = this.roleData.lv let lvExp = this.roleCft[lv - 1].exp if (value == '0') { UiM.Instance.hallNode.getComponent(Main).labLevel.string = `${lv}` } else if (value[0] != '-') { while (Sciencen_M.instance.ContrastNumber(this.roleData.exp, lvExp)) { lv++ this.roleData.lv = lv this.roleData.exp = Sciencen_M.instance.subtraction(this.roleData.exp, lvExp) lvExp = this.roleCft[lv - 1].exp UiM.Instance.hallNode.getComponent(Main).labLevel.string = `${lv}` UiM.Instance.taskNode.getComponent(Task).freshState() //升级弹窗屏蔽 // if (this.roleData.lv == 2 || this.roleData.lv == 3 || this.roleData.lv == 4 || this.roleData.lv == 5) { // UiM.Instance.displayPanel(); // } // else { // if (UiM.Instance.giftNode.active) { // UiM.Instance.panelFuns.push(() => { // UiM.Instance.rewardNode.EnterUserLvUpPanel(); // }) // } // else { // UiM.Instance.checkDelayShow(() => { // UiM.Instance.rewardNode.EnterUserLvUpPanel(); // }) // } // } } CashOutData.Instance.checkCanCash() } else { while (this.roleData.exp[0] == '-') { lv-- this.roleData.lv = lv lvExp = Number(this.roleCft[lv - 1].exp) this.roleData.exp = Sciencen_M.instance.addition(this.roleData.exp, lvExp) UiM.Instance.hallNode.getComponent(Main).labLevel.string = `${lv}` } } UiM.Instance.hallNode.getComponent(Main).expFill.fillRange = Number(Sciencen_M.instance.accDiv(this.roleData.exp, lvExp)) if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } updateHangupVideoTimes() { if (this.roleData.hangupVideoTimes) { this.roleData.hangupVideoTimes++ } else { this.roleData.hangupVideoTimes = 1 } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } updateClickVideoTimes() { if (this.roleData.clickVideoTimes) { this.roleData.clickVideoTimes++ } else { this.roleData.clickVideoTimes = 1 } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } updateHangVideoFree() { GameM.commonData.roleData.hangVideoFree = 1 if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } /** 更新提现进度 * @param type 0 进度 1 完成index增加 * @param num 增加数值 * @param local 是否只更新本地数据 */ updateDailyCash(type, num, local = false) { if (type == 0) { if (GameM.commonData.roleData.dailyPro) { GameM.commonData.roleData.dailyPro += num } else { GameM.commonData.roleData.dailyPro = num } } else if (type == 1) { if (GameM.commonData.roleData.dailyFinishIndex) { GameM.commonData.roleData.dailyFinishIndex += num } else { GameM.commonData.roleData.dailyFinishIndex = num } GameM.commonData.roleData.dailyPro = 0 // GameM.commonData.roleData.canDailyCash = 1 } if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { if (!local) { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } } /** 获取总的各等级车购买次数 */ getBuyTimesByType(type: number): number { let count = 0 for (var i = 0; i < this.buyTimeData.length; i++) { if (this.buyTimeData[i].type == type) { count = this.buyTimeData[i].number break } } return count } /** 设置总的各等级车购买次数 */ setBuyTimesByType(type: number, num: number) { let has = false for (var i = 0; i < this.buyTimeData.length; i++) { if (this.buyTimeData[i].type == type) { this.buyTimeData[i].number = num has = true break } } if (!has) { this.buyTimeData.push({ 'type': type, 'number': num }) } } /** 获取主界面各等级车购买次数 */ getBuyTimesByTypeMain(type: number): number { let count = 0 for (var i = 0; i < this.buyTimeDataMain.length; i++) { if (this.buyTimeDataMain[i].type == type) { count = this.buyTimeDataMain[i].number break } } return count } /** 设置主界面各等级车购买次数 */ setBuyTimesByTypeMain(type: number, num: number) { let has = false for (var i = 0; i < this.buyTimeDataMain.length; i++) { if (this.buyTimeDataMain[i].type == type) { this.buyTimeDataMain[i].number = num has = true break } } if (!has) { this.buyTimeDataMain.push({ 'type': type, 'number': num, 'resetNum': 0, 'pop': 0 }) } } getMaxCarLvCanBuy(): number { let type = 1 if (this.buyTimeTotal > 0) { type = Number(this.buyNumCfg[this.buyTimeTotal.toString()].max) } return type } updateChatRed(add: number) { // this.chatRed += add // let money = (this.chatRed * 0.0001).toFixed(2) // UiM.Instance.chatNode.getComponent(Chat).labMoney.string = `¥${money}` // let data = { // "chatRed": this.chatRed, // } // GameM.httpM.sendDatas(HTTP_TYPE.updateChatRed, data) } /** 更新人物数据*/ updateRoleData() { if (this.useLocalData) { GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2) } else { let data = { 'roleData': this.roleData } GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data) } } /** * //更新可加入保险箱红包 * @param data */ updateBankPacket(data) { if (cc.isValid(UiM.Instance.safeDepositBoxNode)) { UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).updateScrollView(data) } if (cc.isValid(UiM.Instance.hallNode)) { let qipaoNode = UiM.Instance.hallNode.getComponent(Main).bankQipaoNode if (cc.isValid(qipaoNode)) { let bankQipaoTip = qipaoNode.getComponent(BankQipaoTip) bankQipaoTip.showAlreadyMoney(data) } } } /** * 保险箱存入成功 * @param data */ updateBankView(data) { if (data.RichBankCashAmount > 0) { this.richBankCashAmount = data.RichBankCashAmount } else { return } if (cc.isValid(UiM.Instance.safeDepositBoxNode)) { UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).saveMoneySuccess(data.RichBankCashAmount) } } /** * //保险箱任务开始 * @param data */ updateBankTask(data, param) { this.currentRichBankCashTaskIndex = param.index this.richbank_logindays = 1 this.richBankDailyVideoTimes = 0 if (cc.isValid(UiM.Instance.safeDepositBoxNode)) { cc.sys.localStorage.setItem("bankTaskStartTime", Date.now()) UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).initView(true) AdM.onSendEvent("Bank_03", "钱庄开始任务", 'Bank') } let qipaoNode = UiM.Instance.hallNode.getComponent(Main).bankQipaoNode if (cc.isValid(qipaoNode)) { let bankQipaoTip = qipaoNode.getComponent(BankQipaoTip) bankQipaoTip.showAlreadyMoney(null) } } /** * //保险箱提现 * @param data */ updateBankCash(data) { // console.log(data) LogUtil.logV("updateBankCash", "success") let cashMoney = 0 let len = this.richBankConfig.length for (var i = 0; i < len; i++) { if (this.richBankConfig[i].index == this.currentRichBankCashTaskIndex) { cashMoney = Number((this.richBankConfig[i].money * 0.01).toFixed(2)) break } } this.currentRichBankCashTaskIndex = 0 this.richbank_logindays = 1 this.richBankDailyVideoTimes = 0 //计算提现后,银行内剩余的 let currentConfig = this.getBankTaskIndex() this.richBankCashAmount = this.richBankCashAmount - currentConfig.money if (this.richBankCashAmount < 0) { this.richBankCashAmount = 0 } this.roleData.addRichBankFinishIndex++ this.updateRoleData() AdM.onSendEvent("Bank_06", "钱庄-任务全部完成", 'Bank') AdM.setTAEventUser(1, 'bankCashTime_total', 1) AdM.setTAEventUser(1, 'bankCashMoney_total', cashMoney) if (cc.isValid(UiM.Instance.safeDepositBoxNode)) { UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).tixianSuccess(data.CashMode != 2) } if (data.CashMode == 2) { UiM.Instance.onPanel(PANEL_NAME.OfficialNode, false, () => { UiM.Instance.officialNode.getComponent(OfficialNode).init(cashMoney, data.withdrawalCode); AdM.onSendEvent('publicmoney_3', '公众号提现-钱庄', 'publicmoney') }) } } updateBankCashFail(errmsg) { EffectNode.instance.PlayTip(errmsg) if (cc.isValid(UiM.Instance.safeDepositBoxNode)) { UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).tixianFail() } } init() { let arr = this.giftCfg.reward_weight.split(';') for (var i = 0; i < arr.length; i++) { this._giftArr[i] = arr[i].split(',') } TreasureData.Instance.treasureDailyTimes = 0 } /** 更新设备信息 */ updateMachine(info) { let arr = info.split('#') let android_id = arr[0] let idfa = arr[1] let imei = arr[2] let mac = arr[3] let oaid = arr[4] let umid = arr[5] this.tf_channel = arr[6] this.appVersion = arr[7] /** 友盟渠道 */ this.umengChannel = arr[8] /** 设备型号 */ this.deviceType = arr[9] /** 安卓版本号 */ this.androidVersion = arr[10] // console.log('vvvvvvvvv updateMachine ', android_id, " ", idfa, " ", imei, " ", mac, " ", oaid, " ", umid, " ", this.tf_channel, " ", this.appVersion // , " ", this.umengChannel, " ", this.deviceType, " ", this.androidVersion) this.machineInfo = { "android_id": android_id, "idfa": idfa, "imei": imei, "mac": mac, "oaid": oaid, "umid": umid } if (GameM.commonData.session_key != '' && GameM.commonData.uin != '') { console.log(">>>>>5uin:" + GameM.commonData.uin); GameM.httpM.getAccountInfo() } else { GameM.httpM.init(); } } /** 发送设备信息到服务器 */ sendMachineInfo() { GameM.httpM.sendDatas(HTTP_TYPE.machine, this.machineInfo) this.getForceVersionInfo() GameM.commonData.updateVersion() } //发送请求整包更新 getForceVersionInfo() { let data = { 'version': this.appVersion, 'channel': this.tf_channel } LogUtil.logV('getForceVersionInfo ', data) GameM.httpM.sendDatas(HTTP_TYPE.getForceVersionInfo, data, GameM.commonData.getForceVersionInfoBack.bind(this)) } getForceVersionInfoBack(data) { LogUtil.logV('MMM getForceVersionInfoBack ', data) this.needForceUpdate = data.isForceUpdate this.installVersion = data.version this.installUrl = data.downloadAddress this.updateDes = data.versionRemark this.fixDes = data.bugRestoreRemark } updateVersion() { let data = { "version": this.appVersion } GameM.httpM.sendDatas(HTTP_TYPE.updateVersion, data) } /** 获取服务器配置 */ getAllServerCfg() { console.log("--->version:" + this.version) let data = { "versionCode": this.version } GameM.httpM.sendDatas(HTTP_TYPE.getAllConfigInfo, data, GameM.commonData.resultGetServerCfg.bind(this)) } /**获取空投箱配置 */ getAirshipCfg(data: string) { let jsonObj = JSON.parse(data) this.airshipCfg = jsonObj } resultGetServerCfg(data, param) { if (SwitchM.firstLoginLog) { AdM.sendUmeng('umServer5', 'resultGetServerCfg') } let jsonData = data // LogUtil.logV('jsonData ', jsonData) console.log("-->JsonData: ", jsonData) this.globalCfg = jsonData[CFG_SERVER.GlobalCfg] GameM.commonData.globalCfg = this.globalCfg GameM.commonData.gold = this.globalCfg.first_money GameM.commonData.buyCarPriceArr = this.globalCfg['buy_car_^'].split(',') let arr = this.globalCfg['car_lv_up'].split(',') GameM.commonData.carLvUpAdd = Number(arr[0]) GameM.commonData.carLvUpMinus = Number(arr[1]) GameM.commonData.inter_weight = Number(this.globalCfg.inter_weight) GameM.commonData.popInterArr = this.globalCfg['popInter'].split(',') // console.log('GameM.commonData.popInterArr ', GameM.commonData.popInterArr) GameM.commonData.dayBuyCarVideoLimitTimes = this.globalCfg['dayBuyCarVideoLimitTimes'] let splashArr = ["0", "0"] if (this.globalCfg.pullSplashAd) { splashArr = this.globalCfg.pullSplashAd.split(';') } GameM.commonData.pullSplashAd = Number(splashArr[0]) GameM.commonData.splashNeedCashNum = Number(splashArr[1]) LogUtil.logV('GameM.commonData.pullSplashAd ', GameM.commonData.pullSplashAd) LogUtil.logV('GameM.commonData.splashNeedCashNum ', GameM.commonData.splashNeedCashNum) GameM.commonData.videoCoolTime = this.globalCfg.videoCoolTime InvestData.Instance.investCardTime = this.globalCfg.investCardTime InvestData.Instance.investVideoTime = this.globalCfg.investVideoTime GameM.commonData.popPrivacySwitch = this.globalCfg['popPrivacySwitch'] == 1 GameM.commonData.popIdentifySwitch = this.globalCfg['popIdentifySwitch'] == 1 GameM.commonData.richBankUnLockLevel = this.globalCfg.openRichBankLv GameM.commonData.clearCoolTimeLVOpen = this.globalCfg.clearCoolTimeLVOpen TurntableData.Instance.turntableExtrasCfg = this.globalCfg.turntableExtrasCfg if (this.globalCfg.interAdArr) { GameM.commonData.interAdArr = this.globalCfg.interAdArr.split(';') } let ruleArr = this.globalCfg.videoRule.split(';') GameM.commonData.videoRule = [] for (var i = 0; i < ruleArr.length; i++) { let arr = ruleArr[i].split(',') let data = { 'key': Number(arr[0]), 'value': Number(arr[1]) } GameM.commonData.videoRule.push(data) } // console.log('videoRule ', GameM.commonData.videoRule) NativeAdAwardData.Instance.nativeAwardChanceArr = this.globalCfg['nativeAwardChance'].split(',') // console.log('nativeAwardChanceArr ', NativeAdAwardData.Instance.nativeAwardChanceArr) NativeAdAwardData.Instance.nativeShowLevel = this.globalCfg['nativeShowLevel'] NativeAdAwardData.Instance.nativeAwardTimes = this.globalCfg['nativeAwardTimes'] // console.log('nativeShowLevel ', NativeAdAwardData.Instance.nativeShowLevel) // console.log('nativeAwardTimes ', NativeAdAwardData.Instance.nativeAwardTimes) this.newMonsterArr = this.globalCfg['newmonster'].split(",") let guideInstallArr = this.globalCfg['guideInstall'].split(',') DownloadApkData.Instance.installSwitch = guideInstallArr[0] == '1' DownloadApkData.Instance.installRatio = guideInstallArr[1] DownloadApkData.Instance.openRatio = guideInstallArr[2] CashOutData.Instance.cashCft = jsonData[CFG_SERVER.CashCfg] DailyCashData.Instance.dailyCashApplyCfg = jsonData[CFG_SERVER.DailyCashApplyCfg] DailyData.Instance.dailyCfg = jsonData[CFG_SERVER.DailyCfg] this.giftCfg = jsonData[CFG_SERVER.GiftCfg] this.giftBagRedMoney = this.giftCfg.giftBagRedMoney this.priceCfg = jsonData[CFG_SERVER.PriceCfg] // this.richBankConfig = jsonData[CFG_SERVER.RichBankCfg] //西游 if (jsonData[CFG_SERVER.BattleBossCfg] != null) this.fightRoleServerCfg = jsonData[CFG_SERVER.BattleBossCfg] if (jsonData[CFG_SERVER.PartnerTalentCfg] != null) this.mateTalentCfg = jsonData[CFG_SERVER.PartnerTalentCfg] WealthData.Ins.wealthCfg = jsonData["GodofWealthComesCfg"]; RichData.Ins.richItemCardCfg = jsonData["WestItemCardCfg"]; RichData.Ins.richCfg = jsonData["WestCfg"]; // if (this.richBankConfig && this.richBankConfig[0]) { // this.richBankUnLockLevel = this.richBankConfig[0].maxcarlevel // } GameM.commonData.getSingleCfg(CFG_SERVER.AirshipCfg) // this.richBankUnLockLevel = 1 GameM.commonData.init() GameM.httpM.getUserIsNewDay() } /** 单个服务器配置 */ getSingleCfg(cfgName: CFG_SERVER) { GameM.httpM.sendDatas(HTTP_TYPE.getConfigInfo, { "key": cfgName, "versionCode": this.version }, GameM.commonData.getSingleCfgBack.bind(this)) } getSingleCfgBack(data, param) { if (param.key == CFG_SERVER.AirshipCfg) { GameM.commonData.getAirshipCfg(data) } else if (param.key == CFG_SERVER.TurntableCfg) { TurntableData.Instance.getTurnTableCfgBack(data) } } /** 巨量发送激活 * @param type 0 激活 6 次留 */ sendActivate(type) { let data = { "event_type": type, "source": this.appVersion + ';' + this.globalCfg.activate } GameM.httpM.sendDatas(HTTP_TYPE.activate, data, GameM.commonData.sendActivateBack.bind(this)) } sendActivateBack(data, param) { if (param.event_type == 0) { AdM.onSendEvent('juliangActivate', '巨量激活成功') console.log('juliangActivate') } else if (param.event_type == 6) { AdM.onSendEvent('juliangSecondActivate', '巨量次留成功') console.log('juliangSecondActivate') } } /** 广点通发送激活 * @param type 0 激活 1 次留 */ sendQQActivate(type) { let data = null if (type == 0) { data = { "action_type": "ACTIVATE_APP" } } else if (type == 1) { data = { "action_type": "START_APP", "action_param": { "length_of_stay": 1 } } } GameM.httpM.sendDatas(HTTP_TYPE.qqActive, data) } sendCp(key, des) { // console.log('sendCp ', key) let data = { "uin": this.uin, "isFirstDay": this.isFirstDay, "umengChannel": this.umengChannel, "deviceType": this.deviceType, "androidVerison": this.androidVersion, "version": this.appVersion, "point": key, "description": des } GameM.httpM.sendDatas(HTTP_TYPE.cp, data) } /** 获取topon锁价配置 */ getToponLockPriceData() { let data = {} GameM.httpM.sendDatas(HTTP_TYPE.getToponLockPrice, data, GameM.commonData.resultGetToponLockPrice.bind(this)) } resultGetToponLockPrice(data) { this.toponPriceLockCfg = data LogUtil.logV("resultGetToponLockPrice", this.toponPriceLockCfg) } /** 获取广告价格 * @param adsource_id 广告源ID * @param adsource_price topon返回千次价格 如果配置中获取不到价格,就用这个补充 */ getAdPrice(adsource_id, adsource_price) { let price = '' if (!this.toponPriceLockCfg) { return } let len = this.toponPriceLockCfg.length for (var i = 0; i < len; i++) { if (this.toponPriceLockCfg[i].adsourceId == adsource_id) { //uroi要求上传千次价格 单位是千分之一分 price = (this.toponPriceLockCfg[i].lockPrice * 100000).toString() break } } if (price == '') { price = (adsource_price * 100000).toString() } LogUtil.logV('UROIStatsSdk ', 'adsource_id ' + adsource_id) LogUtil.logV('UROIStatsSdk ', 'adsource_price ' + adsource_price) LogUtil.logV('UROIStatsSdk ', 'price ' + price) return price } updateActivateLog(sessionDuration) { let data = { 'appId': this.appid, 'uin': this.uin, 'sessionDuration': sessionDuration } GameM.httpM.sendDatas(HTTP_TYPE.activateLog, data) } /** 获取banner 插屏开启 */ getAdShowConfig() { if (!this.adShowConfig && this.maxCarLevel >= 8 && (DailyCashData.Instance.dailyCashStatus.length > 0 || CashOutData.Instance.cashStatus.length > 0)) { let data = {} GameM.httpM.sendDatas(HTTP_TYPE.adShowConfig, data) } } getAdShowConfigBack(data) { this.adShowConfig = data.adShowConfig LogUtil.logV('getAdShowConfigBack ', this.adShowConfig) } getCashMoney(index) { let data = { 'index': index } GameM.httpM.sendDatas(HTTP_TYPE.getCashMoney, data, GameM.commonData.getCashMoneyBack.bind(this)) } getCashMoneyBack(data) { LogUtil.logV('getCashMoneyBack >>> ', (data.money * 0.01).toFixed(2)) LogUtil.logV('getCashMoneyBack ', data.money) if (UiM.Instance.cashNode) { UiM.Instance.cashNode.getComponent(CashOut).labShowMoney.string = `¥${(data.money * 0.01).toFixed(2)}` } } /** 检查主界面买怪是否提前弹出获得金币界面 * @returns ture 弹出 false 不弹出 */ checkShowMainPop() { let status = false if (this.globalCfg['showMainPop'] == 1) { if (this.adShowConfig) { if (this.adShowConfig.is_show_inter == 1) { //弹出 status = true } else { status = false } } else { //弹出 status = true } } else { //不弹出 status = false } return status } getDatasFromServer(data) { // LogUtil.logV("-------------datainfo ", data); console.log("-->DataInfo:", data); GameM.commonData.sendMachineInfo() this.lastTime = data.lastTime * 1000 this.currentTime = data.currentTime * 1000 GameM.commonData.gameTime = GameM.commonData.currentTime // let last = new Date(this.lastTime).toLocaleDateString() // let now = new Date(this.currentTime).toLocaleDateString() if (data.roleData) { this.roleData = data.roleData } else { //默认新玩家送一个加速券 this.roleData.speedCard = 1 this.updateRoleData() } if (data.buyTimeDataMain != undefined) { this.buyTimeDataMain = data.buyTimeDataMain } // if (data.investData != undefined) { // InvestData.Instance.investData = data.investData // } console.log("this.roleData.speedCard ", this.roleData.speedCard); if (this.roleData.turntableCard == null || this.roleData.turntableCard == undefined) { this.roleData.turntableCard = 0 } if (this.roleData.airshipSpeedCard == null || this.roleData.airshipSpeedCard == undefined) { this.roleData.airshipSpeedCard = 0 } if (this.roleData.airshipTicket == null || this.roleData.airshipTicket == undefined) { this.roleData.airshipTicket = 0 } if (this.roleData.airshipTurntableCard == null || this.roleData.airshipTurntableCard == undefined) { this.roleData.airshipTurntableCard = 0 } if (this.roleData.boxSpeedCard == null || this.roleData.boxSpeedCard == undefined) { this.roleData.boxSpeedCard = 0 } if (this.roleData.boxTicket == null || this.roleData.boxTicket == undefined) { this.roleData.boxTicket = 0 } if (this.roleData.boxTurntableCard == null || this.roleData.boxTurntableCard == undefined) { this.roleData.boxTurntableCard = 0 } if (this.roleData.addRichBankFinishIndex == 0 || this.roleData.addRichBankFinishIndex == null || this.roleData.addRichBankFinishIndex == undefined) { this.roleData.addRichBankFinishIndex = 1 } if (data.userUsualEggInfo) { UsualCaidanData.Instance.userUsualEggInfo = data.userUsualEggInfo } else { UsualCaidanData.Instance.userUsualEggInfo = null } LogUtil.logV('UsualCaidan data.userUsualEggInfo ', data.userUsualEggInfo) if (!this.isFirstIn) { if (this.userIsNewDay == 1) { //今天第一次登录 console.log('今天第一次登录') if (data.loginDays == 2) { AdM.onKSEvent(0) } else if (data.loginDays == 7) { AdM.onKSEvent(1) } this.dailyFirstLogin = true GameM.commonData.giftTimes = 0 GameM.commonData.dailyFinishTimesData = [] GameM.commonData.dailyGetData = [] TurntableData.Instance.turntableRefreshTimes = 0 GameM.commonData.airshipTimes = 0 GameM.httpM.sendDatas(HTTP_TYPE.updateGiftTimes, { 'giftTimes': this.giftTimes }) let data3 = { 'dailyFinishTimesData': [] } GameM.httpM.sendDatas(HTTP_TYPE.updateDailyFinishTimesData, data3) let data1 = { 'dailyGetData': [] } GameM.httpM.sendDatas(HTTP_TYPE.updateDailyGetData, data1) GameM.httpM.sendDatas(HTTP_TYPE.updateTurntableRefreshTimes, { 'turntableRefreshTimes': TurntableData.Instance.turntableRefreshTimes }) GameM.httpM.sendDatas(HTTP_TYPE.updateAirshipTimes, { 'airshipTimes': this.airshipTimes }, GameM.commonData.resultAirShipTimes.bind(this)) this.roleData.hangupVideoTimes = 0 this.roleData.clickVideoTimes = 0 this.roleData.hangVideoFree = 0 this.roleData.canDailyCash = 0 this.roleData.activeNum = 0 this.roleData.activeGet = [0, 0, 0] //重置空投掉落次数 this.roleData.airshipSpeedCard = 0 this.roleData.airshipTicket = 0 this.roleData.airshipTurntableCard = 0 //重置惊喜宝箱掉落次数 this.roleData.boxSpeedCard = 0 this.roleData.boxTicket = 0 this.roleData.boxTurntableCard = 0 this.roleData.turntableExtrasReward = [] this.roleData.turntableCard = 0 if (this.roleData.dailyPro == 0) { GameM.commonData.roleData.dailyCashAniPlayed = 0 } this.updateRoleData() let key = 'dddddddddddddddddddddddddddddddd' let d = null // this.dayCsjTimes = 0 // let d = utils.Encrypt(this.dayCsjTimes, key, GameM.commonData.appid) // GameM.globalStorage.setStorage(STORAGE_KEY.dayCsjTimes, d) // this.dayYlhTimes = 0 // d = utils.Encrypt(this.dayYlhTimes, key, GameM.commonData.appid) // GameM.globalStorage.setStorage(STORAGE_KEY.dayYlhTimes, d) this.dayBuyCarVideoLimitTimes = GameM.commonData.globalCfg['dayBuyCarVideoLimitTimes'] d = Utils.Encrypt(this.dayBuyCarVideoLimitTimes, key, GameM.commonData.appid) GameM.globalStorage.setStorage(STORAGE_KEY.dayBuyCarVideoLimitTimes, d) this.todayVideoTimes = 0 GameM.globalStorage.setStorage(STORAGE_KEY.todayVideoTimes, this.todayVideoTimes) this.todayFullInterTimes = 0 GameM.globalStorage.setStorage(STORAGE_KEY.todayFullInterTimes, this.todayFullInterTimes) this.userIsNewDay = 0 let data6 = { 'userIsNewDay': this.userIsNewDay } GameM.httpM.sendDatas(HTTP_TYPE.updateUserIsNewDay, data6) GameM.globalStorage.setStorage(STORAGE_KEY.showClubGirl, 1) /**重置每天的买车次数 */ for (let i = 0; i < data.maxCarLevel; i++) { LocalManagerData.Instance.saveBuyCarData(i, 0) } GameM.commonData.todayPlayTime = 0 GameM.globalStorage.setStorage(STORAGE_KEY.todayPlayTime, GameM.commonData.todayPlayTime) GlobalStorage.Instance.setStorage(STORAGE_KEY.CoinTipTotay, 0, 0) let cashLen = 0 if (data.cashStatus) { cashLen += data.cashStatus.length } if (data.dailyCashStatus) { cashLen += data.dailyCashStatus.length } let cashEcpm = 0 //已经提现 if (cashLen > 0) { if (data.adShowConfig) { cashEcpm = data.adShowConfig.average_ecpm } if (GameM.commonData.globalCfg['IconShowEcpm']) { let arr = GameM.commonData.globalCfg['IconShowEcpm'].split(',') let len = arr.length for (var i = 0; i < this.cashStateBtnsArr.length; i++) { if (len > i && cashEcpm > Number(arr[i])) { this.cashStateBtnsArr[i] = "1" } else { this.cashStateBtnsArr[i] = "0" } } } } let cashStateStr = '' cashStateStr = this.cashStateBtnsArr.join(',') GlobalStorage.Instance.setStorage(STORAGE_KEY.cashEcpmBtnState, cashStateStr, 1) LogUtil.logV('cashStateBtnsArr aa ', this.cashStateBtnsArr) } else { this.dailyFirstLogin = false this.giftTimes = data.giftTimes if (data.dailyFinishTimesData) { this.dailyFinishTimesData = data.dailyFinishTimesData } else { this.dailyFinishTimesData = [] } if (data.dailyGetData) { this.dailyGetData = data.dailyGetData } else { this.dailyGetData = [] } let update = false if (this.roleData.canDailyCash == undefined) { this.roleData.canDailyCash = 0 this.roleData.dailyFinishIndex = 0 this.roleData.dailyPro = 0 this.roleData.shop = 0 update = true } if (this.roleData.hangVideoFree == undefined) { this.roleData.hangVideoFree = 0 update = true } if (update) { this.updateRoleData() } TurntableData.Instance.turntableRefreshTimes = data.turntableRefreshTimes this.airshipTimes = data.airshipTimes let key = 'dddddddddddddddddddddddddddddddd' let value = GameM.globalStorage.getStorage(STORAGE_KEY.dayBuyCarVideoLimitTimes, 1) if (value != null) { GameM.commonData.dayBuyCarVideoLimitTimes = parseInt(Utils.Decrypt(value, key, GameM.commonData.appid, true)) } let cashStateStr = GlobalStorage.Instance.getStorage(STORAGE_KEY.cashEcpmBtnState, 1) if (cashStateStr != null) { this.cashStateBtnsArr = cashStateStr.split(',') } LogUtil.logV('cashStateBtnsArr bb ', this.cashStateBtnsArr) } GameM.commonData.offlineTime = Math.floor((this.currentTime - this.lastTime) * 0.001) if (GameM.commonData.offlineTime == NaN) { GameM.commonData.offlineTime = 0 } // if (data.step) { // this.step = data.step // } console.log('this.step ', this.step) } else { //第一次登录 console.log('第一次登录') this.isFirstIn = false this.lastTime = this.currentTime GameM.commonData.giftTimes = 0 GameM.commonData.dailyFinishTimesData = [] GameM.commonData.dailyGetData = [] TurntableData.Instance.turntableRefreshTimes = 0 GameM.commonData.airshipTimes = 0 GameM.commonData.offlineTime = 0 AdM.onKSEvent(4) this.userIsNewDay = 0 let data6 = { 'userIsNewDay': this.userIsNewDay } GameM.httpM.sendDatas(HTTP_TYPE.updateUserIsNewDay, data6) let cashStateStr = this.cashStateBtnsArr.join(',') GlobalStorage.Instance.setStorage(STORAGE_KEY.cashEcpmBtnState, cashStateStr, 1) LogUtil.logV('cashStateBtnsArr cc ', this.cashStateBtnsArr) } this.buyTimeTotal = data.buyTimeTotal if (this.roleData.TypeCar4Times == undefined) { this.roleData.TypeCar4Times = 0 } if (this.roleData.investGuide == undefined) { this.roleData.investGuide = 0 } if (this.roleData.dailyGuide == undefined) { this.roleData.dailyGuide = 0 } if (this.roleData.ticket == undefined) { this.roleData.ticket = 0 } if (this.roleData.activeNum == undefined) { this.roleData.activeNum = 0 } if (this.roleData.activeGet == undefined) { this.roleData.activeGet = [0, 0, 0] } if (this.roleData.dailyCashAniPlayed == undefined) { GameM.commonData.roleData.dailyCashAniPlayed = 0 } if (this.roleData.turntableTotal == null || this.roleData.turntableTotal == undefined) { this.roleData.turntableTotal = 0 } if (this.roleData.shopTotal == null || this.roleData.shopTotal == undefined) { this.roleData.shopTotal = 0 } if (this.roleData.investTotal == null || this.roleData.investTotal == undefined) { this.roleData.investTotal = 0 } if (this.roleData.treasureTotal == null || this.roleData.treasureTotal == undefined) { this.roleData.treasureTotal = 0 } if (this.roleData.inviteTotal == null || this.roleData.inviteTotal == undefined) { this.roleData.inviteTotal = 0 } if (this.roleData.airshipTotal == null || this.roleData.airshipTotal == undefined) { this.roleData.airshipTotal = 0 } if (this.roleData.turntableExtrasReward == null || this.roleData.turntableExtrasReward == undefined) { this.roleData.turntableExtrasReward = [] } if (this.offlineTime > 0) { this.videoCoolDown -= this.offlineTime if (this.videoCoolDown < 0) { this.videoCoolDown = 0 } GlobalStorage.Instance.setStorage(STORAGE_KEY.videoCoolDown, this.videoCoolDown) } if (data.gold != '') { this.gold = data.gold.toString() } if (data.videoTimes) { this.videoTimes = data.videoTimes } if (data.bagCar) { //console.log("--->Data:"+JSON.stringify(data)) //console.log("--->BagCar" + JSON.stringify(data.bagCar)) this.bagCar = data.bagCar //15车位版本 // console.log("---->Bag:" + JSON.stringify(data.bagCar)); if (this.bagCar.length == 12) { this.bagCar.push({ 'pos': 12, 'type': 0, 'num': 1 }); this.bagCar.push({ 'pos': 13, 'type': 0, 'num': 1 }); this.bagCar.push({ 'pos': 14, 'type': 0, 'num': 1 }); } } //西游 //this.bagCar.splice(12, 3) // console.log("--->BagCarEnd" + JSON.stringify(this.bagCar)) //console.log("--->dataMaxCarLv:"+data.maxCarLevel); this.maxCarLevel = data.maxCarLevel if (data.buyTimeData) { this.buyTimeData = data.buyTimeData } GameM.globalStorage.speedUpTimeValue = data.speedUpTimeValue this.maxCarLvCanBuy = this.getMaxCarLvCanBuy() this.giftCacheNum = data.giftCacheNum this.boxCacheNum = data.boxCacheNum TurntableData.Instance.turntableTimes = data.turntableTimes if (data.achieveGetData) { this.achieveGetData = data.achieveGetData } if (data.composeAwardGet) { this.composeAwardGet = data.composeAwardGet } // InvestData.Instance.investTime = data.investTime // InvestData.Instance.investIndex = data.investIndex if (data.loginDays) { this.loginDays = data.loginDays } if (this.loginDays == 1) { this.isFirstDay = 1 } else { this.isFirstDay = 0 } this.composeCarTimes = data.composeCarTimes this.lastVideoUpCarBuyTimes = data.lastVideoUpCarBuyTimes if (data.cashStatus) { CashOutData.Instance.cashStatus = data.cashStatus } if (data.redMoneyRecord) { this.redMoneyRecord = data.redMoneyRecord } if (data.cashRecord) { this.cashRecord = data.cashRecord } GameM.commonData.giftCacheMax = GameM.commonData.giftCfg.times GameM.commonData.giftMaxTimes = GameM.commonData.giftCfg.day_times if (GameM.commonData.roleData.lv >= 3 && GameM.commonData.giftTimes < GameM.commonData.giftMaxTimes) { let maxAdd = GameM.commonData.giftMaxTimes - GameM.commonData.giftTimes let len = GameM.commonData.giftCacheNum if (len < GameM.commonData.giftCacheMax) { let canAdd = Math.min((GameM.commonData.giftCfg.times - len), maxAdd) let timeAdd = Math.floor(GameM.commonData.offlineTime / (GameM.commonData.giftCfg.timespan + 30)) let addNum = Math.min(timeAdd, canAdd) GameM.commonData.giftCacheNum += addNum } } else { console.log('今日礼包次数达到上限') } if (!this.roleData.dailyGet) { this.roleData.dailyGet = '0,0,0,0,0,0,0' } DailyData.Instance.dailyGetArr = this.roleData.dailyGet.split(',') GameM.commonData.gameAdd = GameM.globalStorage.getStorage(STORAGE_KEY.gameAdd) + GameM.commonData.offlineTime GameM.globalStorage.setStorage(STORAGE_KEY.gameAdd, GameM.commonData.gameAdd) this.richBankCashAmount = data.richBankCashAmount this.currentRichBankCashTaskIndex = data.currentRichBankCashTaskIndex if (this.currentRichBankCashTaskIndex > 0) { this.roleData.addRichBankFinishIndex = this.currentRichBankCashTaskIndex } this.richBankDailyVideoTimes = data.richBankDailyVideoTimes this.richbank_logindays = data.richbank_logindays this.isopenrichbank = data.isopenrichbank //赋值红包币 this.redMoney = data.redMoney this.getToponLockPriceData() if (data.dailyCashStatus) { DailyCashData.Instance.dailyCashStatus = data.dailyCashStatus } //插屏、banner开启条件 if (this.maxCarLevel >= 8 && (DailyCashData.Instance.dailyCashStatus.length > 0 || CashOutData.Instance.cashStatus.length > 0)) { if (data.adShowConfig) { this.adShowConfig = data.adShowConfig LogUtil.logV('data.adShowConfig ', data.adShowConfig) } } LogUtil.logV('this.adShowConfig ', this.adShowConfig) if (data.userDailyCashInfo) { DailyCashData.Instance.userDailyCashInfo = data.userDailyCashInfo LogUtil.logV('data.userDailyCashInfo ', data.userDailyCashInfo) } //test // GameM.commonData.updateMaxCarLevel(2) // GameM.commonData.roleData.lv = 4 // GameM.commonData.roleData.canDailyCash = 0 // GameM.commonData.roleData.newuser = null // GameM.commonData.redMoney = 0 // GameM.commonData.roleData.exp = 0 // GameM.commonData.step = 1 // this.dailyFirstLogin = true // this.dailyGetArr[1] = '0' // this.maxCarLevel = 30 // this.loginDays = 2 // this.canSign = 0 // GameM.commonData.roleData.phonePieceNum = 0 // GameM.commonData.signDays = 0 // this.updateRoleData() // GameM.commonData.maxCarLevel = 7 // this.roleData.ticket = 10 // this.maxCarLevel = 60 // this.roleData.flower = 300 // this.maxCarLevel = 30 // this.loginDays = 30 //测试 // this.maxCarLevel = 30 // this.loginDays = 10 //西游 MateData.Ins.talentCoin = data.talentCoin; MateData.Ins.MateDataServerInit(data.partnerTalentInfo); FightData.Ins.UpdateTriggerFightRate(); WealthData.Ins.WealthInit(data.userWealthGodInfo, data.adShowConfig.average_ecpm); RichData.Ins.ServerInit(data.userLearningInfo); //WealthData.Ins.wealthInfo = data.userWealthGodInfo; TuCaoData.Ins.ServerInit(data.userTuCaoInfo); //WealthData.Ins.wealthInfo = data.userWealthGodInfo; //WealthData.Ins.paramEcpm = data.adShowConfig.average_ecpm; AdM.setTAEventRegister() //引导下载剩余奖励次数 每日重置 if (data.userTreasureGourdInfo) { DownloadApkData.Instance.installRewards = data.userTreasureGourdInfo.installRewards DownloadApkData.Instance.startRewards = data.userTreasureGourdInfo.startRewards DownloadApkData.Instance.packageInfoArr = data.userTreasureGourdInfo.treasureGourds } console.log("--->MaxCarLv:" + this.maxCarLevel); // this.roleData.lv = 18 // GameM.commonData.canSign = 0 // this.redMoney = 1000000 // this.videoCoolDown = 60 } public disConnectNum = 0 public hasShowDisconnect = false /** 断网弹窗 */ async showDisconnectedNode() { if (this.disConnectNum < 5) { this.disConnectNum++ return } if (!this.hasShowDisconnect) { this.hasShowDisconnect = true this.disConnectNum = 0 let pre = await Utils.loadResPromise('prefabs/DisconnectedNode') let disCon = cc.instantiate(pre) let con = cc.find('Canvas') con.addChild(disCon) } } //西游 /**是否已解锁罢工功能*/ IsUnlockStrike() { //不要点击生产金币功能了 return false; //console.log("-->role lv:"+this.roleData.lv); //return this.maxCarLevel >= this.unlockStrikeLv; return this.maxCarLevel >= this.unlockStrikeLv; } /**西游(弃用 继续使用 maxCarLevel表示最大等级) 更新合成的角色最大等级*/ UpdateComposeMaxRoleLv(lv) { if (lv > this.composeMaxRoleLv) { //首次合成战斗触发在 gift checkShowGuide中 this.composeMaxRoleLv = lv PlayerPrefs.SetInt(STORAGE_KEY.composeMaxRoleLv, this.composeMaxRoleLv); //HttpM.Instance.SendData(HTTP_TYPE.updateMaxCarLevel,{ 'maxCarLevel': this.maxCarLevel },(res)=>{ // console.log("-->update max Car:"+JSON.stringify(res)); //}); //天赋解锁 MateData.Ins.CheckUnlockTalent(lv); //更新战斗触发概率 FightData.Ins.UpdateTriggerFightRate(); } else { //已解锁武将 概率触发战斗 FightData.Ins.CheckTriggerFight(lv); } } } /**轮船方向 */ export enum CARDIR { Up = 0, Left = 1, Right = 2, Down = 3 } export const ConfigOnLine = { GlobalCfg: 'GlobalCfg.json' } export enum MONEY_TYPE { gold = 10001, redMoney = 10002, timespanGold = 10003, box = 10004, offlineGold = 10005, getNewCar = 10006, carLvUp = 10007, popVideo = 10008, buyCarGold = 10014, buyCar = 10015, caidanNew = 10017, mainBuyCarGold = 10018, speedCard = 20001, //加速卡加速投资时间 turnTableCard = 20002, //转盘卡 treasureCard = 20003, //空投获得夺宝券 treasureTicket = 20004, //视频获得夺宝券 active = 20005, //活跃值 talentCoin = 20006, //天赋石 clearCooltime = 30001,//清楚冷却时间 } /** * 签到奖励 在线奖励 幸运转盘 投资收益 日常任务 成就任务 在线礼包 轮船升级 角色升级 轮船等级奖励 空投礼包 新人奖励 购买新车 */ export enum RecordTYPE { signIn = 0, online, turntable, invest, dailytask, achievement, onlineGiftRed, carLevelup, roleLevelup, carLevelReward, airship, newUser, buyNewCar } /** 向服务器发送数据类型 */ export enum HTTP_TYPE { connectTest = 'connectTest', getInfo = 'getInfo', addRedMoney = 'addRedMoney', getRedMoneyRecord = 'getRedMoneyRecord', cash = 'cash', getCashRecord = 'getCashRecord', bankCashRecord = "richbank/getCashRecord", bankOpenCashTask = "richbank/openCashTask", bankCash = "richbank/richbankcash", bankUpdateCashRecord = "richbank/updateCashRecord", backIsOpenRichBank = "richbank/updateIsOpenRichBank", getRichBankCfg = "richbank/getRichBankCfg",//获取服务器配置 getCurrentCashTaskInfo = "richbank/getCurrentCashTaskInfo",//获取当前任务进度 getRichBankInfo = "richbank/getRichBankInfo", updateStep = 'updateStep', updateGold = 'updateGold', updateRoleData = 'updateRoleData', updateBagCar = 'updateBagCar', /**更新最高车等级 更新战斗触发1 队列*/ updateMaxCarLevel = 'updateMaxCarLevel', //更新车等级 updateBuyTimeTotal = 'updateBuyTimeTotal', updateBuyTimeData = 'updateBuyTimeData', updateBuyTimeDataMain = 'updateBuyTimeDataMain', updateSpeedUpTime = 'updateSpeedUpTime', updateSpeedUpStartTime = 'updateSpeedUpStartTime', updateSpeedUpTimeValue = 'updateSpeedUpTimeValue', updateGiftCacheNum = 'updateGiftCacheNum', updateBoxCacheNum = 'updateBoxCacheNum', updateGiftTimes = 'updateGiftTimes', updateTurntableRefreshTimes = 'updateTurntableRefreshTimes', updateTurntableTimes = 'updateTurntableTimes', updateDailyFinishTimesData = 'updateDailyFinishTimesData', updateDailyGetData = 'updateDailyGetData', updateAchieveGetData = 'updateAchieveGetData', updateInvestData = 'updateInvestData', updateComposeAwardGet = 'updateComposeAwardGet', updateComposeCarTimes = 'updateComposeCarTimes', updateAirshipTimes = 'updateAirshipTimes', updateLastVideoUpCarBuyTimes = 'updateLastVideoUpCarBuyTimes', updateSpeedUpTotal = 'updateSpeedUpTotal', updateVideo = 'updateVideo', machine = 'user/machine', getLuckDrawInfo = 'getLuckDrawInfo', refreshluckDrawInfo = 'refreshluckDrawInfo', join = 'join', luckycash = 'luckycash', getLuckyLottery = 'getLuckyLottery', getShouYeLuckyLottery = 'getShouYeLuckyLottery', lotteryresults = 'lotteryresults', getLuckydrawConfig = 'getLuckydrawConfig', updatelottery = 'updatelottery', getDailyLimit = 'getDailyLimit', updateVersion = 'updateVersion', getUserIsNewDay = 'getUserIsNewDay', updateUserIsNewDay = 'updateUserIsNewDay', getConfigInfo = 'getConfigInfo', getAllConfigInfo = 'getAllConfigInfo', activate = 'ad/oe/callback/activate', qqActive = '/ad/qq/callback/activate', cp = 'cp', updateADLog = 'updateADLog', /** 获取topon锁价配置信息*/ getToponLockPrice = 'getToponLockPrice', //裂变 /**会员个人基础信息(等级、升级进度、提现加成、已到账金额、总邀请人数) */ clubGetBaseInfo = "/fission/getBaseInfo", /**提现 */ clubDoWithdraw = "/fission/doWithdraw", /**等级奖励规则 */ clubLevelRewardRule = "/fission/levelRewardRule", /**活跃奖励气泡数据 */ clubMyBubbleData = "/fission/myBubbleData", /**我招募的后代成员 */ clubMyRecruitMembers = "/fission/myRecruitMembers", /**预估收益 */ clubPredictRevenue = "/fission/predictRevenue", /**招募完成提现广播 */ clubRecruitBroadcast = "/fission/recruitBroadcast", /**招募进度 */ clubRecruitProgress = "/fission/recruitProgress", /**获取短地址 */ clubShorturl = "/fission/short-url", /**活跃奖励提现档位 */ clubWithdrawDenominations = "/fission/withdrawDenominations", /**提现记录 */ clubWithDrawRecords = "/fission/withDrawRecords", /**收取泡泡/确定过期泡泡 */ clubCollectBubbles = "/fission/collectBubbles", /** 绑定邀请人 */ bindRelation = "/fission/bindRelation", /** 上传邀请码 */ inviteInstalled = "inviteInstalled", /** 添加app下载日志 */ appDownloadLog = "/fission/appDownloadLog", /** 获取推荐列表 */ recommendList = "/fission/recommendList", /** 自动收集泡泡 */ autoCollectBubbles = "/fission/autoCollectBubbles", /** 投资数据 */ getInvestInfo = 'invest/getInvestInfo', /** 更新投资数据 */ updateInvestProject = 'invest/updateInvestProject', /** 更新投资加速数据 */ reduceTimeInvestProject = 'invest/reduceTimeInvestProject', /** 常规彩蛋 -- 开启彩蛋 */ openUsualEggData = 'coloredEggs/openUsualEggData', /** 常规彩蛋 -- 更新彩蛋进度 */ updateUsualEggData = 'coloredEggs/updateUsualEggData', /** 常规彩蛋 -- 彩蛋完成 */ completeUsualEggTask = 'coloredEggs/completeUsualEggTask', /** 常规彩蛋 -- 彩蛋提现 */ usualEggsTaskCash = 'coloredEggs/usualEggsTaskCash', /** 时长统计 */ activateLog = 'activateLog', /** 是否强更新 */ getForceVersionInfo = 'getForceVersionInfo', /** 获取是否显示插屏和banner */ adShowConfig = 'user/adShowConfig', /** 提前获取提现金额 */ getCashMoney = 'getCashMoney', /** 提前获取彩蛋金额 */ getUsualEggCashMoney = 'coloredEggs/getUsualEggCashMoney', /** 提前获取每日提现金 */ getDailyCashMoney = 'getDailyCashMoney', /** 每日提现买车次数 */ getDailyCashBuyTime = 'getDailyCashBuyTime', /** 每日提现 */ dailyCash = 'dailyCash', /** 查询是否打死boss */ checkDefeatBoss = 'battle/checkDefeatBoss', //西游接口 /**获取战斗一武将队列*/ getMyBossRecords = 'battle/getMyBossRecords', /**开始战斗*/ beginBattle = 'battle/beginBattle', /**战斗结束 结算 奖励获取 解锁伙伴*/ finishBattle = 'battle/finishBattle', /**天赋 升级伙伴天赋*/ upgradePartnerTalent = 'upgradePartnerTalent', updateBattleStoneCount = "updateBattleStoneCount", /**战斗 获取双倍奖励*/ battleDoubleAward = 'battle/doubleAward', /**财神降临 开启财神降临*/ wealthGodOpen = 'wealthgod/openWealthGod', /**财神降临 更新消耗金币*/ wealthUpdateGold = 'wealthgod/updateConsumeGold', /**财神降临 更新时间接口*/ wealthUpdateTime = 'wealthgod/updateWealthGodSecond', /**财神降临 更新财神状态*/ wealthUpdateStatus = 'wealthgod/updateWealthGodStatus', //大富翁 /**大富翁 获取棋盘*/ richManChessboar = 'learning/chessboard', /**大富翁 更新道具信息*/ richManUpdateItemCard = 'learning/updateItemCard', /**大富翁 更新棋盘*/ richManUpdateLattice = 'learning/updateLattice', /**大富翁 获取武将奖励*/ richManBossReward = 'learning/getRewards', /**大富翁 获取一个答题*/ richManGetSubject = 'learning/oneQuestion', /**大富翁 兑换经书列表*/ richManBookList = 'learning/exchangeScriptureNum', /**大富翁 经书红包币兑换*/ richManJadeCash = 'learning/fairyJadeCash', /**大富翁 取经初始化*/ richManInitCardInfo = 'learning/initialItemCardInfo', //引导下载 getPackage = 'treasureGourd/getPackage', updatePackage = 'treasureGourd/updatePackage', updateRewards = 'treasureGourd/updateRewards', //兑换礼包 /**兑换礼包*/ redeemExchange = 'redemption/exchange', /**获取礼包*/ redeemGetRedemption = 'redemption/getRedemption', /**看视频领红包 大额红包提现*/ adRbBigCash = 'redMoneyVideoCash', /**看视频领红包 任务红包提现*/ adRbTaskCash = 'tuCaoRedMoney/gearCash', /**看视频领红包 初始化数据*/ adRbInit = 'tuCaoRedMoney/initUserInfo', /**看视频领红包 免费加进度*/ adRbNoNeedVideo = 'tuCaoRedMoney/noNeedVideo' } /** 服务器放置的配置表 */ export enum CFG_SERVER { GlobalCfg = 'GlobalCfg', CashCfg = 'CashCfg', DailyCashApplyCfg = 'DailyCashApplyCfg', GiftCfg = 'GiftCfg', DailyCfg = 'DailyCfg', PriceCfg = 'PriceCfg', RichBankCfg = 'RichBankCfg', AirshipCfg = 'AirshipCfg', TurntableCfg = "TurntableCfg", UsualEggTaskCfg = 'UsualEggTaskCfg', //西游 BattleBossCfg = "BattleBossCfg", //服务端战斗角色配置 PartnerTalentCfg = "PartnerTalentCfg" //服务端战斗角色配置 }