Comparing version 0.5.0 to 0.6.0
@@ -164,5 +164,11 @@ Living = new Class({ | ||
//If we've been passed a room object, use that. | ||
if (path.addLiving) { return this.setRoom(path); } | ||
if (path.addLiving) { | ||
this.setRoom(path); | ||
return true; | ||
} | ||
var room = this.world.getRoom(path); | ||
this.setRoom(room); | ||
if (room && room.addLiving) { | ||
this.setRoom(room); | ||
return true; | ||
} else return false; | ||
}, | ||
@@ -172,4 +178,5 @@ | ||
moveTo: function(path) { | ||
if (path.path) { this.setRoom(path); } | ||
else { this.setLocation(path); } | ||
if (this.setLocation(path)) { | ||
return true; | ||
} else return false; | ||
}, | ||
@@ -176,0 +183,0 @@ |
@@ -51,9 +51,6 @@ var fs = require('fs'); | ||
}); | ||
this.set('name', config.name); | ||
this.set('name', config.world_name); | ||
this.config = config; | ||
this.worldPath = ENGINE_PATH+config.world_path+'/'; | ||
this.worldPath = config.world_path+'/'; | ||
this.defaultRoom = config.start_room; | ||
this.loadFile('initialize'); | ||
this.players = this.players; | ||
@@ -107,3 +104,3 @@ this.rooms = this.rooms; | ||
loadPlayerData: function(player) { | ||
var path = this.savePath+player.name; | ||
var path = this.worldPath+this.savePath+player.name; | ||
var my = this; | ||
@@ -145,4 +142,5 @@ this.loadFile(path, function(e,data) { | ||
getRoom: function(path) { | ||
if (!path) return; | ||
var that = this; | ||
if (typeOf(path)=='object') { | ||
path = path.to; | ||
} | ||
if (!this.rooms[path]) { | ||
@@ -149,0 +147,0 @@ var room = this.loadModule(this.roomPath+path); |
@@ -11,2 +11,3 @@ module.exports = new Class({ | ||
this.emit("%You leave%s "+direction+"."); | ||
this.force('look'); | ||
return true; | ||
@@ -13,0 +14,0 @@ } else { |
{ | ||
"name":"discord", | ||
"description":"A LP/Discworld inspired MUD server running on Node.JS and MooTools.", | ||
"version":"0.5.0", | ||
"version":"0.6.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -81,4 +81,9 @@ /** | ||
return { listen: server.listen.bind(server) }; | ||
return { | ||
listen: function(port) { | ||
console.log("Game engine listening on port", port); | ||
server.listen(port); | ||
} | ||
}; | ||
}; |
require('./server').start({ | ||
"name" : "New DiscoMUD Install", | ||
"port" : 8000, | ||
"world_path" : "example_world", | ||
"start_room" : "lobby" | ||
}); | ||
}).listen(8000); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124801
3126