DebugPlatform.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. var s =
  5. (this && this.__awaiter) ||
  6. function(t, n, r, l) {
  7. return new(r = r || Promise)(function(i, e) {
  8. function s(t) {
  9. try {
  10. a(l.next(t));
  11. } catch (t) {
  12. e(t);
  13. }
  14. }
  15. function o(t) {
  16. try {
  17. a(l.throw(t));
  18. } catch (t) {
  19. e(t);
  20. }
  21. }
  22. function a(t) {
  23. var e;
  24. t.done ?
  25. i(t.value) :
  26. ((e = t.value) instanceof r ?
  27. e :
  28. new r(function(t) {
  29. t(e);
  30. })
  31. ).then(s, o);
  32. }
  33. a((l = l.apply(t, n || [])).next());
  34. });
  35. };
  36. Object.defineProperty(i, "__esModule", { value: !0 });
  37. const o = t("App"),
  38. a = (t("LayerManager"), t("ADManageBase")),
  39. n = t("PlatformBase");
  40. i.default = class extends n.default {
  41. constructor() {
  42. super(),
  43. (this.expressAdNode = null),
  44. (this._isSignin = !1),
  45. void 0 === window.versionInfo && (window.versionInfo = { version: "", packVersion: "gm", zipVersion: "" });
  46. }
  47. init() {
  48. super.init(), Log.trace("平台为3---------", cc.sys.platform);
  49. }
  50. initAccountServer() {
  51. var t = o.default.ConfigManager.getConfig("Server")[this.getServerId()];
  52. (o.default.ConfigManager.gameConf.serverInfos.game = t.games[0].game),
  53. (o.default.ConfigManager.gameConf.serverInfos.interface = t.stat);
  54. t = o.default.ConfigManager.getServerCacheInfo();
  55. t &&
  56. ((o.default.ConfigManager.gameConf.serverInfos.game = t.game),
  57. (o.default.ConfigManager.gameConf.serverInfos.interface = t.stat));
  58. }
  59. getServerId() {
  60. return "test";
  61. }
  62. getChannel() {
  63. return "test";
  64. }
  65. isShowDebugUI() {
  66. return !1;
  67. }
  68. isAutoShowInteractionAd() {
  69. return !0;
  70. }
  71. showInteractionAd() {
  72. if (!this.expressAdNode) {
  73. let t = (this.expressAdNode = new cc.Node());
  74. (t.width = cc.winSize.width), (t.height = cc.winSize.height);
  75. o.default.ViewManager.uiRoot.addChild(this.expressAdNode), (this.expressAdNode.zIndex = 200);
  76. let e = t.addComponent(cc.Graphics);
  77. (e.fillColor = cc.color(0, 0, 0, 150)),
  78. e.fillRect(-cc.winSize.width / 2, -cc.winSize.height / 2, cc.winSize.width, cc.winSize.height),
  79. (e.fillColor = cc.Color.RED),
  80. e.fillRect(-175, -175, 350, 350);
  81. let i = new cc.Node();
  82. i.addComponent(cc.Label),
  83. t.addChild(i),
  84. (i.color = cc.Color.YELLOW),
  85. (i.x = 200),
  86. (i.y = 200),
  87. this.expressAdNode.addComponent(cc.BlockInputEvents);
  88. }
  89. let t = 5;
  90. const e = this.expressAdNode.getComponentInChildren(cc.Label);
  91. return (
  92. (e.string = t-- + ""),
  93. o.default.TimerManager.doTimer(
  94. 1e3,
  95. 5,
  96. () => {
  97. e.string = t-- + "";
  98. },
  99. this,
  100. () => {
  101. this.expressAdNode.active = !1;
  102. }
  103. ),
  104. (this.expressAdNode.active = !0)
  105. );
  106. }
  107. getAdState(t) {
  108. return 2;
  109. }
  110. showAD(t, e) {
  111. o.default.NotificationCenter.dispatch(a.AdEvent.SHOW_AD_RESULT, { code: 0 }, !0);
  112. }
  113. isGetRemoteRes() {
  114. return !1;
  115. }
  116. isCanShare() {
  117. return !0;
  118. }
  119. share(t, e) {
  120. o.default.NotificationCenter.dispatch(a.AdEvent.SHOW_AD_RESULT, { code: 0 }, !0);
  121. }
  122. login() {
  123. return s(this, void 0, void 0, function*() {
  124. return this.loginInfo.token ? Promise.resolve({ code: 0, loginKey: this.loginInfo.token }) : this.tourist();
  125. });
  126. }
  127. clearAndResetGame(t = !1) {
  128. return s(this, void 0, void 0, function*() {
  129. t && this.saveData(),
  130. o.default.SaveManage.clear(),
  131. o.default.SaveManage.clearAllItem(),
  132. cc.audioEngine.stopAll(),
  133. window.location.reload();
  134. });
  135. }
  136. buy(e) {
  137. return s(this, void 0, void 0, function*() {
  138. var t = this.getProductConfigByPayString(e);
  139. return (this.playerSpendMoney = t.cost), !0;
  140. });
  141. }
  142. };