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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
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
nanahira
srvpro
Commits
2396832c
Commit
2396832c
authored
Jan 09, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
54f06e4d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
132 deletions
+82
-132
ygopro-server.coffee
ygopro-server.coffee
+2
-25
ygopro-server.js
ygopro-server.js
+80
-107
No files found.
ygopro-server.coffee
View file @
2396832c
...
...
@@ -144,25 +144,6 @@ get_memory_usage = ()->
percentUsed
=
0
return
percentUsed
# 定时清理关闭的连接
# the server write data directly to the socket object
# so this is a dumb way to clean data
Graveyard
=
[]
tribute
=
(
socket
)
->
setTimeout
((
socket
)
->
Graveyard
.
push
(
socket
);
return
),
3000
,
socket
return
setInterval
()
->
for
fuck
,
i
in
Graveyard
Graveyard
[
i
].
destroy
()
if
Graveyard
[
i
]
for
you
,
j
in
Graveyard
[
i
]
Graveyard
[
i
][
j
]
=
null
Graveyard
[
i
]
=
null
Graveyard
=
[]
return
,
3000
Cloud_replay_ids
=
[]
ROOM_all
=
[]
...
...
@@ -608,7 +589,6 @@ net.createServer (client) ->
connect_count
--
ROOM_connected_ip
[
client
.
ip
]
=
connect_count
#log.info "disconnect", client.ip, ROOM_connected_ip[client.ip]
#tribute(client)
unless
client
.
closed
client
.
closed
=
true
room
.
disconnect
(
client
)
if
room
...
...
@@ -623,7 +603,6 @@ net.createServer (client) ->
connect_count
--
ROOM_connected_ip
[
client
.
ip
]
=
connect_count
#log.info "err disconnect", client.ip, ROOM_connected_ip[client.ip]
#tribute(client)
unless
client
.
closed
client
.
closed
=
error
room
.
disconnect
(
client
,
error
)
if
room
...
...
@@ -638,7 +617,6 @@ net.createServer (client) ->
#log.info "server closed", client.name, had_error
room
=
ROOM_all
[
client
.
rid
]
#log.info "server close", client.ip, ROOM_connected_ip[client.ip]
#tribute(server)
room
.
disconnector
=
'server'
if
room
server
.
closed
=
true
unless
server
.
closed
unless
client
.
closed
...
...
@@ -650,7 +628,6 @@ net.createServer (client) ->
#log.info "server error", client.name, error
room
=
ROOM_all
[
client
.
rid
]
#log.info "server err close", client.ip, ROOM_connected_ip[client.ip]
#tribute(server)
room
.
disconnector
=
'server'
if
room
server
.
closed
=
error
unless
client
.
closed
...
...
@@ -1370,8 +1347,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
else
if
response
.
statusCode
!=
200
log
.
warn
'DECK POST FAIL'
,
response
.
statusCode
,
client
.
name
,
body
else
log
.
info
'DECK POST OK'
,
response
.
statusCode
,
client
.
name
,
body
#
else
#
log.info 'DECK POST OK', response.statusCode, client.name, body
return
client
.
deck_saved
=
true
return
...
...
ygopro-server.js
View file @
2396832c
This diff is collapsed.
Click to expand it.
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