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
94e878a7
Commit
94e878a7
authored
Jan 22, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update deck check and fix death cancel
parent
8de92df4
Pipeline
#2180
passed with stages
in 7 minutes and 15 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
78 deletions
+81
-78
ygopro-server.coffee
ygopro-server.coffee
+36
-35
ygopro-server.js
ygopro-server.js
+45
-43
No files found.
ygopro-server.coffee
View file @
94e878a7
...
...
@@ -3320,18 +3320,19 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
ygopro
.
stoc_send_chat
(
client
,
"${deck_incorrect_reconnect}"
,
ygopro
.
constants
.
COLORS
.
RED
)
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
room
.
hostinfo
.
mode
==
1
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
and
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
decks
=
await
fs
.
promises
.
readdir
(
settings
.
modules
.
tournament_mode
.
deck_path
)
if
decks
.
length
struct
.
set
(
"mainc"
,
1
)
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
buffer
=
struct
.
buffer
found_deck
=
false
decks
=
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
)
for
deck
in
decks
if
deck_name_match
(
deck
,
client
.
name
)
found_deck
=
deck
if
found_deck
deck_text
=
fs
.
readFileSync
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,{
encoding
:
"ASCII"
})
deck_text
=
await
fs
.
promises
.
readFile
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,{
encoding
:
"ASCII"
})
deck_array
=
deck_text
.
split
(
"
\n
"
)
deck_main
=
[]
deck_side
=
[]
...
...
@@ -3908,7 +3909,7 @@ if true
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
return
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
))
done
()
return
...
...
ygopro-server.js
View file @
94e878a7
...
...
@@ -783,7 +783,7 @@
var
memoryInfo
,
percentUsed
;
memoryInfo
=
(
await
osu
.
mem
.
info
());
percentUsed
=
100
-
memoryInfo
.
freeMemPercentage
;
console
.
log
(
percentUsed
);
// console.log(percentUsed)
memory_usage
=
global
.
memory_usage
=
percentUsed
;
};
...
...
@@ -4421,13 +4421,14 @@
struct
.
set
(
"
deckbuf
"
,
[
4392470
,
4392470
]);
ygopro
.
stoc_send_chat
(
client
,
"
${deck_incorrect_reconnect}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
}
}
else
if
(
room
.
duel_stage
===
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
&&
room
.
hostinfo
.
mode
===
1
&&
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
&&
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
)
{
decks
=
(
await
fs
.
promises
.
readdir
(
settings
.
modules
.
tournament_mode
.
deck_path
));
if
(
decks
.
length
)
{
struct
.
set
(
"
mainc
"
,
1
);
struct
.
set
(
"
sidec
"
,
1
);
struct
.
set
(
"
deckbuf
"
,
[
4392470
,
4392470
]);
buffer
=
struct
.
buffer
;
found_deck
=
false
;
decks
=
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
);
for
(
j
=
0
,
len
=
decks
.
length
;
j
<
len
;
j
++
)
{
deck
=
decks
[
j
];
if
(
deck_name_match
(
deck
,
client
.
name
))
{
...
...
@@ -4435,9 +4436,9 @@
}
}
if
(
found_deck
)
{
deck_text
=
fs
.
readFileSync
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,
{
deck_text
=
(
await
fs
.
promises
.
readFile
(
settings
.
modules
.
tournament_mode
.
deck_path
+
found_deck
,
{
encoding
:
"
ASCII
"
}
);
})
);
deck_array
=
deck_text
.
split
(
"
\n
"
);
deck_main
=
[];
deck_side
=
[];
...
...
@@ -4469,6 +4470,7 @@
ygopro
.
stoc_send_chat
(
client
,
`
${
client
.
name
}
\${deck_not_found}`
,
ygopro
.
constants
.
COLORS
.
RED
);
}
}
}
return
false
;
});
...
...
@@ -5182,7 +5184,7 @@
return
;
}
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
)))
{
done
();
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