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
b6fc504a
Commit
b6fc504a
authored
Mar 23, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai filter
parent
bfd5f993
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
ygopro-server.coffee
ygopro-server.coffee
+18
-4
ygopro-server.js
ygopro-server.js
+21
-5
No files found.
ygopro-server.coffee
View file @
b6fc504a
...
@@ -321,15 +321,29 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -321,15 +321,29 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
client
.
end
()
client
.
end
()
else
if
settings
.
modules
.
windbot
and
info
.
pass
[
0
...
2
]
==
'AI'
else
if
settings
.
modules
.
windbot
and
info
.
pass
[
0
...
2
]
==
'AI'
room
=
Room
.
find_or_create_by_name
(
'M#AI'
+
Math
.
random
().
toString
())
room
.
windbot
=
_
.
sample
settings
.
modules
.
windbot
if
info
.
pass
.
length
>
3
and
info
.
pass
[
0
...
3
]
==
'AI#'
name
=
info
.
pass
.
slice
(
3
)
windbot
=
_
.
sample
_
.
filter
settings
.
modules
.
windbot
,
(
w
)
->
w
.
name
==
name
or
w
.
deck
==
name
if
!
windbot
ygopro
.
stoc_send_chat
(
client
,
'主机密码不正确 (Invalid Windbot Name)'
,
11
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,{
msg
:
1
code
:
2
}
client
.
end
()
return
else
windbot
=
_
.
sample
settings
.
modules
.
windbot
room
=
Room
.
find_or_create_by_name
(
'AI#'
+
Math
.
random
().
toString
())
# 这个 AI# 没有特殊作用, 仅作为标记
room
.
windbot
=
windbot
room
.
private
=
true
room
.
private
=
true
client
.
room
=
room
client
.
room
=
room
client
.
room
.
connect
(
client
)
client
.
room
.
connect
(
client
)
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard_auth
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard_auth
console
.
log
settings
.
modules
.
windbot
ygopro
.
stoc_send_chat
(
client
,
'正在读取用户信息...'
,
11
)
ygopro
.
stoc_send_chat
(
client
,
'正在读取用户信息...'
,
11
)
if
info
.
pass
.
length
<=
8
if
info
.
pass
.
length
<=
8
ygopro
.
stoc_send_chat
(
client
,
'主机密码不正确 (Invalid Length)'
,
11
)
ygopro
.
stoc_send_chat
(
client
,
'主机密码不正确 (Invalid Length)'
,
11
)
...
...
ygopro-server.js
View file @
b6fc504a
...
@@ -293,7 +293,7 @@
...
@@ -293,7 +293,7 @@
});
});
ygopro
.
ctos_follow
(
'
JOIN_GAME
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
ygopro
.
ctos_follow
(
'
JOIN_GAME
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
var
check
,
decrypted_buffer
,
finish
,
i
,
id
,
k
,
l
,
len
,
len1
,
ref
,
ref1
,
room
,
secre
t
;
var
check
,
decrypted_buffer
,
finish
,
i
,
id
,
k
,
l
,
len
,
len1
,
name
,
ref
,
ref1
,
room
,
secret
,
windbo
t
;
if
(
settings
.
modules
.
stop
)
{
if
(
settings
.
modules
.
stop
)
{
ygopro
.
stoc_send_chat
(
client
,
settings
.
modules
.
stop
,
11
);
ygopro
.
stoc_send_chat
(
client
,
settings
.
modules
.
stop
,
11
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
...
@@ -351,13 +351,29 @@
...
@@ -351,13 +351,29 @@
});
});
client
.
end
();
client
.
end
();
}
else
if
(
settings
.
modules
.
windbot
&&
info
.
pass
.
slice
(
0
,
2
)
===
'
AI
'
)
{
}
else
if
(
settings
.
modules
.
windbot
&&
info
.
pass
.
slice
(
0
,
2
)
===
'
AI
'
)
{
room
=
Room
.
find_or_create_by_name
(
'
M#AI
'
+
Math
.
random
().
toString
());
if
(
info
.
pass
.
length
>
3
&&
info
.
pass
.
slice
(
0
,
3
)
===
'
AI#
'
)
{
room
.
windbot
=
_
.
sample
(
settings
.
modules
.
windbot
);
name
=
info
.
pass
.
slice
(
3
);
windbot
=
_
.
sample
(
_
.
filter
(
settings
.
modules
.
windbot
,
function
(
w
)
{
return
w
.
name
===
name
||
w
.
deck
===
name
;
}));
if
(
!
windbot
)
{
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Invalid Windbot Name)
'
,
11
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
1
,
code
:
2
});
client
.
end
();
return
;
}
}
else
{
windbot
=
_
.
sample
(
settings
.
modules
.
windbot
);
}
room
=
Room
.
find_or_create_by_name
(
'
AI#
'
+
Math
.
random
().
toString
());
room
.
windbot
=
windbot
;
room
[
"
private
"
]
=
true
;
room
[
"
private
"
]
=
true
;
client
.
room
=
room
;
client
.
room
=
room
;
client
.
room
.
connect
(
client
);
client
.
room
.
connect
(
client
);
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard_auth
)
{
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard_auth
)
{
console
.
log
(
settings
.
modules
.
windbot
);
ygopro
.
stoc_send_chat
(
client
,
'
正在读取用户信息...
'
,
11
);
ygopro
.
stoc_send_chat
(
client
,
'
正在读取用户信息...
'
,
11
);
if
(
info
.
pass
.
length
<=
8
)
{
if
(
info
.
pass
.
length
<=
8
)
{
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Invalid Length)
'
,
11
);
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Invalid Length)
'
,
11
);
...
@@ -387,7 +403,7 @@
...
@@ -387,7 +403,7 @@
return
(
checksum
&
0xFF
)
===
0
;
return
(
checksum
&
0xFF
)
===
0
;
};
};
finish
=
function
(
buffer
)
{
finish
=
function
(
buffer
)
{
var
action
,
name
,
opt1
,
opt2
,
opt3
,
options
;
var
action
,
opt1
,
opt2
,
opt3
,
options
;
action
=
buffer
.
readUInt8
(
1
)
>>
4
;
action
=
buffer
.
readUInt8
(
1
)
>>
4
;
if
(
buffer
!==
decrypted_buffer
&&
(
action
===
1
||
action
===
2
||
action
===
4
))
{
if
(
buffer
!==
decrypted_buffer
&&
(
action
===
1
||
action
===
2
||
action
===
4
))
{
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Unauthorized)
'
,
11
);
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Unauthorized)
'
,
11
);
...
...
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