Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add command scope for current room

  • Loading branch information...
commit 07a6a45981bbf81441a30884ca601ccd7d96929d 1 parent 476b51b
Luke Slater authored
Showing with 6 additions and 4 deletions.
  1. +2 −0  run.js
  2. +4 −4 tools/gen_db.js
2  run.js
View
@@ -58,6 +58,8 @@ var NodeMUD = function() {
command = socket.user.commands[chunks[0]].code;
} else if(this.db.rooms[0].commands.hasOwnProperty(chunks[0])) { // Global command room
command = this.db.rooms[0].commands[chunks[0]].code;
+ } else if(this.db.rooms[socket.user.location].commands.hasOwnProperty(chunks[0])) { // Current room
+ command = this.db.rooms[socket.user.location].commands[chunks[0]].code;
}
try {
8 tools/gen_db.js
View
@@ -3,16 +3,16 @@ var db = {
"rooms": [
{
"id": 0,
- "name": "Global Command Room",
+ "name": "Globals Room",
"owner": "root",
"description": "It's where global commands go.",
"commands": { }
},
{
- "id": 2,
- "name": "A Mother Fucking Terrarium",
+ "id": 1,
+ "name": "Pub",
"owner": "reality",
- "description": "Here be turtles.",
+ "description": "The Turtle.",
"commands": { }
}
],
Please sign in to comment.
Something went wrong with that request. Please try again.