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
ab79baf5
Commit
ab79baf5
authored
8 years ago
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle redis error
parent
e8ee60e3
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
ygopro-server.coffee
ygopro-server.coffee
+4
-1
ygopro-server.js
ygopro-server.js
+4
-1
No files found.
ygopro-server.coffee
View file @
ab79baf5
...
...
@@ -90,6 +90,9 @@ if settings.modules.enable_cloud_replay
redis
=
require
'redis'
zlib
=
require
'zlib'
redisdb
=
redis
.
createClient
host
:
"127.0.0.1"
,
port
:
settings
.
modules
.
redis_port
redisdb
.
on
'error'
,
(
err
)
->
log
.
warn
err
return
if
settings
.
modules
.
enable_windbot
settings
.
modules
.
windbots
=
require
(
'./windbot/bots.json'
).
windbots
...
...
@@ -731,7 +734,7 @@ net.createServer (client) ->
looplimit
++
#log.info(looplimit)
if
looplimit
>
800
or
ROOM_bad_ip
[
client
.
remoteAddress
]
>
5
or
ROOM_connected_ip
[
client
.
remoteAddress
]
>
10
if
looplimit
>
800
or
ROOM_bad_ip
[
client
.
remoteAddress
]
>
5
log
.
info
(
"error ctos"
,
client
.
name
,
client
.
remoteAddress
)
bad_ip_count
=
ROOM_bad_ip
[
client
.
remoteAddress
]
if
bad_ip_count
...
...
This diff is collapsed.
Click to expand it.
ygopro-server.js
View file @
ab79baf5
...
...
@@ -135,6 +135,9 @@
host
:
"
127.0.0.1
"
,
port
:
settings
.
modules
.
redis_port
});
redisdb
.
on
(
'
error
'
,
function
(
err
)
{
log
.
warn
(
err
);
});
}
if
(
settings
.
modules
.
enable_windbot
)
{
...
...
@@ -937,7 +940,7 @@
}
}
looplimit
++
;
if
(
looplimit
>
800
||
ROOM_bad_ip
[
client
.
remoteAddress
]
>
5
||
ROOM_connected_ip
[
client
.
remoteAddress
]
>
10
)
{
if
(
looplimit
>
800
||
ROOM_bad_ip
[
client
.
remoteAddress
]
>
5
)
{
log
.
info
(
"
error ctos
"
,
client
.
name
,
client
.
remoteAddress
);
bad_ip_count
=
ROOM_bad_ip
[
client
.
remoteAddress
];
if
(
bad_ip_count
)
{
...
...
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