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.
@@ -222,7 +222,8 @@ class FrameworkConfig extends Config_1.Config {
222
222
  },
223
223
  apple: {
224
224
  keyIds: {}
225
- }
225
+ },
226
+ cgmq: null
226
227
  };
227
228
  //key是ip,value是domain
228
229
  ip_to_domain = {};
@@ -118,7 +118,7 @@ class CgMq {
118
118
  cmd: func_name,
119
119
  args: args
120
120
  };
121
- let jsonData = await this._ws.push(to_identity, data);
121
+ let jsonData = (await this._ws.push(to_identity, data));
122
122
  return jsonData;
123
123
  }
124
124
  async onMsg(msg) {
@@ -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
- let jsonData = await this._cgmq.callRemote(this._to_identity, func_name, ...args);
19
- return jsonData;
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<unknown>;
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<unknown>;
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.467",
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",