diff rlgwebd.js @ 81:e4773ac5d4d5

Switch to node v0.8. In node v0.8, path.exists() has been moved to the fs module.
author John "Elwin" Edwards <elwin@sdf.org>
date Sun, 08 Jul 2012 08:02:17 -0700
parents 57bf0dcd080e
children d59dc5cef412
line wrap: on
line diff
--- a/rlgwebd.js	Sat Jun 23 19:45:25 2012 -0700
+++ b/rlgwebd.js	Sun Jul 08 08:02:17 2012 -0700
@@ -360,7 +360,7 @@
   var savedirc = game.uname + "save";
   var basename = String(dropToUID) + "-" + user + game.suffix;
   var savefile = path.join("/var/games/roguelike", savedirc, basename);
-  path.exists(savefile, function (exist) {
+  fs.exists(savefile, function (exist) {
     args.unshift(exist);
     callback.apply(null, args);
   });
@@ -745,7 +745,7 @@
     path.join(nname, "index.html"); /* it was a directory */
   var realname = path.join(serveStaticRoot, nname);
   var extension = path.extname(realname);
-  path.exists(realname, function (exists) {
+  fs.exists(realname, function (exists) {
     var resheaders = {};
     if (!exists || !extension || extension == ".html")
       resheaders["Content-Type"] = "text/html; charset=utf-8";
@@ -989,6 +989,7 @@
   httpServer.close();
   httpServer.removeAllListeners('request');
   ctlServer.close();
+  fs.unlink(ctlsocket);
   tslog("Shutting down...");
   process.exit();
 }