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
94c494dc
Commit
94c494dc
authored
Aug 11, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update add ai command
parent
eed13f3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
ygopro-server.coffee
ygopro-server.coffee
+11
-3
ygopro-server.js
ygopro-server.js
+15
-4
No files found.
ygopro-server.coffee
View file @
94c494dc
...
...
@@ -1294,12 +1294,13 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
msg
=
_
.
trim
(
info
.
msg
)
cancel
=
_
.
startsWith
(
msg
,
"/"
)
room
.
last_active_time
=
moment
()
unless
cancel
or
not
room
.
random_type
switch
msg
cmd
=
msg
.
split
(
' '
)
switch
cmd
[
0
]
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
,
"/ai 添加一个AI"
)
if
settings
.
modules
.
enable_windbot
ygopro
.
stoc_send_chat
(
client
,
"/ai 添加一个AI
,/ai 角色名 可指定添加的角色
"
)
if
settings
.
modules
.
enable_windbot
ygopro
.
stoc_send_chat
(
client
,
"/tip 显示一条提示"
)
if
settings
.
modules
.
tips
when
'/tip'
...
...
@@ -1307,7 +1308,14 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when
'/ai'
if
settings
.
modules
.
enable_windbot
windbot
=
_
.
sample
settings
.
modules
.
windbots
if
name
=
cmd
[
1
]
windbot
=
_
.
sample
_
.
filter
settings
.
modules
.
windbots
,
(
w
)
->
w
.
name
==
name
or
w
.
deck
==
name
if
!
windbot
ygopro
.
stoc_send_chat
(
client
,
"未找到该AI角色或卡组"
,
ygopro
.
constants
.
COLORS
.
RED
)
return
else
windbot
=
_
.
sample
settings
.
modules
.
windbots
room
.
add_windbot
(
windbot
)
when
'/roomname'
...
...
ygopro-server.js
View file @
94c494dc
...
...
@@ -1594,7 +1594,7 @@
});
ygopro
.
ctos_follow
(
'
CHAT
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
var
cancel
,
msg
,
oldmsg
,
room
,
struct
,
windbot
;
var
cancel
,
cmd
,
msg
,
name
,
oldmsg
,
room
,
struct
,
windbot
;
room
=
ROOM_all
[
client
.
rid
];
if
(
!
room
)
{
return
;
...
...
@@ -1604,13 +1604,14 @@
if
(
!
(
cancel
||
!
room
.
random_type
))
{
room
.
last_active_time
=
moment
();
}
switch
(
msg
)
{
cmd
=
msg
.
split
(
'
'
);
switch
(
cmd
[
0
])
{
case
'
/help
'
:
ygopro
.
stoc_send_chat
(
client
,
"
YGOSrv233 指令帮助
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/help 显示这个帮助信息
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/roomname 显示当前房间的名字
"
);
if
(
settings
.
modules
.
enable_windbot
)
{
ygopro
.
stoc_send_chat
(
client
,
"
/ai 添加一个AI
"
);
ygopro
.
stoc_send_chat
(
client
,
"
/ai 添加一个AI
,/ai 角色名 可指定添加的角色
"
);
}
if
(
settings
.
modules
.
tips
)
{
ygopro
.
stoc_send_chat
(
client
,
"
/tip 显示一条提示
"
);
...
...
@@ -1623,7 +1624,17 @@
break
;
case
'
/ai
'
:
if
(
settings
.
modules
.
enable_windbot
)
{
windbot
=
_
.
sample
(
settings
.
modules
.
windbots
);
if
(
name
=
cmd
[
1
])
{
windbot
=
_
.
sample
(
_
.
filter
(
settings
.
modules
.
windbots
,
function
(
w
)
{
return
w
.
name
===
name
||
w
.
deck
===
name
;
}));
if
(
!
windbot
)
{
ygopro
.
stoc_send_chat
(
client
,
"
未找到该AI角色或卡组
"
,
ygopro
.
constants
.
COLORS
.
RED
);
return
;
}
}
else
{
windbot
=
_
.
sample
(
settings
.
modules
.
windbots
);
}
room
.
add_windbot
(
windbot
);
}
break
;
...
...
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