|
@@ -1,8 +1,10 @@
|
|
const BuildingManager = require("../utils/BuildingManager");
|
|
const BuildingManager = require("../utils/BuildingManager");
|
|
const ShareAction = require('./ShareAction');
|
|
const ShareAction = require('./ShareAction');
|
|
const Notikey = require('../utils/GameEnum').GameNotificationKey;
|
|
const Notikey = require('../utils/GameEnum').GameNotificationKey;
|
|
|
|
+const DWTool = require('./utils/DWTool');
|
|
|
|
|
|
-window.Global = {
|
|
|
|
|
|
+var Global = Global || {}
|
|
|
|
+Global = {
|
|
|
|
|
|
// 建筑管理
|
|
// 建筑管理
|
|
BuildingManager: BuildingManager.instance,
|
|
BuildingManager: BuildingManager.instance,
|
|
@@ -40,25 +42,35 @@ window.Global = {
|
|
friendList: []
|
|
friendList: []
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+// 开发模式下快速切换 正式 or 测试 环境
|
|
|
|
+if(CC_DEV && DWTool.getUrlParam('debug') != null) {
|
|
|
|
+ Global.debug = !!~~DWTool.getUrlParam('debug');
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Global.socketUrl = Global.debug ?
|
|
|
|
+'wss://test-message-allstar.duowan.com/connect' : 'wss://message-allstar.duowan.com/connect';
|
|
|
|
+
|
|
|
|
+window.Global = Global;
|
|
|
|
+
|
|
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
|
|
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
|
|
wx.onShow(({ query, shareTicket }) => {
|
|
wx.onShow(({ query, shareTicket }) => {
|
|
- if (typeof wx.getUpdateManager === 'function') {
|
|
|
|
- const updateManager = wx.getUpdateManager()
|
|
|
|
-
|
|
|
|
- updateManager.onCheckForUpdate(function (res) {
|
|
|
|
- // 请求完新版本信息的回调
|
|
|
|
- console.log('hasUpdate: ' + JSON.stringify(res.hasUpdate));
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- updateManager.onUpdateReady(function () {
|
|
|
|
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
|
- updateManager.applyUpdate()
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- updateManager.onUpdateFailed(function () {
|
|
|
|
- // 新的版本下载失败
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // if (typeof wx.getUpdateManager === 'function') {
|
|
|
|
+ // const updateManager = wx.getUpdateManager()
|
|
|
|
+
|
|
|
|
+ // updateManager.onCheckForUpdate(function (res) {
|
|
|
|
+ // // 请求完新版本信息的回调
|
|
|
|
+ // console.log('hasUpdate: ' + JSON.stringify(res.hasUpdate));
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // updateManager.onUpdateReady(function () {
|
|
|
|
+ // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
|
+ // updateManager.applyUpdate()
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ // updateManager.onUpdateFailed(function () {
|
|
|
|
+ // // 新的版本下载失败
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
|
|
console.log('Global onShow' + JSON.stringify(query) + '======================================');
|
|
console.log('Global onShow' + JSON.stringify(query) + '======================================');
|
|
if (query != undefined && query != null) {
|
|
if (query != undefined && query != null) {
|