godprotocol 1.0.75 → 1.0.752
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/Objects/Account.js +2 -1
- package/package.json +1 -1
- package/utils/create_server.js +4 -4
package/Objects/Account.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Aircode from "../Aircode/main";
|
|
2
|
+
import start from "../Index";
|
|
2
3
|
import { hash } from "../utils/hash";
|
|
3
4
|
import { post_request } from "../utils/services";
|
|
4
5
|
import Chain from "./Chain";
|
|
@@ -167,7 +168,7 @@ class Account extends Filesystem {
|
|
|
167
168
|
let account = this.accounts[name] || this.manager.accounts[name];
|
|
168
169
|
|
|
169
170
|
if (!account) {
|
|
170
|
-
account =
|
|
171
|
+
account = start(name, server);
|
|
171
172
|
this.accounts[account.name] = account;
|
|
172
173
|
this.manager.accounts[account.name] = account;
|
|
173
174
|
}
|
package/package.json
CHANGED
package/utils/create_server.js
CHANGED
|
@@ -7,7 +7,7 @@ let PORT = 1901,
|
|
|
7
7
|
const cb = (res, data) => {
|
|
8
8
|
if (typeof data !== "string") data = JSON.stringify(data);
|
|
9
9
|
|
|
10
|
-
res
|
|
10
|
+
res(data);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const create_server = async (initiator, serve) => {
|
|
@@ -43,11 +43,11 @@ const create_server = async (initiator, serve) => {
|
|
|
43
43
|
let account = initiator.create_account(data.name, data.server);
|
|
44
44
|
res.end(account.stringify(true));
|
|
45
45
|
} else if (req.url === "/load") {
|
|
46
|
-
initiator.load(data, (datagram) => cb(res, datagram));
|
|
46
|
+
initiator.load(data, (datagram) => cb(res.end, datagram));
|
|
47
47
|
} else if (req.url === "/parse") {
|
|
48
|
-
initiator.parse(data, (datagram) => cb(res, datagram));
|
|
48
|
+
initiator.parse(data, (datagram) => cb(res.end, datagram));
|
|
49
49
|
} else if (req.url === "/run") {
|
|
50
|
-
initiator.run(data, (datagram) => cb(res, datagram));
|
|
50
|
+
initiator.run(data, (datagram) => cb(res.end, datagram));
|
|
51
51
|
}
|
|
52
52
|
if (serve && req.headers.host !== `${serve.domain}:${serve.port}`)
|
|
53
53
|
console.log(`services:${req.url}`);
|