discord-web
Advanced tools
Comparing version 0.6.0 to 0.6.1
{ | ||
"name":"discord-web", | ||
"description":"Web client for the Discord MUD Engine.", | ||
"version":"0.6.0", | ||
"version":"0.6.1", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -38,4 +38,4 @@ (function() { //Only Discord will end up in the global namespace. | ||
this.attachEvents(); | ||
this.connection = io.connect('http://localhost'); | ||
//this.connection.emit("data", ">>> GUI_ON <<<"); | ||
this.connection = io.connect('http://'+window.location.hostname); | ||
this.connection.emit("data", ">>> GUI_ON <<<"); | ||
this.connection.on('data', this.handleData.bind(this)); | ||
@@ -70,2 +70,8 @@ this.connection.on('ansi', this.handleANSI.bind(this)); | ||
handleData: function(data) { | ||
var my = this; | ||
if (data.match(/\\r\\n/)) { | ||
return data.split("\\r\\n").each(function(l) { | ||
if (l.length) my.handleData(l); | ||
}); | ||
} | ||
data = data.trim(); | ||
@@ -81,3 +87,3 @@ var patt = this.options.escapePattern; | ||
var handlerMeth = obj.handler+'Handler'; | ||
if (!this[handlerMeth]) { console.error("No handler found for "+handlerMeth+"."); return; } | ||
//if (!this[handlerMeth]) { console.error("No handler found for "+handlerMeth+"."); return; } | ||
this[handlerMeth](obj.data); | ||
@@ -84,0 +90,0 @@ } else { |
@@ -10,3 +10,4 @@ var net = require('net'), | ||
app.use(express.static(config.world_path + '/public')); | ||
var path = require('path').normalize(config.static_path || config.world_path + "/../public"); | ||
app.use(express.static(config.static_path || config.world_path + "/../public")); | ||
app.use(express.static(__dirname + '/public')); | ||
@@ -42,2 +43,2 @@ | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
12850
319