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
761025c8
Commit
761025c8
authored
Mar 14, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test ai-play
parent
21176934
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
data/i18n.json
data/i18n.json
+4
-0
ygopro-server.coffee
ygopro-server.coffee
+45
-2
No files found.
data/i18n.json
View file @
761025c8
...
@@ -202,6 +202,8 @@
...
@@ -202,6 +202,8 @@
"auto_death_part2"
:
" minutes."
,
"auto_death_part2"
:
" minutes."
,
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
,
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
,
"windbot_disable_random_room"
:
"By adding the AI, this random game won't get any new player unless they enter the room name:"
,
"windbot_disable_random_room"
:
"By adding the AI, this random game won't get any new player unless they enter the room name:"
,
"stand_bot_added"
:
"Deck confirmed. Adding bot."
,
"stand_bot_removed"
:
"Deck resetted."
,
"using_athletic_deck"
:
" is using a competitive deck."
"using_athletic_deck"
:
" is using a competitive deck."
},
},
"es-es"
:
{
"es-es"
:
{
...
@@ -553,6 +555,8 @@
...
@@ -553,6 +555,8 @@
"auto_death_part2"
:
"分钟后,将自动进入加时赛。"
,
"auto_death_part2"
:
"分钟后,将自动进入加时赛。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
,
"windbot_disable_random_room"
:
"因为添加了AI,本随机对战房间将只能通过房间名加入:"
,
"windbot_disable_random_room"
:
"因为添加了AI,本随机对战房间将只能通过房间名加入:"
,
"stand_bot_added"
:
"已确认卡组。将添加AI参与决斗。"
,
"stand_bot_removed"
:
"已重置卡组。"
,
"using_athletic_deck"
:
" 正在使用竞技卡组。"
"using_athletic_deck"
:
" 正在使用竞技卡组。"
},
},
"ko-kr"
:
{
"ko-kr"
:
{
...
...
ygopro-server.coffee
View file @
761025c8
...
@@ -80,7 +80,9 @@ import_datas = global.import_datas = [
...
@@ -80,7 +80,9 @@ import_datas = global.import_datas = [
"join_time"
,
"join_time"
,
"arena_quit_free"
,
"arena_quit_free"
,
"replays_sent"
,
"replays_sent"
,
"victory_words"
"victory_words"
,
"deck_good"
,
"bot_bound"
]
]
merge
=
require
'deepmerge'
merge
=
require
'deepmerge'
...
@@ -1648,6 +1650,18 @@ class Room
...
@@ -1648,6 +1650,18 @@ class Room
return
return
return
return
add_windbot_stand
:
(
name
,
deckContent
)
->
request
url
:
"http://
#{
settings
.
modules
.
windbot
.
server_ip
}
:
#{
settings
.
modules
.
windbot
.
port
}
/?name=
#{
encodeURIComponent
(
name
)
}
&deck=Test&host=
#{
settings
.
modules
.
windbot
.
my_ip
}
&port=
#{
settings
.
port
}
&version=
#{
settings
.
version
}
&password=
#{
encodeURIComponent
(
@
name
)
}
&chat=false&deckcode=
#{
encodeURIComponent
(
deckContent
.
toString
(
'base64'
))
}
"
,
(
error
,
response
,
body
)
=>
if
error
log
.
warn
'windbot add error'
,
error
,
this
.
name
ygopro
.
stoc_send_chat_to_room
(
this
,
"${add_windbot_failed}"
,
ygopro
.
constants
.
COLORS
.
RED
)
#else
#log.info "windbot added"
return
return
connect
:
(
client
)
->
connect
:
(
client
)
->
@
players
.
push
client
@
players
.
push
client
client
.
join_time
=
moment
()
client
.
join_time
=
moment
()
...
@@ -2941,6 +2955,19 @@ ygopro.ctos_follow 'HS_TOOBSERVER', true, (buffer, info, client, server, datas)-
...
@@ -2941,6 +2955,19 @@ ygopro.ctos_follow 'HS_TOOBSERVER', true, (buffer, info, client, server, datas)-
return
true
return
true
await
return
false
await
return
false
ygopro
.
ctos_follow
'HS_TODUELIST'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
!
client
.
is_local
and
client
.
bot_bound
ygopro
.
stoc_send_chat
(
client
,
"${stand_bot_removed}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
client
.
bot_bound
=
false
stand_bots
=
room
.
get_playing_player
().
filter
((
player
)
->
return
player
.
is_local
and
player
.
name_vpass
==
client
.
name_vpass
)
for
player
in
stand_bots
CLIENT_kick
(
player
)
await
return
false
ygopro
.
ctos_follow
'HS_KICK'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
ygopro
.
ctos_follow
'HS_KICK'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
room
=
ROOM_all
[
client
.
rid
]
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
return
unless
room
...
@@ -3492,6 +3519,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
...
@@ -3492,6 +3519,9 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server, datas)->
return
true
return
true
await
return
cancel
await
return
cancel
ygopro
.
ctos_follow
'HS_READY'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
await
return
client
.
deck_good
and
!
client
.
is_local
ygopro
.
ctos_follow
'UPDATE_DECK'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
ygopro
.
ctos_follow
'UPDATE_DECK'
,
true
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
pre_reconnecting
if
settings
.
modules
.
reconnect
.
enabled
and
client
.
pre_reconnecting
if
!
CLIENT_is_able_to_reconnect
(
client
)
and
!
CLIENT_is_able_to_kick_reconnect
(
client
)
if
!
CLIENT_is_able_to_reconnect
(
client
)
and
!
CLIENT_is_able_to_kick_reconnect
(
client
)
...
@@ -3541,6 +3571,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3541,6 +3571,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
if
client
.
pos
==
0
if
client
.
pos
==
0
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
last_active_time
=
moment
()
room
.
last_active_time
=
moment
()
client
.
deck_good
=
true
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
room
.
recovering
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
room
.
recovering
recover_player_data
=
_
.
find
(
room
.
recover_duel_log
.
players
,
(
player
)
->
recover_player_data
=
_
.
find
(
room
.
recover_duel_log
.
players
,
(
player
)
->
return
player
.
realName
==
client
.
name_vpass
and
buffer
.
compare
(
Buffer
.
from
(
player
.
startDeckBuffer
,
"base64"
))
==
0
return
player
.
realName
==
client
.
name_vpass
and
buffer
.
compare
(
Buffer
.
from
(
player
.
startDeckBuffer
,
"base64"
))
==
0
...
@@ -3557,7 +3588,8 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3557,7 +3588,8 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_reconnect}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_reconnect}"
,
ygopro
.
constants
.
COLORS
.
RED
)
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
client
.
deck_good
=
false
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
and
!
client
.
is_local
decks
=
await
fs
.
promises
.
readdir
(
settings
.
modules
.
tournament_mode
.
deck_path
)
decks
=
await
fs
.
promises
.
readdir
(
settings
.
modules
.
tournament_mode
.
deck_path
)
if
decks
.
length
if
decks
.
length
struct
.
set
(
"mainc"
,
1
)
struct
.
set
(
"mainc"
,
1
)
...
@@ -3590,9 +3622,20 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3590,9 +3622,20 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
else
else
#log.info("bad deck: " + client.name + " / " + buff_main + " / " + buff_side)
#log.info("bad deck: " + client.name + " / " + buff_main + " / " + buff_side)
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_part1}
#{
found_deck
}
${deck_incorrect_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_part1}
#{
found_deck
}
${deck_incorrect_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
client
.
deck_good
=
false
else
else
#log.info("player deck not found: " + client.name)
#log.info("player deck not found: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
"
#{
client
.
name
}
${deck_not_found}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"
#{
client
.
name
}
${deck_not_found}"
,
ygopro
.
constants
.
COLORS
.
RED
)
client
.
deck_good
=
false
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
deck_good
and
!
client
.
is_local
and
!
client
.
bot_bound
client
.
bot_bound
=
true
ygopro
.
stoc_send_chat
(
client
,
"${stand_bot_added}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send
(
client
,
'HS_PLAYER_CHANGE'
,
{
status
:
(
client
.
pos
<<
4
)
|
0xa
})
ygopro
.
ctos_send
(
server
,
'HS_TOOBSERVER'
)
room
.
add_windbot_stand
(
client
.
name_vpass
,
buffer
)
return
true
await
return
false
await
return
false
ygopro
.
ctos_follow
'RESPONSE'
,
false
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
ygopro
.
ctos_follow
'RESPONSE'
,
false
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
...
...
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