cgserver 9.2.4 → 9.2.6

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.
@@ -19,14 +19,13 @@ class Config {
19
19
  if (this._is_init) {
20
20
  return false;
21
21
  }
22
- if (Config.rootDataDir.endsWith("/")) {
23
- Config.rootDataDir = Config.rootDataDir.substring(0, Config.rootDataDir.length - 1);
22
+ let path = Config.rootDataDir + this._file_name;
23
+ if (this._suffix) {
24
+ path += "_" + this._suffix + ".json";
24
25
  }
25
- let suffix2 = "/";
26
- if (Config.debug) {
27
- suffix2 = "_d/";
26
+ else {
27
+ path += ".json";
28
28
  }
29
- let path = Config.rootDataDir + suffix2 + this._file_name + this._suffix + ".json";
30
29
  path = path.toLowerCase();
31
30
  if (!fs.existsSync(path)) {
32
31
  console.error(path + " not exist!");
@@ -38,6 +38,9 @@ class CgServer {
38
38
  set customprocessid(value) {
39
39
  this._custom_process_id = value;
40
40
  }
41
+ get dataRootDir() {
42
+ return Config_1.Config.rootDataDir;
43
+ }
41
44
  constructor() {
42
45
  this.init();
43
46
  }
@@ -22,6 +22,7 @@ declare class CgServer {
22
22
  * 非操作系统的进程id
23
23
  */
24
24
  set customprocessid(value: string);
25
+ get dataRootDir(): string;
25
26
  constructor();
26
27
  init(): void;
27
28
  protected _done: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "9.2.4",
3
+ "version": "9.2.6",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",