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
26a869f2
Commit
26a869f2
authored
Jan 22, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mc'
parents
ba6ff9a8
94e878a7
Pipeline
#2179
passed with stages
in 6 minutes and 35 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
77 deletions
+80
-77
ygopro-server.coffee
ygopro-server.coffee
+36
-35
ygopro-server.js
ygopro-server.js
+44
-42
No files found.
ygopro-server.coffee
View file @
26a869f2
...
@@ -3557,41 +3557,42 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3557,41 +3557,42 @@ 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
and
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
struct
.
set
(
"mainc"
,
1
)
decks
=
await
fs
.
promises
.
readdir
(
settings
.
modules
.
tournament_mode
.
deck_path
)
struct
.
set
(
"sidec"
,
1
)
if
decks
.
length
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
struct
.
set
(
"mainc"
,
1
)
buffer
=
struct
.
buffer
struct
.
set
(
"sidec"
,
1
)
found_deck
=
false
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
decks
=
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
)
buffer
=
struct
.
buffer
for
deck
in
decks
found_deck
=
false
if
deck_name_match
(
deck
,
client
.
name
)
for
deck
in
decks
found_deck
=
deck
if
deck_name_match
(
deck
,
client
.
name
)
if
found_deck
found_deck
=
deck
deck_text
=
fs
.
readFileSync
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,{
encoding
:
"ASCII"
})
if
found_deck
deck_array
=
deck_text
.
split
(
"
\n
"
)
deck_text
=
await
fs
.
promises
.
readFile
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,{
encoding
:
"ASCII"
})
deck_main
=
[]
deck_array
=
deck_text
.
split
(
"
\n
"
)
deck_side
=
[]
deck_main
=
[]
current_deck
=
deck_main
deck_side
=
[]
for
line
in
deck_array
current_deck
=
deck_main
if
line
.
indexOf
(
"!side"
)
>=
0
for
line
in
deck_array
current_deck
=
deck_side
if
line
.
indexOf
(
"!side"
)
>=
0
card
=
parseInt
(
line
)
current_deck
=
deck_side
current_deck
.
push
(
card
)
unless
isNaN
(
card
)
card
=
parseInt
(
line
)
if
_
.
isEqual
(
buff_main
,
deck_main
)
and
_
.
isEqual
(
buff_side
,
deck_side
)
current_deck
.
push
(
card
)
unless
isNaN
(
card
)
deckbuf
=
deck_main
.
concat
(
deck_side
)
if
_
.
isEqual
(
buff_main
,
deck_main
)
and
_
.
isEqual
(
buff_side
,
deck_side
)
struct
.
set
(
"mainc"
,
deck_main
.
length
)
deckbuf
=
deck_main
.
concat
(
deck_side
)
struct
.
set
(
"sidec"
,
deck_side
.
length
)
struct
.
set
(
"mainc"
,
deck_main
.
length
)
struct
.
set
(
"deckbuf"
,
deckbuf
)
struct
.
set
(
"sidec"
,
deck_side
.
length
)
buffer
=
struct
.
buffer
struct
.
set
(
"deckbuf"
,
deckbuf
)
#log.info("deck ok: " + client.name)
buffer
=
struct
.
buffer
ygopro
.
stoc_send_chat
(
client
,
"${deck_correct_part1}
#{
found_deck
}
${deck_correct_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
#log.info("deck ok: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
"${deck_correct_part1}
#{
found_deck
}
${deck_correct_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
#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
)
else
else
#log.info("bad deck: " + client.name + " / " + buff_main + " / " + buff_side)
#log.info("player deck not found: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_part1}
#{
found_deck
}
${deck_incorrect_part2}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send_chat
(
client
,
"
#{
client
.
name
}
${deck_not_found}"
,
ygopro
.
constants
.
COLORS
.
RED
)
else
#log.info("player deck not found: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
"
#{
client
.
name
}
${deck_not_found}"
,
ygopro
.
constants
.
COLORS
.
RED
)
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
)
->
...
@@ -4157,7 +4158,7 @@ if true
...
@@ -4157,7 +4158,7 @@ if true
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
return
return
death_room_found
=
false
death_room_found
=
false
_async
.
each
(
rooms
,
(
room
,
done
)
->
_async
.
each
(
ROOM_all
,
(
room
,
done
)
->
if
!
(
room
and
(
u
.
query
.
deathcancel
==
"all"
or
u
.
query
.
deathcancel
==
room
.
process_pid
.
toString
()
or
u
.
query
.
deathcancel
==
room
.
name
))
if
!
(
room
and
(
u
.
query
.
deathcancel
==
"all"
or
u
.
query
.
deathcancel
==
room
.
process_pid
.
toString
()
or
u
.
query
.
deathcancel
==
room
.
name
))
done
()
done
()
return
return
...
...
ygopro-server.js
View file @
26a869f2
...
@@ -4762,52 +4762,54 @@
...
@@ -4762,52 +4762,54 @@
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
&&
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
deck_check
&&
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
)
{
}
else
if
(
room
.
duel_stage
===
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
&&
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
deck_check
)
{
struct
.
set
(
"
mainc
"
,
1
);
decks
=
(
await
fs
.
promises
.
readdir
(
settings
.
modules
.
tournament_mode
.
deck_path
));
struct
.
set
(
"
sidec
"
,
1
);
if
(
decks
.
length
)
{
struct
.
set
(
"
deckbuf
"
,
[
4392470
,
4392470
]);
struct
.
set
(
"
mainc
"
,
1
);
buffer
=
struct
.
buffer
;
struct
.
set
(
"
sidec
"
,
1
);
found_deck
=
false
;
struct
.
set
(
"
deckbuf
"
,
[
4392470
,
4392470
]);
decks
=
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
);
buffer
=
struct
.
buffer
;
for
(
j
=
0
,
len
=
decks
.
length
;
j
<
len
;
j
++
)
{
found_deck
=
false
;
deck
=
decks
[
j
];
for
(
j
=
0
,
len
=
decks
.
length
;
j
<
len
;
j
++
)
{
if
(
deck_name_match
(
deck
,
client
.
name
))
{
deck
=
decks
[
j
];
found_deck
=
deck
;
if
(
deck_name_match
(
deck
,
client
.
name
))
{
found_deck
=
deck
;
}
}
}
}
if
(
found_deck
)
{
if
(
found_deck
)
{
deck_text
=
(
await
fs
.
promises
.
readFile
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,
{
deck_text
=
fs
.
readFileSync
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,
{
encoding
:
"
ASCII
"
encoding
:
"
ASCII
"
}));
});
deck_array
=
deck_text
.
split
(
"
\n
"
);
deck_array
=
deck_text
.
split
(
"
\n
"
);
deck_main
=
[];
deck_main
=
[];
deck_side
=
[];
deck_side
=
[];
current_deck
=
deck_main
;
current_deck
=
deck_main
;
for
(
l
=
0
,
len1
=
deck_array
.
length
;
l
<
len1
;
l
++
)
{
for
(
l
=
0
,
len1
=
deck_array
.
length
;
l
<
len1
;
l
++
)
{
line
=
deck_array
[
l
];
line
=
deck_array
[
l
];
if
(
line
.
indexOf
(
"
!side
"
)
>=
0
)
{
if
(
line
.
indexOf
(
"
!side
"
)
>=
0
)
{
current_deck
=
deck_side
;
current_deck
=
deck_side
;
}
card
=
parseInt
(
line
);
if
(
!
isNaN
(
card
))
{
current_deck
.
push
(
card
);
}
}
}
card
=
parseInt
(
line
);
if
(
_
.
isEqual
(
buff_main
,
deck_main
)
&&
_
.
isEqual
(
buff_side
,
deck_side
))
{
if
(
!
isNaN
(
card
))
{
deckbuf
=
deck_main
.
concat
(
deck_side
);
current_deck
.
push
(
card
);
struct
.
set
(
"
mainc
"
,
deck_main
.
length
);
struct
.
set
(
"
sidec
"
,
deck_side
.
length
);
struct
.
set
(
"
deckbuf
"
,
deckbuf
);
buffer
=
struct
.
buffer
;
//log.info("deck ok: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
`\${deck_correct_part1}
${
found_deck
}
\${deck_correct_part2}`
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
//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
);
}
}
}
if
(
_
.
isEqual
(
buff_main
,
deck_main
)
&&
_
.
isEqual
(
buff_side
,
deck_side
))
{
deckbuf
=
deck_main
.
concat
(
deck_side
);
struct
.
set
(
"
mainc
"
,
deck_main
.
length
);
struct
.
set
(
"
sidec
"
,
deck_side
.
length
);
struct
.
set
(
"
deckbuf
"
,
deckbuf
);
buffer
=
struct
.
buffer
;
//log.info("deck ok: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
`\${deck_correct_part1}
${
found_deck
}
\${deck_correct_part2}`
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
}
else
{
//log.info("
bad deck: " + client.name + " / " + buff_main + " / " + buff_sid
e)
//log.info("
player deck not found: " + client.nam
e)
ygopro
.
stoc_send_chat
(
client
,
`
\${deck_incorrect_part1}
${
found_deck
}
\${deck_incorrect_part2
}`
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send_chat
(
client
,
`
${
client
.
name
}
\${deck_not_found
}`
,
ygopro
.
constants
.
COLORS
.
RED
);
}
}
}
else
{
//log.info("player deck not found: " + client.name)
ygopro
.
stoc_send_chat
(
client
,
`
${
client
.
name
}
\${deck_not_found}`
,
ygopro
.
constants
.
COLORS
.
RED
);
}
}
}
}
return
false
;
return
false
;
...
@@ -5536,7 +5538,7 @@
...
@@ -5536,7 +5538,7 @@
return
;
return
;
}
}
death_room_found
=
false
;
death_room_found
=
false
;
_async
.
each
(
rooms
,
function
(
room
,
done
)
{
_async
.
each
(
ROOM_all
,
function
(
room
,
done
)
{
if
(
!
(
room
&&
(
u
.
query
.
deathcancel
===
"
all
"
||
u
.
query
.
deathcancel
===
room
.
process_pid
.
toString
()
||
u
.
query
.
deathcancel
===
room
.
name
)))
{
if
(
!
(
room
&&
(
u
.
query
.
deathcancel
===
"
all
"
||
u
.
query
.
deathcancel
===
room
.
process_pid
.
toString
()
||
u
.
query
.
deathcancel
===
room
.
name
)))
{
done
();
done
();
return
;
return
;
...
...
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