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
dc6a46d7
Commit
dc6a46d7
authored
Oct 26, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
764f7055
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
+4
-3
ygopro-server.js
ygopro-server.js
+6
-3
No files found.
ygopro-server.coffee
View file @
dc6a46d7
...
...
@@ -260,6 +260,7 @@ ROOM_find_or_create_ai = (name)->
return
{
"error"
:
"AI房间名过长,请在建立房间后输入 /ai 来添加AI"
}
result
=
new
Room
(
name
)
result
.
windbot
=
windbot
result
.
private
=
true
return
result
ROOM_find_by_name
=
(
name
)
->
...
...
@@ -524,7 +525,7 @@ class Room
url
:
"http://127.0.0.1:
#{
settings
.
modules
.
windbot_port
}
/?name=
#{
encodeURIComponent
(
botdata
.
name
)
}
&deck=
#{
encodeURIComponent
(
botdata
.
deck
)
}
&host=127.0.0.1&port=
#{
settings
.
port
}
&dialog=
#{
encodeURIComponent
(
botdata
.
dialog
)
}
&version=
#{
settings
.
version
}
&password=
#{
encodeURIComponent
(
@
name
)
}
"
,
(
error
,
response
,
body
)
=>
if
error
log
.
warn
'windbot add error'
,
error
,
this
.
name
,
response
log
.
warn
'windbot add error'
,
error
,
this
.
name
ygopro
.
stoc_send_chat_to_room
(
this
,
"添加AI失败,可尝试输入 /ai 重新添加"
,
ygopro
.
constants
.
COLORS
.
RED
)
#else
#log.info "windbot added"
...
...
@@ -888,7 +889,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
else
if
!
info
.
pass
.
length
and
!
settings
.
modules
.
enable_random_duel
and
!
settings
.
modules
.
enable_windbot
ygopro
.
stoc_die
(
client
,
"房间名不能为空,请在主机密码处填写房间名"
)
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard_auth
and
info
.
pass
[
0
...
2
]
!=
'AI
'
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard_auth
and
info
.
pass
[
0
...
3
]
!=
'AI_'
and
info
.
pass
[
0
...
3
]
!=
'AI#
'
ygopro
.
stoc_send_chat
(
client
,
'正在读取用户信息...'
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
info
.
pass
.
length
<=
8
ygopro
.
stoc_die
(
client
,
'主机密码不正确 (Invalid Length)'
)
...
...
@@ -1370,7 +1371,7 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when
'/help'
ygopro
.
stoc_send_chat
(
client
,
"YGOSrv233 指令帮助"
)
ygopro
.
stoc_send_chat
(
client
,
"/help 显示这个帮助信息"
)
ygopro
.
stoc_send_chat
(
client
,
"/roomname 显示当前房间的名字"
)
ygopro
.
stoc_send_chat
(
client
,
"/roomname 显示当前房间的名字"
)
if
!
settings
.
modules
.
mycard_auth
ygopro
.
stoc_send_chat
(
client
,
"/ai 添加一个AI,/ai 角色名 可指定添加的角色"
)
if
settings
.
modules
.
enable_windbot
ygopro
.
stoc_send_chat
(
client
,
"/tip 显示一条提示"
)
if
settings
.
modules
.
tips
...
...
ygopro-server.js
View file @
dc6a46d7
...
...
@@ -359,6 +359,7 @@
}
result
=
new
Room
(
name
);
result
.
windbot
=
windbot
;
result
[
"
private
"
]
=
true
;
return
result
;
};
...
...
@@ -701,7 +702,7 @@
},
(
function
(
_this
)
{
return
function
(
error
,
response
,
body
)
{
if
(
error
)
{
log
.
warn
(
'
windbot add error
'
,
error
,
_this
.
name
,
response
);
log
.
warn
(
'
windbot add error
'
,
error
,
_this
.
name
);
ygopro
.
stoc_send_chat_to_room
(
_this
,
"
添加AI失败,可尝试输入 /ai 重新添加
"
,
ygopro
.
constants
.
COLORS
.
RED
);
}
};
...
...
@@ -1102,7 +1103,7 @@
client
.
destroy
();
}
else
if
(
!
info
.
pass
.
length
&&
!
settings
.
modules
.
enable_random_duel
&&
!
settings
.
modules
.
enable_windbot
)
{
ygopro
.
stoc_die
(
client
,
"
房间名不能为空,请在主机密码处填写房间名
"
);
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard_auth
&&
info
.
pass
.
slice
(
0
,
2
)
!==
'
AI
'
)
{
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard_auth
&&
info
.
pass
.
slice
(
0
,
3
)
!==
'
AI_
'
&&
info
.
pass
.
slice
(
0
,
3
)
!==
'
AI#
'
)
{
ygopro
.
stoc_send_chat
(
client
,
'
正在读取用户信息...
'
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
if
(
info
.
pass
.
length
<=
8
)
{
ygopro
.
stoc_die
(
client
,
'
主机密码不正确 (Invalid Length)
'
);
...
...
@@ -1689,7 +1690,9 @@
case
'
/help
'
:
ygopro
.
stoc_send_chat
(
client
,
"
YGOSrv233 指令帮助
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/help 显示这个帮助信息
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/roomname 显示当前房间的名字
"
);
if
(
!
settings
.
modules
.
mycard_auth
)
{
ygopro
.
stoc_send_chat
(
client
,
"
/roomname 显示当前房间的名字
"
);
}
if
(
settings
.
modules
.
enable_windbot
)
{
ygopro
.
stoc_send_chat
(
client
,
"
/ai 添加一个AI,/ai 角色名 可指定添加的角色
"
);
}
...
...
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