CommonData.ts 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643
  1. import GlobalStorage, { STORAGE_KEY } from "./GlobalStorage";
  2. import GameM, { VIDEO_TYPE } from "../manager/GameM";
  3. import Main from "../Main";
  4. import UiM, { PANEL_NAME } from "../manager/UiM";
  5. import Task from "../ui/Task";
  6. import CashOut from "../ui/CashOut";
  7. import RewardNode from "../ui/RewardNode";
  8. import AdM from "../manager/AdM";
  9. import Shop from "../ui/Shop";
  10. import Sciencen_M from "../utils/Sciencen_M";
  11. import HttpM from "../manager/HttpM";
  12. import LogUtil from "../utils/LogUtil";
  13. import SafeDepositBox from "../ui/SafeDepositBox";
  14. import BankQipaoTip from "../ui/BankQipaoTip";
  15. import LocalManagerData from "./LocalManagerData";
  16. import OfficialNode from "../ui/OfficialNode";
  17. import CashRecordNode from "../ui/CashRecordNode";
  18. import RedCodeNode from "../ui/RedCodeNode";
  19. import TreasureData from "./TreasureData";
  20. import TurntableData from "./TurntableData";
  21. import DailyData from "./DailyData";
  22. import InvestData from "./InvestData";
  23. import CashOutData from "./CashOutData";
  24. import { PlayerPrefs } from "../tools/MyExtends";
  25. import UIMng from "../uiFrames/UIMng";
  26. import { FightData } from "./FightData";
  27. import { MateData } from "./MateData";
  28. import { Utils } from "../utils/Utils";
  29. import UsualCaidanData from "./UsualCaidanData";
  30. import GuideMng from "../manager/GuideMng";
  31. import DailyCashData from "./DailyCashData";
  32. import NativeAdAwardData from "../manager/NativeAdAwardData";
  33. import { GameController } from "../manager/GameController";
  34. import { WealthData } from "./WealthData";
  35. import { RichData } from "./RichData";
  36. import DownloadApkData from "./DownloadApkData";
  37. import SwitchM from "../manager/SwitchM";
  38. import MoreGameNode from "../ui/MoreGameNode";
  39. import EffectNode from "../ui/EffectNode";
  40. import Setting from "../ui/Setting";
  41. import { TuCaoData } from "./TuCaoData";
  42. const { ccclass, property } = cc._decorator;
  43. @ccclass
  44. export default class CommonData {
  45. private static instance: CommonData = null
  46. static get Instance(): CommonData {
  47. if (!this.instance) {
  48. this.instance = new CommonData()
  49. }
  50. return this.instance
  51. }
  52. //西游
  53. /**是否使用西游版生成金币*/
  54. isUseXiYouAddCoin: boolean = true;
  55. /**解锁点击生产金币 最高车等级 默认就解锁*/
  56. unlockStrikeLv: number = 1;
  57. /**本日点击生产金币次数*/
  58. clickStrikeNum: number = 0;
  59. /**本日点击生产金币次数上限*/
  60. clickStrikeMaxNum: number = 2000;
  61. /**点击武将生成金币引导 最高车等级*/
  62. strikeGuideLv: number = 8;
  63. //strikeGuideLv: number = 4;
  64. /**(弃用 继续使用 maxCarLevel) 当前合成的角色的最大等级 必须是合成的车*/
  65. composeMaxRoleLv: number = 0;
  66. /**战斗统一配置*/
  67. fightCfg: any = null;
  68. /**战斗角色配置*/
  69. fightRoleCfg: any = null;
  70. /**战斗角色服务端配置*/
  71. fightRoleServerCfg: any = null;
  72. /**战斗奖励*/
  73. fightRewardCfg: any = null;
  74. /**角色buff配置*/
  75. buffCfg: any = null;
  76. /**角色buffbag buff库*/
  77. buffbagCfg: any = null;
  78. /**伙伴统一配置*/
  79. mateCfg: any = null;
  80. /**伙伴天赋配置 本地加载 然后被服务端配置替换*/
  81. mateTalentCfg: any = null;
  82. /**主页背景配置*/
  83. mainBgCfg: any = null;
  84. /**三国战戟 天赋配置 根据最高武将等级获取对应天赋等级*/
  85. mateTalentDataCfg: any = null;
  86. unlockWealthLevel: number = 13;
  87. /**是否为测试*/
  88. IsTest: boolean = false;
  89. /**是否连接服务器数据*/
  90. static IsServer: boolean = true;
  91. /** topon广告是否加载完成 */
  92. toponLoaded = false
  93. //通信结束
  94. serverFinish = false
  95. /** 广告测试 */
  96. isVideoTest = false
  97. loginTest = false
  98. /** 用本地数据 */
  99. useLocalData = false
  100. /** 红包开关 开 显示 关 不显示 */
  101. redSwitch = true
  102. /** 隐私开关 */
  103. popPrivacySwitch = false
  104. /** 认证开关 */
  105. popIdentifySwitch = false
  106. /** 是否同意隐私和协议 */
  107. passPrivacy = false
  108. ranKey = ''
  109. ranKeyNew = ''
  110. tmp_uin = ''
  111. uin = ''
  112. login_ticket = ''
  113. session_key = ''
  114. wxCode = ''
  115. //西游
  116. //appid = 'wxef592f91d2d125f5'
  117. //三国战戟
  118. // appid = 'wxcc1ce79d026cc35f'
  119. //三国战戟
  120. appid = 'wxefd10800332fee04'
  121. //航海
  122. //appid = 'wx22b3f0f8005f0e51'
  123. // appid = 'wx07895e2f78748daf'
  124. /** 是否有微信老数据 */
  125. isNew = false
  126. /** 第一次登录 */
  127. isFirstIn = false
  128. //西游配置版本
  129. version = '1.0.1'
  130. //version = '1.0.0'
  131. //强更(整包更新) -1 还没出结果 0 不需要 1 需要
  132. needForceUpdate = -1
  133. installVersion: string = ''
  134. installUrl: string = ''
  135. updateDes: string = ''
  136. fixDes: string = ''
  137. /** loader跳过更新 */
  138. skipUpdate = false
  139. //oss地址
  140. resURL: string = 'https://xcx-box.oss-cn-hangzhou.aliyuncs.com/hotgame/HundredsOfMillions/wxGame/'
  141. /** app版本号 */
  142. appVersion = ''
  143. /** 是否是第一天 0 不是 1 是*/
  144. isFirstDay = 0
  145. /** 友盟渠道 */
  146. umengChannel = ''
  147. /** 设备型号 */
  148. deviceType = ''
  149. /** 安卓版本号 */
  150. androidVersion = ''
  151. /** 投放渠道 1 巨量 2 快手 3 广点通 */
  152. advertisingChannel = 1
  153. /** banner和插屏显示开关 */
  154. adShowConfig = null
  155. /** 提现、每日提现、钱庄按钮显示状态 1 显示 0 不显示 */
  156. cashStateBtnsArr = ["1", "1", "1"]
  157. toponId = 'a600b9cb61b556'
  158. toponKey = '66b742dd0e502b64d783d9c66a9d30c4'
  159. rewardPlaceId = 'b600b9daa737ff'
  160. interPlaceId = 'b600b9d639cf05'
  161. nativePlaceId = 'b600b9d7ca9ac1'
  162. fullInterPlaceId = 'b5f9649a8c0f9c'
  163. bannerPlaceId = 'b600b9cde9d982'
  164. /** 金币 */
  165. gold: string = String(2000000)
  166. /**购买车系数表 */
  167. buyCarPriceArr = []
  168. lastDate = ''
  169. curData = ''
  170. //毫秒
  171. lastTime = 0
  172. //服务器时间毫秒
  173. currentTime = 0
  174. /** 购买车升级加等级 */
  175. carLvUpAdd = 0
  176. /** 购买车升级减等级 */
  177. carLvUpMinus = 0
  178. inter_weight = 0.3
  179. /** 每秒收益 */
  180. goldSecond: number = 0
  181. /** 红包币 */
  182. redMoney: number = 0
  183. // recordAwardTypeArr = ['登录奖励', '在线奖励', '幸运转盘', '投资收益', '日常任务', '成就任务', '挂机礼包',
  184. // '武将升级', '账号升级', '武将等级奖励', '惊喜红包', '新人奖励', '购买新武将']
  185. recordAwardTypeArr = ['', '武将提现', '每日提现', '夺宝提现', '钱庄提现', '招募任务提现', '每日招募提现',
  186. '累计招募提现', '', '彩蛋提现', "视频红包", "视频大额红包"]
  187. typeArr = ['恭喜发财,大吉大利', '登录大红包', '准点红包', '红包币红包']
  188. /** 红包记录 */
  189. redMoneyRecord = []
  190. /** 提现记录 */
  191. cashRecord = []
  192. /** 累计提现金额 */
  193. cashTotalNum = 0
  194. curSelChatItem = null
  195. /** 看视频次数 */
  196. videoTimes: number = 0
  197. /** 所有可买车当前价格 下标0开始 是1级车 */
  198. allCarCurPriceArr = []
  199. /** 当前可以视频购买的车 */
  200. curVideoCarType = 1
  201. /** 今日游戏时间 未成年人才计时 */
  202. todayPlayTime = 0
  203. /** 认证 0 未认证 1 认证成人 2 认证未成年人 */
  204. identification = 0
  205. //车位掉落红包币礼包配置
  206. giftBagRedMoney = [
  207. [0, 100, 58],
  208. [100, 200, 158],
  209. [200, 1000000, 258]
  210. ]
  211. /** 背包中车数据 车位:车类型 */
  212. bagCar = [
  213. {
  214. 'pos': 0,
  215. 'type': 0,
  216. 'num': 1
  217. },
  218. {
  219. 'pos': 1,
  220. 'type': 0,
  221. 'num': 1
  222. },
  223. {
  224. 'pos': 2,
  225. 'type': 0,
  226. 'num': 1
  227. },
  228. {
  229. 'pos': 3,
  230. 'type': 0,
  231. 'num': 1
  232. },
  233. {
  234. 'pos': 4,
  235. 'type': 0,
  236. 'num': 1
  237. },
  238. {
  239. 'pos': 5,
  240. 'type': 0,
  241. 'num': 1
  242. },
  243. {
  244. 'pos': 6,
  245. 'type': 0,
  246. 'num': 1
  247. },
  248. {
  249. 'pos': 7,
  250. 'type': 0,
  251. 'num': 1
  252. },
  253. {
  254. 'pos': 8,
  255. 'type': 0,
  256. 'num': 1
  257. },
  258. {
  259. 'pos': 9,
  260. 'type': 0,
  261. 'num': 1
  262. },
  263. {
  264. 'pos': 10,
  265. 'type': 0,
  266. 'num': 1
  267. },
  268. {
  269. 'pos': 11,
  270. 'type': 0,
  271. 'num': 1
  272. },
  273. {
  274. 'pos': 12,
  275. 'type': 0,
  276. 'num': 1
  277. },
  278. {
  279. 'pos': 13,
  280. 'type': 0,
  281. 'num': 1
  282. },
  283. {
  284. 'pos': 14,
  285. 'type': 0,
  286. 'num': 1
  287. }
  288. ]
  289. /** 人物信息 */
  290. roleData = {
  291. 'lv': 1,
  292. 'exp': '0',
  293. 'newuser': 0,
  294. 'hangupVideoTimes': 0,
  295. 'clickVideoTimes': 0, //每日视频次数 用来计算金币衰减
  296. 'shop': 0, //是否已经打开商店强制引导 0 打开 1 关闭
  297. 'dailyGet': '0,0,0,0,0,0,0',
  298. 'hangVideoFree': 0, //今日是否免费领取主动拉视频奖励
  299. 'canDailyCash': 0, //能否当日提现 0 可以 1 不可以
  300. 'dailyFinishIndex': 0, //每日提现完成index
  301. 'dailyPro': 0, //当日提现进度
  302. 'TypeCar4Times': 0, //合成4级车次数为2时弹出每日提现界面
  303. 'videoTimes': 0, //看视频次数 放到人物信息里
  304. 'investGuide': 0, //投资引导
  305. 'dailyGuide': 0, //每日豪礼引导
  306. 'ticket': 0, //夺宝券个数
  307. 'active': 0, //是否激活
  308. 'secondActive': 0, //次留
  309. 'composeGuide': 0, //新车合成奖励
  310. 'ifGuideSecrtary': 0, //秘书引导
  311. 'dailyCashAniPlayed': 0, // 每日提现随机动画播放 0 未播放 1 已播放
  312. 'investTimes': 0, //每日投资次数
  313. 'turntableCard': 0, // 转盘卡
  314. "speedCard": 0, //投资加速券
  315. 'investTotal': 0, //投资总次数
  316. 'turntableTotal': 0, //转盘总次数
  317. 'shopTotal': 0, //累计妖洞购买次数
  318. 'treasureTotal': 0, //累计夺宝次数
  319. 'airshipTotal': 0, //累计热气球次数
  320. 'inviteTotal': 0, //累计有效邀请人数
  321. 'activeNum': 0, //活跃值
  322. 'activeGet': [0, 0, 0], //活跃宝箱领取
  323. 'turntableUseCard': 0, //转盘卡消耗次数。跟随时间重置
  324. 'airshipSpeedCard': 0, //每日空投掉落加速卡次数
  325. 'airshipTurntableCard': 0, //每日空投掉落转盘卡次数
  326. 'airshipTicket': 0, //每日夺宝券掉落次数
  327. 'boxSpeedCard': 0, //每日惊喜宝箱加速卡掉落次数
  328. 'boxTurntableCard': 0, //每日惊喜宝箱转盘掉落次数
  329. "boxTicket": 0, //每日惊喜宝箱夺宝券掉落次数
  330. "addRichBankFinishIndex": 1, //富翁银行正在进行过的档位
  331. "turntableExtrasReward": [] //转盘次数额外奖励
  332. }
  333. nickname = '未授权'
  334. headimgurl = ''
  335. //西游
  336. /**角色*/
  337. roleArr = []
  338. /** 跑道上车数组 */
  339. carArr = []
  340. /** 每个等级车购买次数数据 */
  341. buyTimeData = []
  342. /** 每个等级车主界面购买次数数据 */
  343. buyTimeDataMain = []
  344. /** 可买车的最大等级 */
  345. maxCarLvCanBuy = 0
  346. /** 购买车总次数 */
  347. buyTimeTotal: number = 0
  348. /** 当前车最大等级 */
  349. maxCarLevel: number = 0
  350. /** 合成车辆的次数 */
  351. composeCarTimes: number = 0
  352. /** 累计登陆天数 */
  353. loginDays = 1
  354. /** 引导步骤 */
  355. step: number = 5
  356. /** 车位满了 待发放奖励个数 */
  357. giftCacheNum = 0
  358. /** 车位满了 待发放box个数 */
  359. boxCacheNum = 0
  360. /** 离线获得奖励上限次数 */
  361. giftCacheMax = 0
  362. /** 每日奖励次数 */
  363. giftTimes = 0
  364. /** 每日奖励上限次数 */
  365. giftMaxTimes = 0
  366. /** 离线时间 秒 */
  367. offlineTime = 0
  368. /** 离线收益最大时间 半个个小时 */
  369. offlineTimeMax = 3600 * 0.5
  370. /** 成就任务领取数据
  371. * key
  372. * 1:合成车辆地次数
  373. 2:解锁XX等级地新车
  374. 3:成功观看广告地次数
  375. 4:玩家等级达到XX级别
  376. 5: 加速累计次数
  377. */
  378. achieveGetData = []
  379. /** 每日任务完成次数
  380. * key
  381. * 1:观看广告
  382. 2:转盘
  383. 3:飞艇
  384. 4:加速
  385. */
  386. dailyFinishTimesData = []
  387. /** 每日任务领取数据
  388. * key
  389. * 1:观看广告
  390. 2:转盘
  391. 3:飞艇
  392. 4:加速
  393. */
  394. dailyGetData = []
  395. composeAwardGet = []
  396. /** --------- 配置表--------- */
  397. /** 车信息配置表 */
  398. carCfg: any = null
  399. /** 购买次数对应车类型 */
  400. buyNumCfg: any = null
  401. /** 购买次数对应车类型 */
  402. giftCfg: any = null
  403. /** 全局配置 */
  404. globalCfg: any = null
  405. /** 人物经验配置 */
  406. roleCft: any = null
  407. /** 任务配置 */
  408. taskCft: any = null
  409. /** 任务活跃奖励配置 */
  410. taskAwardCft: any = null
  411. /** 成就配置 */
  412. achieveCft: any = null
  413. /** 文本配置 */
  414. TxtCft: any = null
  415. /** 飞船配置 */
  416. airshipCfg: any = null
  417. /** 保险箱配置信息 */
  418. richBankConfig = null
  419. /** 保险箱解锁轮船等级 */
  420. richBankUnLockLevel: number = 20
  421. /** 银行存入金额 */
  422. richBankCashAmount = 0
  423. /** 当前任务的id,也就是index字段 */
  424. currentRichBankCashTaskIndex = 0
  425. /** 开始银行任务后 每日观看的视频数 */
  426. richBankDailyVideoTimes = 0
  427. /** 开始银行任务后 连续登录数 */
  428. richbank_logindays = 0
  429. /** 当前有没有提现过 1:豪车升级 2:每日提现*/
  430. richbank_noSave = 0
  431. //
  432. isopenrichbank: number = 0
  433. /**每日提现 */
  434. dailyCashOpenLevel = 0
  435. /**转盘*/
  436. turntableOpenLevel = 0
  437. /**提现 */
  438. cashOpenLevel = 5
  439. /**工厂开启等级 */
  440. factoryOpenLevel = 8
  441. /**登录豪礼 */
  442. loginRewardOpenLevel = 0
  443. /**投资开启等级 */
  444. investOpenLevel = 0
  445. /**现金夺宝开启等级 */
  446. //trerasureOpenLevel = 11
  447. trerasureOpenLevel = 0
  448. /**任务开启等级 */
  449. //taskOpenLevel = 13
  450. taskOpenLevel = 0
  451. /**俱乐部 */
  452. clubOpenLevel = 0
  453. /** 伙伴开启等级 */
  454. mateOpenLevel = 10
  455. /**是否开启俱乐部功能 */
  456. isOpenClub = 0
  457. dropGiftOpenLevel = 10
  458. /**分享页选择 0:应用宝,1:落地页 默认为应用宝*/
  459. clubSharePageMode = 0
  460. /** 是否显示过任务引导 */
  461. taskGuide = 0
  462. /** 买车计算公式配置 */
  463. priceCfg: any = null
  464. /** 需要加载配置个数 */
  465. needCfgNum = 0
  466. /** 获取配置个数 */
  467. getCfgNum = 0
  468. /** 需要加载配置名称数组 */
  469. cfgKeyArr = []
  470. curFactory = null
  471. /** 游戏最近时间戳,用来计算离线时间 毫秒*/
  472. gameTime: number = 0
  473. /** 玩家装游戏后玩的时间 计2小时内发视频次数用*/
  474. gameAdd: number = 0
  475. /** 是否有红包币,有就不会增加 */
  476. hasRedMoney: number = 0
  477. //礼包奖励数组
  478. private _giftArr = []
  479. /** 飞艇领取次数 */
  480. airshipTimes = 0
  481. /** 任务红点用 可领取个数 */
  482. taskRedNum = 0
  483. dailyTaskRedNum = 0
  484. achieveTaskRedNum = 0
  485. /** 上次视频升级车等级购买次数 */
  486. lastVideoUpCarBuyTimes = 0
  487. /** 是否在看广告 */
  488. isWatchVideo = false
  489. /** 玩家10秒内是否操作界面 */
  490. hasTouch = false
  491. hasPopVideo = false
  492. dailyFirstLogin = false
  493. /** 是否授权 */
  494. isAuth = false
  495. /** 弹出插屏界面数组 */
  496. popInterArr = []
  497. /** 工厂升级车最大速度 */
  498. maxSpeedState = false
  499. //品质
  500. quality = 2
  501. /** 每日买车视频上线 */
  502. dayBuyCarVideoLimitTimes = 15
  503. /** 设备信息字段 */
  504. machineInfo = null
  505. /** 投放渠道号 */
  506. tf_channel = ''
  507. /** 是否启用topon */
  508. useTopOn = true
  509. /** 是否是新的一天 1:新的一天 */
  510. userIsNewDay = 0
  511. /** 开屏广告配置控制 */
  512. pullSplashAd = 0
  513. /** 开屏需要提现次数 */
  514. splashNeedCashNum = 0
  515. /** 插屏显示概率数组 */
  516. interAdArr = ['0.04', '0.85', '0.03']
  517. /** 配置获得视频间隔 */
  518. videoCoolTime = 0
  519. /** 视频间隔倒计时 */
  520. videoCoolDown = 0
  521. /** 视频调用规则 */
  522. videoRule = []
  523. /** 今日播放视频次数 */
  524. todayVideoTimes = 0
  525. /** 今日全屏视频次数 */
  526. todayFullInterTimes = 0
  527. /** 播放全屏视频 */
  528. showFull = false
  529. /** 提现完成返回显示每日豪礼 */
  530. backShowDaily = false
  531. /** 每日提现随机动画播放 0 未播放 1 已播放 */
  532. dailyCashAniPlayed = 0
  533. /** topon锁价配置 */
  534. toponPriceLockCfg: any = null
  535. /** 清除冷却时间开关 */
  536. clearCoolTimeLVOpen: number = 0
  537. newMonsterArr = []
  538. /**兑换码数据
  539. * code: 1
  540. redemption:
  541. appName: "三国战戟"
  542. content: Array(2)
  543. 0: {type: "10001", count: "100000"}
  544. 1: {type: "10002", count: "30"}
  545. length: 2
  546. __proto__: Array(0)
  547. endTime: "2021-04-08 00:00:00"
  548. id: 1
  549. nebulaAppId: "wxef592f91d2d125f5"
  550. sort: 1
  551. startTime: "2021-03-29 00:00:00"
  552. title: "新手礼包"
  553. version: "1.1.4"
  554. __proto__: Object
  555. __proto__: Object
  556. errcode: 0
  557. errmsg: "ok"
  558. */
  559. redeemData: any = null;
  560. /**教程视频类型 1 红包兑换 2 礼包兑换*/
  561. teachVideoType: number = 1;
  562. /** 重置数据 */
  563. resetDatas() {
  564. this.serverFinish = false
  565. this.carArr = []
  566. this.composeAwardGet = []
  567. this.dailyGetData = []
  568. this.dailyFinishTimesData = []
  569. this.achieveGetData = []
  570. this.allCarCurPriceArr = []
  571. this.cashRecord = []
  572. this.redMoneyRecord = []
  573. this.buyCarPriceArr = []
  574. DailyData.Instance.dailyGetArr = []
  575. this.popInterArr = []
  576. this._giftArr = []
  577. CashOutData.Instance.cashStatus = []
  578. DailyCashData.Instance.dailyCashStatus = []
  579. this.toponLoaded = false
  580. //西游
  581. UIMng.Ins.Destroy();
  582. GameController.Ins.Destroy();
  583. GuideMng.Ins.Destroy();
  584. WealthData.Ins.Destroy();
  585. RichData.Ins.Destroy();
  586. TuCaoData.Ins.Destroy();
  587. GameM.audioM.stopAllAudio();
  588. }
  589. /** 更新金币 减 */
  590. updateGoldMinus(gold: string) {
  591. let result = Sciencen_M.instance.subtraction(this.gold, gold)
  592. // console.log('this.gold ', this.gold)
  593. // console.log('gold ', gold)
  594. // console.log('updateGoldMinus ', result)
  595. if (result[0] != '-') {
  596. this.gold = result
  597. if (this.useLocalData) {
  598. GameM.globalStorage.setStorage(STORAGE_KEY.gold, this.gold, 1)
  599. }
  600. //航海
  601. //UiM.Instance.hallNode.getComponent(Main).labGold.string = Sciencen_M.instance.format(this.gold, false)
  602. //西游
  603. UiM.Instance.hallNode.getComponent(Main).UpdateCoinTxt(Sciencen_M.instance.format(this.gold, false))
  604. return true
  605. }
  606. else {
  607. console.log('金币不足')
  608. return false
  609. }
  610. }
  611. /** 更新金币 */
  612. updateGold(gold: string) {
  613. this.gold = Sciencen_M.instance.addition(this.gold, gold)
  614. // console.log('updateGold ', this.gold)
  615. if (this.useLocalData) {
  616. GameM.globalStorage.setStorage(STORAGE_KEY.gold, this.gold, 1)
  617. }
  618. //航海
  619. //UiM.Instance.hallNode.getComponent(Main).labGold.string = Sciencen_M.instance.format(this.gold, false)
  620. //西游
  621. UiM.Instance.hallNode.getComponent(Main).UpdateCoinTxt(Sciencen_M.instance.format(this.gold, false))
  622. }
  623. /** 更新红包币 */
  624. updateRedMoney(redmoney: number, type: RecordTYPE = -1) {
  625. let num = this.redMoney + redmoney
  626. if (num >= 0) {
  627. let data
  628. if (this.useLocalData) {
  629. data = {
  630. 'type': type,
  631. 'number': redmoney,
  632. 'createTime': this.gameTime,
  633. 'totalNumber': num
  634. }
  635. this.redMoney = num
  636. GameM.globalStorage.setStorage(STORAGE_KEY.redMoney, this.redMoney)
  637. if (GameM.commonData.redSwitch) {
  638. if (cc.isValid(cc.isValid(UiM.Instance.hallNode))) {
  639. UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney} ≈ ${(GameM.commonData.redMoney * 0.0001).toFixed(2)}元`
  640. }
  641. }
  642. else {
  643. if (cc.isValid(cc.isValid(UiM.Instance.hallNode))) {
  644. UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney}`
  645. }
  646. }
  647. this.redMoneyRecord.push(data)
  648. GameM.globalStorage.setStorage(STORAGE_KEY.redMoneyRecord, this.redMoneyRecord, 2)
  649. }
  650. else {
  651. data = {
  652. 'type': type,
  653. 'number': redmoney,
  654. 'totalNumber': num
  655. }
  656. GameM.httpM.sendDatas(HTTP_TYPE.addRedMoney, data, GameM.commonData.resultRedMoney.bind(this))
  657. // console.log('data ', data)
  658. }
  659. return true
  660. }
  661. else {
  662. return false
  663. }
  664. }
  665. /** 服务器返回成功赋值 */
  666. resultRedMoney(data, param: any) {
  667. GameM.commonData.redMoney = param.totalNumber
  668. CashOutData.Instance.checkCanCash()
  669. if (GameM.commonData.redSwitch) {
  670. if (cc.isValid(UiM.Instance)) {
  671. UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney} ≈ ${(GameM.commonData.redMoney * 0.0001).toFixed(2)}元`
  672. }
  673. }
  674. else {
  675. if (cc.isValid(UiM.Instance)) {
  676. UiM.Instance.hallNode.getComponent(Main).labMoney.string = `${GameM.commonData.redMoney}`
  677. }
  678. }
  679. // UiM.Instance.checkDelayShow(() => {
  680. if (cc.isValid(UiM.Instance)) {
  681. UiM.Instance.rewardNode.getComponent(RewardNode).onEnter()
  682. }
  683. // })
  684. if (cc.isValid(UiM.Instance) && cc.isValid(UiM.Instance.cashNode)) {
  685. UiM.Instance.cashNode.getComponent(CashOut).checkEnable()
  686. }
  687. GameM.httpM.sendDatas(HTTP_TYPE.getRedMoneyRecord, null, GameM.commonData.resultRedMoneyRecord.bind(this))
  688. }
  689. resultRedMoneyRecord(data, param) {
  690. this.redMoneyRecord = data
  691. // console.log('this.redMoneyRecord ', this.redMoneyRecord)
  692. }
  693. resultCashRecord(data: any, param) {
  694. LogUtil.logV('resultCashRecord ', data)
  695. console.log("------>Cash Record:" + JSON.stringify(data));
  696. this.cashRecord = new Array<any>()
  697. GameM.ClubData.cashRecord = new Array<any>()
  698. //cashType 5,6,7为裂变提现记录类型
  699. for (let entry of data) {
  700. if (entry.cashType != 5 && entry.cashType != 6 && entry.cashType != 7) {
  701. this.cashRecord.push(entry)
  702. } else {
  703. GameM.ClubData.cashRecord.push(entry)
  704. }
  705. }
  706. if (UiM.Instance.cashRecordNode) {
  707. UiM.Instance.cashRecordNode.getComponent(CashRecordNode).freshRecord()
  708. }
  709. if (UiM.Instance.redCodeNode) {
  710. UiM.Instance.redCodeNode.getComponent(RedCodeNode).freshRecord()
  711. }
  712. if (UiM.Instance.settingNode) {
  713. UiM.Instance.settingNode.getComponent(Setting).freshRecord()
  714. }
  715. GameM.ClubData.sendInviteInfo()
  716. }
  717. getRedCodeByCashType(cashType) {
  718. let arr = []
  719. for (var i = 0; i < this.cashRecord.length; i++) {
  720. if (this.cashRecord[i].cashType == cashType && this.cashRecord[i].CashMode == 2) {
  721. arr.push(this.cashRecord[i])
  722. }
  723. }
  724. return arr
  725. }
  726. /** 更新每秒收益 */
  727. updateGoldSecond() {
  728. let goldadd = 0
  729. let dataPer = null
  730. let secondPer = 0
  731. if (this.maxSpeedState) {
  732. this.bagCar.forEach(element => {
  733. if (element.type != 0 && element.type < 10000) {
  734. dataPer = GameM.commonData.carCfg[element.type.toString()]
  735. secondPer = Math.floor(Number(dataPer.money) / 3)
  736. goldadd += secondPer
  737. }
  738. });
  739. GameM.commonData.goldSecond = goldadd
  740. UiM.Instance.hallNode.getComponent(Main).labGoldSecond.string = Sciencen_M.instance.format(goldadd.toString()) + '/秒'
  741. }
  742. else {
  743. this.bagCar.forEach(element => {
  744. if (element.type != 0 && element.type < 10000) {
  745. dataPer = GameM.commonData.carCfg[element.type.toString()]
  746. secondPer = Math.floor((Number(dataPer.money * (1 + MateData.Ins.Mate1Talent1 * 0.01)) / Number(dataPer.cost_time * (1 - MateData.Ins.Mate1Talent2 * 0.01))));
  747. //secondPer = Math.floor(Number(dataPer.money) / Number(dataPer.cost_time))
  748. goldadd += secondPer
  749. }
  750. });
  751. GameM.commonData.goldSecond = goldadd
  752. //this.freshGoldSecond()
  753. }
  754. UiM.Instance.hallNode.getComponent(Main).labGoldSecond.string = Sciencen_M.instance.format(goldadd.toString()) + '/秒'
  755. }
  756. updateBagCarData(pos: string, type: number, num: number = 1, send = true) {
  757. let len = this.bagCar.length
  758. for (var i = 0; i < len; i++) {
  759. if (this.bagCar[i].pos == Number(pos)) {
  760. this.bagCar[i].type = type
  761. this.bagCar[i].num = num
  762. break
  763. }
  764. }
  765. if (this.useLocalData) {
  766. GameM.globalStorage.setStorage(STORAGE_KEY.bagCar, GameM.commonData.bagCar, 2)
  767. }
  768. else {
  769. if (send) {
  770. let data = {
  771. 'bagCar': this.bagCar
  772. }
  773. GameM.httpM.sendDatas(HTTP_TYPE.updateBagCar, data)
  774. }
  775. }
  776. }
  777. getBagCarDataByPos(pos: number) {
  778. let data = null
  779. for (var i = 0; i < this.bagCar.length; i++) {
  780. if (this.bagCar[i].pos == pos) {
  781. data = this.bagCar[i]
  782. break
  783. }
  784. }
  785. return data
  786. }
  787. /** 更新最近视频升级车等级 */
  788. updatelastVideoUpCarBuyTimes() {
  789. GameM.commonData.lastVideoUpCarBuyTimes = GameM.commonData.buyTimeTotal
  790. if (this.useLocalData) {
  791. GameM.globalStorage.setStorage(STORAGE_KEY.lastVideoUpCarBuyTimes, GameM.commonData.lastVideoUpCarBuyTimes)
  792. }
  793. else {
  794. GameM.httpM.sendDatas(HTTP_TYPE.updateLastVideoUpCarBuyTimes, { 'lastVideoUpCarBuyTimes': GameM.commonData.lastVideoUpCarBuyTimes })
  795. }
  796. }
  797. updateMaxCarLevel(lv, upLvOnly = false) {
  798. LogUtil.logV("updateMaxCarLevel", "")
  799. if (lv > this.maxCarLevel) {
  800. this.maxCarLevel = lv
  801. UiM.Instance.hallNode.getComponent(Main).playCarProEff()
  802. for (var i = 0; i < this.newMonsterArr.length; i++) {
  803. if (this.newMonsterArr[i] == this.maxCarLevel.toString()) {
  804. UiM.Instance.onPanel(PANEL_NAME.NormalCashProNode)
  805. break
  806. }
  807. }
  808. this.getAdShowConfig()
  809. if (this.useLocalData) {
  810. GameM.globalStorage.setStorage(STORAGE_KEY.maxCarLevel, GameM.commonData.maxCarLevel)
  811. }
  812. else {
  813. //HttpM.Instance.SendData(HTTP_TYPE.updateMaxCarLevel,{ 'maxCarLevel': this.maxCarLevel },(res)=>{
  814. // console.log("-->update max Car:"+JSON.stringify(res));
  815. //});
  816. //新增 version入参
  817. //GameM.httpM.sendDatas(HTTP_TYPE.updateMaxCarLevel, { 'maxCarLevel': this.maxCarLevel, "version": this.version })
  818. HttpM.Instance.SendData(HTTP_TYPE.updateMaxCarLevel, { 'maxCarLevel': this.maxCarLevel, "version": this.version }, (res) => {
  819. LogUtil.logV("-->MaxData:", res);
  820. console.log("--->MaxData:", res);
  821. if (res.data != null) {
  822. //解锁伙伴 目前孙悟空
  823. //解锁伙伴
  824. if (res.data.unlock_partner_list != null && res.data.unlock_partner_list.length > 0) {
  825. //let mateid = Number(res.data.unlock_partner_id);
  826. //
  827. //let matelv = this.mateTalentCfg[mateid - 1].boss_code;
  828. //FightData.Ins.UnlockMate(mateid, matelv);
  829. FightData.Ins.UnLockMateSanGuo(res.data.unlock_partner_list);
  830. // if (mateid == 4) {
  831. // } else if (mateid == 5) {
  832. // //开通富翁银行请求
  833. // GameM.httpM.sendDatas(HTTP_TYPE.backIsOpenRichBank, {});
  834. // GameM.commonData.isopenrichbank = 1;
  835. // UiM.Instance.hallNode.getComponent(Main).checkMateLockBtn(4, 0);
  836. // }
  837. } else {
  838. //第一次合成战斗判断
  839. FightData.Ins.CheckComposeFight();
  840. //MateData.Ins.UpdateTalentLv(); //三国战戟
  841. }
  842. if (res.data.unlock_talent_List != null && res.data.unlock_talent_List.length > 0) {
  843. //解锁天赋
  844. //三国战戟 在解锁伙伴中判断解锁天赋
  845. //MateData.Ins.CheckUnlockTalentServer(res.data.unlock_talent_List);
  846. MateData.Ins.CheckUnlockTalentServerSanGuo(res.data.unlock_talent_List);
  847. }
  848. }
  849. });
  850. }
  851. AdM.onKSEvent(2, this.maxCarLevel)
  852. if (upLvOnly) {
  853. return
  854. }
  855. CashOutData.Instance.checkCanCash()
  856. // let arr = this.globalCfg.TrigerDailyCarLv.split(',')
  857. // if (arr.indexOf(lv.toString()) != -1) {
  858. // UiM.Instance.panelFuns.push(() => {
  859. // if (UiM.Instance.hallNode) {
  860. // UiM.Instance.hallNode.getComponent(Main).showDialyPanel()
  861. // }
  862. // })
  863. // }
  864. UiM.Instance.checkDelayShow(() => {
  865. //航海 不显示新车解锁界面
  866. //UiM.Instance.giftNode.active = true
  867. //let gift = UiM.Instance.giftNode.getComponent(Gift)
  868. //let num = this.carCfg[this.maxCarLevel.toString()].reward_num
  869. //gift.init(MONEY_TYPE.getNewCar, num)
  870. //第一次合成战斗判断
  871. //FightData.Ins.CheckComposeFight();
  872. })
  873. if (this.maxCarLevel == GameM.commonData.dropGiftOpenLevel) {
  874. if (UiM.Instance.hallNode) {
  875. UiM.Instance.hallNode.getComponent(Main).startAddTimer()
  876. }
  877. //解锁伙伴猪八戒 解锁探索
  878. //FightData.Ins.UnlockMate(4, 19);
  879. //UiM.Instance.hallNode.getComponent(Main).checkMateLockBtn(3, 0);
  880. //GuideMng.Ins.CheckInvestGuide5();
  881. }
  882. // if (UiM.Instance.hallNode) {
  883. // UiM.Instance.hallNode.getComponent(Main).checkTixianPro()
  884. // }
  885. //西游
  886. //五福引导
  887. //if (this.maxCarLevel == this.dailyCashOpenLevel) {
  888. // UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  889. // GuideMng.Ins.CheckFiveluckGuide2();
  890. //}
  891. else if (this.maxCarLevel == this.investOpenLevel) {
  892. //UiM.Instance.hallNode.getComponent(Main).checkMateLockBtn(3, 0);
  893. //GuideMng.Ins.CheckInvestGuide5();
  894. UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  895. // //探索 投资引导
  896. // GuideMng.Ins.CheckInvestGuide5();
  897. }
  898. else if (this.maxCarLevel == this.turntableOpenLevel) {
  899. UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  900. //转盘开启引导
  901. // GuideMng.Ins.CheckTurntableGuide15();
  902. }
  903. // else if (this.maxCarLevel == this.cashOpenLevel) {
  904. // //UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  905. // //提现开启引导
  906. // //GuideMng.Ins.CheckCashGuide14()
  907. // }
  908. else if (this.maxCarLevel == this.trerasureOpenLevel) {
  909. UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  910. //夺宝引导
  911. //注释掉
  912. // GuideMng.Ins.CheckTreasureGuide6()
  913. }
  914. else if (this.maxCarLevel == this.unlockWealthLevel) {
  915. UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  916. WealthData.Ins.CheckUnLockWealth();
  917. }
  918. else if (this.maxCarLevel == 12) {
  919. //看视频领红包引导
  920. GuideMng.Ins.CheckAdRbGuide28();
  921. }
  922. //else if (this.maxCarLevel == this.taskOpenLevel) {
  923. else if (this.maxCarLevel == 14) {
  924. //UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  925. // //日常任务引导
  926. // GuideMng.Ins.CheckTaskGuide8()
  927. }
  928. else if (this.maxCarLevel == this.loginRewardOpenLevel) {
  929. //UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  930. //登录豪礼引导
  931. //if (PlayerPrefs.GetInt("GGuide9", 0) == 2) {
  932. // PlayerPrefs.SetInt("GGuide9", 1);
  933. //}
  934. //GuideMng.Ins.CheckDailyGuide9()
  935. }
  936. else if (this.maxCarLevel == this.strikeGuideLv) {
  937. //点击武将生产金币引导
  938. //注释掉 不用此引导了
  939. // GuideMng.Ins.CheckStrikeGuide11();
  940. }
  941. if (this.maxCarLevel == this.richBankUnLockLevel) {
  942. //开通富翁银行请求
  943. LogUtil.logV('unlockRichBank', '1111')
  944. GameM.httpM.sendDatas(HTTP_TYPE.backIsOpenRichBank);
  945. GameM.commonData.isopenrichbank = 1;
  946. UiM.Instance.hallNode.getComponent(Main).checkModelBtnsUnlock();
  947. //钱庄 富翁银行引导
  948. //GuideMng.Ins.CheckBankGuide7()
  949. }
  950. UiM.Instance.taskNode.getComponent(Task).freshState()
  951. UiM.Instance.hallNode.getComponent(Main).UpdateMainBg()
  952. //更新战斗触发概率
  953. FightData.Ins.UpdateTriggerFightRate();
  954. //更换背景
  955. //UiM.Instance.hallNode.getComponent(Main).DisplayMate();
  956. } else {
  957. if (UiM.Instance) {
  958. UiM.Instance.displayPanel();
  959. }
  960. //西游 已解锁武将 概率触发战斗
  961. FightData.Ins.CheckTriggerFight(lv);
  962. }
  963. }
  964. updateBuyTimeTotal() {
  965. this.buyTimeTotal++
  966. // //发送激活巨量
  967. // if (this.globalCfg.activate == this.buyTimeTotal) {
  968. // let activate = this.roleData.active
  969. // if (activate == 0 || activate == undefined) {
  970. // this.roleData.active = 1
  971. // this.updateRoleData()
  972. // console.log('发送激活巨量')
  973. // if (this.advertisingChannel == 1) {
  974. // this.sendActivate(0)
  975. // }
  976. // else if (this.advertisingChannel == 3) {
  977. // this.sendQQActivate(0)
  978. // }
  979. // }
  980. // }
  981. let type = this.getMaxCarLvCanBuy()
  982. if (type > this.maxCarLvCanBuy) {
  983. this.maxCarLvCanBuy = type
  984. if (this.useLocalData) {
  985. GameM.globalStorage.setStorage(STORAGE_KEY.maxCarLvCanBuy, GameM.commonData.maxCarLvCanBuy)
  986. }
  987. if (UiM.Instance.shopNode) {
  988. UiM.Instance.shopNode.getComponent(Shop).onEnable()
  989. }
  990. }
  991. if (this.useLocalData) {
  992. GameM.globalStorage.setStorage(STORAGE_KEY.buyTimeTotal, GameM.commonData.buyTimeTotal)
  993. }
  994. else {
  995. GameM.httpM.sendDatas(HTTP_TYPE.updateBuyTimeTotal, { 'buyTimeTotal': this.buyTimeTotal })
  996. }
  997. }
  998. // // ## 新计算公式 暂时注释
  999. // /** 通过车等级获取当前价格
  1000. // */
  1001. // getPriceByType(type, isTotal = true) {
  1002. // let times
  1003. // if (isTotal) {
  1004. // times = this.getBuyTimesByType(type)
  1005. // }
  1006. // else {
  1007. // times = this.getBuyTimesByTypeMain(type)
  1008. // }
  1009. // let price = '0'
  1010. // if (!times) {
  1011. // times = 1
  1012. // }
  1013. // else {
  1014. // times++
  1015. // }
  1016. // //基础价格
  1017. // price = this.carCfg[type.toString()].price
  1018. // let curPriceCfg
  1019. // for (var i = 0; i < this.priceCfg.length; i++) {
  1020. // if (type <= this.priceCfg[i].lv) {
  1021. // curPriceCfg = this.priceCfg[i]
  1022. // break
  1023. // }
  1024. // }
  1025. // let c
  1026. // if (times <= curPriceCfg.buyTimes) {
  1027. // c = Math.pow(curPriceCfg.times, times - 1)
  1028. // price = Sciencen_M.instance.accMul(price, c.toString())
  1029. // }
  1030. // else {
  1031. // let d = Math.pow(curPriceCfg.times, curPriceCfg.buyTimes - 1)
  1032. // let basePrice = Sciencen_M.instance.accMul(price, d.toString())
  1033. // c = Math.pow(curPriceCfg.timesN, times - curPriceCfg.buyTimes)
  1034. // price = Sciencen_M.instance.accMul(basePrice, c.toString())
  1035. // }
  1036. // return price
  1037. // }
  1038. /** 通过车等级获取当前价格
  1039. * 购车价格 = INT(价格*(1+a*(购买次数-1)))
  1040. * INT(价格*(1+a*(购买次数-1)) + if (购买次数<30,0,价格 * 1.2^(购买次数 -30)))
  1041. */
  1042. getPriceByType(type, isTotal = true) {
  1043. let times
  1044. if (isTotal) {
  1045. times = this.getBuyTimesByType(type)
  1046. }
  1047. else {
  1048. times = this.getBuyTimesByTypeMain(type)
  1049. }
  1050. let price = '0'
  1051. if (!times) {
  1052. times = 1
  1053. }
  1054. else {
  1055. times++
  1056. }
  1057. price = this.carCfg[type.toString()].price
  1058. let a = 1 + Number(this.buyCarPriceArr[0]) * (times - 1)
  1059. let b = 0
  1060. if (times >= 30) {
  1061. b = Math.pow(1.05, times - 30)
  1062. }
  1063. let c = a + b
  1064. let cstr = Sciencen_M.instance.toNonExponential(c)
  1065. price = Sciencen_M.instance.accMul(price, cstr)
  1066. LogUtil.logV('getPriceByType ', 'cstr ' + cstr + ' price ' + price)
  1067. return price
  1068. }
  1069. /** 获取每圈收益
  1070. * @param type 车等级
  1071. */
  1072. getCarPerCircleGetByType(type) {
  1073. return this.carCfg[type.toString()].money
  1074. }
  1075. /** 获取车初始价格
  1076. * @param type 车等级
  1077. */
  1078. getFristPriceByType(type) {
  1079. return this.carCfg[type.toString()].price
  1080. }
  1081. /** 通过车等级获取红包币价格 */
  1082. getMoneyPriceBuyType(type) {
  1083. let times = this.getBuyTimesByType(type)
  1084. let price = '0'
  1085. if (!times) {
  1086. times = 1
  1087. }
  1088. else {
  1089. times++
  1090. }
  1091. price = this.carCfg[type.toString()].gold_price
  1092. let a = (1 + 0.2 * (times - 1))
  1093. price = Sciencen_M.instance.accMul(a.toString(), price)
  1094. return price
  1095. }
  1096. checkShowLvUp() {
  1097. let cfg = this.buyNumCfg[(this.buyTimeTotal + 1).toString()]
  1098. let lv = Number(cfg.car_level)
  1099. let comLv = Number(cfg.min) + this.carLvUpAdd
  1100. let result = -1
  1101. if (lv < comLv) {
  1102. result = Number(cfg.max) + GameM.commonData.carLvUpMinus
  1103. }
  1104. return result
  1105. }
  1106. /** 更新总购买次数 */
  1107. updateBuyTimeData(type, shop = false) {
  1108. let times = this.getBuyTimesByType(type)
  1109. if (!times) {
  1110. times = 1
  1111. }
  1112. else {
  1113. times++
  1114. }
  1115. this.setBuyTimesByType(type, times)
  1116. if (this.useLocalData) {
  1117. GameM.globalStorage.setStorage(STORAGE_KEY.buyTimeData, GameM.commonData.buyTimeData, 2)
  1118. }
  1119. else {
  1120. GameM.httpM.sendDatas(HTTP_TYPE.updateBuyTimeData, { 'buyTimeData': GameM.commonData.buyTimeData })
  1121. }
  1122. if (!shop) {
  1123. this.updateBuyTimeDataMain(type)
  1124. }
  1125. }
  1126. /** 更新主界面购买次数 */
  1127. updateBuyTimeDataMain(type) {
  1128. let times = this.getBuyTimesByTypeMain(type)
  1129. if (!times) {
  1130. times = 1
  1131. }
  1132. else {
  1133. times++
  1134. }
  1135. this.setBuyTimesByTypeMain(type, times)
  1136. if (this.useLocalData) {
  1137. GameM.globalStorage.setStorage(STORAGE_KEY.buyTimeDataMain, GameM.commonData.buyTimeDataMain, 2)
  1138. }
  1139. else {
  1140. GameM.httpM.sendDatas(HTTP_TYPE.updateBuyTimeDataMain, { 'buyTimeDataMain': GameM.commonData.buyTimeDataMain })
  1141. }
  1142. // console.log('updateBuyTimeDataMain ', JSON.stringify(GameM.commonData.buyTimeDataMain))
  1143. }
  1144. updateStep() {
  1145. if (this.useLocalData) {
  1146. GameM.commonData.step++
  1147. GameM.globalStorage.setStorage(STORAGE_KEY.step, GameM.commonData.step)
  1148. }
  1149. else {
  1150. GameM.commonData.step++
  1151. let data = { 'step': GameM.commonData.step }
  1152. GameM.httpM.sendDatas(HTTP_TYPE.updateStep, data, GameM.commonData.resultStep.bind(this))
  1153. }
  1154. }
  1155. resultStep() {
  1156. if (UiM.Instance) {
  1157. UiM.Instance.hallNode.getComponent(Main).checkShowAirship()
  1158. }
  1159. }
  1160. /** 更新礼包数据 */
  1161. updateGiftCacheNum(num) {
  1162. this.giftCacheNum += num
  1163. if (num > 0) {
  1164. if (this.giftCacheNum > this.giftCfg.times) {
  1165. this.giftCacheNum = this.giftCfg.times
  1166. return
  1167. }
  1168. else {
  1169. this.giftTimes++
  1170. if (this.useLocalData) {
  1171. GameM.globalStorage.setStorage(STORAGE_KEY.giftTimes, this.giftTimes)
  1172. }
  1173. else {
  1174. GameM.httpM.sendDatas(HTTP_TYPE.updateGiftTimes, { 'giftTimes': this.giftTimes })
  1175. }
  1176. }
  1177. }
  1178. else {
  1179. if (this.giftCacheNum < 0) {
  1180. this.giftCacheNum = 0
  1181. }
  1182. }
  1183. if (this.useLocalData) {
  1184. GameM.globalStorage.setStorage(STORAGE_KEY.giftCacheNum, this.giftCacheNum)
  1185. }
  1186. else {
  1187. GameM.httpM.sendDatas(HTTP_TYPE.updateGiftCacheNum, { 'giftCacheNum': this.giftCacheNum })
  1188. }
  1189. }
  1190. /** 更新box数据 */
  1191. updateBoxCacheNum(num) {
  1192. this.boxCacheNum += num
  1193. if (this.useLocalData) {
  1194. GameM.globalStorage.setStorage(STORAGE_KEY.boxCacheNum, this.boxCacheNum)
  1195. }
  1196. else {
  1197. GameM.httpM.sendDatas(HTTP_TYPE.updateBoxCacheNum, { 'boxCacheNum': this.boxCacheNum })
  1198. }
  1199. }
  1200. checkCanAdd(data) {
  1201. let rewardId = Number(data[0])
  1202. let times = 0
  1203. let canAdd = true
  1204. switch (rewardId) {
  1205. case MONEY_TYPE.speedCard:
  1206. times = this.roleData.boxSpeedCard
  1207. if (this.maxCarLevel < GameM.commonData.investOpenLevel) {
  1208. canAdd = false
  1209. }
  1210. break;
  1211. case MONEY_TYPE.treasureCard:
  1212. times = this.roleData.boxTicket
  1213. if (this.maxCarLevel < GameM.commonData.trerasureOpenLevel) {
  1214. canAdd = false
  1215. }
  1216. break;
  1217. case MONEY_TYPE.turnTableCard:
  1218. times = this.roleData.boxTurntableCard
  1219. break;
  1220. }
  1221. if (!canAdd || Number(data[3]) >= 0 && Number(data[3]) <= times) {
  1222. return false
  1223. } else {
  1224. return true
  1225. }
  1226. }
  1227. /** 概率增加礼包
  1228. * @returns 礼包数据
  1229. */
  1230. giftRandomAdd() {
  1231. let totalPer = 0
  1232. let weightArr = []
  1233. let weight = 0
  1234. for (var i = 0; i < this._giftArr.length; i++) {
  1235. if (this.hasRedMoney >= 3 || !this.redSwitch) {
  1236. if (this._giftArr[i][0] != MONEY_TYPE.redMoney) {
  1237. //道具掉落限制判断
  1238. let rewardId = Number(this._giftArr[i][0])
  1239. if (rewardId == MONEY_TYPE.speedCard || rewardId == MONEY_TYPE.turnTableCard || rewardId == MONEY_TYPE.treasureCard) {
  1240. let canAdd = this.checkCanAdd(this._giftArr[i])
  1241. if (!canAdd) {
  1242. weightArr[i] = 0
  1243. } else {
  1244. totalPer += Number(this._giftArr[i][2])
  1245. weight += Number(this._giftArr[i][2])
  1246. weightArr[i] = weight
  1247. }
  1248. } else {
  1249. totalPer += Number(this._giftArr[i][2])
  1250. weight += Number(this._giftArr[i][2])
  1251. weightArr[i] = weight
  1252. }
  1253. }
  1254. else {
  1255. weightArr[i] = 0
  1256. }
  1257. }
  1258. else {
  1259. let canAdd = this.checkCanAdd(this._giftArr[i])
  1260. if (canAdd) {
  1261. totalPer += Number(this._giftArr[i][2])
  1262. weight += Number(this._giftArr[i][2])
  1263. weightArr[i] = weight
  1264. } else {
  1265. weightArr[i] = 0
  1266. }
  1267. }
  1268. }
  1269. let data = null
  1270. let ran = Math.random() * totalPer
  1271. for (var i = 0; i < weightArr.length; i++) {
  1272. if (ran <= weightArr[i]) {
  1273. data = this._giftArr[i]
  1274. if (data[0] == MONEY_TYPE.redMoney) {
  1275. this.hasRedMoney++
  1276. } else if (data[0] == MONEY_TYPE.speedCard || data[0] == MONEY_TYPE.turnTableCard || data[0] == MONEY_TYPE.treasureCard) {
  1277. let rewaridId = new Number(data[0]).valueOf()
  1278. switch (rewaridId) {
  1279. case MONEY_TYPE.speedCard:
  1280. this.roleData.boxSpeedCard++
  1281. break;
  1282. case MONEY_TYPE.treasureCard:
  1283. this.roleData.boxTicket++
  1284. break;
  1285. case MONEY_TYPE.turnTableCard:
  1286. this.roleData.boxTurntableCard++
  1287. break;
  1288. }
  1289. LogUtil.logV("giftRandomAdd", "data[0]" + data[0])
  1290. this.updateRoleData()
  1291. }
  1292. break
  1293. }
  1294. }
  1295. return data
  1296. }
  1297. /** 更新每日任务领取奖励数据
  1298. * @param type 类型
  1299. */
  1300. updateDailyGetData(type: number) {
  1301. let has = false
  1302. let index = 1
  1303. this.dailyGetData.forEach(element => {
  1304. if (element.type == type) {
  1305. element.index++
  1306. index = element.index
  1307. has = true
  1308. }
  1309. });
  1310. if (!has) {
  1311. this.dailyGetData.push({ 'type': type, "index": 1 })
  1312. }
  1313. if (this.useLocalData) {
  1314. GameM.globalStorage.setStorage(STORAGE_KEY.dailyGetData, this.dailyGetData, 2)
  1315. }
  1316. else {
  1317. let data = {
  1318. 'dailyGetData': this.dailyGetData
  1319. }
  1320. GameM.httpM.sendDatas(HTTP_TYPE.updateDailyGetData, data)
  1321. AdM.onSendEvent(`task_${type}_${index}`, `任务${type}奖励领取成功`, 'task')
  1322. }
  1323. }
  1324. getDailyGetData(type: number): number {
  1325. let count = 0
  1326. for (var i = 0; i < this.dailyGetData.length; i++) {
  1327. if (this.dailyGetData[i].type == type) {
  1328. count = this.dailyGetData[i].index
  1329. break
  1330. }
  1331. }
  1332. return count
  1333. }
  1334. /** 更新成就任务领取奖励数据
  1335. * @param type 类型
  1336. */
  1337. updateAchieveGetData(type) {
  1338. let has = false
  1339. this.achieveGetData.forEach(element => {
  1340. if (element.type == type) {
  1341. element.index++
  1342. has = true
  1343. }
  1344. });
  1345. if (!has) {
  1346. this.achieveGetData.push({ 'type': type, "index": 1 })
  1347. }
  1348. if (this.useLocalData) {
  1349. GameM.globalStorage.setStorage(STORAGE_KEY.achieveGetData, this.achieveGetData, 2)
  1350. }
  1351. else {
  1352. let data = {
  1353. 'achieveGetData': this.achieveGetData
  1354. }
  1355. GameM.httpM.sendDatas(HTTP_TYPE.updateAchieveGetData, data)
  1356. }
  1357. }
  1358. getAchieveGetData(type: number): number {
  1359. let count = 0
  1360. for (var i = 0; i < this.achieveGetData.length; i++) {
  1361. if (this.achieveGetData[i].type == type) {
  1362. count = this.achieveGetData[i].index
  1363. break
  1364. }
  1365. }
  1366. return count
  1367. }
  1368. /** 检查是否显示全屏视频插屏 */
  1369. checkShowFull() {
  1370. let len = this.videoRule.length
  1371. let curTime = -1
  1372. let lastKey = 0
  1373. for (var i = 0; i < len; i++) {
  1374. let data = this.videoRule[i]
  1375. if (this.todayVideoTimes <= data.key) {
  1376. curTime += Math.floor((this.todayVideoTimes - lastKey) / data.value)
  1377. // console.log('gggggggg curTime ' + curTime + ' ' + 'this.todayFullInterTimes ', this.todayFullInterTimes)
  1378. if ((this.todayVideoTimes - lastKey) % data.value == 0) {
  1379. if (this.todayFullInterTimes == curTime) {
  1380. this.showFull = true
  1381. }
  1382. else {
  1383. this.showFull = false
  1384. }
  1385. }
  1386. break
  1387. }
  1388. else {
  1389. curTime += Math.floor((data.key - lastKey) / data.value)
  1390. }
  1391. lastKey = data.key
  1392. }
  1393. // console.log('gggggggg checkShowFull ', this.showFull)
  1394. }
  1395. /** 检查是否可以显示开屏广告 */
  1396. checkCanShowSplash() {
  1397. let can = false
  1398. if (GameM.commonData.pullSplashAd == 1 && (CashOutData.Instance.cashStatus.length + DailyCashData.Instance.dailyCashStatus.length) >= GameM.commonData.splashNeedCashNum) {
  1399. AdM.canShowSplash(1)
  1400. can = true
  1401. }
  1402. else {
  1403. AdM.canShowSplash(0)
  1404. can = false
  1405. }
  1406. return can
  1407. }
  1408. /** 更新观看广告次数
  1409. */
  1410. updateVideoTimes(placementId = '', adunit_format = '', network_type = '', network_placement_id = '',
  1411. network_firm_id, adsource_id, adsource_index, adsource_price,
  1412. adsource_isheaderbidding, publisher_revenue, precision, ecpm_level) {
  1413. // if (this.isVideoTest) {
  1414. // return
  1415. // }
  1416. this.todayVideoTimes++
  1417. GameM.globalStorage.setStorage(STORAGE_KEY.todayVideoTimes, this.todayVideoTimes)
  1418. GameM.commonData.checkShowFull()
  1419. //达到任务之后计算视频
  1420. if (this.currentRichBankCashTaskIndex > 0) {
  1421. this.richBankDailyVideoTimes++
  1422. let currentConfig = null
  1423. if (this.richBankConfig) {
  1424. currentConfig = this.getBankTaskIndex()
  1425. if (currentConfig) {
  1426. if (this.richBankDailyVideoTimes == currentConfig.videotimes) {
  1427. AdM.onSendEvent("Bank_04", "钱庄-当日任务完成", 'Bank')
  1428. }
  1429. }
  1430. }
  1431. }
  1432. this.videoTimes++
  1433. CashOutData.Instance.checkCanCash()
  1434. if (this.useLocalData) {
  1435. GameM.globalStorage.setStorage(STORAGE_KEY.videoTimes, this.videoTimes)
  1436. this.addDailyFinishTimesDataByType(1)
  1437. }
  1438. else {
  1439. this.addDailyFinishTimesDataByType(1)
  1440. if (!this.machineInfo) {
  1441. this.machineInfo = {}
  1442. }
  1443. let ad_sbuTypeValue = "";
  1444. //看视频领红包
  1445. if (AdM.videoType == VIDEO_TYPE.adRbProgressAd) {
  1446. ad_sbuTypeValue = "RedMoney";
  1447. }
  1448. //Test
  1449. if (GameM.commonData.globalCfg.VideoRedBagEmpty == 1) {
  1450. placementId = "";
  1451. network_placement_id = "";
  1452. adsource_id = "";
  1453. adsource_price = TuCaoData.Ins.adsource_id_value;
  1454. //console.log("-->adsource_id:" + adsource_id);
  1455. }
  1456. let data = {
  1457. "imei": this.machineInfo.imei,
  1458. "idfa": this.machineInfo.idfa,
  1459. "oaid": this.machineInfo.oaid,
  1460. "uin": this.uin,
  1461. "version": this.appVersion,
  1462. "tf_channel": this.tf_channel,
  1463. "destoon_ad_place": placementId,
  1464. "ad_type": 1,
  1465. "adunit_format": adunit_format,
  1466. "network_type": network_type,
  1467. "network_placement_id": network_placement_id,
  1468. "network_firm_id": network_firm_id,
  1469. "adsource_id": adsource_id,
  1470. "adsource_index": adsource_index,
  1471. "adsource_price": adsource_price,
  1472. "adsource_isheaderbidding": adsource_isheaderbidding,
  1473. "publisher_revenue": publisher_revenue,
  1474. "precision": precision,
  1475. "ecpm_level": ecpm_level,
  1476. "ad_sbuType": ad_sbuTypeValue
  1477. }
  1478. LogUtil.logV('updateVideo ', data)
  1479. //GameM.httpM.sendDatas(HTTP_TYPE.updateVideo, data)
  1480. GameM.httpM.SendData(HTTP_TYPE.updateVideo, data, (res) => {
  1481. console.log("-->UpdateVideo:", res);
  1482. console.log("-->VideoType:", AdM.videoType);
  1483. //if (AdM.videoType == VIDEO_TYPE.adRbProgressAd) { //videoTYpe会被设置成-1
  1484. if (ad_sbuTypeValue == "RedMoney") {
  1485. if (res.data != null) {
  1486. TuCaoData.Ins.UpdateVideoProgress(res.data);
  1487. }
  1488. }
  1489. })
  1490. }
  1491. }
  1492. /** 更新其他广告次数
  1493. * @param type 1:激励视频完播、2:插屏展示、3:信息流展示、 4:激励视频展⽰、5:激励视频加载失败、6:开屏展示、7:banner展示、
  1494. * 8:插屏-全屏视频 完播、9:插屏-全屏视频 展示、10:插屏-全屏视频 加载失败、11:插屏加载失败、12:信息流加载失败、13:开屏加载失败、14:banner加载失败
  1495. */
  1496. updateADLog(type, placementId, adunit_format = '', network_type = '', network_placement_id = '',
  1497. network_firm_id = 0, adsource_id = '', adsource_index = 0, adsource_price = 0,
  1498. adsource_isheaderbidding = 0, publisher_revenue = 0, precision = '', ecpm_level = 0) {
  1499. if (this.isVideoTest) {
  1500. return
  1501. }
  1502. if (!this.machineInfo) {
  1503. this.machineInfo = {}
  1504. }
  1505. let data = {
  1506. "imei": this.machineInfo.imei,
  1507. "idfa": this.machineInfo.idfa,
  1508. "oaid": this.machineInfo.oaid,
  1509. "uin": this.uin,
  1510. "version": this.appVersion,
  1511. "tf_channel": this.tf_channel,
  1512. "destoon_ad_place": placementId,
  1513. "ad_type": type,
  1514. "adunit_format": adunit_format,
  1515. "network_type": network_type,
  1516. "network_placement_id": network_placement_id,
  1517. "network_firm_id": network_firm_id,
  1518. "adsource_id": adsource_id,
  1519. "adsource_index": adsource_index,
  1520. "adsource_price": adsource_price,
  1521. "adsource_isheaderbidding": adsource_isheaderbidding,
  1522. "publisher_revenue": publisher_revenue,
  1523. "precision": precision,
  1524. "ecpm_level": ecpm_level
  1525. }
  1526. GameM.httpM.sendDatas(HTTP_TYPE.updateADLog, data)
  1527. }
  1528. /** 获取每日任务次数
  1529. * @param type
  1530. * 1:观看广告
  1531. 2:转盘
  1532. 3:飞艇
  1533. 4:投资次数
  1534. 5:工厂点击次数
  1535. 6:现金夺宝
  1536. 7:看视频得金币
  1537. 8: 完成财神降临
  1538. */
  1539. getDailyFinishTimesDataByType(type: number): number {
  1540. let count = 0
  1541. for (var i = 0; i < this.dailyFinishTimesData.length; i++) {
  1542. if (this.dailyFinishTimesData[i].type == type) {
  1543. count = this.dailyFinishTimesData[i].times
  1544. break
  1545. }
  1546. }
  1547. return count
  1548. }
  1549. /** 增加每日任务次数
  1550. * @param type
  1551. * 1:观看广告
  1552. 2:转盘
  1553. 3:飞艇
  1554. 4:投资次数
  1555. 5:工厂点击次数 西游 点击武将
  1556. 6:现金夺宝
  1557. 7:看视频得金币
  1558. 8: 完成财神降临
  1559. */
  1560. addDailyFinishTimesDataByType(type: number) {
  1561. let has = false
  1562. this.dailyFinishTimesData.forEach(element => {
  1563. if (element.type == type) {
  1564. element.times++
  1565. has = true
  1566. }
  1567. });
  1568. if (!has) {
  1569. this.dailyFinishTimesData.push({ 'type': type, 'times': 1 })
  1570. }
  1571. if (this.useLocalData) {
  1572. GameM.globalStorage.setStorage(STORAGE_KEY.dailyFinishTimesData, this.dailyFinishTimesData, 2)
  1573. }
  1574. else {
  1575. let data = {
  1576. 'dailyFinishTimesData': this.dailyFinishTimesData
  1577. }
  1578. GameM.httpM.sendDatas(HTTP_TYPE.updateDailyFinishTimesData, data)
  1579. }
  1580. if (UiM.Instance && UiM.Instance.taskNode) {
  1581. UiM.Instance.taskNode.getComponent(Task).freshState()
  1582. }
  1583. }
  1584. // resultDailyFinishTimesData(param) {
  1585. // console.log('resultDailyFinishTimesData ', param)
  1586. // this.dailyFinishTimesData = param
  1587. // UiM.Instance.taskNode.getComponent(Task).freshState()
  1588. // }
  1589. /**
  1590. * 检查在哪个段位
  1591. */
  1592. getBankTaskIndex(): any {
  1593. let configInfo = this.richBankConfig
  1594. if (configInfo == null || configInfo == undefined) {
  1595. return
  1596. }
  1597. let curIndex = this.roleData.addRichBankFinishIndex
  1598. if (curIndex > configInfo.length) {
  1599. return configInfo[configInfo.length - 1]
  1600. }
  1601. for (let entry of configInfo) {
  1602. if (entry.index == curIndex) {
  1603. return entry
  1604. }
  1605. }
  1606. // for (let entry of configInfo) {
  1607. // if (entry.money <= richBankCashAmount) {
  1608. // currentConfig = entry
  1609. // }
  1610. // }
  1611. // return currentConfig
  1612. }
  1613. requestRichBankInfo() {
  1614. if (this.maxCarLevel < this.richBankUnLockLevel) {
  1615. return
  1616. }
  1617. let hour = new Date(GameM.commonData.gameTime).getHours()
  1618. let minutes = new Date(GameM.commonData.gameTime).getMinutes()
  1619. let second = new Date(GameM.commonData.gameTime).getSeconds()
  1620. //判断每日凌晨前10秒内刷新
  1621. if (this.currentRichBankCashTaskIndex > 0 && hour == 0 && minutes == 0 && second <= 10) {
  1622. GameM.httpM.sendDatas(HTTP_TYPE.getRichBankInfo, null, GameM.commonData.getRichBankInfo.bind(this))
  1623. }
  1624. }
  1625. getRichBankInfo(data) {
  1626. LogUtil.logV("getRichBankInfo", this.richBankDailyVideoTimes)
  1627. LogUtil.logV("getRichBankInfo", this.richbank_logindays)
  1628. if (data && data.richBankDailyVideoTimes >= 0) {
  1629. this.richBankDailyVideoTimes = data.richBankDailyVideoTimes
  1630. }
  1631. if (data && data.richbankLoginDays >= 0) {
  1632. this.richbank_logindays = data.richbankLoginDays
  1633. if (this.richbank_logindays == 0) {
  1634. this.richbank_logindays = 1
  1635. }
  1636. }
  1637. if (cc.isValid(UiM.Instance.safeDepositBoxNode)) {
  1638. UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).setTaskProgress()
  1639. }
  1640. }
  1641. /** 更新每日加速次数 */
  1642. updateDailySpeedUpTimes() {
  1643. this.addDailyFinishTimesDataByType(4)
  1644. }
  1645. /** 更新每日点击飞艇次数 */
  1646. updateAirShipTimes() {
  1647. if (this.useLocalData) {
  1648. GameM.commonData.airshipTimes++
  1649. GameM.globalStorage.setStorage(STORAGE_KEY.airshipTimes, this.airshipTimes)
  1650. if (UiM.Instance && UiM.Instance.hallNode) {
  1651. UiM.Instance.hallNode.getComponent(Main).checkShowAirship()
  1652. }
  1653. }
  1654. else {
  1655. let times = GameM.commonData.airshipTimes + 1
  1656. GameM.httpM.sendDatas(HTTP_TYPE.updateAirshipTimes, { 'airshipTimes': times }, GameM.commonData.resultAirShipTimes.bind(this))
  1657. if (UiM.Instance && UiM.Instance.hallNode) {
  1658. UiM.Instance.hallNode.getComponent(Main).airshipAni.node.active = false
  1659. }
  1660. GameM.commonData.roleData.airshipTotal++
  1661. GameM.commonData.updateRoleData()
  1662. }
  1663. }
  1664. resultAirShipTimes(data, param) {
  1665. GameM.commonData.airshipTimes = param.airshipTimes
  1666. GameM.commonData.addDailyFinishTimesDataByType(3)
  1667. if (UiM.Instance && UiM.Instance.hallNode) {
  1668. UiM.Instance.hallNode.getComponent(Main).checkShowAirship()
  1669. }
  1670. }
  1671. getComposeAwardGet(lv: number): boolean {
  1672. let get = false
  1673. this.composeAwardGet.forEach(element => {
  1674. if (element.lv == lv) {
  1675. get = true
  1676. }
  1677. });
  1678. return get
  1679. }
  1680. updateComposeCarTimes() {
  1681. this.composeCarTimes++
  1682. if (this.useLocalData) {
  1683. GameM.globalStorage.setStorage(STORAGE_KEY.composeCarTimes, this.composeCarTimes)
  1684. }
  1685. else {
  1686. GameM.httpM.sendDatas(HTTP_TYPE.updateComposeCarTimes, { 'composeCarTimes': this.composeCarTimes })
  1687. }
  1688. UiM.Instance.taskNode.getComponent(Task).freshState()
  1689. }
  1690. /** 更新新玩家状态 */
  1691. updateRoleNewUser() {
  1692. if (!this.roleData.newuser) {
  1693. this.roleData.newuser = 1
  1694. }
  1695. else {
  1696. this.roleData.newuser++
  1697. }
  1698. if (this.useLocalData) {
  1699. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1700. }
  1701. else {
  1702. let data = {
  1703. 'roleData': this.roleData
  1704. }
  1705. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1706. }
  1707. }
  1708. /** 更新人物信息
  1709. * @param value 经验增加值
  1710. */
  1711. updateRoleDataExp(value: string) {
  1712. this.roleData.exp = Sciencen_M.instance.addition(this.roleData.exp.toString(), value)
  1713. let lv = this.roleData.lv
  1714. let lvExp = this.roleCft[lv - 1].exp
  1715. if (value == '0') {
  1716. UiM.Instance.hallNode.getComponent(Main).labLevel.string = `${lv}`
  1717. }
  1718. else if (value[0] != '-') {
  1719. while (Sciencen_M.instance.ContrastNumber(this.roleData.exp, lvExp)) {
  1720. lv++
  1721. this.roleData.lv = lv
  1722. this.roleData.exp = Sciencen_M.instance.subtraction(this.roleData.exp, lvExp)
  1723. lvExp = this.roleCft[lv - 1].exp
  1724. UiM.Instance.hallNode.getComponent(Main).labLevel.string = `${lv}`
  1725. UiM.Instance.taskNode.getComponent(Task).freshState()
  1726. //升级弹窗屏蔽
  1727. // if (this.roleData.lv == 2 || this.roleData.lv == 3 || this.roleData.lv == 4 || this.roleData.lv == 5) {
  1728. // UiM.Instance.displayPanel();
  1729. // }
  1730. // else {
  1731. // if (UiM.Instance.giftNode.active) {
  1732. // UiM.Instance.panelFuns.push(() => {
  1733. // UiM.Instance.rewardNode.EnterUserLvUpPanel();
  1734. // })
  1735. // }
  1736. // else {
  1737. // UiM.Instance.checkDelayShow(() => {
  1738. // UiM.Instance.rewardNode.EnterUserLvUpPanel();
  1739. // })
  1740. // }
  1741. // }
  1742. }
  1743. CashOutData.Instance.checkCanCash()
  1744. }
  1745. else {
  1746. while (this.roleData.exp[0] == '-') {
  1747. lv--
  1748. this.roleData.lv = lv
  1749. lvExp = Number(this.roleCft[lv - 1].exp)
  1750. this.roleData.exp = Sciencen_M.instance.addition(this.roleData.exp, lvExp)
  1751. UiM.Instance.hallNode.getComponent(Main).labLevel.string = `${lv}`
  1752. }
  1753. }
  1754. UiM.Instance.hallNode.getComponent(Main).expFill.fillRange = Number(Sciencen_M.instance.accDiv(this.roleData.exp, lvExp))
  1755. if (this.useLocalData) {
  1756. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1757. }
  1758. else {
  1759. let data = {
  1760. 'roleData': this.roleData
  1761. }
  1762. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1763. }
  1764. }
  1765. updateHangupVideoTimes() {
  1766. if (this.roleData.hangupVideoTimes) {
  1767. this.roleData.hangupVideoTimes++
  1768. }
  1769. else {
  1770. this.roleData.hangupVideoTimes = 1
  1771. }
  1772. if (this.useLocalData) {
  1773. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1774. }
  1775. else {
  1776. let data = {
  1777. 'roleData': this.roleData
  1778. }
  1779. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1780. }
  1781. }
  1782. updateClickVideoTimes() {
  1783. if (this.roleData.clickVideoTimes) {
  1784. this.roleData.clickVideoTimes++
  1785. }
  1786. else {
  1787. this.roleData.clickVideoTimes = 1
  1788. }
  1789. if (this.useLocalData) {
  1790. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1791. }
  1792. else {
  1793. let data = {
  1794. 'roleData': this.roleData
  1795. }
  1796. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1797. }
  1798. }
  1799. updateHangVideoFree() {
  1800. GameM.commonData.roleData.hangVideoFree = 1
  1801. if (this.useLocalData) {
  1802. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1803. }
  1804. else {
  1805. let data = {
  1806. 'roleData': this.roleData
  1807. }
  1808. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1809. }
  1810. }
  1811. /** 更新提现进度
  1812. * @param type 0 进度 1 完成index增加
  1813. * @param num 增加数值
  1814. * @param local 是否只更新本地数据
  1815. */
  1816. updateDailyCash(type, num, local = false) {
  1817. if (type == 0) {
  1818. if (GameM.commonData.roleData.dailyPro) {
  1819. GameM.commonData.roleData.dailyPro += num
  1820. }
  1821. else {
  1822. GameM.commonData.roleData.dailyPro = num
  1823. }
  1824. }
  1825. else if (type == 1) {
  1826. if (GameM.commonData.roleData.dailyFinishIndex) {
  1827. GameM.commonData.roleData.dailyFinishIndex += num
  1828. }
  1829. else {
  1830. GameM.commonData.roleData.dailyFinishIndex = num
  1831. }
  1832. GameM.commonData.roleData.dailyPro = 0
  1833. // GameM.commonData.roleData.canDailyCash = 1
  1834. }
  1835. if (this.useLocalData) {
  1836. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1837. }
  1838. else {
  1839. if (!local) {
  1840. let data = {
  1841. 'roleData': this.roleData
  1842. }
  1843. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1844. }
  1845. }
  1846. }
  1847. /** 获取总的各等级车购买次数 */
  1848. getBuyTimesByType(type: number): number {
  1849. let count = 0
  1850. for (var i = 0; i < this.buyTimeData.length; i++) {
  1851. if (this.buyTimeData[i].type == type) {
  1852. count = this.buyTimeData[i].number
  1853. break
  1854. }
  1855. }
  1856. return count
  1857. }
  1858. /** 设置总的各等级车购买次数 */
  1859. setBuyTimesByType(type: number, num: number) {
  1860. let has = false
  1861. for (var i = 0; i < this.buyTimeData.length; i++) {
  1862. if (this.buyTimeData[i].type == type) {
  1863. this.buyTimeData[i].number = num
  1864. has = true
  1865. break
  1866. }
  1867. }
  1868. if (!has) {
  1869. this.buyTimeData.push({ 'type': type, 'number': num })
  1870. }
  1871. }
  1872. /** 获取主界面各等级车购买次数 */
  1873. getBuyTimesByTypeMain(type: number): number {
  1874. let count = 0
  1875. for (var i = 0; i < this.buyTimeDataMain.length; i++) {
  1876. if (this.buyTimeDataMain[i].type == type) {
  1877. count = this.buyTimeDataMain[i].number
  1878. break
  1879. }
  1880. }
  1881. return count
  1882. }
  1883. /** 设置主界面各等级车购买次数 */
  1884. setBuyTimesByTypeMain(type: number, num: number) {
  1885. let has = false
  1886. for (var i = 0; i < this.buyTimeDataMain.length; i++) {
  1887. if (this.buyTimeDataMain[i].type == type) {
  1888. this.buyTimeDataMain[i].number = num
  1889. has = true
  1890. break
  1891. }
  1892. }
  1893. if (!has) {
  1894. this.buyTimeDataMain.push({ 'type': type, 'number': num, 'resetNum': 0, 'pop': 0 })
  1895. }
  1896. }
  1897. getMaxCarLvCanBuy(): number {
  1898. let type = 1
  1899. if (this.buyTimeTotal > 0) {
  1900. type = Number(this.buyNumCfg[this.buyTimeTotal.toString()].max)
  1901. }
  1902. return type
  1903. }
  1904. updateChatRed(add: number) {
  1905. // this.chatRed += add
  1906. // let money = (this.chatRed * 0.0001).toFixed(2)
  1907. // UiM.Instance.chatNode.getComponent(Chat).labMoney.string = `¥${money}`
  1908. // let data = {
  1909. // "chatRed": this.chatRed,
  1910. // }
  1911. // GameM.httpM.sendDatas(HTTP_TYPE.updateChatRed, data)
  1912. }
  1913. /** 更新人物数据*/
  1914. updateRoleData() {
  1915. if (this.useLocalData) {
  1916. GameM.globalStorage.setStorage(STORAGE_KEY.roleData, this.roleData, 2)
  1917. }
  1918. else {
  1919. let data = {
  1920. 'roleData': this.roleData
  1921. }
  1922. GameM.httpM.sendDatas(HTTP_TYPE.updateRoleData, data)
  1923. }
  1924. }
  1925. /**
  1926. * //更新可加入保险箱红包
  1927. * @param data
  1928. */
  1929. updateBankPacket(data) {
  1930. if (cc.isValid(UiM.Instance.safeDepositBoxNode)) {
  1931. UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).updateScrollView(data)
  1932. }
  1933. if (cc.isValid(UiM.Instance.hallNode)) {
  1934. let qipaoNode = UiM.Instance.hallNode.getComponent(Main).bankQipaoNode
  1935. if (cc.isValid(qipaoNode)) {
  1936. let bankQipaoTip = qipaoNode.getComponent(BankQipaoTip)
  1937. bankQipaoTip.showAlreadyMoney(data)
  1938. }
  1939. }
  1940. }
  1941. /**
  1942. * 保险箱存入成功
  1943. * @param data
  1944. */
  1945. updateBankView(data) {
  1946. if (data.RichBankCashAmount > 0) {
  1947. this.richBankCashAmount = data.RichBankCashAmount
  1948. } else {
  1949. return
  1950. }
  1951. if (cc.isValid(UiM.Instance.safeDepositBoxNode)) {
  1952. UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).saveMoneySuccess(data.RichBankCashAmount)
  1953. }
  1954. }
  1955. /**
  1956. * //保险箱任务开始
  1957. * @param data
  1958. */
  1959. updateBankTask(data, param) {
  1960. this.currentRichBankCashTaskIndex = param.index
  1961. this.richbank_logindays = 1
  1962. this.richBankDailyVideoTimes = 0
  1963. if (cc.isValid(UiM.Instance.safeDepositBoxNode)) {
  1964. cc.sys.localStorage.setItem("bankTaskStartTime", Date.now())
  1965. UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).initView(true)
  1966. AdM.onSendEvent("Bank_03", "钱庄开始任务", 'Bank')
  1967. }
  1968. let qipaoNode = UiM.Instance.hallNode.getComponent(Main).bankQipaoNode
  1969. if (cc.isValid(qipaoNode)) {
  1970. let bankQipaoTip = qipaoNode.getComponent(BankQipaoTip)
  1971. bankQipaoTip.showAlreadyMoney(null)
  1972. }
  1973. }
  1974. /**
  1975. * //保险箱提现
  1976. * @param data
  1977. */
  1978. updateBankCash(data) {
  1979. // console.log(data)
  1980. LogUtil.logV("updateBankCash", "success")
  1981. let cashMoney = 0
  1982. let len = this.richBankConfig.length
  1983. for (var i = 0; i < len; i++) {
  1984. if (this.richBankConfig[i].index == this.currentRichBankCashTaskIndex) {
  1985. cashMoney = Number((this.richBankConfig[i].money * 0.01).toFixed(2))
  1986. break
  1987. }
  1988. }
  1989. this.currentRichBankCashTaskIndex = 0
  1990. this.richbank_logindays = 1
  1991. this.richBankDailyVideoTimes = 0
  1992. //计算提现后,银行内剩余的
  1993. let currentConfig = this.getBankTaskIndex()
  1994. this.richBankCashAmount = this.richBankCashAmount - currentConfig.money
  1995. if (this.richBankCashAmount < 0) {
  1996. this.richBankCashAmount = 0
  1997. }
  1998. this.roleData.addRichBankFinishIndex++
  1999. this.updateRoleData()
  2000. AdM.onSendEvent("Bank_06", "钱庄-任务全部完成", 'Bank')
  2001. AdM.setTAEventUser(1, 'bankCashTime_total', 1)
  2002. AdM.setTAEventUser(1, 'bankCashMoney_total', cashMoney)
  2003. if (cc.isValid(UiM.Instance.safeDepositBoxNode)) {
  2004. UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).tixianSuccess(data.CashMode != 2)
  2005. }
  2006. if (data.CashMode == 2) {
  2007. UiM.Instance.onPanel(PANEL_NAME.OfficialNode, false, () => {
  2008. UiM.Instance.officialNode.getComponent(OfficialNode).init(cashMoney, data.withdrawalCode);
  2009. AdM.onSendEvent('publicmoney_3', '公众号提现-钱庄', 'publicmoney')
  2010. })
  2011. }
  2012. }
  2013. updateBankCashFail(errmsg) {
  2014. EffectNode.instance.PlayTip(errmsg)
  2015. if (cc.isValid(UiM.Instance.safeDepositBoxNode)) {
  2016. UiM.Instance.safeDepositBoxNode.getComponent(SafeDepositBox).tixianFail()
  2017. }
  2018. }
  2019. init() {
  2020. let arr = this.giftCfg.reward_weight.split(';')
  2021. for (var i = 0; i < arr.length; i++) {
  2022. this._giftArr[i] = arr[i].split(',')
  2023. }
  2024. TreasureData.Instance.treasureDailyTimes = 0
  2025. }
  2026. /** 更新设备信息 */
  2027. updateMachine(info) {
  2028. let arr = info.split('#')
  2029. let android_id = arr[0]
  2030. let idfa = arr[1]
  2031. let imei = arr[2]
  2032. let mac = arr[3]
  2033. let oaid = arr[4]
  2034. let umid = arr[5]
  2035. this.tf_channel = arr[6]
  2036. this.appVersion = arr[7]
  2037. /** 友盟渠道 */
  2038. this.umengChannel = arr[8]
  2039. /** 设备型号 */
  2040. this.deviceType = arr[9]
  2041. /** 安卓版本号 */
  2042. this.androidVersion = arr[10]
  2043. // console.log('vvvvvvvvv updateMachine ', android_id, " ", idfa, " ", imei, " ", mac, " ", oaid, " ", umid, " ", this.tf_channel, " ", this.appVersion
  2044. // , " ", this.umengChannel, " ", this.deviceType, " ", this.androidVersion)
  2045. this.machineInfo = {
  2046. "android_id": android_id,
  2047. "idfa": idfa,
  2048. "imei": imei,
  2049. "mac": mac,
  2050. "oaid": oaid,
  2051. "umid": umid
  2052. }
  2053. if (GameM.commonData.session_key != '' && GameM.commonData.uin != '') {
  2054. console.log(">>>>>5uin:" + GameM.commonData.uin);
  2055. GameM.httpM.getAccountInfo()
  2056. }
  2057. else {
  2058. GameM.httpM.init();
  2059. }
  2060. }
  2061. /** 发送设备信息到服务器 */
  2062. sendMachineInfo() {
  2063. GameM.httpM.sendDatas(HTTP_TYPE.machine, this.machineInfo)
  2064. this.getForceVersionInfo()
  2065. GameM.commonData.updateVersion()
  2066. }
  2067. //发送请求整包更新
  2068. getForceVersionInfo() {
  2069. let data = {
  2070. 'version': this.appVersion,
  2071. 'channel': this.tf_channel
  2072. }
  2073. LogUtil.logV('getForceVersionInfo ', data)
  2074. GameM.httpM.sendDatas(HTTP_TYPE.getForceVersionInfo, data, GameM.commonData.getForceVersionInfoBack.bind(this))
  2075. }
  2076. getForceVersionInfoBack(data) {
  2077. LogUtil.logV('MMM getForceVersionInfoBack ', data)
  2078. this.needForceUpdate = data.isForceUpdate
  2079. this.installVersion = data.version
  2080. this.installUrl = data.downloadAddress
  2081. this.updateDes = data.versionRemark
  2082. this.fixDes = data.bugRestoreRemark
  2083. }
  2084. updateVersion() {
  2085. let data = {
  2086. "version": this.appVersion
  2087. }
  2088. GameM.httpM.sendDatas(HTTP_TYPE.updateVersion, data)
  2089. }
  2090. /** 获取服务器配置 */
  2091. getAllServerCfg() {
  2092. console.log("--->version:" + this.version)
  2093. let data = {
  2094. "versionCode": this.version
  2095. }
  2096. GameM.httpM.sendDatas(HTTP_TYPE.getAllConfigInfo, data, GameM.commonData.resultGetServerCfg.bind(this))
  2097. }
  2098. /**获取空投箱配置 */
  2099. getAirshipCfg(data: string) {
  2100. let jsonObj = JSON.parse(data)
  2101. this.airshipCfg = jsonObj
  2102. }
  2103. resultGetServerCfg(data, param) {
  2104. if (SwitchM.firstLoginLog) {
  2105. AdM.sendUmeng('umServer5', 'resultGetServerCfg')
  2106. }
  2107. let jsonData = data
  2108. // LogUtil.logV('jsonData ', jsonData)
  2109. console.log("-->JsonData: ", jsonData)
  2110. this.globalCfg = jsonData[CFG_SERVER.GlobalCfg]
  2111. GameM.commonData.globalCfg = this.globalCfg
  2112. GameM.commonData.gold = this.globalCfg.first_money
  2113. GameM.commonData.buyCarPriceArr = this.globalCfg['buy_car_^'].split(',')
  2114. let arr = this.globalCfg['car_lv_up'].split(',')
  2115. GameM.commonData.carLvUpAdd = Number(arr[0])
  2116. GameM.commonData.carLvUpMinus = Number(arr[1])
  2117. GameM.commonData.inter_weight = Number(this.globalCfg.inter_weight)
  2118. GameM.commonData.popInterArr = this.globalCfg['popInter'].split(',')
  2119. // console.log('GameM.commonData.popInterArr ', GameM.commonData.popInterArr)
  2120. GameM.commonData.dayBuyCarVideoLimitTimes = this.globalCfg['dayBuyCarVideoLimitTimes']
  2121. let splashArr = ["0", "0"]
  2122. if (this.globalCfg.pullSplashAd) {
  2123. splashArr = this.globalCfg.pullSplashAd.split(';')
  2124. }
  2125. GameM.commonData.pullSplashAd = Number(splashArr[0])
  2126. GameM.commonData.splashNeedCashNum = Number(splashArr[1])
  2127. LogUtil.logV('GameM.commonData.pullSplashAd ', GameM.commonData.pullSplashAd)
  2128. LogUtil.logV('GameM.commonData.splashNeedCashNum ', GameM.commonData.splashNeedCashNum)
  2129. GameM.commonData.videoCoolTime = this.globalCfg.videoCoolTime
  2130. InvestData.Instance.investCardTime = this.globalCfg.investCardTime
  2131. InvestData.Instance.investVideoTime = this.globalCfg.investVideoTime
  2132. GameM.commonData.popPrivacySwitch = this.globalCfg['popPrivacySwitch'] == 1
  2133. GameM.commonData.popIdentifySwitch = this.globalCfg['popIdentifySwitch'] == 1
  2134. GameM.commonData.richBankUnLockLevel = this.globalCfg.openRichBankLv
  2135. GameM.commonData.clearCoolTimeLVOpen = this.globalCfg.clearCoolTimeLVOpen
  2136. TurntableData.Instance.turntableExtrasCfg = this.globalCfg.turntableExtrasCfg
  2137. if (this.globalCfg.interAdArr) {
  2138. GameM.commonData.interAdArr = this.globalCfg.interAdArr.split(';')
  2139. }
  2140. let ruleArr = this.globalCfg.videoRule.split(';')
  2141. GameM.commonData.videoRule = []
  2142. for (var i = 0; i < ruleArr.length; i++) {
  2143. let arr = ruleArr[i].split(',')
  2144. let data = { 'key': Number(arr[0]), 'value': Number(arr[1]) }
  2145. GameM.commonData.videoRule.push(data)
  2146. }
  2147. // console.log('videoRule ', GameM.commonData.videoRule)
  2148. NativeAdAwardData.Instance.nativeAwardChanceArr = this.globalCfg['nativeAwardChance'].split(',')
  2149. // console.log('nativeAwardChanceArr ', NativeAdAwardData.Instance.nativeAwardChanceArr)
  2150. NativeAdAwardData.Instance.nativeShowLevel = this.globalCfg['nativeShowLevel']
  2151. NativeAdAwardData.Instance.nativeAwardTimes = this.globalCfg['nativeAwardTimes']
  2152. // console.log('nativeShowLevel ', NativeAdAwardData.Instance.nativeShowLevel)
  2153. // console.log('nativeAwardTimes ', NativeAdAwardData.Instance.nativeAwardTimes)
  2154. this.newMonsterArr = this.globalCfg['newmonster'].split(",")
  2155. let guideInstallArr = this.globalCfg['guideInstall'].split(',')
  2156. DownloadApkData.Instance.installSwitch = guideInstallArr[0] == '1'
  2157. DownloadApkData.Instance.installRatio = guideInstallArr[1]
  2158. DownloadApkData.Instance.openRatio = guideInstallArr[2]
  2159. CashOutData.Instance.cashCft = jsonData[CFG_SERVER.CashCfg]
  2160. DailyCashData.Instance.dailyCashApplyCfg = jsonData[CFG_SERVER.DailyCashApplyCfg]
  2161. DailyData.Instance.dailyCfg = jsonData[CFG_SERVER.DailyCfg]
  2162. this.giftCfg = jsonData[CFG_SERVER.GiftCfg]
  2163. this.giftBagRedMoney = this.giftCfg.giftBagRedMoney
  2164. this.priceCfg = jsonData[CFG_SERVER.PriceCfg]
  2165. // this.richBankConfig = jsonData[CFG_SERVER.RichBankCfg]
  2166. //西游
  2167. if (jsonData[CFG_SERVER.BattleBossCfg] != null)
  2168. this.fightRoleServerCfg = jsonData[CFG_SERVER.BattleBossCfg]
  2169. if (jsonData[CFG_SERVER.PartnerTalentCfg] != null)
  2170. this.mateTalentCfg = jsonData[CFG_SERVER.PartnerTalentCfg]
  2171. WealthData.Ins.wealthCfg = jsonData["GodofWealthComesCfg"];
  2172. RichData.Ins.richItemCardCfg = jsonData["WestItemCardCfg"];
  2173. RichData.Ins.richCfg = jsonData["WestCfg"];
  2174. // if (this.richBankConfig && this.richBankConfig[0]) {
  2175. // this.richBankUnLockLevel = this.richBankConfig[0].maxcarlevel
  2176. // }
  2177. GameM.commonData.getSingleCfg(CFG_SERVER.AirshipCfg)
  2178. // this.richBankUnLockLevel = 1
  2179. GameM.commonData.init()
  2180. GameM.httpM.getUserIsNewDay()
  2181. }
  2182. /** 单个服务器配置 */
  2183. getSingleCfg(cfgName: CFG_SERVER) {
  2184. GameM.httpM.sendDatas(HTTP_TYPE.getConfigInfo, { "key": cfgName, "versionCode": this.version }, GameM.commonData.getSingleCfgBack.bind(this))
  2185. }
  2186. getSingleCfgBack(data, param) {
  2187. if (param.key == CFG_SERVER.AirshipCfg) {
  2188. GameM.commonData.getAirshipCfg(data)
  2189. } else if (param.key == CFG_SERVER.TurntableCfg) {
  2190. TurntableData.Instance.getTurnTableCfgBack(data)
  2191. }
  2192. }
  2193. /** 巨量发送激活
  2194. * @param type 0 激活 6 次留
  2195. */
  2196. sendActivate(type) {
  2197. let data = {
  2198. "event_type": type,
  2199. "source": this.appVersion + ';' + this.globalCfg.activate
  2200. }
  2201. GameM.httpM.sendDatas(HTTP_TYPE.activate, data, GameM.commonData.sendActivateBack.bind(this))
  2202. }
  2203. sendActivateBack(data, param) {
  2204. if (param.event_type == 0) {
  2205. AdM.onSendEvent('juliangActivate', '巨量激活成功')
  2206. console.log('juliangActivate')
  2207. }
  2208. else if (param.event_type == 6) {
  2209. AdM.onSendEvent('juliangSecondActivate', '巨量次留成功')
  2210. console.log('juliangSecondActivate')
  2211. }
  2212. }
  2213. /** 广点通发送激活
  2214. * @param type 0 激活 1 次留
  2215. */
  2216. sendQQActivate(type) {
  2217. let data = null
  2218. if (type == 0) {
  2219. data = {
  2220. "action_type": "ACTIVATE_APP"
  2221. }
  2222. }
  2223. else if (type == 1) {
  2224. data = {
  2225. "action_type": "START_APP",
  2226. "action_param": {
  2227. "length_of_stay": 1
  2228. }
  2229. }
  2230. }
  2231. GameM.httpM.sendDatas(HTTP_TYPE.qqActive, data)
  2232. }
  2233. sendCp(key, des) {
  2234. // console.log('sendCp ', key)
  2235. let data = {
  2236. "uin": this.uin,
  2237. "isFirstDay": this.isFirstDay,
  2238. "umengChannel": this.umengChannel,
  2239. "deviceType": this.deviceType,
  2240. "androidVerison": this.androidVersion,
  2241. "version": this.appVersion,
  2242. "point": key,
  2243. "description": des
  2244. }
  2245. GameM.httpM.sendDatas(HTTP_TYPE.cp, data)
  2246. }
  2247. /** 获取topon锁价配置 */
  2248. getToponLockPriceData() {
  2249. let data = {}
  2250. GameM.httpM.sendDatas(HTTP_TYPE.getToponLockPrice, data, GameM.commonData.resultGetToponLockPrice.bind(this))
  2251. }
  2252. resultGetToponLockPrice(data) {
  2253. this.toponPriceLockCfg = data
  2254. LogUtil.logV("resultGetToponLockPrice", this.toponPriceLockCfg)
  2255. }
  2256. /** 获取广告价格
  2257. * @param adsource_id 广告源ID
  2258. * @param adsource_price topon返回千次价格 如果配置中获取不到价格,就用这个补充
  2259. */
  2260. getAdPrice(adsource_id, adsource_price) {
  2261. let price = ''
  2262. if (!this.toponPriceLockCfg) {
  2263. return
  2264. }
  2265. let len = this.toponPriceLockCfg.length
  2266. for (var i = 0; i < len; i++) {
  2267. if (this.toponPriceLockCfg[i].adsourceId == adsource_id) {
  2268. //uroi要求上传千次价格 单位是千分之一分
  2269. price = (this.toponPriceLockCfg[i].lockPrice * 100000).toString()
  2270. break
  2271. }
  2272. }
  2273. if (price == '') {
  2274. price = (adsource_price * 100000).toString()
  2275. }
  2276. LogUtil.logV('UROIStatsSdk ', 'adsource_id ' + adsource_id)
  2277. LogUtil.logV('UROIStatsSdk ', 'adsource_price ' + adsource_price)
  2278. LogUtil.logV('UROIStatsSdk ', 'price ' + price)
  2279. return price
  2280. }
  2281. updateActivateLog(sessionDuration) {
  2282. let data = {
  2283. 'appId': this.appid,
  2284. 'uin': this.uin,
  2285. 'sessionDuration': sessionDuration
  2286. }
  2287. GameM.httpM.sendDatas(HTTP_TYPE.activateLog, data)
  2288. }
  2289. /** 获取banner 插屏开启 */
  2290. getAdShowConfig() {
  2291. if (!this.adShowConfig && this.maxCarLevel >= 8 && (DailyCashData.Instance.dailyCashStatus.length > 0 || CashOutData.Instance.cashStatus.length > 0)) {
  2292. let data = {}
  2293. GameM.httpM.sendDatas(HTTP_TYPE.adShowConfig, data)
  2294. }
  2295. }
  2296. getAdShowConfigBack(data) {
  2297. this.adShowConfig = data.adShowConfig
  2298. LogUtil.logV('getAdShowConfigBack ', this.adShowConfig)
  2299. }
  2300. getCashMoney(index) {
  2301. let data = { 'index': index }
  2302. GameM.httpM.sendDatas(HTTP_TYPE.getCashMoney, data, GameM.commonData.getCashMoneyBack.bind(this))
  2303. }
  2304. getCashMoneyBack(data) {
  2305. LogUtil.logV('getCashMoneyBack >>> ', (data.money * 0.01).toFixed(2))
  2306. LogUtil.logV('getCashMoneyBack ', data.money)
  2307. if (UiM.Instance.cashNode) {
  2308. UiM.Instance.cashNode.getComponent(CashOut).labShowMoney.string = `¥${(data.money * 0.01).toFixed(2)}`
  2309. }
  2310. }
  2311. /** 检查主界面买怪是否提前弹出获得金币界面
  2312. * @returns ture 弹出 false 不弹出
  2313. */
  2314. checkShowMainPop() {
  2315. let status = false
  2316. if (this.globalCfg['showMainPop'] == 1) {
  2317. if (this.adShowConfig) {
  2318. if (this.adShowConfig.is_show_inter == 1) {
  2319. //弹出
  2320. status = true
  2321. }
  2322. else {
  2323. status = false
  2324. }
  2325. }
  2326. else {
  2327. //弹出
  2328. status = true
  2329. }
  2330. }
  2331. else {
  2332. //不弹出
  2333. status = false
  2334. }
  2335. return status
  2336. }
  2337. getDatasFromServer(data) {
  2338. // LogUtil.logV("-------------datainfo ", data);
  2339. console.log("-->DataInfo:", data);
  2340. GameM.commonData.sendMachineInfo()
  2341. this.lastTime = data.lastTime * 1000
  2342. this.currentTime = data.currentTime * 1000
  2343. GameM.commonData.gameTime = GameM.commonData.currentTime
  2344. // let last = new Date(this.lastTime).toLocaleDateString()
  2345. // let now = new Date(this.currentTime).toLocaleDateString()
  2346. if (data.roleData) {
  2347. this.roleData = data.roleData
  2348. }
  2349. else {
  2350. //默认新玩家送一个加速券
  2351. this.roleData.speedCard = 1
  2352. this.updateRoleData()
  2353. }
  2354. if (data.buyTimeDataMain != undefined) {
  2355. this.buyTimeDataMain = data.buyTimeDataMain
  2356. }
  2357. // if (data.investData != undefined) {
  2358. // InvestData.Instance.investData = data.investData
  2359. // }
  2360. console.log("this.roleData.speedCard ", this.roleData.speedCard);
  2361. if (this.roleData.turntableCard == null || this.roleData.turntableCard == undefined) {
  2362. this.roleData.turntableCard = 0
  2363. }
  2364. if (this.roleData.airshipSpeedCard == null || this.roleData.airshipSpeedCard == undefined) {
  2365. this.roleData.airshipSpeedCard = 0
  2366. }
  2367. if (this.roleData.airshipTicket == null || this.roleData.airshipTicket == undefined) {
  2368. this.roleData.airshipTicket = 0
  2369. }
  2370. if (this.roleData.airshipTurntableCard == null || this.roleData.airshipTurntableCard == undefined) {
  2371. this.roleData.airshipTurntableCard = 0
  2372. }
  2373. if (this.roleData.boxSpeedCard == null || this.roleData.boxSpeedCard == undefined) {
  2374. this.roleData.boxSpeedCard = 0
  2375. }
  2376. if (this.roleData.boxTicket == null || this.roleData.boxTicket == undefined) {
  2377. this.roleData.boxTicket = 0
  2378. }
  2379. if (this.roleData.boxTurntableCard == null || this.roleData.boxTurntableCard == undefined) {
  2380. this.roleData.boxTurntableCard = 0
  2381. }
  2382. if (this.roleData.addRichBankFinishIndex == 0 || this.roleData.addRichBankFinishIndex == null || this.roleData.addRichBankFinishIndex == undefined) {
  2383. this.roleData.addRichBankFinishIndex = 1
  2384. }
  2385. if (data.userUsualEggInfo) {
  2386. UsualCaidanData.Instance.userUsualEggInfo = data.userUsualEggInfo
  2387. }
  2388. else {
  2389. UsualCaidanData.Instance.userUsualEggInfo = null
  2390. }
  2391. LogUtil.logV('UsualCaidan data.userUsualEggInfo ', data.userUsualEggInfo)
  2392. if (!this.isFirstIn) {
  2393. if (this.userIsNewDay == 1) {
  2394. //今天第一次登录
  2395. console.log('今天第一次登录')
  2396. if (data.loginDays == 2) {
  2397. AdM.onKSEvent(0)
  2398. }
  2399. else if (data.loginDays == 7) {
  2400. AdM.onKSEvent(1)
  2401. }
  2402. this.dailyFirstLogin = true
  2403. GameM.commonData.giftTimes = 0
  2404. GameM.commonData.dailyFinishTimesData = []
  2405. GameM.commonData.dailyGetData = []
  2406. TurntableData.Instance.turntableRefreshTimes = 0
  2407. GameM.commonData.airshipTimes = 0
  2408. GameM.httpM.sendDatas(HTTP_TYPE.updateGiftTimes, { 'giftTimes': this.giftTimes })
  2409. let data3 = {
  2410. 'dailyFinishTimesData': []
  2411. }
  2412. GameM.httpM.sendDatas(HTTP_TYPE.updateDailyFinishTimesData, data3)
  2413. let data1 = {
  2414. 'dailyGetData': []
  2415. }
  2416. GameM.httpM.sendDatas(HTTP_TYPE.updateDailyGetData, data1)
  2417. GameM.httpM.sendDatas(HTTP_TYPE.updateTurntableRefreshTimes, { 'turntableRefreshTimes': TurntableData.Instance.turntableRefreshTimes })
  2418. GameM.httpM.sendDatas(HTTP_TYPE.updateAirshipTimes, { 'airshipTimes': this.airshipTimes }, GameM.commonData.resultAirShipTimes.bind(this))
  2419. this.roleData.hangupVideoTimes = 0
  2420. this.roleData.clickVideoTimes = 0
  2421. this.roleData.hangVideoFree = 0
  2422. this.roleData.canDailyCash = 0
  2423. this.roleData.activeNum = 0
  2424. this.roleData.activeGet = [0, 0, 0]
  2425. //重置空投掉落次数
  2426. this.roleData.airshipSpeedCard = 0
  2427. this.roleData.airshipTicket = 0
  2428. this.roleData.airshipTurntableCard = 0
  2429. //重置惊喜宝箱掉落次数
  2430. this.roleData.boxSpeedCard = 0
  2431. this.roleData.boxTicket = 0
  2432. this.roleData.boxTurntableCard = 0
  2433. this.roleData.turntableExtrasReward = []
  2434. this.roleData.turntableCard = 0
  2435. if (this.roleData.dailyPro == 0) {
  2436. GameM.commonData.roleData.dailyCashAniPlayed = 0
  2437. }
  2438. this.updateRoleData()
  2439. let key = 'dddddddddddddddddddddddddddddddd'
  2440. let d = null
  2441. // this.dayCsjTimes = 0
  2442. // let d = utils.Encrypt(this.dayCsjTimes, key, GameM.commonData.appid)
  2443. // GameM.globalStorage.setStorage(STORAGE_KEY.dayCsjTimes, d)
  2444. // this.dayYlhTimes = 0
  2445. // d = utils.Encrypt(this.dayYlhTimes, key, GameM.commonData.appid)
  2446. // GameM.globalStorage.setStorage(STORAGE_KEY.dayYlhTimes, d)
  2447. this.dayBuyCarVideoLimitTimes = GameM.commonData.globalCfg['dayBuyCarVideoLimitTimes']
  2448. d = Utils.Encrypt(this.dayBuyCarVideoLimitTimes, key, GameM.commonData.appid)
  2449. GameM.globalStorage.setStorage(STORAGE_KEY.dayBuyCarVideoLimitTimes, d)
  2450. this.todayVideoTimes = 0
  2451. GameM.globalStorage.setStorage(STORAGE_KEY.todayVideoTimes, this.todayVideoTimes)
  2452. this.todayFullInterTimes = 0
  2453. GameM.globalStorage.setStorage(STORAGE_KEY.todayFullInterTimes, this.todayFullInterTimes)
  2454. this.userIsNewDay = 0
  2455. let data6 = {
  2456. 'userIsNewDay': this.userIsNewDay
  2457. }
  2458. GameM.httpM.sendDatas(HTTP_TYPE.updateUserIsNewDay, data6)
  2459. GameM.globalStorage.setStorage(STORAGE_KEY.showClubGirl, 1)
  2460. /**重置每天的买车次数 */
  2461. for (let i = 0; i < data.maxCarLevel; i++) {
  2462. LocalManagerData.Instance.saveBuyCarData(i, 0)
  2463. }
  2464. GameM.commonData.todayPlayTime = 0
  2465. GameM.globalStorage.setStorage(STORAGE_KEY.todayPlayTime, GameM.commonData.todayPlayTime)
  2466. GlobalStorage.Instance.setStorage(STORAGE_KEY.CoinTipTotay, 0, 0)
  2467. let cashLen = 0
  2468. if (data.cashStatus) {
  2469. cashLen += data.cashStatus.length
  2470. }
  2471. if (data.dailyCashStatus) {
  2472. cashLen += data.dailyCashStatus.length
  2473. }
  2474. let cashEcpm = 0
  2475. //已经提现
  2476. if (cashLen > 0) {
  2477. if (data.adShowConfig) {
  2478. cashEcpm = data.adShowConfig.average_ecpm
  2479. }
  2480. if (GameM.commonData.globalCfg['IconShowEcpm']) {
  2481. let arr = GameM.commonData.globalCfg['IconShowEcpm'].split(',')
  2482. let len = arr.length
  2483. for (var i = 0; i < this.cashStateBtnsArr.length; i++) {
  2484. if (len > i && cashEcpm > Number(arr[i])) {
  2485. this.cashStateBtnsArr[i] = "1"
  2486. }
  2487. else {
  2488. this.cashStateBtnsArr[i] = "0"
  2489. }
  2490. }
  2491. }
  2492. }
  2493. let cashStateStr = ''
  2494. cashStateStr = this.cashStateBtnsArr.join(',')
  2495. GlobalStorage.Instance.setStorage(STORAGE_KEY.cashEcpmBtnState, cashStateStr, 1)
  2496. LogUtil.logV('cashStateBtnsArr aa ', this.cashStateBtnsArr)
  2497. }
  2498. else {
  2499. this.dailyFirstLogin = false
  2500. this.giftTimes = data.giftTimes
  2501. if (data.dailyFinishTimesData) {
  2502. this.dailyFinishTimesData = data.dailyFinishTimesData
  2503. }
  2504. else {
  2505. this.dailyFinishTimesData = []
  2506. }
  2507. if (data.dailyGetData) {
  2508. this.dailyGetData = data.dailyGetData
  2509. }
  2510. else {
  2511. this.dailyGetData = []
  2512. }
  2513. let update = false
  2514. if (this.roleData.canDailyCash == undefined) {
  2515. this.roleData.canDailyCash = 0
  2516. this.roleData.dailyFinishIndex = 0
  2517. this.roleData.dailyPro = 0
  2518. this.roleData.shop = 0
  2519. update = true
  2520. }
  2521. if (this.roleData.hangVideoFree == undefined) {
  2522. this.roleData.hangVideoFree = 0
  2523. update = true
  2524. }
  2525. if (update) {
  2526. this.updateRoleData()
  2527. }
  2528. TurntableData.Instance.turntableRefreshTimes = data.turntableRefreshTimes
  2529. this.airshipTimes = data.airshipTimes
  2530. let key = 'dddddddddddddddddddddddddddddddd'
  2531. let value = GameM.globalStorage.getStorage(STORAGE_KEY.dayBuyCarVideoLimitTimes, 1)
  2532. if (value != null) {
  2533. GameM.commonData.dayBuyCarVideoLimitTimes = parseInt(Utils.Decrypt(value, key, GameM.commonData.appid, true))
  2534. }
  2535. let cashStateStr = GlobalStorage.Instance.getStorage(STORAGE_KEY.cashEcpmBtnState, 1)
  2536. if (cashStateStr != null) {
  2537. this.cashStateBtnsArr = cashStateStr.split(',')
  2538. }
  2539. LogUtil.logV('cashStateBtnsArr bb ', this.cashStateBtnsArr)
  2540. }
  2541. GameM.commonData.offlineTime = Math.floor((this.currentTime - this.lastTime) * 0.001)
  2542. if (GameM.commonData.offlineTime == NaN) {
  2543. GameM.commonData.offlineTime = 0
  2544. }
  2545. // if (data.step) {
  2546. // this.step = data.step
  2547. // }
  2548. console.log('this.step ', this.step)
  2549. }
  2550. else {
  2551. //第一次登录
  2552. console.log('第一次登录')
  2553. this.isFirstIn = false
  2554. this.lastTime = this.currentTime
  2555. GameM.commonData.giftTimes = 0
  2556. GameM.commonData.dailyFinishTimesData = []
  2557. GameM.commonData.dailyGetData = []
  2558. TurntableData.Instance.turntableRefreshTimes = 0
  2559. GameM.commonData.airshipTimes = 0
  2560. GameM.commonData.offlineTime = 0
  2561. AdM.onKSEvent(4)
  2562. this.userIsNewDay = 0
  2563. let data6 = {
  2564. 'userIsNewDay': this.userIsNewDay
  2565. }
  2566. GameM.httpM.sendDatas(HTTP_TYPE.updateUserIsNewDay, data6)
  2567. let cashStateStr = this.cashStateBtnsArr.join(',')
  2568. GlobalStorage.Instance.setStorage(STORAGE_KEY.cashEcpmBtnState, cashStateStr, 1)
  2569. LogUtil.logV('cashStateBtnsArr cc ', this.cashStateBtnsArr)
  2570. }
  2571. this.buyTimeTotal = data.buyTimeTotal
  2572. if (this.roleData.TypeCar4Times == undefined) {
  2573. this.roleData.TypeCar4Times = 0
  2574. }
  2575. if (this.roleData.investGuide == undefined) {
  2576. this.roleData.investGuide = 0
  2577. }
  2578. if (this.roleData.dailyGuide == undefined) {
  2579. this.roleData.dailyGuide = 0
  2580. }
  2581. if (this.roleData.ticket == undefined) {
  2582. this.roleData.ticket = 0
  2583. }
  2584. if (this.roleData.activeNum == undefined) {
  2585. this.roleData.activeNum = 0
  2586. }
  2587. if (this.roleData.activeGet == undefined) {
  2588. this.roleData.activeGet = [0, 0, 0]
  2589. }
  2590. if (this.roleData.dailyCashAniPlayed == undefined) {
  2591. GameM.commonData.roleData.dailyCashAniPlayed = 0
  2592. }
  2593. if (this.roleData.turntableTotal == null || this.roleData.turntableTotal == undefined) {
  2594. this.roleData.turntableTotal = 0
  2595. }
  2596. if (this.roleData.shopTotal == null || this.roleData.shopTotal == undefined) {
  2597. this.roleData.shopTotal = 0
  2598. }
  2599. if (this.roleData.investTotal == null || this.roleData.investTotal == undefined) {
  2600. this.roleData.investTotal = 0
  2601. }
  2602. if (this.roleData.treasureTotal == null || this.roleData.treasureTotal == undefined) {
  2603. this.roleData.treasureTotal = 0
  2604. }
  2605. if (this.roleData.inviteTotal == null || this.roleData.inviteTotal == undefined) {
  2606. this.roleData.inviteTotal = 0
  2607. }
  2608. if (this.roleData.airshipTotal == null || this.roleData.airshipTotal == undefined) {
  2609. this.roleData.airshipTotal = 0
  2610. }
  2611. if (this.roleData.turntableExtrasReward == null || this.roleData.turntableExtrasReward == undefined) {
  2612. this.roleData.turntableExtrasReward = []
  2613. }
  2614. if (this.offlineTime > 0) {
  2615. this.videoCoolDown -= this.offlineTime
  2616. if (this.videoCoolDown < 0) {
  2617. this.videoCoolDown = 0
  2618. }
  2619. GlobalStorage.Instance.setStorage(STORAGE_KEY.videoCoolDown, this.videoCoolDown)
  2620. }
  2621. if (data.gold != '') {
  2622. this.gold = data.gold.toString()
  2623. }
  2624. if (data.videoTimes) {
  2625. this.videoTimes = data.videoTimes
  2626. }
  2627. if (data.bagCar) {
  2628. //console.log("--->Data:"+JSON.stringify(data))
  2629. //console.log("--->BagCar" + JSON.stringify(data.bagCar))
  2630. this.bagCar = data.bagCar
  2631. //15车位版本
  2632. // console.log("---->Bag:" + JSON.stringify(data.bagCar));
  2633. if (this.bagCar.length == 12) {
  2634. this.bagCar.push({ 'pos': 12, 'type': 0, 'num': 1 });
  2635. this.bagCar.push({ 'pos': 13, 'type': 0, 'num': 1 });
  2636. this.bagCar.push({ 'pos': 14, 'type': 0, 'num': 1 });
  2637. }
  2638. }
  2639. //西游
  2640. //this.bagCar.splice(12, 3)
  2641. // console.log("--->BagCarEnd" + JSON.stringify(this.bagCar))
  2642. //console.log("--->dataMaxCarLv:"+data.maxCarLevel);
  2643. this.maxCarLevel = data.maxCarLevel
  2644. if (data.buyTimeData) {
  2645. this.buyTimeData = data.buyTimeData
  2646. }
  2647. GameM.globalStorage.speedUpTimeValue = data.speedUpTimeValue
  2648. this.maxCarLvCanBuy = this.getMaxCarLvCanBuy()
  2649. this.giftCacheNum = data.giftCacheNum
  2650. this.boxCacheNum = data.boxCacheNum
  2651. TurntableData.Instance.turntableTimes = data.turntableTimes
  2652. if (data.achieveGetData) {
  2653. this.achieveGetData = data.achieveGetData
  2654. }
  2655. if (data.composeAwardGet) {
  2656. this.composeAwardGet = data.composeAwardGet
  2657. }
  2658. // InvestData.Instance.investTime = data.investTime
  2659. // InvestData.Instance.investIndex = data.investIndex
  2660. if (data.loginDays) {
  2661. this.loginDays = data.loginDays
  2662. }
  2663. if (this.loginDays == 1) {
  2664. this.isFirstDay = 1
  2665. }
  2666. else {
  2667. this.isFirstDay = 0
  2668. }
  2669. this.composeCarTimes = data.composeCarTimes
  2670. this.lastVideoUpCarBuyTimes = data.lastVideoUpCarBuyTimes
  2671. if (data.cashStatus) {
  2672. CashOutData.Instance.cashStatus = data.cashStatus
  2673. }
  2674. if (data.redMoneyRecord) {
  2675. this.redMoneyRecord = data.redMoneyRecord
  2676. }
  2677. if (data.cashRecord) {
  2678. this.cashRecord = data.cashRecord
  2679. }
  2680. GameM.commonData.giftCacheMax = GameM.commonData.giftCfg.times
  2681. GameM.commonData.giftMaxTimes = GameM.commonData.giftCfg.day_times
  2682. if (GameM.commonData.roleData.lv >= 3 && GameM.commonData.giftTimes < GameM.commonData.giftMaxTimes) {
  2683. let maxAdd = GameM.commonData.giftMaxTimes - GameM.commonData.giftTimes
  2684. let len = GameM.commonData.giftCacheNum
  2685. if (len < GameM.commonData.giftCacheMax) {
  2686. let canAdd = Math.min((GameM.commonData.giftCfg.times - len), maxAdd)
  2687. let timeAdd = Math.floor(GameM.commonData.offlineTime / (GameM.commonData.giftCfg.timespan + 30))
  2688. let addNum = Math.min(timeAdd, canAdd)
  2689. GameM.commonData.giftCacheNum += addNum
  2690. }
  2691. }
  2692. else {
  2693. console.log('今日礼包次数达到上限')
  2694. }
  2695. if (!this.roleData.dailyGet) {
  2696. this.roleData.dailyGet = '0,0,0,0,0,0,0'
  2697. }
  2698. DailyData.Instance.dailyGetArr = this.roleData.dailyGet.split(',')
  2699. GameM.commonData.gameAdd = GameM.globalStorage.getStorage(STORAGE_KEY.gameAdd) + GameM.commonData.offlineTime
  2700. GameM.globalStorage.setStorage(STORAGE_KEY.gameAdd, GameM.commonData.gameAdd)
  2701. this.richBankCashAmount = data.richBankCashAmount
  2702. this.currentRichBankCashTaskIndex = data.currentRichBankCashTaskIndex
  2703. if (this.currentRichBankCashTaskIndex > 0) {
  2704. this.roleData.addRichBankFinishIndex = this.currentRichBankCashTaskIndex
  2705. }
  2706. this.richBankDailyVideoTimes = data.richBankDailyVideoTimes
  2707. this.richbank_logindays = data.richbank_logindays
  2708. this.isopenrichbank = data.isopenrichbank
  2709. //赋值红包币
  2710. this.redMoney = data.redMoney
  2711. this.getToponLockPriceData()
  2712. if (data.dailyCashStatus) {
  2713. DailyCashData.Instance.dailyCashStatus = data.dailyCashStatus
  2714. }
  2715. //插屏、banner开启条件
  2716. if (this.maxCarLevel >= 8 && (DailyCashData.Instance.dailyCashStatus.length > 0 || CashOutData.Instance.cashStatus.length > 0)) {
  2717. if (data.adShowConfig) {
  2718. this.adShowConfig = data.adShowConfig
  2719. LogUtil.logV('data.adShowConfig ', data.adShowConfig)
  2720. }
  2721. }
  2722. LogUtil.logV('this.adShowConfig ', this.adShowConfig)
  2723. if (data.userDailyCashInfo) {
  2724. DailyCashData.Instance.userDailyCashInfo = data.userDailyCashInfo
  2725. LogUtil.logV('data.userDailyCashInfo ', data.userDailyCashInfo)
  2726. }
  2727. //test
  2728. // GameM.commonData.updateMaxCarLevel(2)
  2729. // GameM.commonData.roleData.lv = 4
  2730. // GameM.commonData.roleData.canDailyCash = 0
  2731. // GameM.commonData.roleData.newuser = null
  2732. // GameM.commonData.redMoney = 0
  2733. // GameM.commonData.roleData.exp = 0
  2734. // GameM.commonData.step = 1
  2735. // this.dailyFirstLogin = true
  2736. // this.dailyGetArr[1] = '0'
  2737. // this.maxCarLevel = 30
  2738. // this.loginDays = 2
  2739. // this.canSign = 0
  2740. // GameM.commonData.roleData.phonePieceNum = 0
  2741. // GameM.commonData.signDays = 0
  2742. // this.updateRoleData()
  2743. // GameM.commonData.maxCarLevel = 7
  2744. // this.roleData.ticket = 10
  2745. // this.maxCarLevel = 60
  2746. // this.roleData.flower = 300
  2747. // this.maxCarLevel = 30
  2748. // this.loginDays = 30
  2749. //测试
  2750. // this.maxCarLevel = 30
  2751. // this.loginDays = 10
  2752. //西游
  2753. MateData.Ins.talentCoin = data.talentCoin;
  2754. MateData.Ins.MateDataServerInit(data.partnerTalentInfo);
  2755. FightData.Ins.UpdateTriggerFightRate();
  2756. WealthData.Ins.WealthInit(data.userWealthGodInfo, data.adShowConfig.average_ecpm);
  2757. RichData.Ins.ServerInit(data.userLearningInfo); //WealthData.Ins.wealthInfo = data.userWealthGodInfo;
  2758. TuCaoData.Ins.ServerInit(data.userTuCaoInfo); //WealthData.Ins.wealthInfo = data.userWealthGodInfo;
  2759. //WealthData.Ins.paramEcpm = data.adShowConfig.average_ecpm;
  2760. AdM.setTAEventRegister()
  2761. //引导下载剩余奖励次数 每日重置
  2762. if (data.userTreasureGourdInfo) {
  2763. DownloadApkData.Instance.installRewards = data.userTreasureGourdInfo.installRewards
  2764. DownloadApkData.Instance.startRewards = data.userTreasureGourdInfo.startRewards
  2765. DownloadApkData.Instance.packageInfoArr = data.userTreasureGourdInfo.treasureGourds
  2766. }
  2767. console.log("--->MaxCarLv:" + this.maxCarLevel);
  2768. // this.roleData.lv = 18
  2769. // GameM.commonData.canSign = 0
  2770. // this.redMoney = 1000000
  2771. // this.videoCoolDown = 60
  2772. }
  2773. public disConnectNum = 0
  2774. public hasShowDisconnect = false
  2775. /** 断网弹窗 */
  2776. async showDisconnectedNode() {
  2777. if (this.disConnectNum < 5) {
  2778. this.disConnectNum++
  2779. return
  2780. }
  2781. if (!this.hasShowDisconnect) {
  2782. this.hasShowDisconnect = true
  2783. this.disConnectNum = 0
  2784. let pre = await Utils.loadResPromise('prefabs/DisconnectedNode')
  2785. let disCon = cc.instantiate(pre)
  2786. let con = cc.find('Canvas')
  2787. con.addChild(disCon)
  2788. }
  2789. }
  2790. //西游
  2791. /**是否已解锁罢工功能*/
  2792. IsUnlockStrike() {
  2793. //不要点击生产金币功能了
  2794. return false;
  2795. //console.log("-->role lv:"+this.roleData.lv);
  2796. //return this.maxCarLevel >= this.unlockStrikeLv;
  2797. return this.maxCarLevel >= this.unlockStrikeLv;
  2798. }
  2799. /**西游(弃用 继续使用 maxCarLevel表示最大等级) 更新合成的角色最大等级*/
  2800. UpdateComposeMaxRoleLv(lv) {
  2801. if (lv > this.composeMaxRoleLv) {
  2802. //首次合成战斗触发在 gift checkShowGuide中
  2803. this.composeMaxRoleLv = lv
  2804. PlayerPrefs.SetInt(STORAGE_KEY.composeMaxRoleLv, this.composeMaxRoleLv);
  2805. //HttpM.Instance.SendData(HTTP_TYPE.updateMaxCarLevel,{ 'maxCarLevel': this.maxCarLevel },(res)=>{
  2806. // console.log("-->update max Car:"+JSON.stringify(res));
  2807. //});
  2808. //天赋解锁
  2809. MateData.Ins.CheckUnlockTalent(lv);
  2810. //更新战斗触发概率
  2811. FightData.Ins.UpdateTriggerFightRate();
  2812. } else {
  2813. //已解锁武将 概率触发战斗
  2814. FightData.Ins.CheckTriggerFight(lv);
  2815. }
  2816. }
  2817. }
  2818. /**轮船方向 */
  2819. export enum CARDIR {
  2820. Up = 0,
  2821. Left = 1,
  2822. Right = 2,
  2823. Down = 3
  2824. }
  2825. export const ConfigOnLine = {
  2826. GlobalCfg: 'GlobalCfg.json'
  2827. }
  2828. export enum MONEY_TYPE {
  2829. gold = 10001,
  2830. redMoney = 10002,
  2831. timespanGold = 10003,
  2832. box = 10004,
  2833. offlineGold = 10005,
  2834. getNewCar = 10006,
  2835. carLvUp = 10007,
  2836. popVideo = 10008,
  2837. buyCarGold = 10014,
  2838. buyCar = 10015,
  2839. caidanNew = 10017,
  2840. mainBuyCarGold = 10018,
  2841. speedCard = 20001, //加速卡加速投资时间
  2842. turnTableCard = 20002, //转盘卡
  2843. treasureCard = 20003, //空投获得夺宝券
  2844. treasureTicket = 20004, //视频获得夺宝券
  2845. active = 20005, //活跃值
  2846. talentCoin = 20006, //天赋石
  2847. clearCooltime = 30001,//清楚冷却时间
  2848. }
  2849. /**
  2850. * 签到奖励
  2851. 在线奖励
  2852. 幸运转盘
  2853. 投资收益
  2854. 日常任务
  2855. 成就任务
  2856. 在线礼包
  2857. 轮船升级
  2858. 角色升级
  2859. 轮船等级奖励
  2860. 空投礼包
  2861. 新人奖励
  2862. 购买新车
  2863. */
  2864. export enum RecordTYPE {
  2865. signIn = 0,
  2866. online,
  2867. turntable,
  2868. invest,
  2869. dailytask,
  2870. achievement,
  2871. onlineGiftRed,
  2872. carLevelup,
  2873. roleLevelup,
  2874. carLevelReward,
  2875. airship,
  2876. newUser,
  2877. buyNewCar
  2878. }
  2879. /** 向服务器发送数据类型 */
  2880. export enum HTTP_TYPE {
  2881. connectTest = 'connectTest',
  2882. getInfo = 'getInfo',
  2883. addRedMoney = 'addRedMoney',
  2884. getRedMoneyRecord = 'getRedMoneyRecord',
  2885. cash = 'cash',
  2886. getCashRecord = 'getCashRecord',
  2887. bankCashRecord = "richbank/getCashRecord",
  2888. bankOpenCashTask = "richbank/openCashTask",
  2889. bankCash = "richbank/richbankcash",
  2890. bankUpdateCashRecord = "richbank/updateCashRecord",
  2891. backIsOpenRichBank = "richbank/updateIsOpenRichBank",
  2892. getRichBankCfg = "richbank/getRichBankCfg",//获取服务器配置
  2893. getCurrentCashTaskInfo = "richbank/getCurrentCashTaskInfo",//获取当前任务进度
  2894. getRichBankInfo = "richbank/getRichBankInfo",
  2895. updateStep = 'updateStep',
  2896. updateGold = 'updateGold',
  2897. updateRoleData = 'updateRoleData',
  2898. updateBagCar = 'updateBagCar',
  2899. /**更新最高车等级 更新战斗触发1 队列*/
  2900. updateMaxCarLevel = 'updateMaxCarLevel', //更新车等级
  2901. updateBuyTimeTotal = 'updateBuyTimeTotal',
  2902. updateBuyTimeData = 'updateBuyTimeData',
  2903. updateBuyTimeDataMain = 'updateBuyTimeDataMain',
  2904. updateSpeedUpTime = 'updateSpeedUpTime',
  2905. updateSpeedUpStartTime = 'updateSpeedUpStartTime',
  2906. updateSpeedUpTimeValue = 'updateSpeedUpTimeValue',
  2907. updateGiftCacheNum = 'updateGiftCacheNum',
  2908. updateBoxCacheNum = 'updateBoxCacheNum',
  2909. updateGiftTimes = 'updateGiftTimes',
  2910. updateTurntableRefreshTimes = 'updateTurntableRefreshTimes',
  2911. updateTurntableTimes = 'updateTurntableTimes',
  2912. updateDailyFinishTimesData = 'updateDailyFinishTimesData',
  2913. updateDailyGetData = 'updateDailyGetData',
  2914. updateAchieveGetData = 'updateAchieveGetData',
  2915. updateInvestData = 'updateInvestData',
  2916. updateComposeAwardGet = 'updateComposeAwardGet',
  2917. updateComposeCarTimes = 'updateComposeCarTimes',
  2918. updateAirshipTimes = 'updateAirshipTimes',
  2919. updateLastVideoUpCarBuyTimes = 'updateLastVideoUpCarBuyTimes',
  2920. updateSpeedUpTotal = 'updateSpeedUpTotal',
  2921. updateVideo = 'updateVideo',
  2922. machine = 'user/machine',
  2923. getLuckDrawInfo = 'getLuckDrawInfo',
  2924. refreshluckDrawInfo = 'refreshluckDrawInfo',
  2925. join = 'join',
  2926. luckycash = 'luckycash',
  2927. getLuckyLottery = 'getLuckyLottery',
  2928. getShouYeLuckyLottery = 'getShouYeLuckyLottery',
  2929. lotteryresults = 'lotteryresults',
  2930. getLuckydrawConfig = 'getLuckydrawConfig',
  2931. updatelottery = 'updatelottery',
  2932. getDailyLimit = 'getDailyLimit',
  2933. updateVersion = 'updateVersion',
  2934. getUserIsNewDay = 'getUserIsNewDay',
  2935. updateUserIsNewDay = 'updateUserIsNewDay',
  2936. getConfigInfo = 'getConfigInfo',
  2937. getAllConfigInfo = 'getAllConfigInfo',
  2938. activate = 'ad/oe/callback/activate',
  2939. qqActive = '/ad/qq/callback/activate',
  2940. cp = 'cp',
  2941. updateADLog = 'updateADLog',
  2942. /** 获取topon锁价配置信息*/
  2943. getToponLockPrice = 'getToponLockPrice',
  2944. //裂变
  2945. /**会员个人基础信息(等级、升级进度、提现加成、已到账金额、总邀请人数) */
  2946. clubGetBaseInfo = "/fission/getBaseInfo",
  2947. /**提现 */
  2948. clubDoWithdraw = "/fission/doWithdraw",
  2949. /**等级奖励规则 */
  2950. clubLevelRewardRule = "/fission/levelRewardRule",
  2951. /**活跃奖励气泡数据 */
  2952. clubMyBubbleData = "/fission/myBubbleData",
  2953. /**我招募的后代成员 */
  2954. clubMyRecruitMembers = "/fission/myRecruitMembers",
  2955. /**预估收益 */
  2956. clubPredictRevenue = "/fission/predictRevenue",
  2957. /**招募完成提现广播 */
  2958. clubRecruitBroadcast = "/fission/recruitBroadcast",
  2959. /**招募进度 */
  2960. clubRecruitProgress = "/fission/recruitProgress",
  2961. /**获取短地址 */
  2962. clubShorturl = "/fission/short-url",
  2963. /**活跃奖励提现档位 */
  2964. clubWithdrawDenominations = "/fission/withdrawDenominations",
  2965. /**提现记录 */
  2966. clubWithDrawRecords = "/fission/withDrawRecords",
  2967. /**收取泡泡/确定过期泡泡 */
  2968. clubCollectBubbles = "/fission/collectBubbles",
  2969. /** 绑定邀请人 */
  2970. bindRelation = "/fission/bindRelation",
  2971. /** 上传邀请码 */
  2972. inviteInstalled = "inviteInstalled",
  2973. /** 添加app下载日志 */
  2974. appDownloadLog = "/fission/appDownloadLog",
  2975. /** 获取推荐列表 */
  2976. recommendList = "/fission/recommendList",
  2977. /** 自动收集泡泡 */
  2978. autoCollectBubbles = "/fission/autoCollectBubbles",
  2979. /** 投资数据 */
  2980. getInvestInfo = 'invest/getInvestInfo',
  2981. /** 更新投资数据 */
  2982. updateInvestProject = 'invest/updateInvestProject',
  2983. /** 更新投资加速数据 */
  2984. reduceTimeInvestProject = 'invest/reduceTimeInvestProject',
  2985. /** 常规彩蛋 -- 开启彩蛋 */
  2986. openUsualEggData = 'coloredEggs/openUsualEggData',
  2987. /** 常规彩蛋 -- 更新彩蛋进度 */
  2988. updateUsualEggData = 'coloredEggs/updateUsualEggData',
  2989. /** 常规彩蛋 -- 彩蛋完成 */
  2990. completeUsualEggTask = 'coloredEggs/completeUsualEggTask',
  2991. /** 常规彩蛋 -- 彩蛋提现 */
  2992. usualEggsTaskCash = 'coloredEggs/usualEggsTaskCash',
  2993. /** 时长统计 */
  2994. activateLog = 'activateLog',
  2995. /** 是否强更新 */
  2996. getForceVersionInfo = 'getForceVersionInfo',
  2997. /** 获取是否显示插屏和banner */
  2998. adShowConfig = 'user/adShowConfig',
  2999. /** 提前获取提现金额 */
  3000. getCashMoney = 'getCashMoney',
  3001. /** 提前获取彩蛋金额 */
  3002. getUsualEggCashMoney = 'coloredEggs/getUsualEggCashMoney',
  3003. /** 提前获取每日提现金 */
  3004. getDailyCashMoney = 'getDailyCashMoney',
  3005. /** 每日提现买车次数 */
  3006. getDailyCashBuyTime = 'getDailyCashBuyTime',
  3007. /** 每日提现 */
  3008. dailyCash = 'dailyCash',
  3009. /** 查询是否打死boss */
  3010. checkDefeatBoss = 'battle/checkDefeatBoss',
  3011. //西游接口
  3012. /**获取战斗一武将队列*/
  3013. getMyBossRecords = 'battle/getMyBossRecords',
  3014. /**开始战斗*/
  3015. beginBattle = 'battle/beginBattle',
  3016. /**战斗结束 结算 奖励获取 解锁伙伴*/
  3017. finishBattle = 'battle/finishBattle',
  3018. /**天赋 升级伙伴天赋*/
  3019. upgradePartnerTalent = 'upgradePartnerTalent',
  3020. updateBattleStoneCount = "updateBattleStoneCount",
  3021. /**战斗 获取双倍奖励*/
  3022. battleDoubleAward = 'battle/doubleAward',
  3023. /**财神降临 开启财神降临*/
  3024. wealthGodOpen = 'wealthgod/openWealthGod',
  3025. /**财神降临 更新消耗金币*/
  3026. wealthUpdateGold = 'wealthgod/updateConsumeGold',
  3027. /**财神降临 更新时间接口*/
  3028. wealthUpdateTime = 'wealthgod/updateWealthGodSecond',
  3029. /**财神降临 更新财神状态*/
  3030. wealthUpdateStatus = 'wealthgod/updateWealthGodStatus',
  3031. //大富翁
  3032. /**大富翁 获取棋盘*/
  3033. richManChessboar = 'learning/chessboard',
  3034. /**大富翁 更新道具信息*/
  3035. richManUpdateItemCard = 'learning/updateItemCard',
  3036. /**大富翁 更新棋盘*/
  3037. richManUpdateLattice = 'learning/updateLattice',
  3038. /**大富翁 获取武将奖励*/
  3039. richManBossReward = 'learning/getRewards',
  3040. /**大富翁 获取一个答题*/
  3041. richManGetSubject = 'learning/oneQuestion',
  3042. /**大富翁 兑换经书列表*/
  3043. richManBookList = 'learning/exchangeScriptureNum',
  3044. /**大富翁 经书红包币兑换*/
  3045. richManJadeCash = 'learning/fairyJadeCash',
  3046. /**大富翁 取经初始化*/
  3047. richManInitCardInfo = 'learning/initialItemCardInfo',
  3048. //引导下载
  3049. getPackage = 'treasureGourd/getPackage',
  3050. updatePackage = 'treasureGourd/updatePackage',
  3051. updateRewards = 'treasureGourd/updateRewards',
  3052. //兑换礼包
  3053. /**兑换礼包*/
  3054. redeemExchange = 'redemption/exchange',
  3055. /**获取礼包*/
  3056. redeemGetRedemption = 'redemption/getRedemption',
  3057. /**看视频领红包 大额红包提现*/
  3058. adRbBigCash = 'redMoneyVideoCash',
  3059. /**看视频领红包 任务红包提现*/
  3060. adRbTaskCash = 'tuCaoRedMoney/gearCash',
  3061. /**看视频领红包 初始化数据*/
  3062. adRbInit = 'tuCaoRedMoney/initUserInfo',
  3063. /**看视频领红包 免费加进度*/
  3064. adRbNoNeedVideo = 'tuCaoRedMoney/noNeedVideo'
  3065. }
  3066. /** 服务器放置的配置表 */
  3067. export enum CFG_SERVER {
  3068. GlobalCfg = 'GlobalCfg',
  3069. CashCfg = 'CashCfg',
  3070. DailyCashApplyCfg = 'DailyCashApplyCfg',
  3071. GiftCfg = 'GiftCfg',
  3072. DailyCfg = 'DailyCfg',
  3073. PriceCfg = 'PriceCfg',
  3074. RichBankCfg = 'RichBankCfg',
  3075. AirshipCfg = 'AirshipCfg',
  3076. TurntableCfg = "TurntableCfg",
  3077. UsualEggTaskCfg = 'UsualEggTaskCfg',
  3078. //西游
  3079. BattleBossCfg = "BattleBossCfg", //服务端战斗角色配置
  3080. PartnerTalentCfg = "PartnerTalentCfg" //服务端战斗角色配置
  3081. }