-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs, playable demo and a few fix/changes to the engine #88
Conversation
@@ -1,11 +1,14 @@ | |||
const vm = require('vm'); | |||
|
|||
const parse = require('./parse'); | |||
const parse = require('./parse').parseSentence; | |||
const noun = require('./parse').parseNoun; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module './parse' import/no-unresolved
Fixed (and slightly expanded) the travis/coverage tests, now all passed (tag 3.1-RC2)
EDIT: Just added demo to .eslintignore, doh. |
@@ -1,4 +1,6 @@ | |||
const C3 = require('./c3'); | |||
const idify = require('./idify'); | |||
const parseNoun = require('./parse').parseNoun; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unable to resolve path to module './parse' import/no-unresolved
Great work @Omikhleia , I was trying to do something similar to this repo, but you and @doughsay did a much better job. I think is related to the loading moodb subfolders or something. This is my .env
There are some warnings when loading things, like
In the client I pointed to the localhost server, I created the user and player without problems, and entered in play mode, but when I write 'say hello' it's return 'I didn't understand that': and the error is
Also the tab key don´t work for mode cycling. |
@vitogit |
@Omikhleia I tested on windows and found some problems 3)I think I found the problem with the object loading. |
@Omikhleia Changing the load method in moo-db to
fix the problem in my mac, and now is working fine. All objects are loading, there are some warning because is trying to load some folders that don´t have json, like demo/world/players, but that doesn't affect gameplay. |
Thanks for the testing and feedback, @vitogit. Regarding your points:
EDIT: One path for refactoring is to work with POSIX filenames only, to avoid all those / vs. \ issues. I always found that the node.js "path" module was bad by design ("The default operation of the path module varies based on the operating system on which a Node.js application is running." - which makes the default API inconsistent...). |
Now running on both Linux and Windows without the changes made for one breaking the other, and all path names behaving identically ^^. Everything seems to be running ok. Finally kept the recursive approach from @vitogit above. |
@@ -84,7 +97,7 @@ class FsDb { | |||
|
|||
mapFor(filepath, create = true) { | |||
const getCallback = create ? this.createOrGetMap.bind(this) : this.getMap.bind(this); | |||
const keys = this.toRelpath(path.dirname(filepath)).split('/').filter(x => x); | |||
const keys = this.toRelpath(path.posix.dirname(filepath)).split('/').filter(x => x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using path.posix so many times, I think you could change the requiere to requiere: const path = require('path').posix;
and just use path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Point taken.
Hey, thanks for the contributions! I've cleared out the newly ignored hound comments for the demo world. I'll investigate why the 5 remaining get complaints from Hound but not when run locally. If I can't figure it out, I'm just going to disable Hound. Seems more trouble than it's worth... |
Let's just try disabling the no-resolved rule for eslint to get hound to stop bothering us about it. I think I will eventually just turn off hound, since I have no control over what version of eslint it's running under the hood. Better to have full control over it and run it manually from within travis the same way we'd run it locally. |
Ok, well I've just disabled hound altogether cause I realized I was already running eslint inside travis. So that will catch any linting errors; no need to also include hound. |
Rebase on my latest master branch to get the removal of hound.yml and re-rerun the checks. |
- builder wand - food and drinks - closeable/lockable object - Slightly different hierarchical model
…n subfolders Seems to work fine with the demo mudlib, but probably some more work do do... Too many conversions between ids and paths between MooDB and FsDb
… nicer directory structure.
[DOC] Fix tables in markdown for GitHub...
Markdow tables and linebreaks, etc. - behaving differently than e.g. http://dillinger.io/
Shh, viewing on GitHub seems to break with things such as Array.<WorldObject>... Removing the brackets, then.
Do I hate markdown?
…re not well regarder.
... and change name of inn as a tribute to JRRT.
… without interest
From module "chalk": use bright blue on Windows as the normal blue color is illegible i.e. escape 94m instead of 34m.
… print-test regarding colored string: From module "chalk": use bright blue on Windows as the normal blue color is illegible i.e. escape 94m instead of 34m.
(replacing a duplicate test)
…tween Win32 and Unix Fix Moo DB to recurse into the FS DB tree
Thanks for the contributions! I'm going to go ahead and merge this. There are a few places I'd still like to clean things up, but that can come later. |
Greetings,
I am suggesting my master branch tag 3.1-RC for a pull request.
Note that the version in package.json is still 3.0.0, I leave it upon you to decide whether it must be upgraded.
Reviews and/or comments are obviously accepted :)
Details of the changes follow hereafter.
Code has been checked with eslint, and via a few playtest sessions.
Changes overview
Change details
README.md
doc/...
demo/...
package.json
src/controllers/player-controller.js
src/controllers/user-controller.js
src/lib/context.js
src/lib/fs-db.js
src/lib/idify.js
src/lib/moo-db.js
src/lib/parse.js
src/lib/world-object-class-builder.js
*src/lib/world-object-proxy-builder.js *