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
ab667bc0
Commit
ab667bc0
authored
Aug 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update timeout
parent
477dacf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
ygopro-server.coffee
ygopro-server.coffee
+5
-4
ygopro-server.js
ygopro-server.js
+5
-2
No files found.
ygopro-server.coffee
View file @
ab667bc0
...
...
@@ -607,7 +607,7 @@ net.createServer (client) ->
server
=
new
net
.
Socket
()
client
.
server
=
server
client
.
setTimeout
(
300000
)
#5分钟
client
.
setTimeout
(
2000
)
#连接前超时2秒
# 释放处理
client
.
on
'close'
,
(
had_error
)
->
...
...
@@ -668,7 +668,7 @@ net.createServer (client) ->
client
.
destroy
()
return
if
ROOM_bad_ip
[
client
.
ip
]
>
5
if
ROOM_bad_ip
[
client
.
ip
]
>
5
or
ROOM_connected_ip
[
client
.
ip
]
>
10
log
.
info
'BAD IP'
,
client
.
ip
client
.
destroy
()
return
...
...
@@ -970,6 +970,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
#client.room = room
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
room
.
connect
(
client
)
return
...
...
@@ -1065,7 +1066,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
started
if
settings
.
modules
.
enable_halfway_watch
#client.room = room
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
加入了观战"
)
...
...
@@ -1076,7 +1077,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
else
ygopro
.
stoc_die
(
client
,
"决斗已开始,不允许观战"
)
else
#client.room = room
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
room
.
connect
(
client
)
return
...
...
ygopro-server.js
View file @
ab667bc0
...
...
@@ -800,7 +800,7 @@
ROOM_connected_ip
[
client
.
ip
]
=
connect_count
;
server
=
new
net
.
Socket
();
client
.
server
=
server
;
client
.
setTimeout
(
300
000
);
client
.
setTimeout
(
2
000
);
client
.
on
(
'
close
'
,
function
(
had_error
)
{
var
room
;
room
=
ROOM_all
[
client
.
rid
];
...
...
@@ -866,7 +866,7 @@
client
.
destroy
();
}
});
if
(
ROOM_bad_ip
[
client
.
ip
]
>
5
)
{
if
(
ROOM_bad_ip
[
client
.
ip
]
>
5
||
ROOM_connected_ip
[
client
.
ip
]
>
10
)
{
log
.
info
(
'
BAD IP
'
,
client
.
ip
);
client
.
destroy
();
return
;
...
...
@@ -1187,6 +1187,7 @@
}
else
if
(
room
.
error
)
{
ygopro
.
stoc_die
(
client
,
room
.
error
);
}
else
{
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
room
.
connect
(
client
);
}
...
...
@@ -1284,6 +1285,7 @@
ygopro
.
stoc_die
(
client
,
room
.
error
);
}
else
if
(
room
.
started
)
{
if
(
settings
.
modules
.
enable_halfway_watch
)
{
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
加入了观战
"
);
...
...
@@ -1298,6 +1300,7 @@
ygopro
.
stoc_die
(
client
,
"
决斗已开始,不允许观战
"
);
}
}
else
{
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
room
.
connect
(
client
);
}
...
...
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