notherbase-fs 3.2.6 → 3.2.8
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/controllers/spirit-world.js +4 -1
- package/package.json +1 -1
- package/public/js/base.js +2 -9
- package/test/coast/tall-beach/nono-cove/index.ejs +1 -0
- package/test/pages/void/index.ejs +32 -1
- package/test/the-front/check/emailTime.js +0 -2
- package/test/the-front/check/index.ejs +1 -1
- package/test/the-front/index.ejs +0 -4
- package/views/explorer.ejs +0 -2
- package/views/footer.ejs +1 -1
- package/test/the-front/add-gold.js +0 -23
- package/test/the-front/check/add-more-gold.js +0 -3
- package/test/the-front/check/subtract-gold.js +0 -3
- package/test/the-front/checks.js +0 -11
- package/test/the-front/incTranslation.js +0 -9
- package/test/the-front/load-groups.js +0 -46
- package/views/basic-footer.ejs +0 -2
- package/views/menu.ejs +0 -43
|
@@ -96,7 +96,10 @@ export default class SpiritWorld {
|
|
|
96
96
|
if (req.body.scope === "local") {
|
|
97
97
|
let user = await req.db.User.recallOne(req.session.currentUser);
|
|
98
98
|
if (user?.id) parent = user.id;
|
|
99
|
-
else
|
|
99
|
+
else {
|
|
100
|
+
fail(res, "User had no id on load()");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
100
103
|
}
|
|
101
104
|
|
|
102
105
|
let spirit = await req.db.Spirit.recallOne(req.body.service, parent);
|
package/package.json
CHANGED
package/public/js/base.js
CHANGED
|
@@ -21,8 +21,6 @@ class Base {
|
|
|
21
21
|
this.username = "";
|
|
22
22
|
this.email = "";
|
|
23
23
|
this.lastUpdate = 0;
|
|
24
|
-
|
|
25
|
-
this.refresh();
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
/**
|
|
@@ -79,7 +77,8 @@ class Base {
|
|
|
79
77
|
logout = async () => {
|
|
80
78
|
let response = await Base.commune("logout");
|
|
81
79
|
|
|
82
|
-
|
|
80
|
+
location.reload();
|
|
81
|
+
//return response;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
/**
|
|
@@ -110,11 +109,8 @@ class Base {
|
|
|
110
109
|
});
|
|
111
110
|
|
|
112
111
|
if (response.status === "success") {
|
|
113
|
-
this.playerInventory.refresh();
|
|
114
112
|
this.playerAccount.username = response.data;
|
|
115
113
|
this.playerAccount.email = email;
|
|
116
|
-
this.playerAccount.refresh();
|
|
117
|
-
this.playerAttributes.refresh();
|
|
118
114
|
}
|
|
119
115
|
|
|
120
116
|
return response;
|
|
@@ -160,9 +156,6 @@ class Base {
|
|
|
160
156
|
}));
|
|
161
157
|
|
|
162
158
|
if (response.status != "success") console.log(`${window.location.pathname} - ${response.message}`);
|
|
163
|
-
|
|
164
|
-
this.playerInventory.refresh();
|
|
165
|
-
this.playerAttributes.refresh();
|
|
166
159
|
|
|
167
160
|
return response;
|
|
168
161
|
}
|
|
@@ -1,5 +1,36 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Test</title>
|
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<!-- font-family: 'Roboto' or 'Roboto Condensed', sans-serif; -->
|
|
11
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">
|
|
12
|
+
<!-- 'Redacted Script', cursive; -->
|
|
13
|
+
<link href="https://fonts.googleapis.com/css2?family=Redacted+Script:wght@300&display=swap" rel="stylesheet">
|
|
14
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
15
|
+
<link rel="stylesheet" href="/styles/main.css">
|
|
16
|
+
<link rel="stylesheet" href="/styles/menu.css">
|
|
17
|
+
<link rel="stylesheet" href="/styles/inventory.css">
|
|
18
|
+
<link rel="stylesheet" href="/styles/player.css">
|
|
19
|
+
<link rel="stylesheet" href="/styles/account.css">
|
|
20
|
+
<link rel="stylesheet" href="/styles/more.css">
|
|
21
|
+
<link rel="stylesheet" href="/styles/chat.css">
|
|
22
|
+
<script src="/js/base.js"></script>
|
|
23
|
+
</head>
|
|
24
|
+
<script>
|
|
25
|
+
const currentRoute = "<%- route %>";
|
|
26
|
+
</script>
|
|
1
27
|
<style>
|
|
2
28
|
<%- include("./void.css"); %>
|
|
3
29
|
</style>
|
|
4
30
|
|
|
5
|
-
<
|
|
31
|
+
<body>
|
|
32
|
+
<main>
|
|
33
|
+
<a href="/">Leave the Void</a>
|
|
34
|
+
</main>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|
package/test/the-front/index.ejs
CHANGED
package/views/explorer.ejs
CHANGED
package/views/footer.ejs
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export default async (req, user) => {
|
|
2
|
-
let gold = await req.db.Item.recallOne("Gold Coin");
|
|
3
|
-
if (!gold) {
|
|
4
|
-
//console.log(gold);
|
|
5
|
-
await req.db.Item.create("Gold Coin", "Gold Coin", "Long Gold Coin");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
await user.offsetItem("Gold Coin", 15);
|
|
9
|
-
|
|
10
|
-
// await req.db.Spirit.delete("gold");
|
|
11
|
-
|
|
12
|
-
let local = await req.db.Spirit.recallOne("gold", user.id);
|
|
13
|
-
|
|
14
|
-
if (!local.memory.data.gold) local.memory.data.gold = 0;
|
|
15
|
-
local.memory.data.gold += 15;
|
|
16
|
-
await local.commit();
|
|
17
|
-
|
|
18
|
-
let global = await req.db.Spirit.recallOne("gold");
|
|
19
|
-
|
|
20
|
-
if (!global.memory.data.gold) global.memory.data.gold = 0;
|
|
21
|
-
global.memory.data.gold += 15;
|
|
22
|
-
await global.commit();
|
|
23
|
-
}
|
package/test/the-front/checks.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default async function emailTime(req, user) {
|
|
2
|
-
let goldCheck = req.db.Item.recall("Gold Coin");
|
|
3
|
-
|
|
4
|
-
if (!goldCheck) req.db.Item.create("Gold Coin", "Gold Coin Short", "Gold Coin Long");
|
|
5
|
-
|
|
6
|
-
let inv = user.memory.data.inventory;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return "Sent";
|
|
11
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export default async function (req, user) {
|
|
2
|
-
let spirit = await req.db.Spirit.recallAll("group");
|
|
3
|
-
|
|
4
|
-
let inGroups = [];
|
|
5
|
-
|
|
6
|
-
for (let i = 0; i < spirit.memory.length; i++) {
|
|
7
|
-
if (!spirit.memory[i].data) spirit.memory.splice(i, 1);
|
|
8
|
-
else {
|
|
9
|
-
if (Array.isArray(spirit.memory[i].data.members)) {
|
|
10
|
-
if (spirit.memory[i].data.members.includes(`${user.id}`)) {
|
|
11
|
-
let groupInfo = {
|
|
12
|
-
id: spirit.memory[i].id,
|
|
13
|
-
...spirit.memory[i].data
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
for (let j = 0; j < spirit.memory[i].data.members.length; j++) {
|
|
17
|
-
let user = await req.db.User.recallOne(null, null, spirit.memory[i].data.members[j]);
|
|
18
|
-
groupInfo.members[j] = {
|
|
19
|
-
id: spirit.memory[i].data.members[j],
|
|
20
|
-
name: user.memory.data.username
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (Array.isArray(spirit.memory[i].data.joinRequests)) {
|
|
25
|
-
for (let j = 0; j < spirit.memory[i].data.joinRequests.length; j++) {
|
|
26
|
-
let user = await req.db.User.recallOne(null, null, spirit.memory[i].data.joinRequests[j].id);
|
|
27
|
-
groupInfo.joinRequests[j] = {
|
|
28
|
-
id: spirit.memory[i].data.joinRequests[j].id,
|
|
29
|
-
name: user.memory.data.username,
|
|
30
|
-
note: spirit.memory[i].data.joinRequests[j].note
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
else spirit.memory[i].data.joinRequests = [];
|
|
35
|
-
|
|
36
|
-
inGroups.push(groupInfo);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else spirit.memory[i].data.members = [];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
spirit.commit();
|
|
44
|
-
|
|
45
|
-
return inGroups;
|
|
46
|
-
}
|
package/views/basic-footer.ejs
DELETED
package/views/menu.ejs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<div class="fade invisible" onclick="base.closeMenu()">
|
|
2
|
-
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
<div class="menu invisible">
|
|
6
|
-
<div class="tabs">
|
|
7
|
-
<button id="inventory" onclick="base.switchTab('inventory')">
|
|
8
|
-
Inventory
|
|
9
|
-
</button>
|
|
10
|
-
<button id="player" onclick="base.switchTab('player')">
|
|
11
|
-
Player
|
|
12
|
-
</button>
|
|
13
|
-
<button id="account" onclick="base.switchTab('account')">
|
|
14
|
-
Account
|
|
15
|
-
</button>
|
|
16
|
-
<button id="more" onclick="base.switchTab('more')">
|
|
17
|
-
More
|
|
18
|
-
</button>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<button id="close" onclick="base.closeMenu()">
|
|
22
|
-
X
|
|
23
|
-
</button>
|
|
24
|
-
|
|
25
|
-
<div id="content-window">
|
|
26
|
-
<%- include("./menu/inventory.ejs"); %>
|
|
27
|
-
<%- include("./menu/player.ejs"); %>
|
|
28
|
-
<%- include("./menu/account.ejs", { user: user }); %>
|
|
29
|
-
<%- include("./menu/more.ejs"); %>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<button id="logout" onclick="logoutViaMenu()">Logout</button>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
const logoutViaMenu = async () => {
|
|
36
|
-
let response = await base.logout();
|
|
37
|
-
console.log(response);
|
|
38
|
-
location.reload();
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<button id="menu" onclick="base.openMenu()"><i class="fas fa-cog"></i></button>
|