Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-match
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
MyCard
ygopro-match
Commits
0b5522ac
Commit
0b5522ac
authored
Jan 01, 2026
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add allPools
parent
e84a98f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
main.js
main.js
+10
-9
No files found.
main.js
View file @
0b5522ac
...
@@ -62,6 +62,7 @@ class Pool {
...
@@ -62,6 +62,7 @@ class Pool {
let
playingPool
=
new
Pool
({
timeoutLogPrefix
:
"
With timeout, user is seen as had left the game:
"
,
timeoutMs
:
config
.
match
.
longestMatchTime
});
let
playingPool
=
new
Pool
({
timeoutLogPrefix
:
"
With timeout, user is seen as had left the game:
"
,
timeoutMs
:
config
.
match
.
longestMatchTime
});
let
pendingPool
=
new
Pool
({
timeoutLogPrefix
:
"
Pending room expired for user:
"
,
timeoutMs
:
600000
});
let
pendingPool
=
new
Pool
({
timeoutLogPrefix
:
"
Pending room expired for user:
"
,
timeoutMs
:
600000
});
const
allPools
=
[
playingPool
,
pendingPool
];
let
playerOpponents
=
new
Map
();
let
playerOpponents
=
new
Map
();
let
predictedEntertainTime
=
600
,
predictedAthleticTime
=
600
;
let
predictedEntertainTime
=
600
,
predictedAthleticTime
=
600
;
let
entertainRequestCountInTime
=
0
,
athleticRequestCountInTime
=
0
;
let
entertainRequestCountInTime
=
0
,
athleticRequestCountInTime
=
0
;
...
@@ -71,18 +72,17 @@ let localLog = function (content) {
...
@@ -71,18 +72,17 @@ let localLog = function (content) {
};
};
let
clearUserPools
=
function
(
user
)
{
let
clearUserPools
=
function
(
user
)
{
let
removedFromPlaying
=
false
;
let
removed
=
false
;
let
removedFromPending
=
false
;
let
toClear
=
[
user
];
let
toClear
=
[
user
];
let
seen
=
new
Set
();
let
seen
=
new
Set
();
while
(
toClear
.
length
>
0
)
{
while
(
toClear
.
length
>
0
)
{
let
currentUser
=
toClear
.
pop
();
let
currentUser
=
toClear
.
pop
();
if
(
!
currentUser
||
seen
.
has
(
currentUser
))
continue
;
if
(
!
currentUser
||
seen
.
has
(
currentUser
))
continue
;
seen
.
add
(
currentUser
);
seen
.
add
(
currentUser
);
let
playingRemoval
=
playingPool
.
delete
(
currentUser
);
for
(
let
pool
of
allPools
)
{
let
pendingRemoval
=
pendingP
ool
.
delete
(
currentUser
);
let
removal
=
p
ool
.
delete
(
currentUser
);
if
(
playingRemoval
!==
null
)
removedFromPlaying
=
true
;
if
(
removal
!==
null
)
removed
=
true
;
if
(
pendingRemoval
!==
null
)
removedFromPending
=
true
;
}
let
opponent
=
playerOpponents
.
get
(
currentUser
);
let
opponent
=
playerOpponents
.
get
(
currentUser
);
playerOpponents
.
delete
(
currentUser
);
playerOpponents
.
delete
(
currentUser
);
if
(
opponent
)
{
if
(
opponent
)
{
...
@@ -90,7 +90,7 @@ let clearUserPools = function(user) {
...
@@ -90,7 +90,7 @@ let clearUserPools = function(user) {
toClear
.
push
(
opponent
);
toClear
.
push
(
opponent
);
}
}
}
}
return
removed
FromPlaying
||
removedFromPending
;
return
removed
;
};
};
function
parseRequestUrl
(
req
)
{
function
parseRequestUrl
(
req
)
{
...
@@ -567,8 +567,9 @@ let endClearResponse = function(query, res) {
...
@@ -567,8 +567,9 @@ let endClearResponse = function(query, res) {
}
}
}
}
};
};
clearFromPool
(
playingPool
);
for
(
let
pool
of
allPools
)
{
clearFromPool
(
pendingPool
);
clearFromPool
(
pool
);
}
res
.
end
(
`
${
count
}
user cleared.`
);
res
.
end
(
`
${
count
}
user cleared.`
);
};
};
...
...
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