cgserver 6.9.467 → 6.9.470
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/dist/lib/Config/FrameworkConfig.js +2 -1
- package/dist/lib/ThirdParty/CgMq.js +1 -1
- package/dist/lib/ThirdParty/Rpc.js +13 -2
- package/dist/types/Config/FrameworkConfig.d.ts +2 -0
- package/dist/types/ThirdParty/CgMq.d.ts +1 -1
- package/dist/types/ThirdParty/Rpc.d.ts +3 -1
- package/package.json +2 -1
|
@@ -5,6 +5,10 @@ const Core_1 = require("../Core/Core");
|
|
|
5
5
|
const Log_1 = require("../Logic/Log");
|
|
6
6
|
const CgMq_1 = require("./CgMq");
|
|
7
7
|
class Remote {
|
|
8
|
+
_retmsg = null;
|
|
9
|
+
get retMsg() {
|
|
10
|
+
return this._retmsg;
|
|
11
|
+
}
|
|
8
12
|
_cgmq = null;
|
|
9
13
|
get cgmq() {
|
|
10
14
|
return this._cgmq;
|
|
@@ -15,8 +19,15 @@ class Remote {
|
|
|
15
19
|
this._cgmq = cgmq;
|
|
16
20
|
}
|
|
17
21
|
async call(func_name, ...args) {
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
this._retmsg = await this._cgmq.callRemote(this._to_identity, func_name, ...args);
|
|
23
|
+
if (!this._retmsg.data) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let datas = this._retmsg.data;
|
|
27
|
+
if (datas.length == 1) {
|
|
28
|
+
return datas[0];
|
|
29
|
+
}
|
|
30
|
+
return datas;
|
|
20
31
|
}
|
|
21
32
|
}
|
|
22
33
|
class RpcConfig extends CgMq_1.CgMqConfig {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MongoConfig } from "../Database/MongoManager";
|
|
2
|
+
import { RpcConfig } from "../ThirdParty/Rpc";
|
|
2
3
|
import { Config } from "./Config";
|
|
3
4
|
export declare enum ESessionType {
|
|
4
5
|
Cache = 0,
|
|
@@ -218,6 +219,7 @@ export declare class FrameworkConfig extends Config {
|
|
|
218
219
|
apple: {
|
|
219
220
|
keyIds: {};
|
|
220
221
|
};
|
|
222
|
+
cgmq: RpcConfig;
|
|
221
223
|
};
|
|
222
224
|
ip_to_domain: {};
|
|
223
225
|
root_path: string;
|
|
@@ -45,7 +45,7 @@ export declare class CgMq {
|
|
|
45
45
|
get cfg(): CgMqConfig;
|
|
46
46
|
get identity(): string;
|
|
47
47
|
init(cfg: CgMqConfig, onmsg?: (msg: CgMqRetMsg) => any): Promise<unknown>;
|
|
48
|
-
callRemote(to_identity: string, func_name: string, ...args: any[]): Promise<
|
|
48
|
+
callRemote(to_identity: string, func_name: string, ...args: any[]): Promise<CgMqRetMsg>;
|
|
49
49
|
onMsg(msg: CgMqRetMsg): Promise<any>;
|
|
50
50
|
}
|
|
51
51
|
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CgMq, CgMqConfig, CgMqRetMsg } from "./CgMq";
|
|
2
2
|
declare class Remote {
|
|
3
|
+
protected _retmsg: CgMqRetMsg;
|
|
4
|
+
get retMsg(): CgMqRetMsg;
|
|
3
5
|
protected _cgmq: CgMq;
|
|
4
6
|
get cgmq(): CgMq;
|
|
5
7
|
protected _to_identity: string;
|
|
6
8
|
constructor(identity: string, cgmq: CgMq);
|
|
7
|
-
call(func_name: string, ...args: any[]): Promise<
|
|
9
|
+
call(func_name: string, ...args: any[]): Promise<any | any[]>;
|
|
8
10
|
}
|
|
9
11
|
export declare class RpcConfig extends CgMqConfig {
|
|
10
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cgserver",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.470",
|
|
4
4
|
"author": "trojan",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "free for all.Websocket or Http",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@types/websocket": "^1.0.4",
|
|
49
49
|
"alipay_sdk2": "^1.1.6",
|
|
50
50
|
"alipay-sdk": "^3.1.7",
|
|
51
|
+
"cgserver": "^6.9.468",
|
|
51
52
|
"colors": "^1.4.0",
|
|
52
53
|
"cookie-parser": "^1.4.5",
|
|
53
54
|
"cors": "^2.8.5",
|