notherbase-fs 1.3.5 → 1.3.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/explorer.js
CHANGED
|
@@ -23,7 +23,7 @@ const explorer = async function explorer(worldPath, voidPath) {
|
|
|
23
23
|
await db.poi.create({
|
|
24
24
|
route: currentRoute,
|
|
25
25
|
name: req.params.detail,
|
|
26
|
-
type: "
|
|
26
|
+
type: "user",
|
|
27
27
|
user: req.session.currentUser,
|
|
28
28
|
data: {}
|
|
29
29
|
});
|
|
@@ -37,6 +37,55 @@ const explorer = async function explorer(worldPath, voidPath) {
|
|
|
37
37
|
res.status(500).end();
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
router.get(`/:region/:area/:poi/:detail/load`, async function(req, res) {
|
|
42
|
+
try {
|
|
43
|
+
let currentRoute = `${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}`;
|
|
44
|
+
|
|
45
|
+
if (await db.poi.exists({ route: currentRoute, user: req.session.currentUser }) === false) {
|
|
46
|
+
await db.poi.create({
|
|
47
|
+
route: currentRoute,
|
|
48
|
+
name: req.params.detail,
|
|
49
|
+
type: "user",
|
|
50
|
+
user: req.session.currentUser,
|
|
51
|
+
data: {}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let found = await db.poi.findOne({ route: currentRoute, user: req.session.currentUser });
|
|
56
|
+
|
|
57
|
+
if (found) res.send(found.data);
|
|
58
|
+
else res.send("Found nothing.");
|
|
59
|
+
}
|
|
60
|
+
catch(err) {
|
|
61
|
+
console.log(err);
|
|
62
|
+
res.status(500).end();
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
router.post(`/:region/:area/:poi/:detail/save`, async function(req, res) {
|
|
67
|
+
try {
|
|
68
|
+
let currentRoute = `${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}`;
|
|
69
|
+
|
|
70
|
+
if (await db.poi.exists({ route: currentRoute, user: req.session.currentUser }) === false) {
|
|
71
|
+
await db.poi.create({
|
|
72
|
+
route: currentRoute,
|
|
73
|
+
name: req.params.detail,
|
|
74
|
+
type: "user",
|
|
75
|
+
user: req.session.currentUser,
|
|
76
|
+
data: {}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
await db.poi.updateOne({ route: currentRoute, user: req.session.currentUser }, { data: req.body });
|
|
81
|
+
|
|
82
|
+
res.send("Update successful!");
|
|
83
|
+
}
|
|
84
|
+
catch(err) {
|
|
85
|
+
console.log(err);
|
|
86
|
+
res.status(500).end();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
40
89
|
|
|
41
90
|
router.get(`/:region/:area/:poi/:detail`, async function(req, res) {
|
|
42
91
|
try {
|
package/package.json
CHANGED
package/public/styles/main.css
CHANGED
|
@@ -90,9 +90,10 @@
|
|
|
90
90
|
|
|
91
91
|
let addToTime = async function addToTime() {
|
|
92
92
|
try {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
time += 10;
|
|
94
|
+
|
|
95
|
+
await $.post(`/coast/tall-beach/nono-cove/index/save`, { timer: time, lastTime: Date.now() }, function () {
|
|
96
|
+
$("#timer").text(Math.floor(time));
|
|
96
97
|
});
|
|
97
98
|
} catch (error) {
|
|
98
99
|
console.log(error);
|
|
@@ -101,9 +102,15 @@
|
|
|
101
102
|
|
|
102
103
|
let getTime = async function getTime() {
|
|
103
104
|
try {
|
|
104
|
-
await $.
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
await $.get(`/coast/tall-beach/nono-cove/index/load`, function (data) {
|
|
106
|
+
console.log(data);
|
|
107
|
+
data.timer = parseFloat(data.timer);
|
|
108
|
+
data.lastTime = parseFloat(data.lastTime);
|
|
109
|
+
console.log(data);
|
|
110
|
+
console.log(Date.now());
|
|
111
|
+
time = data.timer - ((Date.now() - data.lastTime) / 1000);
|
|
112
|
+
if (time < 0) time = 0;
|
|
113
|
+
$("#timer").text(Math.floor(time));
|
|
107
114
|
});
|
|
108
115
|
} catch (error) {
|
|
109
116
|
console.log(error);
|
|
@@ -113,8 +120,10 @@
|
|
|
113
120
|
let updateTime = function updateTime() {
|
|
114
121
|
if (time > 0) {
|
|
115
122
|
time--;
|
|
116
|
-
|
|
123
|
+
if (time < 0) time = 0;
|
|
124
|
+
$("#timer").text(Math.floor(time));
|
|
117
125
|
}
|
|
126
|
+
|
|
118
127
|
}
|
|
119
128
|
|
|
120
129
|
setInterval(updateTime, 1000);
|
package/views/head.ejs
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<!-- 'Roboto Condensed', sans-serif; -->
|
|
11
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">
|
|
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
12
|
<!-- 'Redacted Script', cursive; -->
|
|
13
13
|
<link href="https://fonts.googleapis.com/css2?family=Redacted+Script:wght@300&display=swap" rel="stylesheet">
|
|
14
14
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|