@xiaoguomeiyitian/core 1.3.7 → 1.3.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.
- package/README.md +15 -6
- package/dist/cli.js +0 -5
- package/dist/lib_darwin_20.jsc +0 -0
- package/dist/lib_darwin_22.jsc +0 -0
- package/dist/lib_darwin_24.jsc +0 -0
- package/dist/lib_linux_20.jsc +0 -0
- package/dist/lib_linux_22.jsc +0 -0
- package/dist/lib_linux_24.jsc +0 -0
- package/dist/lib_win32_20.jsc +0 -0
- package/dist/lib_win32_22.jsc +0 -0
- package/dist/lib_win32_24.jsc +0 -0
- package/package.json +5 -5
- package/types/lib.d.ts +3 -1
package/README.md
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
## cli
|
|
22
22
|
|
|
23
|
-
* core dbg 在线调试
|
|
24
23
|
* core defs 生成类型定义
|
|
25
24
|
* core func 生成调用函数列表
|
|
26
25
|
|
|
@@ -164,10 +163,14 @@ export declare class Global {
|
|
|
164
163
|
getPropType(type: string, prop: string): any;
|
|
165
164
|
/**获取某类实体属性的默认值 */
|
|
166
165
|
getPropDefault(type: string, prop: string): any;
|
|
166
|
+
/** 解析实体数据,没有默认值添加默认值 */
|
|
167
|
+
parseEntity(type: string, data: any, keys?: string[]): any;
|
|
167
168
|
/**从redis读取数据 */
|
|
168
|
-
loadByRedis(type: string, id: string): Promise<any>;
|
|
169
|
-
/**数据写入到redis */
|
|
170
|
-
setToRedis(type: string, id: string, data: any): Promise<void>;
|
|
169
|
+
loadByRedis(type: string, id: string, redis?: any): Promise<any>;
|
|
170
|
+
/**数据写入到redis del 是否删除重新完整保存 默认 false */
|
|
171
|
+
setToRedis(type: string, id: string, data: any, del?: boolean, redis?: any): Promise<void>;
|
|
172
|
+
/**从redis删除*/
|
|
173
|
+
delByReids(type: string, id: string, redis?: any): Promise<void>;
|
|
171
174
|
/**根据条件从mongo中查询单条实体数据*/
|
|
172
175
|
findOne(type: string, filter: any, keys?: string[]): Promise<any>;
|
|
173
176
|
/**根据条件从mongo中查询多条实体数据*/
|
|
@@ -186,6 +189,8 @@ export declare class Global {
|
|
|
186
189
|
loadfile(filePath: string, reChain?: boolean, reload?: boolean): Promise<void>;
|
|
187
190
|
/**保存之前没有保存的dump数据*/
|
|
188
191
|
flushDumpData(): Promise<void>;
|
|
192
|
+
/** 执行临时补丁脚本 */
|
|
193
|
+
runPatch(patchName: string, ...args: any[]): Promise<any>;
|
|
189
194
|
/** 获取V8 CPU调用统计信息,默认统计10秒钟 cwd/profile.cpuprofile*/
|
|
190
195
|
profiler(time?: number): void;
|
|
191
196
|
/** 获取V8 GC统计信息,默认统计10秒钟 */
|
|
@@ -223,21 +228,25 @@ export declare class Entity {
|
|
|
223
228
|
flush(): Promise<void>;
|
|
224
229
|
/**销毁 */
|
|
225
230
|
destroy(): Promise<void>;
|
|
226
|
-
/**添加定时器 */
|
|
231
|
+
/**添加定时器 time ms 毫秒 */
|
|
227
232
|
addOneLoop(funcName: Function, time: number): number;
|
|
228
233
|
/**清除定时器 */
|
|
229
234
|
clearOneLoop(timeId: number): void;
|
|
230
|
-
/**添加循环 */
|
|
235
|
+
/**添加循环 time ms 毫秒 */
|
|
231
236
|
addLoop(funcName: Function, time: number): number;
|
|
232
237
|
/**清除循环 */
|
|
233
238
|
clearLoop(timeId: number): void;
|
|
234
239
|
/**清除所有定时器 */
|
|
235
240
|
clearAllLoop(): void;
|
|
241
|
+
/** 当实体创建(热更新实体不会调用这个函数) */
|
|
236
242
|
onCreate(): void;
|
|
243
|
+
/** 当实体属性发生变化(该函数中不能直接更新实体属性,只能通过异步方式更新) */
|
|
237
244
|
onPropChange(prop: string, value: any): void;
|
|
245
|
+
/** 当实体销毁 */
|
|
238
246
|
onDestroy(): void;
|
|
239
247
|
}
|
|
240
248
|
export declare class GenEntityDefs {
|
|
249
|
+
ts: any;
|
|
241
250
|
gen(filePath: string): void;
|
|
242
251
|
}
|
|
243
252
|
export declare class GenServiceFunc {
|
package/dist/cli.js
CHANGED
|
@@ -4,11 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
// 获取当前工作目录
|
|
6
6
|
const cmd = process.argv[2];
|
|
7
|
-
//调试
|
|
8
|
-
if (cmd == "dbg") {
|
|
9
|
-
process.argv = [process.argv[0], process.argv[1], process.argv[2], "-autoDeBug", "1", "-serviceType", process.argv[3], "-rpcPort", process.argv[4]];
|
|
10
|
-
global.G = new index_1.Global();
|
|
11
|
-
}
|
|
12
7
|
//生成EntityDefs
|
|
13
8
|
if (cmd == "defs") {
|
|
14
9
|
new index_1.GenEntityDefs().gen("./src/shared/protocols/entityDefs.ts");
|
package/dist/lib_darwin_20.jsc
CHANGED
|
Binary file
|
package/dist/lib_darwin_22.jsc
CHANGED
|
Binary file
|
package/dist/lib_darwin_24.jsc
CHANGED
|
Binary file
|
package/dist/lib_linux_20.jsc
CHANGED
|
Binary file
|
package/dist/lib_linux_22.jsc
CHANGED
|
Binary file
|
package/dist/lib_linux_24.jsc
CHANGED
|
Binary file
|
package/dist/lib_win32_20.jsc
CHANGED
|
Binary file
|
package/dist/lib_win32_22.jsc
CHANGED
|
Binary file
|
package/dist/lib_win32_24.jsc
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiaoguomeiyitian/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "types/lib.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"bundleDependencies": [],
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^22.14.1",
|
|
26
|
-
"typescript": "^5.
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@xiaoguomeiyitian/utils": "^0.1.
|
|
29
|
+
"@xiaoguomeiyitian/utils": "^0.1.3",
|
|
30
30
|
"bytenode": "^1.5.7",
|
|
31
|
-
"classic-level": "^
|
|
32
|
-
"tsrpc": "^3.4.
|
|
31
|
+
"classic-level": "^3.0.0",
|
|
32
|
+
"tsrpc": "^3.4.21"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/types/lib.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare class Global {
|
|
|
13
13
|
getPropType(type: string, prop: string): any;
|
|
14
14
|
/**获取某类实体属性的默认值 */
|
|
15
15
|
getPropDefault(type: string, prop: string): any;
|
|
16
|
+
/** 解析实体数据,没有默认值添加默认值 */
|
|
17
|
+
parseEntity(type: string, data: any, keys?: string[]): any;
|
|
16
18
|
/**从redis读取数据 */
|
|
17
19
|
loadByRedis(type: string, id: string, redis?: any): Promise<any>;
|
|
18
20
|
/**数据写入到redis del 是否删除重新完整保存 默认 false */
|
|
@@ -88,7 +90,7 @@ export declare class Entity {
|
|
|
88
90
|
clearAllLoop(): void;
|
|
89
91
|
/** 当实体创建(热更新实体不会调用这个函数) */
|
|
90
92
|
onCreate(): void;
|
|
91
|
-
/** 当实体属性发生变化 */
|
|
93
|
+
/** 当实体属性发生变化(该函数中不能直接更新实体属性,只能通过异步方式更新) */
|
|
92
94
|
onPropChange(prop: string, value: any): void;
|
|
93
95
|
/** 当实体销毁 */
|
|
94
96
|
onDestroy(): void;
|