Permalink
Browse files

fixing bug in library package.json,cleaning up package json, and addi…

…ng error handling
  • Loading branch information...
1 parent ece8830 commit 3df1ff080a48c6392acb8ab50a9169566a186871 @AndrewSwerlick committed Dec 16, 2011
Showing with 24 additions and 14 deletions.
  1. +1 −1 node_modules/x11/package.json
  2. +10 −6 package.json
  3. +12 −6 remote-server.js
  4. +1 −1 simpleServer.js

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,11 @@
-{ "name" : "node-remote"
-, "author" : "Andrew Swerlick <andrew.swerlick@gmail.com>"
-, "version" : "0.0.1"
-, "dependencies" : {
- "socket.io" : "0.x.x"
- }
+{
+ "name" : "node-remote",
+ "author" : "Andrew Swerlick <andrew.swerlick@gmail.com>",
+ "version" : "0.0.1",
+ "dependencies" : {
+ "socket.io" : "0.x.x"
+ },
+ "devDependencies" :{
+ "vows" : "0.x.x"
+ }
}
View
@@ -10,22 +10,28 @@ server.listen(8000);
xManager.createXManager(function(manager) {
sockets.on('connection', function(socket) {
socket.on('move', function(data) {
- manager.move(data.xPercent, data.yPercent);
+ try{manager.move(data.xPercent, data.yPercent);}
+ catch(err){}
});
socket.on('moveRelative', function(data) {
- manager.moveRelative(data.x, data.y);
+ try{manager.moveRelative(data.x, data.y);}
+ catch(err){}
});
socket.on('keyUp', function(data){
- manager.keyUp(data.key);
+ try{manager.keyUp(data.key);}
+ catch(err){}
});
socket.on('keyDown', function(data){
- manager.keyDown(data.key);
+ try{manager.keyDown(data.key);}
+ catch(err){}
});
socket.on('keyPress', function(data){
- manager.keyPress(data.key);
+ try{manager.keyPress(data.key);}
+ catch(err){}
});
socket.on('click', function(data){
- manager.click(data.clickCode);
+ try{manager.click(data.clickCode);}
+ catch(err){}
});
});
View
@@ -2,7 +2,7 @@ var url = require('url'),
http = require('http'),
path = require('path'),
fs = require('fs');
- log = require('sys').puts;
+ log = require('util').puts;
module.exports.createServer = function()
{

0 comments on commit 3df1ff0

Please sign in to comment.