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
9d553918
Commit
9d553918
authored
Mar 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix & add ai log
parent
c78c65d7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
7 deletions
+25
-7
room.coffee
room.coffee
+8
-2
room.js
room.js
+8
-2
ygopro-server.coffee
ygopro-server.coffee
+3
-1
ygopro-server.js
ygopro-server.js
+6
-2
No files found.
room.coffee
View file @
9d553918
...
...
@@ -322,9 +322,9 @@ class Room
player
.
pre_establish_buffers
=
[]
return
return
console
.
log
@
windbot
if
@
windbot
spawn
'mono'
,
[
'WindBot.exe'
],
{
log
.
info
@
windbot
@
ai_process
=
spawn
'mono'
,
[
'WindBot.exe'
],
{
cwd
:
'windbot'
,
env
:
{
YGOPRO_VERSION
:
settings
.
version
YGOPRO_HOST
:
'127.0.0.1'
...
...
@@ -334,6 +334,12 @@ class Room
YGOPRO_DIALOG
:
@
windbot
.
dialog
}
}
@
ai_process
.
stdout
.
on
'data'
,
(
data
)
=>
log
.
info
"AI stdout: "
+
data
return
@
ai_process
.
stderr
.
on
'data'
,
(
data
)
=>
log
.
info
"AI stderr: "
+
data
return
return
catch
@
error
=
"建立房间失败,请重试"
...
...
room.js
View file @
9d553918
...
...
@@ -420,9 +420,9 @@
player
.
pre_establish_buffers
=
[];
});
});
console
.
log
(
_this
.
windbot
);
if
(
_this
.
windbot
)
{
spawn
(
'
mono
'
,
[
'
WindBot.exe
'
],
{
log
.
info
(
_this
.
windbot
);
_this
.
ai_process
=
spawn
(
'
mono
'
,
[
'
WindBot.exe
'
],
{
cwd
:
'
windbot
'
,
env
:
{
YGOPRO_VERSION
:
settings
.
version
,
...
...
@@ -433,6 +433,12 @@
YGOPRO_DIALOG
:
_this
.
windbot
.
dialog
}
});
_this
.
ai_process
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
log
.
info
(
"
AI stdout:
"
+
data
);
});
_this
.
ai_process
.
stderr
.
on
(
'
data
'
,
function
(
data
)
{
log
.
info
(
"
AI stderr:
"
+
data
);
});
}
};
})(
this
));
...
...
ygopro-server.coffee
View file @
9d553918
...
...
@@ -31,6 +31,8 @@ settings.BANNED_IP = []
settings
.
modules
.
hang_timeout
=
90
settings
.
version
=
parseInt
(
fs
.
readFileSync
(
'ygopro/gframe/game.cpp'
,
'utf8'
).
match
(
/PRO_VERSION = ([x\d]+)/
)[
1
],
'16'
)
settings
.
lflist
=
(
for
list
in
fs
.
readFileSync
(
'ygopro/lflist.conf'
,
'utf8'
).
match
(
/!.*/g
)
date
=
list
.
match
(
/!([\d\.]+)/
)
continue
unless
date
{
date
:
moment
(
list
.
match
(
/!([\d\.]+)/
)[
1
],
'YYYY.MM.DD'
),
tcg
:
list
.
indexOf
(
'TCG'
)
!=
-
1
})
#组件
...
...
@@ -339,7 +341,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
else
windbot
=
_
.
sample
settings
.
modules
.
windbot
room
=
Room
.
find_or_create_by_name
(
'AI#'
+
Math
.
random
().
toString
(
))
# 这个 AI# 没有特殊作用, 仅作为标记
room
=
Room
.
find_or_create_by_name
(
'AI#'
+
Math
.
floor
(
Math
.
random
()
*
100000
))
# 这个 AI# 没有特殊作用, 仅作为标记
room
.
windbot
=
windbot
room
.
private
=
true
client
.
room
=
room
...
...
ygopro-server.js
View file @
9d553918
// Generated by CoffeeScript 1.10.0
(
function
()
{
var
Graveyard
,
Room
,
_
,
bunyan
,
crypto
,
debug
,
dialogues
,
execFile
,
fs
,
http
,
http_server
,
https
,
https_server
,
list
,
log
,
moment
,
net
,
options
,
os
,
path
,
pg
,
request
,
requestListener
,
roomlist
,
settings
,
tips
,
tribute
,
url
,
users_cache
,
wait_room_start
,
ygopro
;
var
Graveyard
,
Room
,
_
,
bunyan
,
crypto
,
d
ate
,
d
ebug
,
dialogues
,
execFile
,
fs
,
http
,
http_server
,
https
,
https_server
,
list
,
log
,
moment
,
net
,
options
,
os
,
path
,
pg
,
request
,
requestListener
,
roomlist
,
settings
,
tips
,
tribute
,
url
,
users_cache
,
wait_room_start
,
ygopro
;
net
=
require
(
'
net
'
);
...
...
@@ -46,6 +46,10 @@
results
=
[];
for
(
k
=
0
,
len
=
ref
.
length
;
k
<
len
;
k
++
)
{
list
=
ref
[
k
];
date
=
list
.
match
(
/!
([\d\.]
+
)
/
);
if
(
!
date
)
{
continue
;
}
results
.
push
({
date
:
moment
(
list
.
match
(
/!
([\d\.]
+
)
/
)[
1
],
'
YYYY.MM.DD
'
),
tcg
:
list
.
indexOf
(
'
TCG
'
)
!==
-
1
...
...
@@ -382,7 +386,7 @@
}
else
{
windbot
=
_
.
sample
(
settings
.
modules
.
windbot
);
}
room
=
Room
.
find_or_create_by_name
(
'
AI#
'
+
Math
.
random
().
toString
(
));
room
=
Room
.
find_or_create_by_name
(
'
AI#
'
+
Math
.
floor
(
Math
.
random
()
*
100000
));
room
.
windbot
=
windbot
;
room
[
"
private
"
]
=
true
;
client
.
room
=
room
;
...
...
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