Commit 8b34cc43 authored by mercury233's avatar mercury233

compile without inotify

parent bfd54f21
config.json
#################
## node
#################
/node_modules/
#################
## JetBrains
#################
......
{
"ip": "",
"ip": "127.0.0.1",
"port": 7911,
"version": 4897,
"version": 4917,
"modules": {
"welcome": "Mycard Server",
"tips": "https://my-card.in/tips.json",
"dialogues": "https://my-card.in/dialogues.json",
"tips": "http://mercury233.me/ygosrv233/tips.json",
"dialogues": "http://mercury233.me/ygosrv233/dialogues.json",
"database": false,
"post_start_watching": true,
"skip_empty_side": true,
......
......@@ -16,7 +16,6 @@
"underscore": "*",
"underscore.string": "*",
"freeport": "*",
"inotify": "*",
"request": "*",
"mongoose": "*",
"bunyan": "*",
......
......@@ -12,7 +12,7 @@ _ = require 'underscore'
_.str = require 'underscore.string'
_.mixin(_.str.exports());
Inotify = require('inotify').Inotify
#Inotify = require('inotify').Inotify
WebSocketServer = require('websocket').server
request = require 'request'
......
// Generated by CoffeeScript 1.9.3
(function() {
var Deck, Inotify, Room, User, WebSocketServer, _, bunyan, debug, dialogues, execFile, fs, http, http_server, i, inotify, level_points, log, mycard, net, originIsAllowed, os, path, request, settings, tips, url, victories, waiting, wsServer, ygopro,
var Deck, Room, User, WebSocketServer, _, bunyan, debug, dialogues, execFile, fs, http, http_server, i, level_points, log, mycard, net, originIsAllowed, os, path, request, settings, tips, url, victories, waiting, wsServer, ygopro,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
net = require('net');
......@@ -23,8 +23,6 @@
_.mixin(_.str.exports());
Inotify = require('inotify').Inotify;
WebSocketServer = require('websocket').server;
request = require('request');
......@@ -928,31 +926,26 @@
});
}
inotify = new Inotify();
inotify.addWatch({
/*
inotify = new Inotify()
inotify.addWatch
path: 'ygocore/replay',
watch_for: Inotify.IN_CLOSE_WRITE | Inotify.IN_CREATE | Inotify.IN_MODIFY,
callback: function(event) {
var mask, port, room;
mask = event.mask;
if (event.name) {
port = parseInt(path.basename(event.name, '.yrp'));
room = Room.find_by_port(port);
if (room) {
if (mask & Inotify.IN_CREATE) {
} else if (mask & Inotify.IN_CLOSE_WRITE) {
return fs.unlink(path.join('ygocore/replay'), function(err) {});
} else if (mask & Inotify.IN_MODIFY) {
return room.alive = true;
}
}
} else {
return log.error("event without filename");
}
}
});
callback: (event)->
mask = event.mask
if event.name
port = parseInt path.basename(event.name, '.yrp')
room = Room.find_by_port port
if room
if mask & Inotify.IN_CREATE
else if mask & Inotify.IN_CLOSE_WRITE
fs.unlink path.join('ygocore/replay'), (err)->
else if mask & Inotify.IN_MODIFY
room.alive = true
else
log.error "event without filename"
*/
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment