cgserver 9.0.0 → 9.0.2

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 CHANGED
@@ -1,3 +1,5 @@
1
+ 9.0.2
2
+ 1、修复uuid问题
1
3
  9.0.0
2
4
  1、升级了新的rpc,支持分组和具体
3
5
  2、rpc至少请使用2.0.0版本
@@ -8,7 +8,7 @@ const crypto = require("crypto");
8
8
  const Log_1 = require("../Logic/Log");
9
9
  const CryptoJS = require("crypto-js");
10
10
  const ec_key_1 = require("ec-key");
11
- const uuid_1 = require("uuid");
11
+ const uuidv4_1 = require("uuidv4");
12
12
  /**
13
13
  * 常用的工具函数类
14
14
  */
@@ -654,7 +654,7 @@ class core {
654
654
  return dtext;
655
655
  }
656
656
  static getUuid() {
657
- let id = new uuid_1.v4();
657
+ let id = (0, uuidv4_1.uuid)();
658
658
  return id;
659
659
  }
660
660
  static signatureBase64(private_key, rsa_name, payload) {
@@ -26,6 +26,7 @@ class IRpcClientWebSocket extends IClientWebSocket_1.IClientWebSocket {
26
26
  toRetMsg(req_msg, data, errcode) {
27
27
  let ret_msg = this.getNewMsg(req_msg.cmd, errcode);
28
28
  //唯一标识必须保持一致
29
+ ret_msg.__return = true;
29
30
  ret_msg.__rpcid = req_msg.__rpcid;
30
31
  ret_msg.data = data;
31
32
  ret_msg.from_group = this._group;
@@ -32,6 +32,7 @@ class IRpcServerWebSocket extends IServerWebSocket_1.IServerWebSocket {
32
32
  toRetMsg(req_msg, data, errcode) {
33
33
  let ret_msg = this.getNewMsg(req_msg.cmd, errcode);
34
34
  //唯一标识必须保持一致
35
+ ret_msg.__return = true;
35
36
  ret_msg.__rpcid = req_msg.__rpcid;
36
37
  ret_msg.data = data;
37
38
  ret_msg.from_group = this._group;
@@ -29,16 +29,10 @@ class CgMqServerWebsocket extends IRpcServerWebSocket_1.IRpcServerWebSocket {
29
29
  return jsonData;
30
30
  }
31
31
  //收到来自远程的调用消息
32
- async receive_msg(msg) {
33
- let data = await this._cgmq.onMsg(msg);
34
- let ret_msg = this.getNewMsg("msg");
35
- ret_msg.data = data;
36
- ret_msg.__return = true;
37
- //这个唯一标识必须和请求一致
38
- ret_msg.__rpcid = msg.__rpcid;
39
- ret_msg.to_group = msg.from_group;
40
- ret_msg.to_id = msg.to_id;
41
- this.send(msg);
32
+ async receive_msg(req_msg) {
33
+ let data = await this._cgmq.onMsg(req_msg);
34
+ let ret_msg = this.toRetMsg(req_msg, data);
35
+ this.send(ret_msg);
42
36
  }
43
37
  }
44
38
  class RpcConfig {
@@ -123,7 +123,7 @@ declare class AppleTool {
123
123
  onVerify(receipt: string, environment: string): Promise<ResponseBody>;
124
124
  signature(nickname: string, create_time: number, appBundleID: string, productIdentifier: string, offerIdentifier: string): {
125
125
  keyIdentifier: string;
126
- nonce: any;
126
+ nonce: string;
127
127
  timestamp: number;
128
128
  signature: any;
129
129
  };
@@ -6,7 +6,7 @@ declare class CgMqServerWebsocket extends IRpcServerWebSocket {
6
6
  onOpen(e?: any): void;
7
7
  init(): Promise<RpcMsg>;
8
8
  push(to_group: string, data: any, to_id?: string): Promise<RpcMsg>;
9
- receive_msg(msg: RpcMsg): Promise<void>;
9
+ receive_msg(req_msg: RpcMsg): Promise<void>;
10
10
  }
11
11
  export declare class RpcConfig {
12
12
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",
@@ -77,6 +77,7 @@
77
77
  "socket.io": "^4.7.4",
78
78
  "underscore": "^1.13.6",
79
79
  "urlencode": "^2.0.0",
80
+ "uuidv4": "^6.2.13",
80
81
  "websocket": "^1.0.34"
81
82
  }
82
83
  }