| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643 |
- 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<any>()
- GameM.ClubData.cashRecord = new Array<any>()
- //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" //服务端战斗角色配置
- }
|