@cc-component/cc-core 1.8.1 → 1.8.3
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.
|
@@ -50,31 +50,31 @@ export interface IConfig {
|
|
|
50
50
|
*/
|
|
51
51
|
export interface EnvironmentConfig {
|
|
52
52
|
/** 版本号 */
|
|
53
|
-
version
|
|
53
|
+
version?: string;
|
|
54
54
|
/** 本地数据加密密钥 */
|
|
55
|
-
localDataKey
|
|
55
|
+
localDataKey?: string;
|
|
56
56
|
/** 本地数据加密初始向量 */
|
|
57
|
-
localDataIv
|
|
57
|
+
localDataIv?: string;
|
|
58
58
|
/** 帧率设置 */
|
|
59
|
-
frameRate
|
|
59
|
+
frameRate?: number;
|
|
60
60
|
/** 加载超时GUI时间(ms) */
|
|
61
|
-
loadingTimeoutGui
|
|
61
|
+
loadingTimeoutGui?: number;
|
|
62
62
|
/** 移动设备安全区域适配开关 */
|
|
63
|
-
mobileSafeArea
|
|
63
|
+
mobileSafeArea?: boolean;
|
|
64
64
|
/** 性能统计显示开关 */
|
|
65
|
-
stats
|
|
65
|
+
stats?: boolean;
|
|
66
66
|
/** HTTP服务器地址 */
|
|
67
|
-
httpServer
|
|
67
|
+
httpServer?: string;
|
|
68
68
|
/** HTTP请求超时时间(ms) */
|
|
69
|
-
httpTimeout
|
|
69
|
+
httpTimeout?: number;
|
|
70
70
|
/** WebSocket服务器地址 */
|
|
71
|
-
webSocketServer
|
|
71
|
+
webSocketServer?: string;
|
|
72
72
|
/** WebSocket心跳间隔时间(ms) */
|
|
73
|
-
webSocketHeartTime
|
|
73
|
+
webSocketHeartTime?: number;
|
|
74
74
|
/** WebSocket接收超时时间(ms) */
|
|
75
|
-
webSocketReceiveTime
|
|
75
|
+
webSocketReceiveTime?: number;
|
|
76
76
|
/** WebSocket重连超时时间(ms) */
|
|
77
|
-
webSocketReconnetTimeOut
|
|
77
|
+
webSocketReconnetTimeOut?: number;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
@@ -267,7 +267,7 @@ export class EffectSingleCase {
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
/**获取节点-同步 */
|
|
271
271
|
getNode(params: IPoolParams): Node {
|
|
272
272
|
const name = params.path.split(':').pop();
|
|
273
273
|
var np = this.effects.get(name);
|
|
@@ -276,6 +276,19 @@ export class EffectSingleCase {
|
|
|
276
276
|
return node
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
/**获取节点-异步 */
|
|
280
|
+
async loadNode(params: IPoolParams): Promise<Node> {
|
|
281
|
+
let node = this.getNode(params)
|
|
282
|
+
if (!node || (node && !node.isValid)) {
|
|
283
|
+
if ((node && !node.isValid)) {
|
|
284
|
+
Logger.debug('节点已销毁,请检测业务逻辑。节点没有进行回收就销毁了界面', params.path)
|
|
285
|
+
}
|
|
286
|
+
node = await App.pool.load(params)
|
|
287
|
+
}
|
|
288
|
+
this.updateNode(node, params)
|
|
289
|
+
return node
|
|
290
|
+
}
|
|
291
|
+
|
|
279
292
|
/** 加载节点对象 */
|
|
280
293
|
load(params: IPoolParams): Promise<Node> {
|
|
281
294
|
return new Promise(async (resolve, reject) => {
|