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
Hide 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
...
@@ -20,7 +20,9 @@ RUN strip ygopro
RUN
mv
/usr/src/app/windbot /usr/src/app/windbot-source
RUN
mv
/usr/src/app/windbot /usr/src/app/windbot-source
WORKDIR
/usr/src/app/windbot-source
WORKDIR
/usr/src/app/windbot-source
RUN
xbuild /property:Configuration
=
Release /property:OutDir
=
/usr/src/app/windbot/
RUN
xbuild /property:Configuration
=
Release /property:OutDir
=
/usr/src/app/windbot/
WORKDIR
/usr/src/app
RUN
rm
-rf
/usr/src/app/windbot-source
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
WORKDIR
/usr/src/app
CMD
[ "npm", "start" ]
CMD
[ "npm", "start" ]
config.json
View file @
bfd5f993
{
{
"port"
:
7911
,
"port"
:
7911
,
"ygopro_path"
:
"ygopro"
,
"ygopro_path"
:
"ygopro"
,
"modules"
:
{
"modules"
:
{
"welcome"
:
"YGOPRO Server"
,
"welcome"
:
"YGOPRO Server"
,
"update"
:
"请更新游戏版本"
,
"update"
:
"请更新游戏版本"
,
"stop"
:
false
,
"stop"
:
false
,
"tips"
:
"http://mycard.moe/ygopro/tips.json"
,
"tips"
:
"http://mycard.moe/ygopro/tips.json"
,
"dialogues"
:
"http://mycard.moe/ygopro/dialogues.json"
,
"dialogues"
:
"http://mycard.moe/ygopro/dialogues.json"
,
"redis_port"
:
6379
,
"redis_port"
:
6379
,
"enable_websocket_roomlist"
:
true
,
"enable_websocket_roomlist"
:
true
,
"enable_random_duel"
:
false
,
"enable_random_duel"
:
false
,
"mycard_auth"
:
"https://ygobbs.com"
,
"mycard_auth"
:
"https://ygobbs.com"
,
"post_start_watching"
:
true
,
"post_start_watching"
:
true
,
"TCG_banlist_id"
:
8
,
"TCG_banlist_id"
:
8
,
"enable_TCG_as_default"
:
false
,
"enable_TCG_as_default"
:
false
,
"http"
:
{
"http"
:
{
"port"
:
7922
,
"port"
:
7922
,
"password"
:
"123456"
,
"password"
:
"123456"
,
"ssl"
:
{
"ssl"
:
{
"enabled"
:
true
,
"enabled"
:
true
,
"port"
:
7923
,
"port"
:
7923
,
"cert"
:
"ssl/ygopro-server.crt"
,
"cert"
:
"ssl/ygopro-server.crt"
,
"key"
:
"ssl/ygopro-server.key"
"key"
:
"ssl/ygopro-server.key"
}
}
}
},
}
"windbot"
:
[
{
"name"
:
"啪啪尼"
,
"deck"
:
"Dragunity"
}
]
}
}
}
room.coffee
View file @
bfd5f993
...
@@ -318,6 +318,15 @@ class Room
...
@@ -318,6 +318,15 @@ class Room
player
.
pre_establish_buffers
=
[]
player
.
pre_establish_buffers
=
[]
return
return
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
return
catch
catch
@
error
=
"建立房间失败,请重试"
@
error
=
"建立房间失败,请重试"
...
...
room.js
View file @
bfd5f993
...
@@ -412,6 +412,19 @@
...
@@ -412,6 +412,19 @@
player
.
pre_establish_buffers
=
[];
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
));
})(
this
));
}
catch
(
error1
)
{
}
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)->
...
@@ -320,7 +320,16 @@ 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'
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
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
)
...
@@ -737,6 +746,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
...
@@ -737,6 +746,8 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
for
player
in
client
.
room
.
players
when
player
.
pos
!=
7
for
player
in
client
.
room
.
players
when
player
.
pos
!=
7
client
.
room
.
dueling_players
[
player
.
pos
]
=
player
client
.
room
.
dueling_players
[
player
.
pos
]
=
player
client
.
room
.
player_datas
.
push
ip
:
player
.
remoteAddress
,
name
:
player
.
name
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
if
settings
.
modules
.
tips
ygopro
.
stoc_send_random_tip
(
client
)
ygopro
.
stoc_send_random_tip
(
client
)
return
return
...
...
ygopro-server.js
View file @
bfd5f993
...
@@ -350,7 +350,14 @@
...
@@ -350,7 +350,14 @@
code
:
2
code
:
2
});
});
client
.
end
();
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
)
{
}
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
);
...
@@ -380,7 +387,7 @@
...
@@ -380,7 +387,7 @@
return
(
checksum
&
0xFF
)
===
0
;
return
(
checksum
&
0xFF
)
===
0
;
};
};
finish
=
function
(
buffer
)
{
finish
=
function
(
buffer
)
{
var
action
,
name
,
opt1
,
opt2
,
opt3
,
options
,
room
;
var
action
,
name
,
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
);
...
@@ -853,6 +860,9 @@
...
@@ -853,6 +860,9 @@
ip
:
player
.
remoteAddress
,
ip
:
player
.
remoteAddress
,
name
:
player
.
name
name
:
player
.
name
});
});
if
(
client
.
room
.
windbot
)
{
client
.
room
.
dueling_players
[
1
-
player
.
pos
]
=
{};
}
}
}
}
}
if
(
settings
.
modules
.
tips
)
{
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