@ives_xxz/framework 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,7 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
13
13
 
14
14
  setListener(listener: FW.HotUpdateListener): void {
15
15
  this.listener = listener;
16
+ FWLog.debug('热更新监听设置');
16
17
  }
17
18
 
18
19
  public update(localManifest: cc.Asset) {
@@ -20,6 +21,7 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
20
21
  FWLog.error('没有找到本地Manifest文件!');
21
22
  return;
22
23
  }
24
+ FWLog.debug('开始热更新流程');
23
25
  this.localManifest = localManifest;
24
26
  this.storePath = `${jsb.fileUtils ? jsb.fileUtils.getWritablePath() : '/'}${TEMOTE_ASSET}`;
25
27
  this.assetMgr = new jsb.AssetsManager('', this.storePath, this.versionCompareHandle);
@@ -38,6 +40,7 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
38
40
  }
39
41
 
40
42
  private versionCompareHandle(currentVersion: string, newVersion: string): number {
43
+ FWLog.debug('版本比较', currentVersion, newVersion);
41
44
  this.listener.versionCompareHandle(currentVersion, newVersion);
42
45
  var vA = currentVersion.split('.');
43
46
  var vB = newVersion.split('.');
@@ -66,12 +69,16 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
66
69
  }
67
70
 
68
71
  private checkHotUpdate() {
72
+ FWLog.debug('checkHotUpdate1', this.isUpdate);
69
73
  if (this.isUpdate) {
70
74
  return;
71
75
  }
76
+ FWLog.debug('checkHotUpdate2', this.assetMgr.getState() === jsb.AssetsManager.State.UNINITED);
72
77
  if (this.assetMgr.getState() === jsb.AssetsManager.State.UNINITED) {
73
78
  this.assetMgr.loadLocalManifest(this.localManifest.nativeUrl);
74
79
  }
80
+ FWLog.debug('checkHotUpdate3', this.assetMgr.getLocalManifest());
81
+ FWLog.debug('checkHotUpdate4', this.assetMgr.getLocalManifest().isLoaded());
75
82
  if (!this.assetMgr.getLocalManifest() || !this.assetMgr.getLocalManifest().isLoaded()) {
76
83
  return;
77
84
  }
@@ -211,6 +218,6 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
211
218
  return `${size.toFixed(size < 10 ? 2 : 1)} ${units[unitIndex]}`;
212
219
  }
213
220
 
214
- public initialize(): void {}
215
- public onDestroy(): void {}
221
+ public initialize(): void { }
222
+ public onDestroy(): void { }
216
223
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -8,4 +8,4 @@
8
8
  ],
9
9
  "author": "ives",
10
10
  "license": "ISC"
11
- }
11
+ }