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
560db373
Commit
560db373
authored
Aug 08, 2017
by
IamI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
b51563d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
main.js
main.js
+4
-4
No files found.
main.js
View file @
560db373
...
@@ -15,7 +15,7 @@ let entertainRequestCountInTime = 0, athleticRequestCountInTime = 0;
...
@@ -15,7 +15,7 @@ let entertainRequestCountInTime = 0, athleticRequestCountInTime = 0;
let
localLog
=
function
(
content
)
{
let
localLog
=
function
(
content
)
{
console
.
log
(
"
[
"
+
new
Date
().
toLocaleString
()
+
"
]
"
+
content
)
console
.
log
(
"
[
"
+
new
Date
().
toLocaleString
()
+
"
]
"
+
content
)
}
}
;
let
getUserConfig
=
function
(
user
,
callback
)
{
let
getUserConfig
=
function
(
user
,
callback
)
{
// HTTP GET 抓取数据。
// HTTP GET 抓取数据。
...
@@ -114,7 +114,7 @@ let updateAthleticMatch = function () {
...
@@ -114,7 +114,7 @@ let updateAthleticMatch = function () {
updateAthleticMatch
=
function
()
{
updateAthleticMatch
=
function
()
{
let
length
=
athleticUserPool
.
length
;
let
length
=
athleticUserPool
.
length
;
if
(
length
<
2
)
return
;
if
(
length
<
2
)
return
;
athleticUserPool
.
sort
((
a
,
b
)
=>
b
.
pt
-
a
.
pt
);
athleticUserPool
.
sort
((
a
,
b
)
=>
b
.
data
.
pt
-
a
.
dat
a
.
pt
);
let
newPool
=
[];
let
newPool
=
[];
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
let
userA
=
athleticUserPool
[
i
];
let
userA
=
athleticUserPool
[
i
];
...
@@ -126,7 +126,7 @@ updateAthleticMatch = function () {
...
@@ -126,7 +126,7 @@ updateAthleticMatch = function () {
newPool
.
push
(
userA
);
newPool
.
push
(
userA
);
break
;
break
;
}
}
// 若
exp
之差小于门限,则匹配房间
// 若
pt
之差小于门限,则匹配房间
if
(
userA
.
data
.
pt
-
userB
.
data
.
pt
<
config
.
match
.
atheleticPtGate
)
{
if
(
userA
.
data
.
pt
-
userB
.
data
.
pt
<
config
.
match
.
atheleticPtGate
)
{
pair
(
userA
.
client
,
userB
.
client
,
'
athletic
'
);
pair
(
userA
.
client
,
userB
.
client
,
'
athletic
'
);
i
+=
1
;
i
+=
1
;
...
@@ -136,7 +136,7 @@ updateAthleticMatch = function () {
...
@@ -136,7 +136,7 @@ updateAthleticMatch = function () {
newPool
.
push
(
userA
);
newPool
.
push
(
userA
);
}
}
athleticUserPool
=
newPool
;
athleticUserPool
=
newPool
;
}
}
;
// 刷新娱乐玩家池
// 刷新娱乐玩家池
let
updateEntertainMatch
=
function
()
{
let
updateEntertainMatch
=
function
()
{
...
...
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