notherbase-fs 1.4.2 → 1.4.3

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.
@@ -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, req.session.currentUser, req.body);
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) {
@@ -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
- let scriptResult = await require(`${path}/scripts/${req.params.script}.js`)(db, req.session.currentUser, req.body);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "main": "notherbase-fs.js",
6
6
  "scripts": {