Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
srvpro
Commits
8b34cc43
Commit
8b34cc43
authored
Aug 11, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compile without inotify
parent
bfd54f21
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
31 deletions
+29
-31
.gitignore
.gitignore
+6
-0
config.json
config.json
+4
-4
package.json
package.json
+0
-1
ygopro-server.coffee
ygopro-server.coffee
+1
-1
ygopro-server.js
ygopro-server.js
+18
-25
No files found.
.gitignore
View file @
8b34cc43
config.json
config.json
#################
## node
#################
/node_modules/
#################
#################
## JetBrains
## JetBrains
#################
#################
...
...
config.json
View file @
8b34cc43
{
{
"ip"
:
""
,
"ip"
:
"
127.0.0.1
"
,
"port"
:
7911
,
"port"
:
7911
,
"version"
:
4
89
7
,
"version"
:
4
91
7
,
"modules"
:
{
"modules"
:
{
"welcome"
:
"Mycard Server"
,
"welcome"
:
"Mycard Server"
,
"tips"
:
"http
s://my-card.in
/tips.json"
,
"tips"
:
"http
://mercury233.me/ygosrv233
/tips.json"
,
"dialogues"
:
"http
s://my-card.in
/dialogues.json"
,
"dialogues"
:
"http
://mercury233.me/ygosrv233
/dialogues.json"
,
"database"
:
false
,
"database"
:
false
,
"post_start_watching"
:
true
,
"post_start_watching"
:
true
,
"skip_empty_side"
:
true
,
"skip_empty_side"
:
true
,
...
...
package.json
View file @
8b34cc43
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
"
underscore
"
:
"
*
"
,
"
underscore
"
:
"
*
"
,
"
underscore.string
"
:
"
*
"
,
"
underscore.string
"
:
"
*
"
,
"
freeport
"
:
"
*
"
,
"
freeport
"
:
"
*
"
,
"
inotify
"
:
"
*
"
,
"
request
"
:
"
*
"
,
"
request
"
:
"
*
"
,
"
mongoose
"
:
"
*
"
,
"
mongoose
"
:
"
*
"
,
"
bunyan
"
:
"
*
"
,
"
bunyan
"
:
"
*
"
,
...
...
ygopro-server.coffee
View file @
8b34cc43
...
@@ -12,7 +12,7 @@ _ = require 'underscore'
...
@@ -12,7 +12,7 @@ _ = require 'underscore'
_
.
str
=
require
'underscore.string'
_
.
str
=
require
'underscore.string'
_
.
mixin
(
_
.
str
.
exports
());
_
.
mixin
(
_
.
str
.
exports
());
Inotify
=
require
(
'inotify'
).
Inotify
#
Inotify = require('inotify').Inotify
WebSocketServer
=
require
(
'websocket'
).
server
WebSocketServer
=
require
(
'websocket'
).
server
request
=
require
'request'
request
=
require
'request'
...
...
ygopro-server.js
View file @
8b34cc43
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.9.3
(
function
()
{
(
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
;
};
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
'
);
net
=
require
(
'
net
'
);
...
@@ -23,8 +23,6 @@
...
@@ -23,8 +23,6 @@
_
.
mixin
(
_
.
str
.
exports
());
_
.
mixin
(
_
.
str
.
exports
());
Inotify
=
require
(
'
inotify
'
).
Inotify
;
WebSocketServer
=
require
(
'
websocket
'
).
server
;
WebSocketServer
=
require
(
'
websocket
'
).
server
;
request
=
require
(
'
request
'
);
request
=
require
(
'
request
'
);
...
@@ -928,31 +926,26 @@
...
@@ -928,31 +926,26 @@
});
});
}
}
inotify
=
new
Inotify
();
inotify
.
addWatch
({
/*
inotify = new Inotify()
inotify.addWatch
path: 'ygocore/replay',
path: 'ygocore/replay',
watch_for: Inotify.IN_CLOSE_WRITE | Inotify.IN_CREATE | Inotify.IN_MODIFY,
watch_for: Inotify.IN_CLOSE_WRITE | Inotify.IN_CREATE | Inotify.IN_MODIFY,
callback
:
function
(
event
)
{
callback: (event)->
var
mask
,
port
,
room
;
mask = event.mask
mask
=
event
.
mask
;
if event.name
if
(
event
.
name
)
{
port = parseInt path.basename(event.name, '.yrp')
port
=
parseInt
(
path
.
basename
(
event
.
name
,
'
.yrp
'
));
room = Room.find_by_port port
room
=
Room
.
find_by_port
(
port
);
if room
if
(
room
)
{
if mask & Inotify.IN_CREATE
if
(
mask
&
Inotify
.
IN_CREATE
)
{
else if mask & Inotify.IN_CLOSE_WRITE
fs.unlink path.join('ygocore/replay'), (err)->
}
else
if
(
mask
&
Inotify
.
IN_CLOSE_WRITE
)
{
else if mask & Inotify.IN_MODIFY
return
fs
.
unlink
(
path
.
join
(
'
ygocore/replay
'
),
function
(
err
)
{});
room.alive = true
}
else
if
(
mask
&
Inotify
.
IN_MODIFY
)
{
else
return
room
.
alive
=
true
;
log.error "event without filename"
}
*/
}
}
else
{
return
log
.
error
(
"
event without filename
"
);
}
}
});
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment