@ives_xxz/framework 1.2.21 → 1.2.23
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.
- package/FW.d.ts +2 -1
- package/manager/FWLayerManager.ts +0 -7
- package/manager/FWSocketManager.ts +2 -0
- package/package.json +1 -1
- package/service/socket/FWSocket.ts +18 -1
package/FW.d.ts
CHANGED
|
@@ -281,6 +281,7 @@ declare namespace FW {
|
|
|
281
281
|
reconnectInternal: number;
|
|
282
282
|
protocolSymbol: Symbol;
|
|
283
283
|
protocolPollingTime: number;
|
|
284
|
+
certificate: cc.Asset;
|
|
284
285
|
};
|
|
285
286
|
|
|
286
287
|
/**
|
|
@@ -1490,7 +1491,7 @@ declare namespace FW {
|
|
|
1490
1491
|
/**
|
|
1491
1492
|
* 状态构造类
|
|
1492
1493
|
*/
|
|
1493
|
-
stateConstructor: { new
|
|
1494
|
+
stateConstructor: { new(): T };
|
|
1494
1495
|
};
|
|
1495
1496
|
|
|
1496
1497
|
type AudioManager = {
|
|
@@ -138,7 +138,6 @@ export class FWLayerManager extends FWManager implements FW.LayerManager {
|
|
|
138
138
|
layerData.controllerName = ctrName;
|
|
139
139
|
|
|
140
140
|
this.layerMap.set(data.type, layerData);
|
|
141
|
-
FWLog.debug('打开Layer -> ', layerData?.controllerName, this.layerMap.has(data.type));
|
|
142
141
|
|
|
143
142
|
if (this.layerRegistry.has(data.type)) {
|
|
144
143
|
return this.layerMap.get(data.type).controllerProxy as Ctr;
|
|
@@ -302,8 +301,6 @@ export class FWLayerManager extends FWManager implements FW.LayerManager {
|
|
|
302
301
|
displayLayer<Ctr extends FW.LayerController = FW.LayerController>(ctr: Ctr): Ctr {
|
|
303
302
|
const layerData = ctr.layerData;
|
|
304
303
|
|
|
305
|
-
FWLog.debug('关闭Layer -> ', layerData?.controllerName);
|
|
306
|
-
|
|
307
304
|
if (!this.layerMap.has(ctr.layerData.controllerConstructor)) {
|
|
308
305
|
FWLog.warn(`display layer failed,layer name : ${layerData.layerName}`);
|
|
309
306
|
return;
|
|
@@ -403,8 +400,6 @@ export class FWLayerManager extends FWManager implements FW.LayerManager {
|
|
|
403
400
|
this.notifyExternalRefUpdates(ctr.layerData);
|
|
404
401
|
}
|
|
405
402
|
|
|
406
|
-
FWLog.debug('closeLayer', layerData.controllerConstructor);
|
|
407
|
-
|
|
408
403
|
this.layerMap.delete(layerData.controllerConstructor);
|
|
409
404
|
this.layerRegistry.delete(ctr.layerData.controllerConstructor);
|
|
410
405
|
|
|
@@ -523,7 +518,6 @@ export class FWLayerManager extends FWManager implements FW.LayerManager {
|
|
|
523
518
|
}
|
|
524
519
|
|
|
525
520
|
public clear() {
|
|
526
|
-
FWLog.debug('调用clear');
|
|
527
521
|
this.layerQueue = new FWQueue();
|
|
528
522
|
this.layerStack = [];
|
|
529
523
|
this.layerRegistry = new Set<new () => FW.LayerController>();
|
|
@@ -532,7 +526,6 @@ export class FWLayerManager extends FWManager implements FW.LayerManager {
|
|
|
532
526
|
}
|
|
533
527
|
|
|
534
528
|
public onDestroy(): void {
|
|
535
|
-
FWLog.debug('调用onDestroy');
|
|
536
529
|
this.layerMap.clear();
|
|
537
530
|
this.layerMap = null;
|
|
538
531
|
this.layerQueue = null;
|
|
@@ -36,6 +36,8 @@ export default class FWSocketManager extends FWManager implements FW.SocketManag
|
|
|
36
36
|
maxReconnectTimes: config.maxReconnectTimes,
|
|
37
37
|
reconnectInternal: config.reconnectInternal,
|
|
38
38
|
protocolSymbol: config.protocolSymbol,
|
|
39
|
+
protocolPollingTime: config.protocolPollingTime,
|
|
40
|
+
certificate: config.certificate,
|
|
39
41
|
});
|
|
40
42
|
this.socketMap.set(tag, proxy.socket);
|
|
41
43
|
|
package/package.json
CHANGED
|
@@ -45,6 +45,8 @@ export default class FWSocket implements FW.Socket {
|
|
|
45
45
|
private protocolRegistry: Map<string, Set<Symbol>>;
|
|
46
46
|
/** 协议符号容器 */
|
|
47
47
|
private protocolContainer: Map<Symbol, FW.ProtocolPolling>;
|
|
48
|
+
/** 证书 */
|
|
49
|
+
private certificate: cc.Asset;
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* 消息事件列表
|
|
@@ -82,7 +84,21 @@ export default class FWSocket implements FW.Socket {
|
|
|
82
84
|
this.sendHeartTimestamp = 0;
|
|
83
85
|
this.receiveTimeStamp = new Date().getTime();
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
if (config.certificate) {
|
|
88
|
+
let url = config.certificate.nativeUrl;
|
|
89
|
+
if (cc.assetManager.cacheManager) {
|
|
90
|
+
url =
|
|
91
|
+
cc.assetManager.cacheManager.getCache(url) ||
|
|
92
|
+
cc.assetManager.cacheManager.getTemp(url) ||
|
|
93
|
+
url;
|
|
94
|
+
}
|
|
95
|
+
//@ts-ignore
|
|
96
|
+
this.socket = new WebSocket(address, [], url);
|
|
97
|
+
} else {
|
|
98
|
+
this.socket = new WebSocket(address);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
86
102
|
this.socket.onopen = this.onSocketOpen.bind(this);
|
|
87
103
|
this.socket.onclose = this.onSocketClose.bind(this);
|
|
88
104
|
this.socket.onerror = this.onSocketError.bind(this);
|
|
@@ -196,6 +212,7 @@ export default class FWSocket implements FW.Socket {
|
|
|
196
212
|
reconnectInternal: this.reconnectInternal,
|
|
197
213
|
protocolSymbol: this.protocolSymbol,
|
|
198
214
|
protocolPollingTime: this.protocolPollingTime,
|
|
215
|
+
certificate: this.certificate,
|
|
199
216
|
});
|
|
200
217
|
}
|
|
201
218
|
|