notherbase-fs 1.4.2 → 1.4.4
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
|
@@ -9,8 +9,9 @@ const explorer = async function explorer(worldPath, voidPath) {
|
|
|
9
9
|
try {
|
|
10
10
|
let currentAreaRoute = `${req.params.region}/${req.params.area}/${req.params.poi}`;
|
|
11
11
|
let currentRoute = `${req.params.region}/${req.params.area}/${req.params.poi}/${req.params.detail}`;
|
|
12
|
+
const foundUser = await db.user.findById(req.session.currentUser);
|
|
12
13
|
|
|
13
|
-
let scriptResult = await require(`${worldPath}/${currentAreaRoute}/server-scripts/${req.params.script}.js`)(db, currentRoute,
|
|
14
|
+
let scriptResult = await require(`${worldPath}/${currentAreaRoute}/server-scripts/${req.params.script}.js`)(db, currentRoute, foundUser, req.body);
|
|
14
15
|
res.send({ scriptResult: scriptResult });
|
|
15
16
|
}
|
|
16
17
|
catch(err) {
|
package/controllers/inventory.js
CHANGED
|
@@ -35,6 +35,7 @@ router.post("/", async function(req, res) {
|
|
|
35
35
|
if (foundItem) {
|
|
36
36
|
let foundInventory = await inventory.findOne({user: req.session.currentUser}).populate("items.item");
|
|
37
37
|
|
|
38
|
+
console.log(foundInventory.items);
|
|
38
39
|
let holding = false;
|
|
39
40
|
|
|
40
41
|
for (let j = 0; j < foundInventory.items.length; j++) {
|
package/controllers/pages.js
CHANGED
|
@@ -10,7 +10,9 @@ module.exports = function name(path)
|
|
|
10
10
|
|
|
11
11
|
router.post(`/serve/:script`, async function(req, res) {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
const foundUser = await db.user.findById(req.session.currentUser);
|
|
14
|
+
|
|
15
|
+
let scriptResult = await require(`${path}/scripts/${req.params.script}.js`)(db, foundUser, req.body);
|
|
14
16
|
res.send(scriptResult);
|
|
15
17
|
}
|
|
16
18
|
catch(err) {
|
package/package.json
CHANGED
package/public/js/memories.js
CHANGED