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
bfd5f993
Commit
bfd5f993
authored
Mar 23, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windbot
parent
8767710c
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
79 additions
and
28 deletions
+79
-28
Dockerfile
Dockerfile
+2
-0
config.json
config.json
+32
-26
room.coffee
room.coffee
+9
-0
room.js
room.js
+13
-0
windbot
windbot
+1
-1
ygopro-server.coffee
ygopro-server.coffee
+11
-0
ygopro-server.js
ygopro-server.js
+11
-1
No files found.
Dockerfile
View file @
bfd5f993
...
...
@@ -20,7 +20,9 @@ RUN strip ygopro
RUN
mv
/usr/src/app/windbot /usr/src/app/windbot-source
WORKDIR
/usr/src/app/windbot-source
RUN
xbuild /property:Configuration
=
Release /property:OutDir
=
/usr/src/app/windbot/
WORKDIR
/usr/src/app
RUN
rm
-rf
/usr/src/app/windbot-source
RUN
ln
-s
/usr/src/app/ygopro/cards.cdb /usr/src/app/windbot/cards.cdb
WORKDIR
/usr/src/app
CMD
[ "npm", "start" ]
config.json
View file @
bfd5f993
...
...
@@ -23,6 +23,12 @@
"cert"
:
"ssl/ygopro-server.crt"
,
"key"
:
"ssl/ygopro-server.key"
}
},
"windbot"
:
[
{
"name"
:
"啪啪尼"
,
"deck"
:
"Dragunity"
}
]
}
}
room.coffee
View file @
bfd5f993
...
...
@@ -318,6 +318,15 @@ class Room
player
.
pre_establish_buffers
=
[]
return
return
console
.
log
@
windbot
if
@
windbot
spawn
'mono'
,
[
'WindBot.exe'
],
{
cwd
:
'windbot'
,
env
:
{
YGOPRO_VERSION
:
settings
.
version
YGOPRO_HOST
:
'127.0.0.1'
YGOPRO_PORT
:
@
port
YGOPRO_NAME
:
@
windbot
.
name
YGOPRO_DECK
:
@
windbot
.
deck
}}
return
catch
@
error
=
"建立房间失败,请重试"
...
...
room.js
View file @
bfd5f993
...
...
@@ -412,6 +412,19 @@
player
.
pre_establish_buffers
=
[];
});
});
console
.
log
(
_this
.
windbot
);
if
(
_this
.
windbot
)
{
spawn
(
'
mono
'
,
[
'
WindBot.exe
'
],
{
cwd
:
'
windbot
'
,
env
:
{
YGOPRO_VERSION
:
settings
.
version
,
YGOPRO_HOST
:
'
127.0.0.1
'
,
YGOPRO_PORT
:
_this
.
port
,
YGOPRO_NAME
:
_this
.
windbot
.
name
,
YGOPRO_DECK
:
_this
.
windbot
.
deck
}
});
}
};
})(
this
));
}
catch
(
error1
)
{
...
...
windbot
@
5a7b6557
Subproject commit
2241def41d8259ce023e94cede8593c51925cc93
Subproject commit
5a7b65570c43bf8bfbc0434625be154ff3fabe4b
ygopro-server.coffee
View file @
bfd5f993
...
...
@@ -320,7 +320,16 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
}
client
.
end
()
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
room
.
private
=
true
client
.
room
=
room
client
.
room
.
connect
(
client
)
else
if
info
.
pass
.
length
and
settings
.
modules
.
mycard_auth
console
.
log
settings
.
modules
.
windbot
ygopro
.
stoc_send_chat
(
client
,
'正在读取用户信息...'
,
11
)
if
info
.
pass
.
length
<=
8
ygopro
.
stoc_send_chat
(
client
,
'主机密码不正确 (Invalid Length)'
,
11
)
...
...
@@ -737,6 +746,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
for
player
in
client
.
room
.
players
when
player
.
pos
!=
7
client
.
room
.
dueling_players
[
player
.
pos
]
=
player
client
.
room
.
player_datas
.
push
ip
:
player
.
remoteAddress
,
name
:
player
.
name
if
client
.
room
.
windbot
client
.
room
.
dueling_players
[
1
-
player
.
pos
]
=
{}
if
settings
.
modules
.
tips
ygopro
.
stoc_send_random_tip
(
client
)
return
...
...
ygopro-server.js
View file @
bfd5f993
...
...
@@ -350,7 +350,14 @@
code
:
2
});
client
.
end
();
}
else
if
(
settings
.
modules
.
windbot
&&
info
.
pass
.
slice
(
0
,
2
)
===
'
AI
'
)
{
room
=
Room
.
find_or_create_by_name
(
'
M#AI
'
+
Math
.
random
().
toString
());
room
.
windbot
=
_
.
sample
(
settings
.
modules
.
windbot
);
room
[
"
private
"
]
=
true
;
client
.
room
=
room
;
client
.
room
.
connect
(
client
);
}
else
if
(
info
.
pass
.
length
&&
settings
.
modules
.
mycard_auth
)
{
console
.
log
(
settings
.
modules
.
windbot
);
ygopro
.
stoc_send_chat
(
client
,
'
正在读取用户信息...
'
,
11
);
if
(
info
.
pass
.
length
<=
8
)
{
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Invalid Length)
'
,
11
);
...
...
@@ -380,7 +387,7 @@
return
(
checksum
&
0xFF
)
===
0
;
};
finish
=
function
(
buffer
)
{
var
action
,
name
,
opt1
,
opt2
,
opt3
,
options
,
room
;
var
action
,
name
,
opt1
,
opt2
,
opt3
,
options
;
action
=
buffer
.
readUInt8
(
1
)
>>
4
;
if
(
buffer
!==
decrypted_buffer
&&
(
action
===
1
||
action
===
2
||
action
===
4
))
{
ygopro
.
stoc_send_chat
(
client
,
'
主机密码不正确 (Unauthorized)
'
,
11
);
...
...
@@ -853,6 +860,9 @@
ip
:
player
.
remoteAddress
,
name
:
player
.
name
});
if
(
client
.
room
.
windbot
)
{
client
.
room
.
dueling_players
[
1
-
player
.
pos
]
=
{};
}
}
}
if
(
settings
.
modules
.
tips
)
{
...
...
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