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
2e362c65
Commit
2e362c65
authored
Dec 19, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mc ban
parent
0e31eb21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
ygopro-server.coffee
ygopro-server.coffee
+13
-12
ygopro-server.js
ygopro-server.js
+12
-14
No files found.
ygopro-server.coffee
View file @
2e362c65
...
...
@@ -2005,6 +2005,19 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
else
if
!
info
.
pass
.
length
and
!
settings
.
modules
.
random_duel
.
enabled
and
!
settings
.
modules
.
windbot
.
enabled
and
!
settings
.
modules
.
challonge
.
enabled
ygopro
.
stoc_die
(
client
,
"${blank_room_name}"
)
else
if
settings
.
modules
.
mysql
.
enabled
and
await
dataManager
.
checkBan
(
"name"
,
client
.
name
)
#账号被封
exactBan
=
await
dataManager
.
checkBanWithNameAndIP
(
client
.
name
,
client
.
ip
)
if
!
exactBan
exactBan
=
dataManager
.
getBan
(
client
.
name
,
client
.
ip
)
await
dataManager
.
banPlayer
(
exactBan
)
log
.
warn
(
"BANNED USER LOGIN"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${banned_user_login}"
)
else
if
settings
.
modules
.
mysql
.
enabled
and
await
dataManager
.
checkBan
(
"ip"
,
client
.
ip
)
#IP被封
log
.
warn
(
"BANNED IP LOGIN"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${banned_ip_login}"
)
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard
.
enabled
and
info
.
pass
[
0
...
3
]
!=
'AI#'
ygopro
.
stoc_send_chat
(
client
,
'${loading_user_info}'
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
info
.
pass
.
length
<=
8
...
...
@@ -2345,18 +2358,6 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
log
.
warn
(
"MULTI LOGIN"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${too_much_connection}"
+
client
.
ip
)
else
if
settings
.
modules
.
mysql
.
enabled
and
await
dataManager
.
checkBan
(
"name"
,
client
.
name
)
#账号被封
exactBan
=
await
dataManager
.
checkBanWithNameAndIP
(
client
.
name
,
client
.
ip
)
if
!
exactBan
exactBan
=
dataManager
.
getBan
(
client
.
name
,
client
.
ip
)
await
dataManager
.
banPlayer
(
exactBan
)
log
.
warn
(
"BANNED USER LOGIN"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${banned_user_login}"
)
else
if
settings
.
modules
.
mysql
.
enabled
and
await
dataManager
.
checkBan
(
"ip"
,
client
.
ip
)
#IP被封
log
.
warn
(
"BANNED IP LOGIN"
,
client
.
name
,
client
.
ip
)
ygopro
.
stoc_die
(
client
,
"${banned_ip_login}"
)
else
if
!
settings
.
modules
.
tournament_mode
.
enabled
and
!
settings
.
modules
.
challonge
.
enabled
and
_
.
any
(
badwords
.
level3
,
(
badword
)
->
regexp
=
new
RegExp
(
badword
,
'i'
)
return
name
.
match
(
regexp
)
...
...
ygopro-server.js
View file @
2e362c65
...
...
@@ -633,9 +633,7 @@
await
axios
.
post
(
settings
.
modules
.
random_duel
.
post_match_scores
,
qs
.
stringify
({
accesskey
:
settings
.
modules
.
random_duel
.
post_match_accesskey
,
rank
:
JSON
.
stringify
(
scores
)
}),
{
responseType
:
"
json
"
});
}));
}
catch
(
error1
)
{
e
=
error1
;
log
.
warn
(
'
RANDOM SCORE POST ERROR
'
,
e
.
toString
());
...
...
@@ -2671,6 +2669,17 @@
CLIENT_kick
(
client
);
}
else
if
(
!
info
.
pass
.
length
&&
!
settings
.
modules
.
random_duel
.
enabled
&&
!
settings
.
modules
.
windbot
.
enabled
&&
!
settings
.
modules
.
challonge
.
enabled
)
{
ygopro
.
stoc_die
(
client
,
"
${blank_room_name}
"
);
}
else
if
(
settings
.
modules
.
mysql
.
enabled
&&
(
await
dataManager
.
checkBan
(
"
name
"
,
client
.
name
)))
{
//账号被封
exactBan
=
(
await
dataManager
.
checkBanWithNameAndIP
(
client
.
name
,
client
.
ip
));
if
(
!
exactBan
)
{
exactBan
=
dataManager
.
getBan
(
client
.
name
,
client
.
ip
);
await
dataManager
.
banPlayer
(
exactBan
);
}
log
.
warn
(
"
BANNED USER LOGIN
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${banned_user_login}
"
);
}
else
if
(
settings
.
modules
.
mysql
.
enabled
&&
(
await
dataManager
.
checkBan
(
"
ip
"
,
client
.
ip
)))
{
//IP被封
log
.
warn
(
"
BANNED IP LOGIN
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${banned_ip_login}
"
);
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard
.
enabled
&&
info
.
pass
.
slice
(
0
,
3
)
!==
'
AI#
'
)
{
ygopro
.
stoc_send_chat
(
client
,
'
${loading_user_info}
'
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
if
(
info
.
pass
.
length
<=
8
)
{
...
...
@@ -3081,17 +3090,6 @@
}
else
if
(
ROOM_connected_ip
[
client
.
ip
]
>
5
)
{
log
.
warn
(
"
MULTI LOGIN
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${too_much_connection}
"
+
client
.
ip
);
}
else
if
(
settings
.
modules
.
mysql
.
enabled
&&
(
await
dataManager
.
checkBan
(
"
name
"
,
client
.
name
)))
{
//账号被封
exactBan
=
(
await
dataManager
.
checkBanWithNameAndIP
(
client
.
name
,
client
.
ip
));
if
(
!
exactBan
)
{
exactBan
=
dataManager
.
getBan
(
client
.
name
,
client
.
ip
);
await
dataManager
.
banPlayer
(
exactBan
);
}
log
.
warn
(
"
BANNED USER LOGIN
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${banned_user_login}
"
);
}
else
if
(
settings
.
modules
.
mysql
.
enabled
&&
(
await
dataManager
.
checkBan
(
"
ip
"
,
client
.
ip
)))
{
//IP被封
log
.
warn
(
"
BANNED IP LOGIN
"
,
client
.
name
,
client
.
ip
);
ygopro
.
stoc_die
(
client
,
"
${banned_ip_login}
"
);
}
else
if
(
!
settings
.
modules
.
tournament_mode
.
enabled
&&
!
settings
.
modules
.
challonge
.
enabled
&&
_
.
any
(
badwords
.
level3
,
function
(
badword
)
{
var
regexp
;
regexp
=
new
RegExp
(
badword
,
'
i
'
);
...
...
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